Loading packages/SystemUI/src/com/android/systemui/statusbar/DragDownHelper.java +21 −2 Original line number Diff line number Diff line Loading @@ -92,7 +92,7 @@ public class DragDownHelper implements Gefingerpoken { mInitialTouchY = y; mInitialTouchX = x; mDragDownCallback.onTouchSlopExceeded(); return true; return mStartingChild != null || mDragDownCallback.isDragDownAnywhereEnabled(); } break; } Loading Loading @@ -162,7 +162,11 @@ public class DragDownHelper implements Gefingerpoken { if (mStartingChild == null) { mStartingChild = findView(x, y); if (mStartingChild != null) { if (mDragDownCallback.isDragDownEnabledForView(mStartingChild)) { mCallback.setUserLockedChild(mStartingChild, true); } else { mStartingChild = null; } } } } Loading Loading @@ -237,6 +241,10 @@ public class DragDownHelper implements Gefingerpoken { return mDraggingDown; } public boolean isDragDownEnabled() { return mDragDownCallback.isDragDownEnabledForView(null); } public interface DragDownCallback { /** Loading @@ -253,5 +261,16 @@ public class DragDownHelper implements Gefingerpoken { void onTouchSlopExceeded(); void setEmptyDragAmount(float amount); boolean isFalsingCheckNeeded(); /** * Is dragging down enabled on a given view * @param view The view to check or {@code null} to check if it's enabled at all */ boolean isDragDownEnabledForView(ExpandableView view); /** * @return if drag down is enabled anywhere, not just on selected views. */ boolean isDragDownAnywhereEnabled(); } } packages/SystemUI/src/com/android/systemui/statusbar/NotificationPresenter.java +0 −5 Original line number Diff line number Diff line Loading @@ -62,11 +62,6 @@ public interface NotificationPresenter extends ExpandableNotificationRow.OnExpan */ int getMaxNotificationsWhileLocked(boolean recompute); /** * True if the presenter is currently locked. */ boolean isPresenterLocked(); /** * Called when the row states are updated by {@link NotificationViewHierarchyManager}. */ Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/DynamicPrivacyController.java +45 −4 Original line number Diff line number Diff line Loading @@ -20,8 +20,12 @@ import android.content.Context; import android.util.ArraySet; import com.android.internal.annotations.VisibleForTesting; import com.android.systemui.plugins.statusbar.StatusBarStateController; import com.android.systemui.statusbar.NotificationLockscreenUserManager; import com.android.systemui.statusbar.StatusBarState; import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager; import com.android.systemui.statusbar.phone.UnlockMethodCache; import com.android.systemui.statusbar.policy.KeyguardMonitor; import javax.inject.Inject; import javax.inject.Singleton; Loading @@ -34,22 +38,33 @@ public class DynamicPrivacyController implements UnlockMethodCache.OnUnlockMetho private final UnlockMethodCache mUnlockMethodCache; private final NotificationLockscreenUserManager mLockscreenUserManager; private final StatusBarStateController mStateController; private final KeyguardMonitor mKeyguardMonitor; private ArraySet<Listener> mListeners = new ArraySet<>(); private boolean mLastDynamicUnlocked; private boolean mCacheInvalid; private StatusBarKeyguardViewManager mStatusBarKeyguardViewManager; @Inject DynamicPrivacyController(Context context, NotificationLockscreenUserManager notificationLockscreenUserManager) { this(notificationLockscreenUserManager, UnlockMethodCache.getInstance(context)); KeyguardMonitor keyguardMonitor, NotificationLockscreenUserManager notificationLockscreenUserManager, StatusBarStateController stateController) { this(notificationLockscreenUserManager, keyguardMonitor, UnlockMethodCache.getInstance(context), stateController); } @VisibleForTesting DynamicPrivacyController(NotificationLockscreenUserManager notificationLockscreenUserManager, UnlockMethodCache unlockMethodCache) { KeyguardMonitor keyguardMonitor, UnlockMethodCache unlockMethodCache, StatusBarStateController stateController) { mLockscreenUserManager = notificationLockscreenUserManager; mStateController = stateController; mUnlockMethodCache = unlockMethodCache; mKeyguardMonitor = keyguardMonitor; mUnlockMethodCache.addListener(this); mLastDynamicUnlocked = isDynamicallyUnlocked(); } Loading Loading @@ -77,13 +92,39 @@ public class DynamicPrivacyController implements UnlockMethodCache.OnUnlockMetho } public boolean isDynamicallyUnlocked() { return mUnlockMethodCache.canSkipBouncer() && isDynamicPrivacyEnabled(); return (mUnlockMethodCache.canSkipBouncer() || mKeyguardMonitor.isKeyguardGoingAway() || mKeyguardMonitor.isKeyguardFadingAway()) && isDynamicPrivacyEnabled(); } public void addListener(Listener listener) { mListeners.add(listener); } /** * Is the notification shade currently in a locked down mode where it's fully showing but the * contents aren't revealed yet? */ public boolean isInLockedDownShade() { if (!mStatusBarKeyguardViewManager.isShowing() || !mStatusBarKeyguardViewManager.isSecure()) { return false; } int state = mStateController.getState(); if (state != StatusBarState.SHADE && state != StatusBarState.SHADE_LOCKED) { return false; } if (!isDynamicPrivacyEnabled() || isDynamicallyUnlocked()) { return false; } return true; } public void setStatusBarKeyguardViewManager( StatusBarKeyguardViewManager statusBarKeyguardViewManager) { mStatusBarKeyguardViewManager = statusBarKeyguardViewManager; } public interface Listener { void onDynamicPrivacyChanged(); } Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java +40 −1 Original line number Diff line number Diff line Loading @@ -180,6 +180,8 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd */ private static final int DISTANCE_BETWEEN_ADJACENT_SECTIONS_PX = 1; private final KeyguardBypassController mKeyguardBypassController; private final DynamicPrivacyController mDynamicPrivacyController; private final SysuiStatusBarStateController mStatusbarStateController; private ExpandHelper mExpandHelper; private final NotificationSwipeHelper mSwipeHelper; Loading Loading @@ -605,6 +607,8 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd } }); dynamicPrivacyController.addListener(this); mDynamicPrivacyController = dynamicPrivacyController; mStatusbarStateController = (SysuiStatusBarStateController) statusBarStateController; } private void updateDismissRtlSetting(boolean dismissRtl) { Loading Loading @@ -695,6 +699,9 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd */ @ShadeViewRefactor(RefactorComponent.SHADE_VIEW) public boolean hasActiveClearableNotifications(@SelectedRows int selection) { if (mDynamicPrivacyController.isInLockedDownShade()) { return false; } int childCount = getChildCount(); for (int i = 0; i < childCount; i++) { View child = getChildAt(i); Loading Loading @@ -5700,7 +5707,10 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd mAnimateBottomOnLayout = true; } // Let's update the footer once the notifications have been updated (in the next frame) post(this::updateFooter); post(() -> { updateFooter(); updateSectionBoundaries(); }); } public void setOnPulseHeightChangedListener(Runnable listener) { Loading Loading @@ -6356,6 +6366,11 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd } return true; } else if (mDynamicPrivacyController.isInLockedDownShade()) { mStatusbarStateController.setLeaveOpenOnKeyguardHide(true); mStatusBar.dismissKeyguardThenExecute(() -> false /* dismissAction */, null /* cancelRunnable */, false /* afterKeyguardGone */); return true; } else { // abort gesture. return false; Loading Loading @@ -6389,6 +6404,30 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd public boolean isFalsingCheckNeeded() { return mStatusBarState == StatusBarState.KEYGUARD; } @Override public boolean isDragDownEnabledForView(ExpandableView view) { if (isDragDownAnywhereEnabled()) { return true; } if (mDynamicPrivacyController.isInLockedDownShade()) { if (view == null) { // Dragging down is allowed in general return true; } if (view instanceof ExpandableNotificationRow) { // Only drag down on sensitive views, otherwise the ExpandHelper will take this return ((ExpandableNotificationRow) view).getEntry().isSensitive(); } } return false; } @Override public boolean isDragDownAnywhereEnabled() { return mStatusbarStateController.getState() == StatusBarState.KEYGUARD && !mKeyguardBypassController.getBypassEnabled(); } }; public DragDownCallback getDragDownCallback() { return mDragDownCallback; } Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java +6 −2 Original line number Diff line number Diff line Loading @@ -194,6 +194,7 @@ import com.android.systemui.statusbar.SysuiStatusBarStateController; import com.android.systemui.statusbar.VibratorHelper; import com.android.systemui.statusbar.notification.ActivityLaunchAnimator; import com.android.systemui.statusbar.notification.BypassHeadsUpNotifier; import com.android.systemui.statusbar.notification.DynamicPrivacyController; import com.android.systemui.statusbar.notification.NotificationActivityStarter; import com.android.systemui.statusbar.notification.NotificationAlertingManager; import com.android.systemui.statusbar.notification.NotificationClicker; Loading Loading @@ -376,6 +377,8 @@ public class StatusBar extends SystemUI implements DemoMode, @Inject protected HeadsUpManagerPhone mHeadsUpManager; @Inject DynamicPrivacyController mDynamicPrivacyController; @Inject BypassHeadsUpNotifier mBypassHeadsUpNotifier; @Nullable @Inject Loading Loading @@ -592,7 +595,7 @@ public class StatusBar extends SystemUI implements DemoMode, private boolean mVibrateOnOpening; private VibratorHelper mVibratorHelper; private ActivityLaunchAnimator mActivityLaunchAnimator; protected NotificationPresenter mPresenter; protected StatusBarNotificationPresenter mPresenter; private NotificationActivityStarter mNotificationActivityStarter; private boolean mPulsing; protected BubbleController mBubbleController; Loading Loading @@ -1067,7 +1070,7 @@ public class StatusBar extends SystemUI implements DemoMode, mPresenter = new StatusBarNotificationPresenter(mContext, mNotificationPanel, mHeadsUpManager, mStatusBarWindow, mStackScroller, mDozeScrimController, mScrimController, mActivityLaunchAnimator, mStatusBarKeyguardViewManager, mScrimController, mActivityLaunchAnimator, mDynamicPrivacyController, mNotificationAlertingManager, rowBinder); mNotificationListController = Loading Loading @@ -1244,6 +1247,7 @@ public class StatusBar extends SystemUI implements DemoMode, .setStatusBarKeyguardViewManager(mStatusBarKeyguardViewManager); mBiometricUnlockController.setStatusBarKeyguardViewManager(mStatusBarKeyguardViewManager); mRemoteInputManager.getController().addCallback(mStatusBarKeyguardViewManager); mDynamicPrivacyController.setStatusBarKeyguardViewManager(mStatusBarKeyguardViewManager); mKeyguardViewMediatorCallback = keyguardViewMediator.getViewMediatorCallback(); mLightBarController.setBiometricUnlockController(mBiometricUnlockController); Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/DragDownHelper.java +21 −2 Original line number Diff line number Diff line Loading @@ -92,7 +92,7 @@ public class DragDownHelper implements Gefingerpoken { mInitialTouchY = y; mInitialTouchX = x; mDragDownCallback.onTouchSlopExceeded(); return true; return mStartingChild != null || mDragDownCallback.isDragDownAnywhereEnabled(); } break; } Loading Loading @@ -162,7 +162,11 @@ public class DragDownHelper implements Gefingerpoken { if (mStartingChild == null) { mStartingChild = findView(x, y); if (mStartingChild != null) { if (mDragDownCallback.isDragDownEnabledForView(mStartingChild)) { mCallback.setUserLockedChild(mStartingChild, true); } else { mStartingChild = null; } } } } Loading Loading @@ -237,6 +241,10 @@ public class DragDownHelper implements Gefingerpoken { return mDraggingDown; } public boolean isDragDownEnabled() { return mDragDownCallback.isDragDownEnabledForView(null); } public interface DragDownCallback { /** Loading @@ -253,5 +261,16 @@ public class DragDownHelper implements Gefingerpoken { void onTouchSlopExceeded(); void setEmptyDragAmount(float amount); boolean isFalsingCheckNeeded(); /** * Is dragging down enabled on a given view * @param view The view to check or {@code null} to check if it's enabled at all */ boolean isDragDownEnabledForView(ExpandableView view); /** * @return if drag down is enabled anywhere, not just on selected views. */ boolean isDragDownAnywhereEnabled(); } }
packages/SystemUI/src/com/android/systemui/statusbar/NotificationPresenter.java +0 −5 Original line number Diff line number Diff line Loading @@ -62,11 +62,6 @@ public interface NotificationPresenter extends ExpandableNotificationRow.OnExpan */ int getMaxNotificationsWhileLocked(boolean recompute); /** * True if the presenter is currently locked. */ boolean isPresenterLocked(); /** * Called when the row states are updated by {@link NotificationViewHierarchyManager}. */ Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/DynamicPrivacyController.java +45 −4 Original line number Diff line number Diff line Loading @@ -20,8 +20,12 @@ import android.content.Context; import android.util.ArraySet; import com.android.internal.annotations.VisibleForTesting; import com.android.systemui.plugins.statusbar.StatusBarStateController; import com.android.systemui.statusbar.NotificationLockscreenUserManager; import com.android.systemui.statusbar.StatusBarState; import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager; import com.android.systemui.statusbar.phone.UnlockMethodCache; import com.android.systemui.statusbar.policy.KeyguardMonitor; import javax.inject.Inject; import javax.inject.Singleton; Loading @@ -34,22 +38,33 @@ public class DynamicPrivacyController implements UnlockMethodCache.OnUnlockMetho private final UnlockMethodCache mUnlockMethodCache; private final NotificationLockscreenUserManager mLockscreenUserManager; private final StatusBarStateController mStateController; private final KeyguardMonitor mKeyguardMonitor; private ArraySet<Listener> mListeners = new ArraySet<>(); private boolean mLastDynamicUnlocked; private boolean mCacheInvalid; private StatusBarKeyguardViewManager mStatusBarKeyguardViewManager; @Inject DynamicPrivacyController(Context context, NotificationLockscreenUserManager notificationLockscreenUserManager) { this(notificationLockscreenUserManager, UnlockMethodCache.getInstance(context)); KeyguardMonitor keyguardMonitor, NotificationLockscreenUserManager notificationLockscreenUserManager, StatusBarStateController stateController) { this(notificationLockscreenUserManager, keyguardMonitor, UnlockMethodCache.getInstance(context), stateController); } @VisibleForTesting DynamicPrivacyController(NotificationLockscreenUserManager notificationLockscreenUserManager, UnlockMethodCache unlockMethodCache) { KeyguardMonitor keyguardMonitor, UnlockMethodCache unlockMethodCache, StatusBarStateController stateController) { mLockscreenUserManager = notificationLockscreenUserManager; mStateController = stateController; mUnlockMethodCache = unlockMethodCache; mKeyguardMonitor = keyguardMonitor; mUnlockMethodCache.addListener(this); mLastDynamicUnlocked = isDynamicallyUnlocked(); } Loading Loading @@ -77,13 +92,39 @@ public class DynamicPrivacyController implements UnlockMethodCache.OnUnlockMetho } public boolean isDynamicallyUnlocked() { return mUnlockMethodCache.canSkipBouncer() && isDynamicPrivacyEnabled(); return (mUnlockMethodCache.canSkipBouncer() || mKeyguardMonitor.isKeyguardGoingAway() || mKeyguardMonitor.isKeyguardFadingAway()) && isDynamicPrivacyEnabled(); } public void addListener(Listener listener) { mListeners.add(listener); } /** * Is the notification shade currently in a locked down mode where it's fully showing but the * contents aren't revealed yet? */ public boolean isInLockedDownShade() { if (!mStatusBarKeyguardViewManager.isShowing() || !mStatusBarKeyguardViewManager.isSecure()) { return false; } int state = mStateController.getState(); if (state != StatusBarState.SHADE && state != StatusBarState.SHADE_LOCKED) { return false; } if (!isDynamicPrivacyEnabled() || isDynamicallyUnlocked()) { return false; } return true; } public void setStatusBarKeyguardViewManager( StatusBarKeyguardViewManager statusBarKeyguardViewManager) { mStatusBarKeyguardViewManager = statusBarKeyguardViewManager; } public interface Listener { void onDynamicPrivacyChanged(); } Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java +40 −1 Original line number Diff line number Diff line Loading @@ -180,6 +180,8 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd */ private static final int DISTANCE_BETWEEN_ADJACENT_SECTIONS_PX = 1; private final KeyguardBypassController mKeyguardBypassController; private final DynamicPrivacyController mDynamicPrivacyController; private final SysuiStatusBarStateController mStatusbarStateController; private ExpandHelper mExpandHelper; private final NotificationSwipeHelper mSwipeHelper; Loading Loading @@ -605,6 +607,8 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd } }); dynamicPrivacyController.addListener(this); mDynamicPrivacyController = dynamicPrivacyController; mStatusbarStateController = (SysuiStatusBarStateController) statusBarStateController; } private void updateDismissRtlSetting(boolean dismissRtl) { Loading Loading @@ -695,6 +699,9 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd */ @ShadeViewRefactor(RefactorComponent.SHADE_VIEW) public boolean hasActiveClearableNotifications(@SelectedRows int selection) { if (mDynamicPrivacyController.isInLockedDownShade()) { return false; } int childCount = getChildCount(); for (int i = 0; i < childCount; i++) { View child = getChildAt(i); Loading Loading @@ -5700,7 +5707,10 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd mAnimateBottomOnLayout = true; } // Let's update the footer once the notifications have been updated (in the next frame) post(this::updateFooter); post(() -> { updateFooter(); updateSectionBoundaries(); }); } public void setOnPulseHeightChangedListener(Runnable listener) { Loading Loading @@ -6356,6 +6366,11 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd } return true; } else if (mDynamicPrivacyController.isInLockedDownShade()) { mStatusbarStateController.setLeaveOpenOnKeyguardHide(true); mStatusBar.dismissKeyguardThenExecute(() -> false /* dismissAction */, null /* cancelRunnable */, false /* afterKeyguardGone */); return true; } else { // abort gesture. return false; Loading Loading @@ -6389,6 +6404,30 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd public boolean isFalsingCheckNeeded() { return mStatusBarState == StatusBarState.KEYGUARD; } @Override public boolean isDragDownEnabledForView(ExpandableView view) { if (isDragDownAnywhereEnabled()) { return true; } if (mDynamicPrivacyController.isInLockedDownShade()) { if (view == null) { // Dragging down is allowed in general return true; } if (view instanceof ExpandableNotificationRow) { // Only drag down on sensitive views, otherwise the ExpandHelper will take this return ((ExpandableNotificationRow) view).getEntry().isSensitive(); } } return false; } @Override public boolean isDragDownAnywhereEnabled() { return mStatusbarStateController.getState() == StatusBarState.KEYGUARD && !mKeyguardBypassController.getBypassEnabled(); } }; public DragDownCallback getDragDownCallback() { return mDragDownCallback; } Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java +6 −2 Original line number Diff line number Diff line Loading @@ -194,6 +194,7 @@ import com.android.systemui.statusbar.SysuiStatusBarStateController; import com.android.systemui.statusbar.VibratorHelper; import com.android.systemui.statusbar.notification.ActivityLaunchAnimator; import com.android.systemui.statusbar.notification.BypassHeadsUpNotifier; import com.android.systemui.statusbar.notification.DynamicPrivacyController; import com.android.systemui.statusbar.notification.NotificationActivityStarter; import com.android.systemui.statusbar.notification.NotificationAlertingManager; import com.android.systemui.statusbar.notification.NotificationClicker; Loading Loading @@ -376,6 +377,8 @@ public class StatusBar extends SystemUI implements DemoMode, @Inject protected HeadsUpManagerPhone mHeadsUpManager; @Inject DynamicPrivacyController mDynamicPrivacyController; @Inject BypassHeadsUpNotifier mBypassHeadsUpNotifier; @Nullable @Inject Loading Loading @@ -592,7 +595,7 @@ public class StatusBar extends SystemUI implements DemoMode, private boolean mVibrateOnOpening; private VibratorHelper mVibratorHelper; private ActivityLaunchAnimator mActivityLaunchAnimator; protected NotificationPresenter mPresenter; protected StatusBarNotificationPresenter mPresenter; private NotificationActivityStarter mNotificationActivityStarter; private boolean mPulsing; protected BubbleController mBubbleController; Loading Loading @@ -1067,7 +1070,7 @@ public class StatusBar extends SystemUI implements DemoMode, mPresenter = new StatusBarNotificationPresenter(mContext, mNotificationPanel, mHeadsUpManager, mStatusBarWindow, mStackScroller, mDozeScrimController, mScrimController, mActivityLaunchAnimator, mStatusBarKeyguardViewManager, mScrimController, mActivityLaunchAnimator, mDynamicPrivacyController, mNotificationAlertingManager, rowBinder); mNotificationListController = Loading Loading @@ -1244,6 +1247,7 @@ public class StatusBar extends SystemUI implements DemoMode, .setStatusBarKeyguardViewManager(mStatusBarKeyguardViewManager); mBiometricUnlockController.setStatusBarKeyguardViewManager(mStatusBarKeyguardViewManager); mRemoteInputManager.getController().addCallback(mStatusBarKeyguardViewManager); mDynamicPrivacyController.setStatusBarKeyguardViewManager(mStatusBarKeyguardViewManager); mKeyguardViewMediatorCallback = keyguardViewMediator.getViewMediatorCallback(); mLightBarController.setBiometricUnlockController(mBiometricUnlockController); Loading