diff options
author | Jesse Chan <jc@lineageos.org> | 2020-06-02 13:59:52 +0800 |
---|---|---|
committer | Luca Stefani <luca.stefani.ge1@gmail.com> | 2020-06-10 23:29:40 +0200 |
commit | 230e19d9f7719dd67e6b4e47be75ccedc23cada0 (patch) | |
tree | df78d681a9d8c74ab50f8c9c2aac58c1ed957552 | |
parent | ac2040adcbf3ae05058d204cd1001297e065034f (diff) | |
download | frameworks_base-230e19d9f7719dd67e6b4e47be75ccedc23cada0.tar.gz frameworks_base-230e19d9f7719dd67e6b4e47be75ccedc23cada0.tar.bz2 frameworks_base-230e19d9f7719dd67e6b4e47be75ccedc23cada0.zip |
SystemUI: set no hint overlay to highest priority
As overlays are also used to apply navigation mode, it is needed to set
our customization overlay to highest priority to ensure it is applied.
Change-Id: I41ca4b7ea99fea9f62d2e8ece5114f682e8e7fe9
Signed-off-by: Jesse Chan <jc@lineageos.org>
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarInflaterView.java | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarInflaterView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarInflaterView.java index db58e1364b3..339eceeddd0 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarInflaterView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarInflaterView.java @@ -21,10 +21,11 @@ import static android.view.WindowManagerPolicyConstants.NAV_BAR_MODE_GESTURAL; import android.annotation.Nullable; import android.app.ActivityManager; import android.content.Context; -import android.content.om.OverlayManager; +import android.content.om.IOverlayManager; import android.content.res.Configuration; import android.graphics.drawable.Icon; -import android.os.UserHandle; +import android.os.RemoteException; +import android.os.ServiceManager; import android.util.AttributeSet; import android.util.Log; import android.util.SparseArray; @@ -264,12 +265,18 @@ public class NavigationBarInflaterView extends FrameLayout } private void updateHint() { + final IOverlayManager iom = IOverlayManager.Stub.asInterface( + ServiceManager.getService(Context.OVERLAY_SERVICE)); final boolean state = mNavBarMode == NAV_BAR_MODE_GESTURAL && !mIsHintEnabled; - UserHandle userId = UserHandle.of(ActivityManager.getCurrentUser()); + final int userId = ActivityManager.getCurrentUser(); try { - mContext.getSystemService(OverlayManager.class).setEnabled( - OVERLAY_NAVIGATION_HIDE_HINT, state, userId); - } catch (Exception e) { + iom.setEnabled(OVERLAY_NAVIGATION_HIDE_HINT, state, userId); + if (state) { + // As overlays are also used to apply navigation mode, it is needed to set + // our customization overlay to highest priority to ensure it is applied. + iom.setHighestPriority(OVERLAY_NAVIGATION_HIDE_HINT, userId); + } + } catch (RemoteException e) { Log.e(TAG, "Failed to " + (state ? "enable" : "disable") + " overlay " + OVERLAY_NAVIGATION_HIDE_HINT + " for user " + userId); } |