diff --git a/packages/SystemUI/res/layout/ongoing_privacy_chip.xml b/packages/SystemUI/res/layout/ongoing_privacy_chip.xml
index f64a64e619a00..b16e06207ca36 100644
--- a/packages/SystemUI/res/layout/ongoing_privacy_chip.xml
+++ b/packages/SystemUI/res/layout/ongoing_privacy_chip.xml
@@ -28,7 +28,7 @@
android:orientation="horizontal"
android:focusable="true">
-
-
-
-
+
\ No newline at end of file
diff --git a/packages/SystemUI/res/values/dimens.xml b/packages/SystemUI/res/values/dimens.xml
index 30c29dcff9e0d..521d1eaa54a6b 100644
--- a/packages/SystemUI/res/values/dimens.xml
+++ b/packages/SystemUI/res/values/dimens.xml
@@ -1003,10 +1003,8 @@
0dp
32dp
-
- 8dp
- 0dp
+ 8dp
8dp
@@ -1017,10 +1015,7 @@
@*android:dimen/status_bar_icon_size
16dp
-
- 12sp
-
- 8dp
+
8dp
diff --git a/packages/SystemUI/res/values/strings.xml b/packages/SystemUI/res/values/strings.xml
index 5b86fb7a98399..da433913bfa33 100644
--- a/packages/SystemUI/res/values/strings.xml
+++ b/packages/SystemUI/res/values/strings.xml
@@ -2320,26 +2320,12 @@
app for debugging. Will not be seen by users. [CHAR LIMIT=20] -->
Dump SysUI Heap
-
-
- - %d app
- - %d apps
- - %d apps
-
-
%1$s is using your %2$s.
Applications are using your %s.
-
-
- - %1$d application is using your %2$s.
- - %1$d applications are using your %2$s.
- - %1$d applications are using your %2$s.
-
-
Got it
diff --git a/packages/SystemUI/src/com/android/systemui/privacy/OngoingPrivacyChip.kt b/packages/SystemUI/src/com/android/systemui/privacy/OngoingPrivacyChip.kt
index 15dc43f041f49..23742c0953bb5 100644
--- a/packages/SystemUI/src/com/android/systemui/privacy/OngoingPrivacyChip.kt
+++ b/packages/SystemUI/src/com/android/systemui/privacy/OngoingPrivacyChip.kt
@@ -17,9 +17,9 @@ package com.android.systemui.privacy
import android.content.Context
import android.util.AttributeSet
import android.view.ViewGroup
+import android.widget.FrameLayout
import android.widget.ImageView
import android.widget.LinearLayout
-import android.widget.TextView
import com.android.systemui.Dependency
import com.android.systemui.R
import com.android.systemui.statusbar.policy.KeyguardMonitor
@@ -42,9 +42,8 @@ class OngoingPrivacyChip @JvmOverloads constructor(
private val sidePadding =
context.resources.getDimensionPixelSize(R.dimen.ongoing_appops_chip_side_padding)
private val backgroundDrawable = context.getDrawable(R.drawable.privacy_chip_bg)
- private lateinit var text: TextView
private lateinit var iconsContainer: LinearLayout
- private lateinit var back: LinearLayout
+ private lateinit var back: FrameLayout
var expanded = false
set(value) {
if (value != field) {
@@ -66,14 +65,14 @@ class OngoingPrivacyChip @JvmOverloads constructor(
super.onFinishInflate()
back = findViewById(R.id.background)
- text = findViewById(R.id.text_container)
iconsContainer = findViewById(R.id.icons_container)
}
// Should only be called if the builder icons or app changed
private fun updateView() {
back.background = if (expanded) backgroundDrawable else null
- back.setPaddingRelative(0, 0, if (expanded) sidePadding else 0, 0)
+ val padding = if (expanded) sidePadding else 0
+ back.setPaddingRelative(padding, 0, padding, 0)
fun setIcons(dialogBuilder: PrivacyDialogBuilder, iconsContainer: ViewGroup) {
iconsContainer.removeAllViews()
dialogBuilder.generateIcons().forEachIndexed { i, it ->
@@ -95,44 +94,17 @@ class OngoingPrivacyChip @JvmOverloads constructor(
if (!privacyList.isEmpty()) {
generateContentDescription()
setIcons(builder, iconsContainer)
- setApplicationText()
} else {
- text.visibility = GONE
iconsContainer.removeAllViews()
}
requestLayout()
}
- private fun setApplicationText() {
- text.visibility = if (builder.types.size == 1 && expanded) VISIBLE else GONE
- if (builder.types.size == 1 && expanded) {
- if (builder.app != null && !amISecure()) {
- text.setText(builder.app?.applicationName)
- } else {
- text.text = context.resources.getQuantityString(
- R.plurals.ongoing_privacy_chip_multiple_apps,
- builder.appsAndTypes.size, builder.appsAndTypes.size)
- }
- }
- }
-
private fun amISecure() = keyguardMonitor.isShowing && keyguardMonitor.isSecure
private fun generateContentDescription() {
val typesText = builder.joinTypes()
- if (builder.types.size > 1) {
- contentDescription = context.getString(
- R.string.ongoing_privacy_chip_content_multiple_apps, typesText)
- } else {
- if (builder.app != null && !amISecure()) {
- contentDescription =
- context.getString(R.string.ongoing_privacy_chip_content_single_app,
- builder.app?.applicationName, typesText)
- } else {
- contentDescription = context.resources.getQuantityString(
- R.plurals.ongoing_privacy_chip_content_multiple_apps_single_op,
- builder.appsAndTypes.size, builder.appsAndTypes.size, typesText)
- }
- }
+ contentDescription = context.getString(
+ R.string.ongoing_privacy_chip_content_multiple_apps, typesText)
}
}
\ No newline at end of file
diff --git a/packages/SystemUI/src/com/android/systemui/privacy/PrivacyDialogBuilder.kt b/packages/SystemUI/src/com/android/systemui/privacy/PrivacyDialogBuilder.kt
index bbea6b277e909..59b3c3464a69d 100644
--- a/packages/SystemUI/src/com/android/systemui/privacy/PrivacyDialogBuilder.kt
+++ b/packages/SystemUI/src/com/android/systemui/privacy/PrivacyDialogBuilder.kt
@@ -22,7 +22,6 @@ class PrivacyDialogBuilder(private val context: Context, itemsList: List>>
val types: List
- val app: PrivacyApplication?
private val separator = context.getString(R.string.ongoing_privacy_dialog_separator)
private val lastSeparator = context.getString(R.string.ongoing_privacy_dialog_last_separator)
@@ -32,8 +31,6 @@ class PrivacyDialogBuilder(private val context: Context, itemsList: List): List {
@@ -58,11 +55,7 @@ class PrivacyDialogBuilder(private val context: Context, itemsList: List