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

Commit e29b9f8f authored by Dianne Hackborn's avatar Dianne Hackborn Committed by Android (Google) Code Review
Browse files

Merge "Add app op for Bluetooth scans"

parents b41cd310 e04f13d9
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -115,7 +115,7 @@ package android.app {
    field public static final java.lang.String OPSTR_WRITE_WALLPAPER = "android:write_wallpaper";
    field public static final int OP_RECORD_AUDIO = 27; // 0x1b
    field public static final int OP_SYSTEM_ALERT_WINDOW = 24; // 0x18
    field public static final int _NUM_OP = 77; // 0x4d
    field public static final int _NUM_OP = 78; // 0x4e
  }

  public static abstract interface AppOpsManager.OnOpActiveChangedListener {
+13 −1
Original line number Diff line number Diff line
@@ -338,8 +338,10 @@ public class AppOpsManager {
    /** @hide Any app start foreground service. */
    public static final int OP_START_FOREGROUND = 76;
    /** @hide */
    public static final int OP_BLUETOOTH_SCAN = 77;
    /** @hide */
    @TestApi
    public static final int _NUM_OP = 77;
    public static final int _NUM_OP = 78;

    /** Access to coarse location information. */
    public static final String OPSTR_COARSE_LOCATION = "android:coarse_location";
@@ -581,6 +583,8 @@ public class AppOpsManager {
    /** @hide */
    @SystemApi @TestApi
    public static final String OPSTR_START_FOREGROUND = "android:start_foreground";
    /** @hide */
    public static final String OPSTR_BLUETOOTH_SCAN = "android:bluetooth_scan";

    // Warning: If an permission is added here it also has to be added to
    // com.android.packageinstaller.permission.utils.EventLogger
@@ -718,6 +722,7 @@ public class AppOpsManager {
            OP_ACCEPT_HANDOVER,                 // ACCEPT_HANDOVER
            OP_MANAGE_IPSEC_TUNNELS,            // MANAGE_IPSEC_HANDOVERS
            OP_START_FOREGROUND,                // START_FOREGROUND
            OP_COARSE_LOCATION,                 // BLUETOOTH_SCAN
    };

    /**
@@ -801,6 +806,7 @@ public class AppOpsManager {
            OPSTR_ACCEPT_HANDOVER,
            OPSTR_MANAGE_IPSEC_TUNNELS,
            OPSTR_START_FOREGROUND,
            OPSTR_BLUETOOTH_SCAN,
    };

    /**
@@ -885,6 +891,7 @@ public class AppOpsManager {
            "ACCEPT_HANDOVER",
            "MANAGE_IPSEC_TUNNELS",
            "START_FOREGROUND",
            "BLUETOOTH_SCAN",
    };

    /**
@@ -969,6 +976,7 @@ public class AppOpsManager {
            Manifest.permission.ACCEPT_HANDOVER,
            null, // no permission for OP_MANAGE_IPSEC_TUNNELS
            Manifest.permission.FOREGROUND_SERVICE,
            null, // no permission for OP_BLUETOOTH_SCAN
    };

    /**
@@ -1054,6 +1062,7 @@ public class AppOpsManager {
            null, // ACCEPT_HANDOVER
            null, // MANAGE_IPSEC_TUNNELS
            null, // START_FOREGROUND
            null, // maybe should be UserManager.DISALLOW_SHARE_LOCATION, //BLUETOOTH_SCAN
    };

    /**
@@ -1138,6 +1147,7 @@ public class AppOpsManager {
            false, // ACCEPT_HANDOVER
            false, // MANAGE_IPSEC_HANDOVERS
            false, // START_FOREGROUND
            true, // BLUETOOTH_SCAN
    };

    /**
@@ -1221,6 +1231,7 @@ public class AppOpsManager {
            AppOpsManager.MODE_ALLOWED,  // ACCEPT_HANDOVER
            AppOpsManager.MODE_ERRORED,  // MANAGE_IPSEC_TUNNELS
            AppOpsManager.MODE_ALLOWED,  // OP_START_FOREGROUND
            AppOpsManager.MODE_ALLOWED,  // OP_BLUETOOTH_SCAN
    };

    /**
@@ -1308,6 +1319,7 @@ public class AppOpsManager {
            false, // ACCEPT_HANDOVER
            false, // MANAGE_IPSEC_TUNNELS
            false, // START_FOREGROUND
            false, // BLUETOOTH_SCAN
    };

    /**