Merge changes from topic "uwb_ranging_permission" into sc-dev

* changes:
  Add a new uwb ranging app-ops
  Add a new uwb ranging runtime permission
This commit is contained in:
Jeff Sharkey
2021-04-02 14:45:57 +00:00
committed by Android (Google) Code Review
4 changed files with 29 additions and 1 deletions

View File

@@ -174,6 +174,7 @@ package android {
field public static final String USE_FULL_SCREEN_INTENT = "android.permission.USE_FULL_SCREEN_INTENT";
field public static final String USE_ICC_AUTH_WITH_DEVICE_IDENTIFIER = "android.permission.USE_ICC_AUTH_WITH_DEVICE_IDENTIFIER";
field public static final String USE_SIP = "android.permission.USE_SIP";
field public static final String UWB_RANGING = "android.permission.UWB_RANGING";
field public static final String VIBRATE = "android.permission.VIBRATE";
field public static final String WAKE_LOCK = "android.permission.WAKE_LOCK";
field public static final String WRITE_APN_SETTINGS = "android.permission.WRITE_APN_SETTINGS";

View File

@@ -1222,9 +1222,12 @@ public class AppOpsManager {
*/
public static final int OP_MANAGE_MEDIA = AppProtoEnums.APP_OP_MANAGE_MEDIA;
/** @hide */
public static final int OP_UWB_RANGING = AppProtoEnums.APP_OP_UWB_RANGING;
/** @hide */
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
public static final int _NUM_OP = 112;
public static final int _NUM_OP = 113;
/** Access to coarse location information. */
public static final String OPSTR_COARSE_LOCATION = "android:coarse_location";
@@ -1637,6 +1640,8 @@ public class AppOpsManager {
* @hide
*/
public static final String OPSTR_MANAGE_MEDIA = "android:manage_media";
/** @hide */
public static final String OPSTR_UWB_RANGING = "android:uwb_ranging";
/** {@link #sAppOpsToNote} not initialized yet for this op */
private static final byte SHOULD_COLLECT_NOTE_OP_NOT_INITIALIZED = 0;
@@ -1706,6 +1711,7 @@ public class AppOpsManager {
// Nearby devices
OP_BLUETOOTH_SCAN,
OP_BLUETOOTH_CONNECT,
OP_UWB_RANGING,
// APPOP PERMISSIONS
OP_ACCESS_NOTIFICATIONS,
@@ -1846,6 +1852,7 @@ public class AppOpsManager {
OP_COARSE_LOCATION, // OP_COARSE_LOCATION_SOURCE
OP_MANAGE_MEDIA, // MANAGE_MEDIA
OP_BLUETOOTH_CONNECT, // OP_BLUETOOTH_CONNECT
OP_UWB_RANGING, // OP_UWB_RANGING
};
/**
@@ -1964,6 +1971,7 @@ public class AppOpsManager {
OPSTR_COARSE_LOCATION_SOURCE,
OPSTR_MANAGE_MEDIA,
OPSTR_BLUETOOTH_CONNECT,
OPSTR_UWB_RANGING,
};
/**
@@ -2083,6 +2091,7 @@ public class AppOpsManager {
"COARSE_LOCATION_SOURCE",
"MANAGE_MEDIA",
"BLUETOOTH_CONNECT",
"UWB_RANGING"
};
/**
@@ -2203,6 +2212,7 @@ public class AppOpsManager {
null, // no permission for OP_ACCESS_COARSE_LOCATION_SOURCE,
Manifest.permission.MANAGE_MEDIA,
Manifest.permission.BLUETOOTH_CONNECT,
Manifest.permission.UWB_RANGING,
};
/**
@@ -2323,6 +2333,7 @@ public class AppOpsManager {
null, // ACCESS_COARSE_LOCATION_SOURCE
null, // MANAGE_MEDIA
null, // BLUETOOTH_CONNECT
null, // UWB_RANGING
};
/**
@@ -2442,6 +2453,7 @@ public class AppOpsManager {
null, // ACCESS_COARSE_LOCATION_SOURCE
null, // MANAGE_MEDIA
null, // BLUETOOTH_CONNECT
null, // UWB_RANGING
};
/**
@@ -2560,6 +2572,7 @@ public class AppOpsManager {
AppOpsManager.MODE_ALLOWED, // ACCESS_COARSE_LOCATION_SOURCE
AppOpsManager.MODE_DEFAULT, // MANAGE_MEDIA
AppOpsManager.MODE_ALLOWED, // BLUETOOTH_CONNECT
AppOpsManager.MODE_ALLOWED, // UWB_RANGING
};
/**
@@ -2682,6 +2695,7 @@ public class AppOpsManager {
false, // ACCESS_COARSE_LOCATION_SOURCE
false, // MANAGE_MEDIA
false, // BLUETOOTH_CONNECT
false, // UWB_RANGING
};
/**

View File

@@ -1954,6 +1954,14 @@
android:label="@string/permlab_bluetooth_connect"
android:protectionLevel="dangerous" />
<!-- Required to be able to range to devices using uwb.
<p>Protection level: dangerous -->
<permission android:name="android.permission.UWB_RANGING"
android:permissionGroup="android.permission-group.UNDEFINED"
android:description="@string/permdesc_uwb_ranging"
android:label="@string/permlab_uwb_ranging"
android:protectionLevel="dangerous" />
<!-- @SystemApi @TestApi Allows an application to suspend other apps, which will prevent the
user from using them until they are unsuspended.
@hide

View File

@@ -1485,6 +1485,11 @@
<!-- Description of an application permission, listed so the user can choose whether they want to allow the application to do this. [CHAR LIMIT=120]-->
<string name="permdesc_bluetooth_connect" product="default">Allows the app to connect to paired Bluetooth devices</string>
<!-- Title of an application permission, listed so the user can choose whether they want to allow the application to do this. [CHAR LIMIT=50]-->
<string name="permlab_uwb_ranging">range to devices using ultra-wideband</string>
<!-- Description of an application permission, listed so the user can choose whether they want to allow the application to do this. [CHAR LIMIT=120]-->
<string name="permdesc_uwb_ranging" product="default">Allows the app to range to devices using ultra-wideband</string>
<!-- Title of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
<string name="permlab_preferredPaymentInfo">Preferred NFC Payment Service Information</string>
<!-- Description of an application permission, listed so the user can choose whether they want to allow the application to do this. -->