Loading packages/SystemUI/res/values/config.xml +3 −0 Original line number Diff line number Diff line Loading @@ -338,4 +338,7 @@ <!-- Whether to show activity indicators in the status bar --> <bool name="config_showActivity">false</bool> <!-- Whether or not the button to clear all notifications will be shown. --> <bool name="config_enableNotificationsClearAll">true</bool> </resources> packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java +37 −14 Original line number Diff line number Diff line Loading @@ -716,6 +716,7 @@ public class StatusBar extends SystemUI implements DemoMode, private ConfigurationListener mConfigurationListener; private InflationExceptionHandler mInflationExceptionHandler = this::handleInflationException; private boolean mReinflateNotificationsOnUserSwitched; private boolean mClearAllEnabled; private void recycleAllVisibilityObjects(ArraySet<NotificationVisibility> array) { final int N = array.size(); Loading Loading @@ -761,8 +762,10 @@ public class StatusBar extends SystemUI implements DemoMode, mWindowManager = (WindowManager) mContext.getSystemService(Context.WINDOW_SERVICE); mDisplay = mWindowManager.getDefaultDisplay(); updateDisplaySize(); mScrimSrcModeEnabled = mContext.getResources().getBoolean( R.bool.config_status_bar_scrim_behind_use_src); Resources res = mContext.getResources(); mScrimSrcModeEnabled = res.getBoolean(R.bool.config_status_bar_scrim_behind_use_src); mClearAllEnabled = res.getBoolean(R.bool.config_enableNotificationsClearAll); DateTimeView.setReceiverHandler(Dependency.get(Dependency.TIME_TICK_HANDLER)); putComponent(StatusBar.class, this); Loading Loading @@ -810,7 +813,7 @@ public class StatusBar extends SystemUI implements DemoMode, mRecents = getComponent(Recents.class); final Configuration currentConfig = mContext.getResources().getConfiguration(); final Configuration currentConfig = res.getConfiguration(); mLocale = currentConfig.locale; mLayoutDirection = TextUtils.getLayoutDirectionFromLocale(mLocale); Loading @@ -823,7 +826,7 @@ public class StatusBar extends SystemUI implements DemoMode, mCommandQueue.addCallbacks(this); int[] switches = new int[9]; ArrayList<IBinder> binders = new ArrayList<IBinder>(); ArrayList<IBinder> binders = new ArrayList<>(); ArrayList<String> iconSlots = new ArrayList<>(); ArrayList<StatusBarIcon> icons = new ArrayList<>(); Rect fullscreenStackBounds = new Rect(); Loading Loading @@ -904,8 +907,8 @@ public class StatusBar extends SystemUI implements DemoMode, Slog.e(TAG, "Failed to register VR mode state listener: " + e); } mNonBlockablePkgs = new HashSet<String>(); Collections.addAll(mNonBlockablePkgs, mContext.getResources().getStringArray( mNonBlockablePkgs = new HashSet<>(); Collections.addAll(mNonBlockablePkgs, res.getStringArray( com.android.internal.R.array.config_nonBlockableNotificationPackages)); // end old BaseStatusBar.start(). Loading Loading @@ -1358,6 +1361,10 @@ public class StatusBar extends SystemUI implements DemoMode, } private void inflateDismissView() { if (!mClearAllEnabled) { return; } mDismissView = (DismissView) LayoutInflater.from(mContext).inflate( R.layout.status_bar_notification_dismiss_all, mStackScroller, false); mDismissView.setOnButtonClickListener(new View.OnClickListener() { Loading Loading @@ -2023,9 +2030,11 @@ public class StatusBar extends SystemUI implements DemoMode, } private void updateClearAll() { boolean showDismissView = mState != StatusBarState.KEYGUARD && hasActiveClearableNotifications(); if (!mClearAllEnabled) { return; } boolean showDismissView = mState != StatusBarState.KEYGUARD && hasActiveClearableNotifications(); mStackScroller.updateDismissView(showDismissView); } Loading Loading @@ -6615,9 +6624,23 @@ public class StatusBar extends SystemUI implements DemoMode, } mNotificationPanel.setNoVisibleNotifications(visibleNotifications == 0); mStackScroller.changeViewPosition(mDismissView, mStackScroller.getChildCount() - 1); mStackScroller.changeViewPosition(mEmptyShadeView, mStackScroller.getChildCount() - 2); mStackScroller.changeViewPosition(mNotificationShelf, mStackScroller.getChildCount() - 3); // The following views will be moved to the end of mStackScroller. This counter represents // the offset from the last child. Initialized to 1 for the very last position. It is post- // incremented in the following "changeViewPosition" calls so that its value is correct for // subsequent calls. int offsetFromEnd = 1; if (mDismissView != null) { mStackScroller.changeViewPosition(mDismissView, mStackScroller.getChildCount() - offsetFromEnd++); } mStackScroller.changeViewPosition(mEmptyShadeView, mStackScroller.getChildCount() - offsetFromEnd++); // No post-increment for this call because it is the last one. Make sure to add one if // another "changeViewPosition" call is ever added. mStackScroller.changeViewPosition(mNotificationShelf, mStackScroller.getChildCount() - offsetFromEnd); } public boolean shouldShowOnKeyguard(StatusBarNotification sbn) { Loading packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java +14 −5 Original line number Diff line number Diff line Loading @@ -38,6 +38,7 @@ import android.graphics.Rect; import android.os.Bundle; import android.os.Handler; import android.service.notification.StatusBarNotification; import android.support.annotation.NonNull; import android.util.AttributeSet; import android.util.FloatProperty; import android.util.Log; Loading Loading @@ -3574,7 +3575,9 @@ public class NotificationStackScrollLayout extends ViewGroup } public void goToFullShade(long delay) { if (mDismissView != null) { mDismissView.setInvisible(); } mEmptyShadeView.setInvisible(); mGoToFullShadeNeedsAnimation = true; mGoToFullShadeDelay = delay; Loading Loading @@ -3701,7 +3704,7 @@ public class NotificationStackScrollLayout extends ViewGroup return -1; } public void setDismissView(DismissView dismissView) { public void setDismissView(@NonNull DismissView dismissView) { int index = -1; if (mDismissView != null) { index = indexOfChild(mDismissView); Loading Loading @@ -3757,6 +3760,10 @@ public class NotificationStackScrollLayout extends ViewGroup } public void updateDismissView(boolean visible) { if (mDismissView == null) { return; } int oldVisibility = mDismissView.willBeGone() ? GONE : mDismissView.getVisibility(); int newVisibility = visible ? VISIBLE : GONE; if (oldVisibility != newVisibility) { Loading Loading @@ -3814,15 +3821,17 @@ public class NotificationStackScrollLayout extends ViewGroup } public boolean isDismissViewNotGone() { return mDismissView.getVisibility() != View.GONE && !mDismissView.willBeGone(); return mDismissView != null && mDismissView.getVisibility() != View.GONE && !mDismissView.willBeGone(); } public boolean isDismissViewVisible() { return mDismissView.isVisible(); return mDismissView != null && mDismissView.isVisible(); } public int getDismissViewHeight() { return mDismissView.getHeight() + mPaddingBetweenElements; return mDismissView == null ? 0 : mDismissView.getHeight() + mPaddingBetweenElements; } public int getEmptyShadeViewHeight() { Loading Loading
packages/SystemUI/res/values/config.xml +3 −0 Original line number Diff line number Diff line Loading @@ -338,4 +338,7 @@ <!-- Whether to show activity indicators in the status bar --> <bool name="config_showActivity">false</bool> <!-- Whether or not the button to clear all notifications will be shown. --> <bool name="config_enableNotificationsClearAll">true</bool> </resources>
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java +37 −14 Original line number Diff line number Diff line Loading @@ -716,6 +716,7 @@ public class StatusBar extends SystemUI implements DemoMode, private ConfigurationListener mConfigurationListener; private InflationExceptionHandler mInflationExceptionHandler = this::handleInflationException; private boolean mReinflateNotificationsOnUserSwitched; private boolean mClearAllEnabled; private void recycleAllVisibilityObjects(ArraySet<NotificationVisibility> array) { final int N = array.size(); Loading Loading @@ -761,8 +762,10 @@ public class StatusBar extends SystemUI implements DemoMode, mWindowManager = (WindowManager) mContext.getSystemService(Context.WINDOW_SERVICE); mDisplay = mWindowManager.getDefaultDisplay(); updateDisplaySize(); mScrimSrcModeEnabled = mContext.getResources().getBoolean( R.bool.config_status_bar_scrim_behind_use_src); Resources res = mContext.getResources(); mScrimSrcModeEnabled = res.getBoolean(R.bool.config_status_bar_scrim_behind_use_src); mClearAllEnabled = res.getBoolean(R.bool.config_enableNotificationsClearAll); DateTimeView.setReceiverHandler(Dependency.get(Dependency.TIME_TICK_HANDLER)); putComponent(StatusBar.class, this); Loading Loading @@ -810,7 +813,7 @@ public class StatusBar extends SystemUI implements DemoMode, mRecents = getComponent(Recents.class); final Configuration currentConfig = mContext.getResources().getConfiguration(); final Configuration currentConfig = res.getConfiguration(); mLocale = currentConfig.locale; mLayoutDirection = TextUtils.getLayoutDirectionFromLocale(mLocale); Loading @@ -823,7 +826,7 @@ public class StatusBar extends SystemUI implements DemoMode, mCommandQueue.addCallbacks(this); int[] switches = new int[9]; ArrayList<IBinder> binders = new ArrayList<IBinder>(); ArrayList<IBinder> binders = new ArrayList<>(); ArrayList<String> iconSlots = new ArrayList<>(); ArrayList<StatusBarIcon> icons = new ArrayList<>(); Rect fullscreenStackBounds = new Rect(); Loading Loading @@ -904,8 +907,8 @@ public class StatusBar extends SystemUI implements DemoMode, Slog.e(TAG, "Failed to register VR mode state listener: " + e); } mNonBlockablePkgs = new HashSet<String>(); Collections.addAll(mNonBlockablePkgs, mContext.getResources().getStringArray( mNonBlockablePkgs = new HashSet<>(); Collections.addAll(mNonBlockablePkgs, res.getStringArray( com.android.internal.R.array.config_nonBlockableNotificationPackages)); // end old BaseStatusBar.start(). Loading Loading @@ -1358,6 +1361,10 @@ public class StatusBar extends SystemUI implements DemoMode, } private void inflateDismissView() { if (!mClearAllEnabled) { return; } mDismissView = (DismissView) LayoutInflater.from(mContext).inflate( R.layout.status_bar_notification_dismiss_all, mStackScroller, false); mDismissView.setOnButtonClickListener(new View.OnClickListener() { Loading Loading @@ -2023,9 +2030,11 @@ public class StatusBar extends SystemUI implements DemoMode, } private void updateClearAll() { boolean showDismissView = mState != StatusBarState.KEYGUARD && hasActiveClearableNotifications(); if (!mClearAllEnabled) { return; } boolean showDismissView = mState != StatusBarState.KEYGUARD && hasActiveClearableNotifications(); mStackScroller.updateDismissView(showDismissView); } Loading Loading @@ -6615,9 +6624,23 @@ public class StatusBar extends SystemUI implements DemoMode, } mNotificationPanel.setNoVisibleNotifications(visibleNotifications == 0); mStackScroller.changeViewPosition(mDismissView, mStackScroller.getChildCount() - 1); mStackScroller.changeViewPosition(mEmptyShadeView, mStackScroller.getChildCount() - 2); mStackScroller.changeViewPosition(mNotificationShelf, mStackScroller.getChildCount() - 3); // The following views will be moved to the end of mStackScroller. This counter represents // the offset from the last child. Initialized to 1 for the very last position. It is post- // incremented in the following "changeViewPosition" calls so that its value is correct for // subsequent calls. int offsetFromEnd = 1; if (mDismissView != null) { mStackScroller.changeViewPosition(mDismissView, mStackScroller.getChildCount() - offsetFromEnd++); } mStackScroller.changeViewPosition(mEmptyShadeView, mStackScroller.getChildCount() - offsetFromEnd++); // No post-increment for this call because it is the last one. Make sure to add one if // another "changeViewPosition" call is ever added. mStackScroller.changeViewPosition(mNotificationShelf, mStackScroller.getChildCount() - offsetFromEnd); } public boolean shouldShowOnKeyguard(StatusBarNotification sbn) { Loading
packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java +14 −5 Original line number Diff line number Diff line Loading @@ -38,6 +38,7 @@ import android.graphics.Rect; import android.os.Bundle; import android.os.Handler; import android.service.notification.StatusBarNotification; import android.support.annotation.NonNull; import android.util.AttributeSet; import android.util.FloatProperty; import android.util.Log; Loading Loading @@ -3574,7 +3575,9 @@ public class NotificationStackScrollLayout extends ViewGroup } public void goToFullShade(long delay) { if (mDismissView != null) { mDismissView.setInvisible(); } mEmptyShadeView.setInvisible(); mGoToFullShadeNeedsAnimation = true; mGoToFullShadeDelay = delay; Loading Loading @@ -3701,7 +3704,7 @@ public class NotificationStackScrollLayout extends ViewGroup return -1; } public void setDismissView(DismissView dismissView) { public void setDismissView(@NonNull DismissView dismissView) { int index = -1; if (mDismissView != null) { index = indexOfChild(mDismissView); Loading Loading @@ -3757,6 +3760,10 @@ public class NotificationStackScrollLayout extends ViewGroup } public void updateDismissView(boolean visible) { if (mDismissView == null) { return; } int oldVisibility = mDismissView.willBeGone() ? GONE : mDismissView.getVisibility(); int newVisibility = visible ? VISIBLE : GONE; if (oldVisibility != newVisibility) { Loading Loading @@ -3814,15 +3821,17 @@ public class NotificationStackScrollLayout extends ViewGroup } public boolean isDismissViewNotGone() { return mDismissView.getVisibility() != View.GONE && !mDismissView.willBeGone(); return mDismissView != null && mDismissView.getVisibility() != View.GONE && !mDismissView.willBeGone(); } public boolean isDismissViewVisible() { return mDismissView.isVisible(); return mDismissView != null && mDismissView.isVisible(); } public int getDismissViewHeight() { return mDismissView.getHeight() + mPaddingBetweenElements; return mDismissView == null ? 0 : mDismissView.getHeight() + mPaddingBetweenElements; } public int getEmptyShadeViewHeight() { Loading