Merge "Fix ANR in SystemUI due to race condition." into tm-qpr-dev am: cc0ae10b35

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/21020954

Change-Id: Ibcafccf7ff5ed061db04cf182adb752e8588aca1
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Rahul Banerjee
2023-01-19 16:12:44 +00:00
committed by Automerger Merge Worker
2 changed files with 9 additions and 5 deletions

View File

@@ -865,6 +865,11 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {
wiredChargingRippleController.registerCallbacks(); wiredChargingRippleController.registerCallbacks();
mLightRevealScrimViewModelLazy = lightRevealScrimViewModelLazy; mLightRevealScrimViewModelLazy = lightRevealScrimViewModelLazy;
// Based on teamfood flag, turn predictive back dispatch on at runtime.
if (mFeatureFlags.isEnabled(Flags.WM_ENABLE_PREDICTIVE_BACK_SYSUI)) {
mContext.getApplicationInfo().setEnableOnBackInvokedCallback(true);
}
} }
@Override @Override
@@ -979,11 +984,6 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {
// Lastly, call to the icon policy to install/update all the icons. // Lastly, call to the icon policy to install/update all the icons.
mIconPolicy.init(); mIconPolicy.init();
// Based on teamfood flag, turn predictive back dispatch on at runtime.
if (mFeatureFlags.isEnabled(Flags.WM_ENABLE_PREDICTIVE_BACK_SYSUI)) {
mContext.getApplicationInfo().setEnableOnBackInvokedCallback(true);
}
mKeyguardStateController.addCallback(new KeyguardStateController.Callback() { mKeyguardStateController.addCallback(new KeyguardStateController.Callback() {
@Override @Override
public void onUnlockedChanged() { public void onUnlockedChanged() {

View File

@@ -321,6 +321,10 @@ public class CentralSurfacesImplTest extends SysuiTestCase {
public void setup() throws Exception { public void setup() throws Exception {
MockitoAnnotations.initMocks(this); MockitoAnnotations.initMocks(this);
// CentralSurfacesImpl's runtime flag check fails if the flag is absent.
// This value is unused, because test manifest is opted in.
mFeatureFlags.set(Flags.WM_ENABLE_PREDICTIVE_BACK_SYSUI, false);
IThermalService thermalService = mock(IThermalService.class); IThermalService thermalService = mock(IThermalService.class);
mPowerManager = new PowerManager(mContext, mPowerManagerService, thermalService, mPowerManager = new PowerManager(mContext, mPowerManagerService, thermalService,
Handler.createAsync(Looper.myLooper())); Handler.createAsync(Looper.myLooper()));