diff options
author | 2020-06-12 18:46:51 +0000 | |
---|---|---|
committer | 2020-06-12 18:46:51 +0000 | |
commit | 3800919656b6eda3bad44ef20678b8f3cced6f1e (patch) | |
tree | 800f3921da52266068e57a70fb544b7c07455d21 | |
parent | 8cda481f5b35e0b1ded8f8fe33f8497a8be62f7b (diff) | |
parent | 9b5eec6fa792f036442be68897d1638dd459e96c (diff) |
Merge "Restore overlay change broadcast handler for secondary users" into rvc-dev
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationModeController.java | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationModeController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationModeController.java index daefef5e826d..c211de08cb8e 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationModeController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationModeController.java @@ -16,14 +16,19 @@ package com.android.systemui.statusbar.phone; +import static android.content.Intent.ACTION_OVERLAY_CHANGED; import static android.view.WindowManagerPolicyConstants.NAV_BAR_MODE_GESTURAL; import static android.view.WindowManagerPolicyConstants.NAV_BAR_MODE_GESTURAL_OVERLAY; +import android.content.BroadcastReceiver; import android.content.Context; +import android.content.Intent; +import android.content.IntentFilter; import android.content.om.IOverlayManager; import android.content.om.OverlayInfo; import android.content.pm.PackageManager; import android.content.res.ApkAssets; +import android.os.PatternMatcher; import android.os.RemoteException; import android.os.ServiceManager; import android.os.UserHandle; @@ -79,6 +84,19 @@ public class NavigationModeController implements Dumpable { } }; + // The primary user SysUI process doesn't get AppInfo changes from overlay package changes for + // the secondary user (b/158613864), so we need to update the interaction mode here as well + // as a fallback if we don't receive the configuration change + private BroadcastReceiver mReceiver = new BroadcastReceiver() { + @Override + public void onReceive(Context context, Intent intent) { + if (DEBUG) { + Log.d(TAG, "ACTION_OVERLAY_CHANGED"); + } + updateCurrentInteractionMode(true /* notify */); + } + }; + @Inject public NavigationModeController(Context context, @@ -92,6 +110,11 @@ public class NavigationModeController implements Dumpable { mUiBgExecutor = uiBgExecutor; deviceProvisionedController.addCallback(mDeviceProvisionedCallback); + IntentFilter overlayFilter = new IntentFilter(ACTION_OVERLAY_CHANGED); + overlayFilter.addDataScheme("package"); + overlayFilter.addDataSchemeSpecificPart("android", PatternMatcher.PATTERN_LITERAL); + mContext.registerReceiverAsUser(mReceiver, UserHandle.ALL, overlayFilter, null, null); + configurationController.addCallback(new ConfigurationController.ConfigurationListener() { @Override public void onOverlayChanged() { |