Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cd746de2 authored by Ben Lin's avatar Ben Lin Committed by Android (Google) Code Review
Browse files

Merge "Notification pipeline: allow header visibility customization."

parents 0c0f576a 182787ab
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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
+8 −2
Original line number Diff line number Diff line
@@ -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
}
+4 −2
Original line number Diff line number Diff line
@@ -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();
    }