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

Commit c523672b authored by Diogo Ferreira's avatar Diogo Ferreira Committed by Ricardo Cerqueira
Browse files

su: Add an indicator when a 'su' session is active

This adds an indicator to the statusbar that is visible whenever a root
session is active, akin to the fine location icon.

Change-Id: I669fcc87e2b7a3201308170d7727ec5fb0e00e2b
parent 35a8a2e9
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -71,6 +71,10 @@ public class AppOpsManager {
     * will do this for you).
     */

    /** {@hide */
    public static final String ACTION_SU_SESSION_CHANGED =
            "android.intent.action.SU_SESSION_CHANGED";

    final Context mContext;
    final IAppOpsService mService;
    final ArrayMap<OnOpChangedListener, IAppOpsCallback> mModeWatchers
+1 −0
Original line number Diff line number Diff line
@@ -73,6 +73,7 @@
    <protected-broadcast android:name="android.intent.action.USER_BACKGROUND" />
    <protected-broadcast android:name="android.intent.action.USER_FOREGROUND" />
    <protected-broadcast android:name="android.intent.action.USER_SWITCHED" />
    <protected-broadcast android:name="android.intent.action.SU_SESSION_CHANGED" />

    <protected-broadcast android:name="android.os.action.POWER_SAVE_MODE_CHANGED" />
    <protected-broadcast android:name="android.os.action.POWER_SAVE_MODE_CHANGING" />
+1 −0
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@
       <item><xliff:g id="id">sync_active</xliff:g></item>
       <item><xliff:g id="id">cast</xliff:g></item>
       <item><xliff:g id="id">location</xliff:g></item>
       <item><xliff:g id="id">su</xliff:g></item>
       <item><xliff:g id="id">bluetooth</xliff:g></item>
       <item><xliff:g id="id">nfc</xliff:g></item>
       <item><xliff:g id="id">tty</xliff:g></item>
+15 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<inset xmlns:android="http://schemas.android.com/apk/res/android"
    android:insetLeft="2.5dp"
    android:insetRight="2.5dp">
    <vector
        android:width="23dp"
        android:height="18dp"
        android:viewportWidth="24"
        android:viewportHeight="24">

        <path
            android:fillColor="#FFFFFFFF"
            android:pathData="M12.49,15.934h-2.373L9.24,21H6.966l0.89-5.066H5.051v-2.089h3.163l0.63-3.584H5.977V8.148h3.238 l0.902-5.141h2.261l-0.902,5.141h2.373l0.914-5.141h2.261l-0.902,5.141h2.719v2.113h-3.089l-0.63,3.584h2.78v2.089h-3.139L13.874,21 H11.6L12.49,15.934Z M10.488,13.845h2.36l0.63-3.584h-2.373L10.488,13.845z" />
    </vector>
</inset>
+3 −0
Original line number Diff line number Diff line
@@ -39,6 +39,9 @@
    <!-- Content description of the roaming tile in quick settings when on (not shown on the screen). [CHAR LIMIT=NONE] -->
    <string name="accessibility_quick_settings_roaming_on">Roaming on.</string>

    <!-- Content description of the superuser tile -->
    <string name="accessibility_su_active">Superuser session active</string>

    <!-- QuickSettings: Mobile data [CHAR LIMIT=NONE] -->
    <string name="quick_settings_mobile_data_label">Mobile data</string>
    <!-- QuickSettings: Roaming [CHAR LIMIT=NONE] -->
Loading