Merge "Notification pipeline: allow header visibility customization."

This commit is contained in:
Ben Lin
2022-01-26 05:45:10 +00:00
committed by Android (Google) Code Review
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();
}