diff options
| author | 2022-02-25 21:41:58 +0000 | |
|---|---|---|
| committer | 2022-02-25 21:41:58 +0000 | |
| commit | d7af7fcaff1151f0a6f186be11fbf43f89f676cd (patch) | |
| tree | a7b570a2a755943f93255f5e95ee4c761c77d140 | |
| parent | e15d10f33db733f5ae8212af24c77e60f890d1c2 (diff) | |
| parent | 6510aa238e4bacb7c88e6f4fc9954d63ab95f48c (diff) | |
Merge "Implement API feedback for Safety Center QS" into tm-dev
| -rw-r--r-- | core/api/current.txt | 1 | ||||
| -rw-r--r-- | core/api/system-current.txt | 1 | ||||
| -rw-r--r-- | core/api/test-current.txt | 2 | ||||
| -rw-r--r-- | core/java/android/content/Intent.java | 9 | ||||
| -rw-r--r-- | core/java/android/hardware/SensorPrivacyManager.java | 8 | ||||
| -rw-r--r-- | core/proto/android/hardware/sensorprivacy.proto | 2 | ||||
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/qs/HeaderPrivacyIconsController.kt | 12 |
7 files changed, 19 insertions, 16 deletions
diff --git a/core/api/current.txt b/core/api/current.txt index 00d7d80808b1..698c1ce93f70 100644 --- a/core/api/current.txt +++ b/core/api/current.txt @@ -10329,7 +10329,6 @@ package android.content { field public static final String ACTION_VIEW_LOCUS = "android.intent.action.VIEW_LOCUS"; field @RequiresPermission(android.Manifest.permission.START_VIEW_PERMISSION_USAGE) public static final String ACTION_VIEW_PERMISSION_USAGE = "android.intent.action.VIEW_PERMISSION_USAGE"; field @RequiresPermission(android.Manifest.permission.START_VIEW_PERMISSION_USAGE) public static final String ACTION_VIEW_PERMISSION_USAGE_FOR_PERIOD = "android.intent.action.VIEW_PERMISSION_USAGE_FOR_PERIOD"; - field @RequiresPermission("android.permission.MANAGE_SENSOR_PRIVACY") public static final String ACTION_VIEW_SAFETY_HUB = "android.intent.action.VIEW_SAFETY_HUB"; field public static final String ACTION_VOICE_COMMAND = "android.intent.action.VOICE_COMMAND"; field @Deprecated public static final String ACTION_WALLPAPER_CHANGED = "android.intent.action.WALLPAPER_CHANGED"; field public static final String ACTION_WEB_SEARCH = "android.intent.action.WEB_SEARCH"; diff --git a/core/api/system-current.txt b/core/api/system-current.txt index 414b2740350f..70b0f22f677d 100644 --- a/core/api/system-current.txt +++ b/core/api/system-current.txt @@ -3035,6 +3035,7 @@ package android.content { field public static final String ACTION_USER_REMOVED = "android.intent.action.USER_REMOVED"; field public static final String ACTION_USER_SWITCHED = "android.intent.action.USER_SWITCHED"; field @RequiresPermission(android.Manifest.permission.START_VIEW_APP_FEATURES) public static final String ACTION_VIEW_APP_FEATURES = "android.intent.action.VIEW_APP_FEATURES"; + field @RequiresPermission(android.Manifest.permission.MANAGE_SENSOR_PRIVACY) public static final String ACTION_VIEW_SAFETY_CENTER_QS = "android.intent.action.VIEW_SAFETY_CENTER_QS"; field public static final String ACTION_VOICE_ASSIST = "android.intent.action.VOICE_ASSIST"; field public static final String CATEGORY_LEANBACK_SETTINGS = "android.intent.category.LEANBACK_SETTINGS"; field public static final String EXTRA_CALLING_PACKAGE = "android.intent.extra.CALLING_PACKAGE"; diff --git a/core/api/test-current.txt b/core/api/test-current.txt index b752c4de22c7..22637ca95b9c 100644 --- a/core/api/test-current.txt +++ b/core/api/test-current.txt @@ -1073,7 +1073,7 @@ package android.hardware { field public static final int DIALOG = 3; // 0x3 field public static final int OTHER = 5; // 0x5 field public static final int QS_TILE = 1; // 0x1 - field public static final int SAFETY_HUB = 6; // 0x6 + field public static final int SAFETY_CENTER = 6; // 0x6 field public static final int SETTINGS = 2; // 0x2 field public static final int SHELL = 4; // 0x4 } diff --git a/core/java/android/content/Intent.java b/core/java/android/content/Intent.java index 0aa25ef97dd0..478befd9c26d 100644 --- a/core/java/android/content/Intent.java +++ b/core/java/android/content/Intent.java @@ -2054,7 +2054,7 @@ public class Intent implements Parcelable, Cloneable { "android.intent.action.VIEW_PERMISSION_USAGE_FOR_PERIOD"; /** - * Activity action: Launch the Safety Hub UI. + * Activity action: Launch the Safety Center Quick Settings UI. * * <p> * Input: Nothing. @@ -2062,11 +2062,14 @@ public class Intent implements Parcelable, Cloneable { * <p> * Output: Nothing. * </p> + * + * @hide */ + @SystemApi @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) @RequiresPermission(Manifest.permission.MANAGE_SENSOR_PRIVACY) - public static final String ACTION_VIEW_SAFETY_HUB = - "android.intent.action.VIEW_SAFETY_HUB"; + public static final String ACTION_VIEW_SAFETY_CENTER_QS = + "android.intent.action.VIEW_SAFETY_CENTER_QS"; /** * Activity action: Launch UI to manage a default app. diff --git a/core/java/android/hardware/SensorPrivacyManager.java b/core/java/android/hardware/SensorPrivacyManager.java index a3cc01c0adfb..0460e5831e33 100644 --- a/core/java/android/hardware/SensorPrivacyManager.java +++ b/core/java/android/hardware/SensorPrivacyManager.java @@ -136,9 +136,9 @@ public final class SensorPrivacyManager { public static final int OTHER = SensorPrivacyToggleSourceProto.OTHER; /** - * Constant for SAFETY_HUB. + * Constant for SAFETY_CENTER. */ - public static final int SAFETY_HUB = SensorPrivacyToggleSourceProto.SAFETY_HUB; + public static final int SAFETY_CENTER = SensorPrivacyToggleSourceProto.SAFETY_CENTER; /** * Source for toggling sensors @@ -151,7 +151,7 @@ public final class SensorPrivacyManager { DIALOG, SHELL, OTHER, - SAFETY_HUB + SAFETY_CENTER }) @Retention(RetentionPolicy.SOURCE) public @interface Source {} @@ -652,7 +652,7 @@ public final class SensorPrivacyManager { String packageName = mContext.getOpPackageName(); if (Objects.equals(packageName, mContext.getPackageManager().getPermissionControllerPackageName())) { - return Sources.SAFETY_HUB; + return Sources.SAFETY_CENTER; } return Sources.OTHER; } diff --git a/core/proto/android/hardware/sensorprivacy.proto b/core/proto/android/hardware/sensorprivacy.proto index 97870a16da2b..9359528b613b 100644 --- a/core/proto/android/hardware/sensorprivacy.proto +++ b/core/proto/android/hardware/sensorprivacy.proto @@ -128,7 +128,7 @@ message SensorPrivacyToggleSourceProto { DIALOG = 3; SHELL = 4; OTHER = 5; - SAFETY_HUB = 6; + SAFETY_CENTER = 6; } // Source for which sensor privacy was toggled. diff --git a/packages/SystemUI/src/com/android/systemui/qs/HeaderPrivacyIconsController.kt b/packages/SystemUI/src/com/android/systemui/qs/HeaderPrivacyIconsController.kt index 8afb7933aacc..95b4b725e4c6 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/HeaderPrivacyIconsController.kt +++ b/packages/SystemUI/src/com/android/systemui/qs/HeaderPrivacyIconsController.kt @@ -118,7 +118,7 @@ class HeaderPrivacyIconsController @Inject constructor( // If the privacy chip is visible, it means there were some indicators uiEventLogger.log(PrivacyChipEvent.ONGOING_INDICATORS_CHIP_CLICK) if (safetyCenterEnabled) { - showSafetyHub() + showSafetyCenter() } else { privacyDialogController.showDialog(privacyChip.context) } @@ -131,16 +131,16 @@ class HeaderPrivacyIconsController @Inject constructor( updatePrivacyIconSlots() } - private fun showSafetyHub() { + private fun showSafetyCenter() { backgroundExecutor.execute { val usage = ArrayList(permGroupUsage()) privacyLogger.logUnfilteredPermGroupUsage(usage) - val startSafetyHub = Intent(Intent.ACTION_VIEW_SAFETY_HUB) - startSafetyHub.putParcelableArrayListExtra(PermissionManager.EXTRA_PERMISSION_USAGES, + val startSafetyCenter = Intent(Intent.ACTION_VIEW_SAFETY_CENTER_QS) + startSafetyCenter.putParcelableArrayListExtra(PermissionManager.EXTRA_PERMISSION_USAGES, usage) - startSafetyHub.flags = Intent.FLAG_ACTIVITY_NEW_TASK + startSafetyCenter.flags = Intent.FLAG_ACTIVITY_NEW_TASK uiExecutor.execute { - activityStarter.startActivity(startSafetyHub, true, + activityStarter.startActivity(startSafetyCenter, true, ActivityLaunchAnimator.Controller.fromView(privacyChip)) } } |