Skip to content

Commit c8b47c0

Browse files
auto-submit[bot]auto-submit[bot]
and
auto-submit[bot]
authored
Reverts "Implements UISceneDelegate dynamically w/ FlutterLaunchEngine (#168396)" (#168880)
<!-- start_original_pr_link --> Reverts: #168396 <!-- end_original_pr_link --> <!-- start_initiating_author --> Initiated by: matanlurey <!-- end_initiating_author --> <!-- start_revert_reason --> Reason for reverting: Broke iOS device lab tests. <!-- end_revert_reason --> <!-- start_original_pr_author --> Original PR Author: gaaclarke <!-- end_original_pr_author --> <!-- start_reviewers --> Reviewed By: {vashworth, hellohuanlin} <!-- end_reviewers --> <!-- start_revert_body --> This change reverts the following previous change: fixes: #167267 design doc: https://docs.google.com/document/d/1ZfcQOs-UKRa9jsFG84-MTFeibZTLKCvPQLxF2eskx44/edit?tab=t.0 ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [x] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview [Tree Hygiene]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md [test-exempt]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests [Flutter Style Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md [Features we expect every widget to implement]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md [Data Driven Fixes]: https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md <!-- end_revert_body --> Co-authored-by: auto-submit[bot] <flutter-engprod-team@google.com>
1 parent 773d076 commit c8b47c0

16 files changed

+13
-376
lines changed

engine/src/flutter/ci/licenses_golden/licenses_flutter

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52771,7 +52771,6 @@ ORIGIN: ../../../flutter/shell/platform/darwin/ios/framework/Source/ConnectionCo
5277152771
ORIGIN: ../../../flutter/shell/platform/darwin/ios/framework/Source/FakeUIPressProxy.swift + ../../../flutter/LICENSE
5277252772
ORIGIN: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterAppDelegate.mm + ../../../flutter/LICENSE
5277352773
ORIGIN: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterAppDelegateTest.mm + ../../../flutter/LICENSE
52774-
ORIGIN: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterAppDelegate_Internal.h + ../../../flutter/LICENSE
5277552774
ORIGIN: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterAppDelegate_Test.h + ../../../flutter/LICENSE
5277652775
ORIGIN: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterCallbackCache.mm + ../../../flutter/LICENSE
5277752776
ORIGIN: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterCallbackCache_Internal.h + ../../../flutter/LICENSE
@@ -52802,9 +52801,6 @@ ORIGIN: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterKeySe
5280252801
ORIGIN: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterKeyboardManager.h + ../../../flutter/LICENSE
5280352802
ORIGIN: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterKeyboardManager.mm + ../../../flutter/LICENSE
5280452803
ORIGIN: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterKeyboardManagerTest.mm + ../../../flutter/LICENSE
52805-
ORIGIN: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterLaunchEngine.h + ../../../flutter/LICENSE
52806-
ORIGIN: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterLaunchEngine.m + ../../../flutter/LICENSE
52807-
ORIGIN: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterLaunchEngineTest.mm + ../../../flutter/LICENSE
5280852804
ORIGIN: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterMetalLayer.h + ../../../flutter/LICENSE
5280952805
ORIGIN: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterMetalLayer.mm + ../../../flutter/LICENSE
5281052806
ORIGIN: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterMetalLayerTest.mm + ../../../flutter/LICENSE
@@ -55793,7 +55789,6 @@ FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/ConnectionColl
5579355789
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FakeUIPressProxy.swift
5579455790
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterAppDelegate.mm
5579555791
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterAppDelegateTest.mm
55796-
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterAppDelegate_Internal.h
5579755792
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterAppDelegate_Test.h
5579855793
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterCallbackCache.mm
5579955794
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterCallbackCache_Internal.h
@@ -55824,9 +55819,6 @@ FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterKeySeco
5582455819
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterKeyboardManager.h
5582555820
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterKeyboardManager.mm
5582655821
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterKeyboardManagerTest.mm
55827-
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterLaunchEngine.h
55828-
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterLaunchEngine.m
55829-
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterLaunchEngineTest.mm
5583055822
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterMetalLayer.h
5583155823
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterMetalLayer.mm
5583255824
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterMetalLayerTest.mm

engine/src/flutter/engine.code-workspace

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -425,37 +425,6 @@
425425
"ios_debug_unopt"
426426
]
427427
},
428-
{
429-
"type": "shell",
430-
"command": "./flutter/bin/et",
431-
"options": {
432-
"cwd": "${workspaceFolder}/.."
433-
},
434-
"problemMatcher": [
435-
"$gcc"
436-
],
437-
"presentation": {
438-
"echo": true,
439-
"reveal": "silent",
440-
"focus": false,
441-
"panel": "shared",
442-
"clear": true
443-
},
444-
"group": {
445-
"kind": "build"
446-
},
447-
"label": "ios_debug_sim_unopt_arm64",
448-
"args": [
449-
"build",
450-
"-c",
451-
"host_debug_unopt_arm64",
452-
"&&",
453-
"./flutter/bin/et",
454-
"build",
455-
"-c",
456-
"ios_debug_sim_unopt_arm64"
457-
]
458-
},
459428
{
460429
"type": "shell",
461430
"command": "./flutter/bin/et",

engine/src/flutter/shell/platform/darwin/ios/BUILD.gn

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ source_set("flutter_framework_source") {
6666

6767
sources = [
6868
"framework/Source/FlutterAppDelegate.mm",
69-
"framework/Source/FlutterAppDelegate_Internal.h",
7069
"framework/Source/FlutterCallbackCache.mm",
7170
"framework/Source/FlutterCallbackCache_Internal.h",
7271
"framework/Source/FlutterChannelKeyResponder.h",
@@ -85,8 +84,6 @@ source_set("flutter_framework_source") {
8584
"framework/Source/FlutterKeySecondaryResponder.h",
8685
"framework/Source/FlutterKeyboardManager.h",
8786
"framework/Source/FlutterKeyboardManager.mm",
88-
"framework/Source/FlutterLaunchEngine.h",
89-
"framework/Source/FlutterLaunchEngine.m",
9087
"framework/Source/FlutterMetalLayer.h",
9188
"framework/Source/FlutterMetalLayer.mm",
9289
"framework/Source/FlutterOverlayView.h",
@@ -244,7 +241,6 @@ if (enable_ios_unittests) {
244241
"framework/Source/FlutterFakeKeyEvents.h",
245242
"framework/Source/FlutterFakeKeyEvents.mm",
246243
"framework/Source/FlutterKeyboardManagerTest.mm",
247-
"framework/Source/FlutterLaunchEngineTest.mm",
248244
"framework/Source/FlutterMetalLayerTest.mm",
249245
"framework/Source/FlutterPlatformPluginTest.mm",
250246
"framework/Source/FlutterPlatformViewsTest.mm",

engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterAppDelegate.mm

Lines changed: 3 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
#import "flutter/shell/platform/darwin/ios/framework/Headers/FlutterViewController.h"
1010
#import "flutter/shell/platform/darwin/ios/framework/Source/FlutterAppDelegate_Test.h"
1111
#import "flutter/shell/platform/darwin/ios/framework/Source/FlutterEngine_Internal.h"
12-
#import "flutter/shell/platform/darwin/ios/framework/Source/FlutterLaunchEngine.h"
1312
#import "flutter/shell/platform/darwin/ios/framework/Source/FlutterPluginAppLifeCycleDelegate_internal.h"
1413
#import "flutter/shell/platform/darwin/ios/framework/Source/FlutterSharedApplication.h"
1514
#import "flutter/shell/platform/darwin/ios/framework/Source/FlutterViewController_Internal.h"
@@ -21,49 +20,20 @@
2120
static NSString* const kBackgroundFetchCapatibility = @"fetch";
2221
static NSString* const kRestorationStateAppModificationKey = @"mod-date";
2322

24-
@interface FlutterSceneDelegate : NSObject <UIWindowSceneDelegate>
25-
@property(nonatomic, strong, nullable) UIWindow* window;
26-
@end
27-
28-
@implementation FlutterSceneDelegate
29-
30-
- (void)scene:(UIScene*)scene
31-
willConnectToSession:(UISceneSession*)session
32-
options:(UISceneConnectionOptions*)connectionOptions {
33-
NSObject<UIApplicationDelegate>* appDelegate = FlutterSharedApplication.application.delegate;
34-
if (appDelegate.window.rootViewController) {
35-
// If this is not nil we are running into a case where someone is manually
36-
// performing root view controller setup in the UIApplicationDelegate.
37-
UIWindowScene* windowScene = (UIWindowScene*)scene;
38-
self.window = [[UIWindow alloc] initWithWindowScene:windowScene];
39-
self.window.rootViewController = appDelegate.window.rootViewController;
40-
appDelegate.window = self.window;
41-
[self.window makeKeyAndVisible];
42-
}
43-
}
44-
45-
@end
46-
4723
@interface FlutterAppDelegate ()
4824
@property(nonatomic, copy) FlutterViewController* (^rootFlutterViewControllerGetter)(void);
4925
@property(nonatomic, strong) FlutterPluginAppLifeCycleDelegate* lifeCycleDelegate;
50-
@property(nonatomic, strong) FlutterLaunchEngine* launchEngine;
5126
@end
5227

5328
@implementation FlutterAppDelegate
5429

5530
- (instancetype)init {
5631
if (self = [super init]) {
5732
_lifeCycleDelegate = [[FlutterPluginAppLifeCycleDelegate alloc] init];
58-
_launchEngine = [[FlutterLaunchEngine alloc] init];
5933
}
6034
return self;
6135
}
6236

63-
- (nullable FlutterEngine*)takeLaunchEngine {
64-
return [self.launchEngine takeEngine];
65-
}
66-
6737
- (BOOL)application:(UIApplication*)application
6838
willFinishLaunchingWithOptions:(NSDictionary*)launchOptions {
6939
return [self.lifeCycleDelegate application:application
@@ -263,23 +233,23 @@ - (BOOL)application:(UIApplication*)application
263233
if (flutterRootViewController) {
264234
return [[flutterRootViewController pluginRegistry] registrarForPlugin:pluginKey];
265235
}
266-
return [self.launchEngine.engine registrarForPlugin:pluginKey];
236+
return nil;
267237
}
268238

269239
- (BOOL)hasPlugin:(NSString*)pluginKey {
270240
FlutterViewController* flutterRootViewController = [self rootFlutterViewController];
271241
if (flutterRootViewController) {
272242
return [[flutterRootViewController pluginRegistry] hasPlugin:pluginKey];
273243
}
274-
return [self.launchEngine.engine hasPlugin:pluginKey];
244+
return false;
275245
}
276246

277247
- (NSObject*)valuePublishedByPlugin:(NSString*)pluginKey {
278248
FlutterViewController* flutterRootViewController = [self rootFlutterViewController];
279249
if (flutterRootViewController) {
280250
return [[flutterRootViewController pluginRegistry] valuePublishedByPlugin:pluginKey];
281251
}
282-
return [self.launchEngine.engine valuePublishedByPlugin:pluginKey];
252+
return nil;
283253
}
284254

285255
#pragma mark - Selectors handling
@@ -371,31 +341,4 @@ - (int64_t)lastAppModificationTime {
371341
return [fileDate timeIntervalSince1970];
372342
}
373343

374-
- (UISceneConfiguration*)application:(UIApplication*)application
375-
configurationForConnectingSceneSession:(UISceneSession*)connectingSceneSession
376-
options:(UISceneConnectionOptions*)options {
377-
NSDictionary* sceneManifest =
378-
[[NSBundle mainBundle] objectForInfoDictionaryKey:@"UIApplicationSceneManifest"];
379-
NSDictionary* sceneConfigs = sceneManifest[@"UISceneConfigurations"];
380-
381-
if (sceneConfigs.count > 0) {
382-
return connectingSceneSession.configuration;
383-
} else {
384-
UISceneConfiguration* config =
385-
[UISceneConfiguration configurationWithName:@"flutter"
386-
sessionRole:connectingSceneSession.role];
387-
config.delegateClass = [FlutterSceneDelegate class];
388-
389-
NSString* mainStoryboard =
390-
[[NSBundle mainBundle] objectForInfoDictionaryKey:@"UIMainStoryboardFile"];
391-
392-
if (mainStoryboard) {
393-
UIStoryboard* storyboard = [UIStoryboard storyboardWithName:mainStoryboard
394-
bundle:[NSBundle mainBundle]];
395-
config.storyboard = storyboard;
396-
}
397-
return config;
398-
}
399-
}
400-
401344
@end

engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterAppDelegateTest.mm

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
#import "flutter/shell/platform/darwin/ios/framework/Headers/FlutterAppDelegate.h"
99
#import "flutter/shell/platform/darwin/ios/framework/Headers/FlutterEngine.h"
1010
#import "flutter/shell/platform/darwin/ios/framework/Headers/FlutterViewController.h"
11-
#import "flutter/shell/platform/darwin/ios/framework/Source/FlutterAppDelegate_Internal.h"
1211
#import "flutter/shell/platform/darwin/ios/framework/Source/FlutterAppDelegate_Test.h"
1312
#import "flutter/shell/platform/darwin/ios/framework/Source/FlutterEngine_Test.h"
1413

@@ -155,20 +154,6 @@ - (void)testReleasesWindowOnDealloc {
155154
XCTAssertNil(weakWindow);
156155
}
157156

158-
- (void)testGrabLaunchEngine {
159-
// Clear out the mocking of the root view controller.
160-
[self.mockMainBundle stopMocking];
161-
self.appDelegate.rootFlutterViewControllerGetter = nil;
162-
// Working with plugins forces the creation of an engine.
163-
XCTAssertFalse([self.appDelegate hasPlugin:@"hello"]);
164-
XCTAssertNotNil([self.appDelegate takeLaunchEngine]);
165-
XCTAssertNil([self.appDelegate takeLaunchEngine]);
166-
}
167-
168-
- (void)testGrabLaunchEngineWithoutPlugins {
169-
XCTAssertNil([self.appDelegate takeLaunchEngine]);
170-
}
171-
172157
#pragma mark - Deep linking
173158

174159
- (void)testUniversalLinkPushRouteInformation {

engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterAppDelegate_Internal.h

Lines changed: 0 additions & 16 deletions
This file was deleted.

engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterLaunchEngine.h

Lines changed: 0 additions & 40 deletions
This file was deleted.

engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterLaunchEngine.m

Lines changed: 0 additions & 52 deletions
This file was deleted.

engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterLaunchEngineTest.mm

Lines changed: 0 additions & 26 deletions
This file was deleted.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy