diff options
| author | 2024-03-19 10:40:12 -0700 | |
|---|---|---|
| committer | 2024-03-19 12:30:45 -0700 | |
| commit | a25c7565e600b5a2a3552fba175d98734a9b308b (patch) | |
| tree | 0c8a1e5902463fb2c5d1e5716e7fc676c270c173 | |
| parent | 05ec7771ef1d582750c5856c491e114416b1ee52 (diff) | |
Update EMERGENCY_LOCATION op to default to ALLOWED
As per offline discussion on how this op should work.
Bug: 301150056
Test: na
Change-Id: I5102bdd5828de52c837fb05f9bda5247e3137134
| -rw-r--r-- | core/java/android/app/AppOpsManager.java | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/core/java/android/app/AppOpsManager.java b/core/java/android/app/AppOpsManager.java index a8352fad8a90..ff713d071a05 100644 --- a/core/java/android/app/AppOpsManager.java +++ b/core/java/android/app/AppOpsManager.java @@ -1581,6 +1581,10 @@ public class AppOpsManager { * Allows an app to access location without the traditional location permissions and while the * user location setting is off, but only during pre-defined emergency sessions. * + * <p>This op is only used for tracking, not for permissions, so it is still the client's + * responsibility to check the {@link Manifest.permission.LOCATION_BYPASS} permission + * appropriately. + * * @hide */ public static final int OP_EMERGENCY_LOCATION = AppProtoEnums.APP_OP_EMERGENCY_LOCATION; @@ -2459,6 +2463,10 @@ public class AppOpsManager { * Allows an app to access location without the traditional location permissions and while the * user location setting is off, but only during pre-defined emergency sessions. * + * <p>This op is only used for tracking, not for permissions, so it is still the client's + * responsibility to check the {@link Manifest.permission.LOCATION_BYPASS} permission + * appropriately. + * * @hide */ @SystemApi @@ -3047,8 +3055,10 @@ public class AppOpsManager { new AppOpInfo.Builder(OP_UNARCHIVAL_CONFIRMATION, OPSTR_UNARCHIVAL_CONFIRMATION, "UNARCHIVAL_CONFIRMATION") .setDefaultMode(MODE_ALLOWED).build(), - // TODO(b/301150056): STOPSHIP determine how this appop should work with the permission new AppOpInfo.Builder(OP_EMERGENCY_LOCATION, OPSTR_EMERGENCY_LOCATION, "EMERGENCY_LOCATION") + .setDefaultMode(MODE_ALLOWED) + // even though this has a permission associated, this op is only used for tracking, + // and the client is responsible for checking the LOCATION_BYPASS permission. .setPermission(Manifest.permission.LOCATION_BYPASS).build(), }; |