Loading packages/SystemUI/plugin/src/com/android/systemui/plugins/FalsingManager.java +6 −0 Original line number Diff line number Diff line Loading @@ -102,6 +102,12 @@ public interface FalsingManager { */ boolean isFalseDoubleTap(); /** * Whether the last proximity event reported NEAR. May be used to short circuit motion events * that require the proximity sensor is not covered. */ boolean isProximityNear(); boolean isClassifierEnabled(); boolean shouldEnforceBouncer(); Loading packages/SystemUI/src/com/android/systemui/classifier/BrightLineFalsingManager.java +8 −0 Original line number Diff line number Diff line Loading @@ -80,12 +80,14 @@ public class BrightLineFalsingManager implements FalsingManager { private final Collection<FalsingClassifier> mClassifiers; private final List<FalsingBeliefListener> mFalsingBeliefListeners = new ArrayList<>(); private List<FalsingTapListener> mFalsingTapListeners = new ArrayList<>(); private ProximityEvent mLastProximityEvent; private boolean mDestroyed; private final SessionListener mSessionListener = new SessionListener() { @Override public void onSessionEnded() { mLastProximityEvent = null; mClassifiers.forEach(FalsingClassifier::onSessionEnded); } Loading Loading @@ -336,6 +338,7 @@ public class BrightLineFalsingManager implements FalsingManager { public void onProximityEvent(ProximityEvent proximityEvent) { // TODO: some of these classifiers might allow us to abort early, meaning we don't have to // make these calls. mLastProximityEvent = proximityEvent; mClassifiers.forEach((classifier) -> classifier.onProximityEvent(proximityEvent)); } Loading @@ -347,6 +350,11 @@ public class BrightLineFalsingManager implements FalsingManager { } } @Override public boolean isProximityNear() { return mLastProximityEvent != null && mLastProximityEvent.getCovered(); } @Override public boolean isUnlockingDisabled() { return false; Loading packages/SystemUI/src/com/android/systemui/classifier/FalsingCollectorImpl.java +3 −3 Original line number Diff line number Diff line Loading @@ -47,9 +47,9 @@ import javax.inject.Inject; @SysUISingleton class FalsingCollectorImpl implements FalsingCollector { private static final boolean DEBUG = false; private static final String TAG = "FalsingManager"; private static final String PROXIMITY_SENSOR_TAG = "FalsingManager"; private static final String TAG = "FalsingCollector"; private static final String PROXIMITY_SENSOR_TAG = "FalsingCollector"; private static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG); private static final long GESTURE_PROCESSING_DELAY_MS = 100; private final FalsingDataProvider mFalsingDataProvider; Loading packages/SystemUI/src/com/android/systemui/classifier/FalsingManagerProxy.java +5 −0 Original line number Diff line number Diff line Loading @@ -143,6 +143,11 @@ public class FalsingManagerProxy implements FalsingManager, Dumpable { return mInternalFalsingManager.isFalseDoubleTap(); } @Override public boolean isProximityNear() { return mInternalFalsingManager.isProximityNear(); } @Override public boolean isClassifierEnabled() { return mInternalFalsingManager.isClassifierEnabled(); Loading packages/SystemUI/src/com/android/systemui/shade/NotificationShadeWindowViewController.java +6 −50 Original line number Diff line number Diff line Loading @@ -17,12 +17,9 @@ package com.android.systemui.shade; import android.app.StatusBarManager; import android.hardware.display.AmbientDisplayConfiguration; import android.media.AudioManager; import android.media.session.MediaSessionLegacyHelper; import android.os.SystemClock; import android.os.UserHandle; import android.provider.Settings; import android.util.Log; import android.view.GestureDetector; import android.view.InputDevice; Loading Loading @@ -52,7 +49,6 @@ import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager; import com.android.systemui.statusbar.phone.dagger.CentralSurfacesComponent; import com.android.systemui.statusbar.phone.panelstate.PanelExpansionStateManager; import com.android.systemui.statusbar.window.StatusBarWindowStateController; import com.android.systemui.tuner.TunerService; import java.io.PrintWriter; import java.util.Optional; Loading @@ -66,7 +62,6 @@ import javax.inject.Inject; public class NotificationShadeWindowViewController { private static final String TAG = "NotifShadeWindowVC"; private final FalsingCollector mFalsingCollector; private final TunerService mTunerService; private final SysuiStatusBarStateController mStatusBarStateController; private final NotificationShadeWindowView mView; private final NotificationShadeDepthController mDepthController; Loading @@ -77,6 +72,7 @@ public class NotificationShadeWindowViewController { private final StatusBarWindowStateController mStatusBarWindowStateController; private final KeyguardUnlockAnimationController mKeyguardUnlockAnimationController; private final AmbientState mAmbientState; private final PulsingGestureListener mPulsingGestureListener; private GestureDetector mGestureDetector; private View mBrightnessMirror; Loading @@ -88,8 +84,6 @@ public class NotificationShadeWindowViewController { private final CentralSurfaces mService; private final NotificationShadeWindowController mNotificationShadeWindowController; private DragDownHelper mDragDownHelper; private boolean mDoubleTapEnabled; private boolean mSingleTapEnabled; private boolean mExpandingBelowNotch; private final DockManager mDockManager; private final NotificationPanelViewController mNotificationPanelViewController; Loading @@ -102,7 +96,6 @@ public class NotificationShadeWindowViewController { public NotificationShadeWindowViewController( LockscreenShadeTransitionController transitionController, FalsingCollector falsingCollector, TunerService tunerService, SysuiStatusBarStateController statusBarStateController, DockManager dockManager, NotificationShadeDepthController depthController, Loading @@ -117,10 +110,11 @@ public class NotificationShadeWindowViewController { CentralSurfaces centralSurfaces, NotificationShadeWindowController controller, KeyguardUnlockAnimationController keyguardUnlockAnimationController, AmbientState ambientState) { AmbientState ambientState, PulsingGestureListener pulsingGestureListener ) { mLockscreenShadeTransitionController = transitionController; mFalsingCollector = falsingCollector; mTunerService = tunerService; mStatusBarStateController = statusBarStateController; mView = notificationShadeWindowView; mDockManager = dockManager; Loading @@ -136,6 +130,7 @@ public class NotificationShadeWindowViewController { mNotificationShadeWindowController = controller; mKeyguardUnlockAnimationController = keyguardUnlockAnimationController; mAmbientState = ambientState; mPulsingGestureListener = pulsingGestureListener; // This view is not part of the newly inflated expanded status bar. mBrightnessMirror = mView.findViewById(R.id.brightness_mirror_container); Loading @@ -151,46 +146,7 @@ public class NotificationShadeWindowViewController { /** Inflates the {@link R.layout#status_bar_expanded} layout and sets it up. */ public void setupExpandedStatusBar() { mStackScrollLayout = mView.findViewById(R.id.notification_stack_scroller); TunerService.Tunable tunable = (key, newValue) -> { AmbientDisplayConfiguration configuration = new AmbientDisplayConfiguration(mView.getContext()); switch (key) { case Settings.Secure.DOZE_DOUBLE_TAP_GESTURE: mDoubleTapEnabled = configuration.doubleTapGestureEnabled( UserHandle.USER_CURRENT); break; case Settings.Secure.DOZE_TAP_SCREEN_GESTURE: mSingleTapEnabled = configuration.tapGestureEnabled(UserHandle.USER_CURRENT); } }; mTunerService.addTunable(tunable, Settings.Secure.DOZE_DOUBLE_TAP_GESTURE, Settings.Secure.DOZE_TAP_SCREEN_GESTURE); GestureDetector.SimpleOnGestureListener gestureListener = new GestureDetector.SimpleOnGestureListener() { @Override public boolean onSingleTapConfirmed(MotionEvent e) { if (mSingleTapEnabled && !mDockManager.isDocked()) { mService.wakeUpIfDozing( SystemClock.uptimeMillis(), mView, "SINGLE_TAP"); return true; } return false; } @Override public boolean onDoubleTap(MotionEvent e) { if (mDoubleTapEnabled || mSingleTapEnabled) { mService.wakeUpIfDozing( SystemClock.uptimeMillis(), mView, "DOUBLE_TAP"); return true; } return false; } }; mGestureDetector = new GestureDetector(mView.getContext(), gestureListener); mGestureDetector = new GestureDetector(mView.getContext(), mPulsingGestureListener); mLowLightClockController.ifPresent(controller -> controller.attachLowLightClockView(mView)); Loading Loading
packages/SystemUI/plugin/src/com/android/systemui/plugins/FalsingManager.java +6 −0 Original line number Diff line number Diff line Loading @@ -102,6 +102,12 @@ public interface FalsingManager { */ boolean isFalseDoubleTap(); /** * Whether the last proximity event reported NEAR. May be used to short circuit motion events * that require the proximity sensor is not covered. */ boolean isProximityNear(); boolean isClassifierEnabled(); boolean shouldEnforceBouncer(); Loading
packages/SystemUI/src/com/android/systemui/classifier/BrightLineFalsingManager.java +8 −0 Original line number Diff line number Diff line Loading @@ -80,12 +80,14 @@ public class BrightLineFalsingManager implements FalsingManager { private final Collection<FalsingClassifier> mClassifiers; private final List<FalsingBeliefListener> mFalsingBeliefListeners = new ArrayList<>(); private List<FalsingTapListener> mFalsingTapListeners = new ArrayList<>(); private ProximityEvent mLastProximityEvent; private boolean mDestroyed; private final SessionListener mSessionListener = new SessionListener() { @Override public void onSessionEnded() { mLastProximityEvent = null; mClassifiers.forEach(FalsingClassifier::onSessionEnded); } Loading Loading @@ -336,6 +338,7 @@ public class BrightLineFalsingManager implements FalsingManager { public void onProximityEvent(ProximityEvent proximityEvent) { // TODO: some of these classifiers might allow us to abort early, meaning we don't have to // make these calls. mLastProximityEvent = proximityEvent; mClassifiers.forEach((classifier) -> classifier.onProximityEvent(proximityEvent)); } Loading @@ -347,6 +350,11 @@ public class BrightLineFalsingManager implements FalsingManager { } } @Override public boolean isProximityNear() { return mLastProximityEvent != null && mLastProximityEvent.getCovered(); } @Override public boolean isUnlockingDisabled() { return false; Loading
packages/SystemUI/src/com/android/systemui/classifier/FalsingCollectorImpl.java +3 −3 Original line number Diff line number Diff line Loading @@ -47,9 +47,9 @@ import javax.inject.Inject; @SysUISingleton class FalsingCollectorImpl implements FalsingCollector { private static final boolean DEBUG = false; private static final String TAG = "FalsingManager"; private static final String PROXIMITY_SENSOR_TAG = "FalsingManager"; private static final String TAG = "FalsingCollector"; private static final String PROXIMITY_SENSOR_TAG = "FalsingCollector"; private static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG); private static final long GESTURE_PROCESSING_DELAY_MS = 100; private final FalsingDataProvider mFalsingDataProvider; Loading
packages/SystemUI/src/com/android/systemui/classifier/FalsingManagerProxy.java +5 −0 Original line number Diff line number Diff line Loading @@ -143,6 +143,11 @@ public class FalsingManagerProxy implements FalsingManager, Dumpable { return mInternalFalsingManager.isFalseDoubleTap(); } @Override public boolean isProximityNear() { return mInternalFalsingManager.isProximityNear(); } @Override public boolean isClassifierEnabled() { return mInternalFalsingManager.isClassifierEnabled(); Loading
packages/SystemUI/src/com/android/systemui/shade/NotificationShadeWindowViewController.java +6 −50 Original line number Diff line number Diff line Loading @@ -17,12 +17,9 @@ package com.android.systemui.shade; import android.app.StatusBarManager; import android.hardware.display.AmbientDisplayConfiguration; import android.media.AudioManager; import android.media.session.MediaSessionLegacyHelper; import android.os.SystemClock; import android.os.UserHandle; import android.provider.Settings; import android.util.Log; import android.view.GestureDetector; import android.view.InputDevice; Loading Loading @@ -52,7 +49,6 @@ import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager; import com.android.systemui.statusbar.phone.dagger.CentralSurfacesComponent; import com.android.systemui.statusbar.phone.panelstate.PanelExpansionStateManager; import com.android.systemui.statusbar.window.StatusBarWindowStateController; import com.android.systemui.tuner.TunerService; import java.io.PrintWriter; import java.util.Optional; Loading @@ -66,7 +62,6 @@ import javax.inject.Inject; public class NotificationShadeWindowViewController { private static final String TAG = "NotifShadeWindowVC"; private final FalsingCollector mFalsingCollector; private final TunerService mTunerService; private final SysuiStatusBarStateController mStatusBarStateController; private final NotificationShadeWindowView mView; private final NotificationShadeDepthController mDepthController; Loading @@ -77,6 +72,7 @@ public class NotificationShadeWindowViewController { private final StatusBarWindowStateController mStatusBarWindowStateController; private final KeyguardUnlockAnimationController mKeyguardUnlockAnimationController; private final AmbientState mAmbientState; private final PulsingGestureListener mPulsingGestureListener; private GestureDetector mGestureDetector; private View mBrightnessMirror; Loading @@ -88,8 +84,6 @@ public class NotificationShadeWindowViewController { private final CentralSurfaces mService; private final NotificationShadeWindowController mNotificationShadeWindowController; private DragDownHelper mDragDownHelper; private boolean mDoubleTapEnabled; private boolean mSingleTapEnabled; private boolean mExpandingBelowNotch; private final DockManager mDockManager; private final NotificationPanelViewController mNotificationPanelViewController; Loading @@ -102,7 +96,6 @@ public class NotificationShadeWindowViewController { public NotificationShadeWindowViewController( LockscreenShadeTransitionController transitionController, FalsingCollector falsingCollector, TunerService tunerService, SysuiStatusBarStateController statusBarStateController, DockManager dockManager, NotificationShadeDepthController depthController, Loading @@ -117,10 +110,11 @@ public class NotificationShadeWindowViewController { CentralSurfaces centralSurfaces, NotificationShadeWindowController controller, KeyguardUnlockAnimationController keyguardUnlockAnimationController, AmbientState ambientState) { AmbientState ambientState, PulsingGestureListener pulsingGestureListener ) { mLockscreenShadeTransitionController = transitionController; mFalsingCollector = falsingCollector; mTunerService = tunerService; mStatusBarStateController = statusBarStateController; mView = notificationShadeWindowView; mDockManager = dockManager; Loading @@ -136,6 +130,7 @@ public class NotificationShadeWindowViewController { mNotificationShadeWindowController = controller; mKeyguardUnlockAnimationController = keyguardUnlockAnimationController; mAmbientState = ambientState; mPulsingGestureListener = pulsingGestureListener; // This view is not part of the newly inflated expanded status bar. mBrightnessMirror = mView.findViewById(R.id.brightness_mirror_container); Loading @@ -151,46 +146,7 @@ public class NotificationShadeWindowViewController { /** Inflates the {@link R.layout#status_bar_expanded} layout and sets it up. */ public void setupExpandedStatusBar() { mStackScrollLayout = mView.findViewById(R.id.notification_stack_scroller); TunerService.Tunable tunable = (key, newValue) -> { AmbientDisplayConfiguration configuration = new AmbientDisplayConfiguration(mView.getContext()); switch (key) { case Settings.Secure.DOZE_DOUBLE_TAP_GESTURE: mDoubleTapEnabled = configuration.doubleTapGestureEnabled( UserHandle.USER_CURRENT); break; case Settings.Secure.DOZE_TAP_SCREEN_GESTURE: mSingleTapEnabled = configuration.tapGestureEnabled(UserHandle.USER_CURRENT); } }; mTunerService.addTunable(tunable, Settings.Secure.DOZE_DOUBLE_TAP_GESTURE, Settings.Secure.DOZE_TAP_SCREEN_GESTURE); GestureDetector.SimpleOnGestureListener gestureListener = new GestureDetector.SimpleOnGestureListener() { @Override public boolean onSingleTapConfirmed(MotionEvent e) { if (mSingleTapEnabled && !mDockManager.isDocked()) { mService.wakeUpIfDozing( SystemClock.uptimeMillis(), mView, "SINGLE_TAP"); return true; } return false; } @Override public boolean onDoubleTap(MotionEvent e) { if (mDoubleTapEnabled || mSingleTapEnabled) { mService.wakeUpIfDozing( SystemClock.uptimeMillis(), mView, "DOUBLE_TAP"); return true; } return false; } }; mGestureDetector = new GestureDetector(mView.getContext(), gestureListener); mGestureDetector = new GestureDetector(mView.getContext(), mPulsingGestureListener); mLowLightClockController.ifPresent(controller -> controller.attachLowLightClockView(mView)); Loading