summaryrefslogtreecommitdiff
path: root/PermissionController/src/com/android/permissioncontroller/safetycenter
diff options
context:
space:
mode:
authorShriya Gupta <shrigupt@google.com>2023-02-28 17:24:29 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2023-02-28 17:24:29 +0000
commit781d32c6f8e869305ba294d824c40f91753d4032 (patch)
tree641e039faa8c54aa02f3c1c5d3c1b18c7ca9798a /PermissionController/src/com/android/permissioncontroller/safetycenter
parent90f743b223c892125d271f56bea6896c85f5ba89 (diff)
parent0483b778977ea043e7f319e7fdc88cc3e665b8a4 (diff)
downloadPermission-781d32c6f8e869305ba294d824c40f91753d4032.tar.gz
Merge "Hide the data category when privacy subpage sources aren't visible" into udc-dev
Diffstat (limited to 'PermissionController/src/com/android/permissioncontroller/safetycenter')
-rw-r--r--PermissionController/src/com/android/permissioncontroller/safetycenter/ui/PrivacySubpageFragment.kt8
1 files changed, 8 insertions, 0 deletions
diff --git a/PermissionController/src/com/android/permissioncontroller/safetycenter/ui/PrivacySubpageFragment.kt b/PermissionController/src/com/android/permissioncontroller/safetycenter/ui/PrivacySubpageFragment.kt
index e7ea88e00..43e090cf8 100644
--- a/PermissionController/src/com/android/permissioncontroller/safetycenter/ui/PrivacySubpageFragment.kt
+++ b/PermissionController/src/com/android/permissioncontroller/safetycenter/ui/PrivacySubpageFragment.kt
@@ -106,6 +106,7 @@ class PrivacySubpageFragment : SafetyCenterFragment() {
Log.d(TAG, "updateSafetyCenterEntries called with $entryGroup")
subpageGenericEntryGroup.removeAll()
subpageDataEntryGroup.removeAll()
+ var atLeastOneDataEntryVisible = false
for (entry in entryGroup.entries) {
val entryId = entry.id
@@ -136,9 +137,16 @@ class PrivacySubpageFragment : SafetyCenterFragment() {
}
else -> {
subpageDataEntryGroup.addPreference(subpageEntry)
+ atLeastOneDataEntryVisible =
+ atLeastOneDataEntryVisible || subpageEntry.isVisible()
}
}
}
+
+ /* The data entry group currently consists of only two sources which have an initial
+ * display state hidden. So if they are not visible, we should hide the entire category
+ * including the header */
+ subpageDataEntryGroup.setVisible(atLeastOneDataEntryVisible)
}
private fun renderPrivacyControls(prefStates: Map<Pref, PrefState>) {