Notification pipeline: allow header visibility customization.

This introduces new configs so that some devices that never use section
headers can disable them permanently.

Bug: None
Test: Push to a device with the flag true locally, headers don't show
up

Change-Id: Id7cf3866ed191bbfef2e31bbce67da1d23b70e16
This commit is contained in:
Ben Lin
2022-01-21 18:51:59 -08:00
parent cdf014104d
commit 182787ab1e
3 changed files with 15 additions and 4 deletions

View File

@@ -581,6 +581,9 @@
<!-- Whether to use the split 2-column notification shade -->
<bool name="config_use_split_notification_shade">false</bool>
<!-- Whether notification header should never show section headers. -->
<bool name="config_notification_never_show_section_headers">false</bool>
<!-- Default udfps icon. Same path as ic_fingerprint.xml -->
<string name="config_udfpsIcon" translatable="false">
M25.5,16.3283C28.47,14.8433 31.9167,14 35.5834,14C39.2501,14 42.6968,14.8433 45.6668,16.3283

View File

@@ -16,7 +16,9 @@
package com.android.systemui.statusbar.notification
import android.content.Context
import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.R
import javax.inject.Inject
/**
@@ -29,6 +31,10 @@ import javax.inject.Inject
* visibility when it invalidates, and we just store that state here.)
*/
@SysUISingleton
class SectionHeaderVisibilityProvider @Inject constructor() {
class SectionHeaderVisibilityProvider @Inject constructor(
context: Context
) {
var neverShowSectionHeaders = context.resources.getBoolean(R.bool.config_notification_never_show_section_headers)
private set
var sectionHeadersVisible = true
}
}

View File

@@ -220,8 +220,10 @@ public class KeyguardCoordinator implements Coordinator {
}
private void invalidateListFromFilter(String reason) {
mSectionHeaderVisibilityProvider.setSectionHeadersVisible(
mStatusBarStateController.getState() != StatusBarState.KEYGUARD);
boolean onKeyguard = mStatusBarStateController.getState() == StatusBarState.KEYGUARD;
boolean neverShowSections = mSectionHeaderVisibilityProvider.getNeverShowSectionHeaders();
boolean showSections = !onKeyguard && !neverShowSections;
mSectionHeaderVisibilityProvider.setSectionHeadersVisible(showSections);
mNotifFilter.invalidateList();
}