mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-04 01:46:49 +00:00
Support predictive back from all apps to home
bug: b/238475505 Test: manual Change-Id: Ibf4f7f41a26b044a538e2cd566d2297ed88f1b99
This commit is contained in:
@@ -176,14 +176,7 @@ public abstract class BaseActivity extends Activity implements ActivityContext {
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
if (Utilities.ATLEAST_T) {
|
||||
getOnBackInvokedDispatcher().registerOnBackInvokedCallback(
|
||||
OnBackInvokedDispatcher.PRIORITY_DEFAULT,
|
||||
() -> {
|
||||
onBackPressed();
|
||||
TestLogging.recordEvent(TestProtocol.SEQUENCE_MAIN, "onBackInvoked");
|
||||
});
|
||||
}
|
||||
registerBackDispatcher();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -246,6 +239,17 @@ public abstract class BaseActivity extends Activity implements ActivityContext {
|
||||
|
||||
}
|
||||
|
||||
protected void registerBackDispatcher() {
|
||||
if (Utilities.ATLEAST_T) {
|
||||
getOnBackInvokedDispatcher().registerOnBackInvokedCallback(
|
||||
OnBackInvokedDispatcher.PRIORITY_DEFAULT,
|
||||
() -> {
|
||||
onBackPressed();
|
||||
TestLogging.recordEvent(TestProtocol.SEQUENCE_MAIN, "onBackInvoked");
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isStarted() {
|
||||
return (mActivityFlags & ACTIVITY_STATE_STARTED) != 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user