This repository was archived by the owner on Feb 25, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +19
-3
lines changed
shell/platform/android/io/flutter Expand file tree Collapse file tree 3 files changed +19
-3
lines changed Original file line number Diff line number Diff line change @@ -666,14 +666,21 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
666
666
public void registerOnBackInvokedCallback () {
667
667
if (Build .VERSION .SDK_INT >= 33 ) {
668
668
// TODO(justinmc): This is really the one and only thing that stops root
669
- // pback for me.
669
+ // pback for me. There are probably other places you need to mess with
670
+ // this for other embedding strategies!
670
671
Log .e ("justin" , "registerOnBackInvokedCallback" );
671
672
getOnBackInvokedDispatcher ()
672
673
.registerOnBackInvokedCallback (
673
674
OnBackInvokedDispatcher .PRIORITY_DEFAULT , onBackInvokedCallback );
674
675
}
675
676
}
676
677
678
+ @ Override
679
+ public void navigatorIsEmpty () {
680
+ Log .e ("justin" , "navigatorIsEmpty in embedding FlutterActivity" );
681
+ unregisterOnBackInvokedCallback ();
682
+ }
683
+
677
684
/**
678
685
* Unregisters the callback from OnBackInvokedDispatcher.
679
686
*
Original file line number Diff line number Diff line change @@ -1661,6 +1661,13 @@ public boolean popSystemNavigator() {
1661
1661
return false ;
1662
1662
}
1663
1663
1664
+ @ Override
1665
+ public void navigatorIsEmpty () {
1666
+ // TODO(justinmc): Implement. Implementing in FlutterActivity first.
1667
+ // unregisterOnBackInvokedCallback();
1668
+ Log .e ("justin" , "navigatorIsEmpty in embedding FlutterFragment" );
1669
+ }
1670
+
1664
1671
@ VisibleForTesting
1665
1672
@ NonNull
1666
1673
boolean shouldDelayFirstAndroidViewDraw () {
Original file line number Diff line number Diff line change @@ -56,6 +56,8 @@ public interface PlatformPluginDelegate {
56
56
* androidx.activity.OnBackPressedDispatcher} will be executed.
57
57
*/
58
58
boolean popSystemNavigator ();
59
+
60
+ void navigatorIsEmpty ();
59
61
}
60
62
61
63
@ VisibleForTesting
@@ -111,6 +113,7 @@ public void setSystemUiOverlayStyle(
111
113
112
114
@ Override
113
115
public void navigatorIsEmpty () {
116
+ Log .e ("justin" , "navigatorIsEmpty in PlatformHandler.PlatformMessageChannel." );
114
117
PlatformPlugin .this .navigatorIsEmpty ();
115
118
}
116
119
@@ -482,8 +485,7 @@ private void setSystemChromeSystemUIOverlayStyle(
482
485
483
486
private void navigatorIsEmpty () {
484
487
Log .e ("justin" , "navigatorIsEmpty in PlatformPlugin" );
485
- // TODO(justinmc): Can't quite call it like this, need FlutterActivity.
486
- // activity.unregisterOnBackInvokedCallback();
488
+ platformPluginDelegate .navigatorIsEmpty ();
487
489
}
488
490
489
491
private void popSystemNavigator () {
You can’t perform that action at this time.
0 commit comments