Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dec75e8c authored by Roman Birg's avatar Roman Birg
Browse files

SystemUI: hide up arrow NavRing indicator if no targets present



If there aren't any navring targets setup (the user has removed all of
them, or maybe search assistant is not present) then there is still a
hint in the lockscreen to pull up from the nav bar.

If there are no targets setup, hide the arrow indicator.

Change-Id: I65103a4cec668a9a8b3f678f991f5acba17d19f5
Signed-off-by: default avatarRoman Birg <roman@cyngn.com>
parent f8d91d07
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -253,6 +253,18 @@ public class NavigationRingHelpers {
        return com.android.internal.R.drawable.ic_navigation_ring_torch_off;
    }

    public static boolean hasLockscreenTargets(Context context) {
        final String[] result = new String[NavigationRingHelpers.MAX_ACTIONS];
        for (int i = 0; i < result.length; i++) {
            String targetValue = Settings.System.getString(context.getContentResolver(),
                    Settings.System.NAVIGATION_RING_TARGETS[i]);
            if (!TextUtils.equals(targetValue, NavigationRingConstants.ACTION_NONE)) {
                return true;
            }
        }
        return false;
    }

    public static void updateDynamicIconIfNeeded(Context context,
            GlowPadView view, String action, int position) {
        int resourceId = -1;
+5 −1
Original line number Diff line number Diff line
@@ -57,6 +57,9 @@ import android.view.accessibility.AccessibilityManager.TouchExplorationStateChan
import android.widget.ImageView;
import android.widget.LinearLayout;

import com.android.internal.util.cm.LockscreenTargetUtils;
import com.android.internal.util.cm.NavigationRingConstants;
import com.android.internal.util.cm.NavigationRingHelpers;
import com.android.internal.widget.LockPatternUtils;
import com.android.systemui.R;
import com.android.systemui.statusbar.BaseStatusBar;
@@ -602,7 +605,8 @@ public class NavigationBarView extends LinearLayout {
        final boolean showCamera = showSearch && !mCameraDisabledByDpm
                && mLockUtils.getCameraEnabled();

        setVisibleOrGone(getSearchLight(), showSearch && mModLockDisabled);
        setVisibleOrGone(getSearchLight(), showSearch && mModLockDisabled
                && NavigationRingHelpers.hasLockscreenTargets(mContext));
        setVisibleOrGone(getCameraButton(), showCamera);

        mBarTransitions.applyBackButtonQuiescentAlpha(mBarTransitions.getMode(), true /*animate*/);