Merge "Force update the disable flags following status bar registration" into tm-qpr-dev am: ef1f84f5f1 am: 6d5ca42faa

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

Change-Id: I4026da18919aaca68c82738f7e2e6e0fc301abcb
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Winson Chung
2022-12-15 10:01:05 +00:00
committed by Automerger Merge Worker

View File

@@ -16,6 +16,7 @@
package com.android.systemui.statusbar.phone;
import static android.app.StatusBarManager.DISABLE_HOME;
import static android.app.StatusBarManager.WINDOW_STATE_HIDDEN;
import static android.app.StatusBarManager.WINDOW_STATE_SHOWING;
import static android.app.StatusBarManager.WindowVisibleState;
@@ -69,6 +70,7 @@ import android.graphics.Point;
import android.hardware.devicestate.DeviceStateManager;
import android.metrics.LogMaker;
import android.net.Uri;
import android.os.Binder;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
@@ -1030,8 +1032,21 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {
// set the initial view visibility
int disabledFlags1 = result.mDisabledFlags1;
int disabledFlags2 = result.mDisabledFlags2;
mInitController.addPostInitTask(
() -> setUpDisableFlags(disabledFlags1, disabledFlags2));
mInitController.addPostInitTask(() -> {
setUpDisableFlags(disabledFlags1, disabledFlags2);
try {
// NOTE(b/262059863): Force-update the disable flags after applying the flags
// returned from registerStatusBar(). The result's disabled flags may be stale
// if StatusBarManager's disabled flags are updated between registering the bar and
// this handling this post-init task. We force an update in this case, and use a new
// token to not conflict with any other disabled flags already requested by SysUI
Binder token = new Binder();
mBarService.disable(DISABLE_HOME, token, mContext.getPackageName());
mBarService.disable(0, token, mContext.getPackageName());
} catch (RemoteException ex) {
ex.rethrowFromSystemServer();
}
});
mFalsingManager.addFalsingBeliefListener(mFalsingBeliefListener);