Loading packages/SystemUI/src/com/android/systemui/SwipeHelper.java +1 −0 Original line number Diff line number Diff line Loading @@ -679,6 +679,7 @@ public class SwipeHelper implements Gefingerpoken { public boolean isDismissGesture(MotionEvent ev) { float translation = getTranslation(mCurrView); return ev.getActionMasked() == MotionEvent.ACTION_UP && !mFalsingManager.isUnlockingDisabled() && !isFalseGesture(ev) && (swipedFastEnough() || swipedFarEnough()) && mCallback.canChildBeDismissedInDirection(mCurrView, translation > 0); } Loading packages/SystemUI/src/com/android/systemui/analytics/DataCollector.java +21 −22 Original line number Diff line number Diff line Loading @@ -16,6 +16,9 @@ package com.android.systemui.analytics; import static com.android.systemui.statusbar.phone.nano.TouchAnalyticsProto.Session; import static com.android.systemui.statusbar.phone.nano.TouchAnalyticsProto.Session.PhoneEvent; import android.content.Context; import android.database.ContentObserver; import android.hardware.Sensor; Loading @@ -36,9 +39,6 @@ import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import static com.android.systemui.statusbar.phone.nano.TouchAnalyticsProto.Session; import static com.android.systemui.statusbar.phone.nano.TouchAnalyticsProto.Session.PhoneEvent; /** * Tracks touch, sensor and phone events when the lockscreen is on. If the phone is unlocked * the data containing these events is saved to a file. This data is collected Loading @@ -53,6 +53,8 @@ public class DataCollector implements SensorEventListener { private static final String COLLECT_BAD_TOUCHES = "data_collector_collect_bad_touches"; private static final String ALLOW_REJECTED_TOUCH_REPORTS = "data_collector_allow_rejected_touch_reports"; private static final String DISABLE_UNLOCKING_FOR_FALSING_COLLECTION = "data_collector_disable_unlocking"; private static final long TIMEOUT_MILLIS = 11000; // 11 seconds. public static final boolean DEBUG = false; Loading @@ -65,11 +67,11 @@ public class DataCollector implements SensorEventListener { private SensorLoggerSession mCurrentSession = null; private boolean mEnableCollector = false; private boolean mTimeoutActive = false; private boolean mCollectBadTouches = false; private boolean mCornerSwiping = false; private boolean mTrackingStarted = false; private boolean mAllowReportRejectedTouch = false; private boolean mDisableUnlocking = false; private static DataCollector sInstance = null; Loading Loading @@ -98,6 +100,11 @@ public class DataCollector implements SensorEventListener { mSettingsObserver, UserHandle.USER_ALL); mContext.getContentResolver().registerContentObserver( Settings.Secure.getUriFor(DISABLE_UNLOCKING_FOR_FALSING_COLLECTION), false, mSettingsObserver, UserHandle.USER_ALL); updateConfiguration(); } Loading @@ -118,6 +125,9 @@ public class DataCollector implements SensorEventListener { mAllowReportRejectedTouch = Build.IS_DEBUGGABLE && 0 != Settings.Secure.getInt( mContext.getContentResolver(), ALLOW_REJECTED_TOUCH_REPORTS, 0); mDisableUnlocking = mEnableCollector && Build.IS_DEBUGGABLE && 0 != Settings.Secure.getInt( mContext.getContentResolver(), DISABLE_UNLOCKING_FOR_FALSING_COLLECTION, 0); } private boolean sessionEntrypoint() { Loading @@ -144,7 +154,7 @@ public class DataCollector implements SensorEventListener { SensorLoggerSession session = mCurrentSession; mCurrentSession = null; if (mEnableCollector) { if (mEnableCollector || mDisableUnlocking) { session.end(System.currentTimeMillis(), result); queueSession(session); } Loading Loading @@ -183,11 +193,11 @@ public class DataCollector implements SensorEventListener { byte[] b = Session.toByteArray(currentSession.toProto()); String dir = mContext.getFilesDir().getAbsolutePath(); if (currentSession.getResult() != Session.SUCCESS) { if (!mCollectBadTouches) { if (!mDisableUnlocking && !mCollectBadTouches) { return; } dir += "/bad_touches"; } else { } else if (!mDisableUnlocking) { dir += "/good_touches"; } Loading @@ -208,19 +218,6 @@ public class DataCollector implements SensorEventListener { public synchronized void onSensorChanged(SensorEvent event) { if (isEnabled() && mCurrentSession != null) { mCurrentSession.addSensorEvent(event, System.nanoTime()); enforceTimeout(); } } private void enforceTimeout() { if (mTimeoutActive) { if (System.currentTimeMillis() - mCurrentSession.getStartTimestampMillis() > TIMEOUT_MILLIS) { onSessionEnd(Session.UNKNOWN); if (DEBUG) { Log.i(TAG, "Analytics timed out."); } } } } Loading @@ -233,9 +230,12 @@ public class DataCollector implements SensorEventListener { * rejected touch report. */ public boolean isEnabled() { return mEnableCollector || mAllowReportRejectedTouch; return mEnableCollector || mAllowReportRejectedTouch || mDisableUnlocking; } public boolean isUnlockingDisabled() { return mDisableUnlocking; } /** * @return true if the full data set for data gathering should be collected - including * extensive sensor data, which is is not normally included with rejected touch reports. Loading Loading @@ -450,7 +450,6 @@ public class DataCollector implements SensorEventListener { } mCurrentSession.addMotionEvent(event); mCurrentSession.setTouchArea(width, height); enforceTimeout(); } } Loading packages/SystemUI/src/com/android/systemui/classifier/FalsingManager.java +3 −0 Original line number Diff line number Diff line Loading @@ -201,6 +201,9 @@ public class FalsingManager implements SensorEventListener { return mHumanInteractionClassifier.isEnabled() || mDataCollector.isEnabled(); } public boolean isUnlockingDisabled() { return mDataCollector.isUnlockingDisabled(); } /** * @return true if the classifier determined that this is not a human interacting with the phone */ Loading packages/SystemUI/src/com/android/systemui/statusbar/DragDownHelper.java +2 −1 Original line number Diff line number Diff line Loading @@ -128,7 +128,8 @@ public class DragDownHelper implements Gefingerpoken { } return true; case MotionEvent.ACTION_UP: if (!isFalseTouch() && mDragDownCallback.onDraggedDown(mStartingChild, if (!mFalsingManager.isUnlockingDisabled() && !isFalseTouch() && mDragDownCallback.onDraggedDown(mStartingChild, (int) (y - mInitialTouchY))) { if (mStartingChild == null) { cancelExpansion(); Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardDismissUtil.java +1 −1 Original line number Diff line number Diff line Loading @@ -35,7 +35,7 @@ public class KeyguardDismissUtil implements KeyguardDismissHandler { } /** * Executes an action that requres the screen to be unlocked. * Executes an action that requires the screen to be unlocked. * * <p>Must be called after {@link #setDismissHandler}. */ Loading Loading
packages/SystemUI/src/com/android/systemui/SwipeHelper.java +1 −0 Original line number Diff line number Diff line Loading @@ -679,6 +679,7 @@ public class SwipeHelper implements Gefingerpoken { public boolean isDismissGesture(MotionEvent ev) { float translation = getTranslation(mCurrView); return ev.getActionMasked() == MotionEvent.ACTION_UP && !mFalsingManager.isUnlockingDisabled() && !isFalseGesture(ev) && (swipedFastEnough() || swipedFarEnough()) && mCallback.canChildBeDismissedInDirection(mCurrView, translation > 0); } Loading
packages/SystemUI/src/com/android/systemui/analytics/DataCollector.java +21 −22 Original line number Diff line number Diff line Loading @@ -16,6 +16,9 @@ package com.android.systemui.analytics; import static com.android.systemui.statusbar.phone.nano.TouchAnalyticsProto.Session; import static com.android.systemui.statusbar.phone.nano.TouchAnalyticsProto.Session.PhoneEvent; import android.content.Context; import android.database.ContentObserver; import android.hardware.Sensor; Loading @@ -36,9 +39,6 @@ import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import static com.android.systemui.statusbar.phone.nano.TouchAnalyticsProto.Session; import static com.android.systemui.statusbar.phone.nano.TouchAnalyticsProto.Session.PhoneEvent; /** * Tracks touch, sensor and phone events when the lockscreen is on. If the phone is unlocked * the data containing these events is saved to a file. This data is collected Loading @@ -53,6 +53,8 @@ public class DataCollector implements SensorEventListener { private static final String COLLECT_BAD_TOUCHES = "data_collector_collect_bad_touches"; private static final String ALLOW_REJECTED_TOUCH_REPORTS = "data_collector_allow_rejected_touch_reports"; private static final String DISABLE_UNLOCKING_FOR_FALSING_COLLECTION = "data_collector_disable_unlocking"; private static final long TIMEOUT_MILLIS = 11000; // 11 seconds. public static final boolean DEBUG = false; Loading @@ -65,11 +67,11 @@ public class DataCollector implements SensorEventListener { private SensorLoggerSession mCurrentSession = null; private boolean mEnableCollector = false; private boolean mTimeoutActive = false; private boolean mCollectBadTouches = false; private boolean mCornerSwiping = false; private boolean mTrackingStarted = false; private boolean mAllowReportRejectedTouch = false; private boolean mDisableUnlocking = false; private static DataCollector sInstance = null; Loading Loading @@ -98,6 +100,11 @@ public class DataCollector implements SensorEventListener { mSettingsObserver, UserHandle.USER_ALL); mContext.getContentResolver().registerContentObserver( Settings.Secure.getUriFor(DISABLE_UNLOCKING_FOR_FALSING_COLLECTION), false, mSettingsObserver, UserHandle.USER_ALL); updateConfiguration(); } Loading @@ -118,6 +125,9 @@ public class DataCollector implements SensorEventListener { mAllowReportRejectedTouch = Build.IS_DEBUGGABLE && 0 != Settings.Secure.getInt( mContext.getContentResolver(), ALLOW_REJECTED_TOUCH_REPORTS, 0); mDisableUnlocking = mEnableCollector && Build.IS_DEBUGGABLE && 0 != Settings.Secure.getInt( mContext.getContentResolver(), DISABLE_UNLOCKING_FOR_FALSING_COLLECTION, 0); } private boolean sessionEntrypoint() { Loading @@ -144,7 +154,7 @@ public class DataCollector implements SensorEventListener { SensorLoggerSession session = mCurrentSession; mCurrentSession = null; if (mEnableCollector) { if (mEnableCollector || mDisableUnlocking) { session.end(System.currentTimeMillis(), result); queueSession(session); } Loading Loading @@ -183,11 +193,11 @@ public class DataCollector implements SensorEventListener { byte[] b = Session.toByteArray(currentSession.toProto()); String dir = mContext.getFilesDir().getAbsolutePath(); if (currentSession.getResult() != Session.SUCCESS) { if (!mCollectBadTouches) { if (!mDisableUnlocking && !mCollectBadTouches) { return; } dir += "/bad_touches"; } else { } else if (!mDisableUnlocking) { dir += "/good_touches"; } Loading @@ -208,19 +218,6 @@ public class DataCollector implements SensorEventListener { public synchronized void onSensorChanged(SensorEvent event) { if (isEnabled() && mCurrentSession != null) { mCurrentSession.addSensorEvent(event, System.nanoTime()); enforceTimeout(); } } private void enforceTimeout() { if (mTimeoutActive) { if (System.currentTimeMillis() - mCurrentSession.getStartTimestampMillis() > TIMEOUT_MILLIS) { onSessionEnd(Session.UNKNOWN); if (DEBUG) { Log.i(TAG, "Analytics timed out."); } } } } Loading @@ -233,9 +230,12 @@ public class DataCollector implements SensorEventListener { * rejected touch report. */ public boolean isEnabled() { return mEnableCollector || mAllowReportRejectedTouch; return mEnableCollector || mAllowReportRejectedTouch || mDisableUnlocking; } public boolean isUnlockingDisabled() { return mDisableUnlocking; } /** * @return true if the full data set for data gathering should be collected - including * extensive sensor data, which is is not normally included with rejected touch reports. Loading Loading @@ -450,7 +450,6 @@ public class DataCollector implements SensorEventListener { } mCurrentSession.addMotionEvent(event); mCurrentSession.setTouchArea(width, height); enforceTimeout(); } } Loading
packages/SystemUI/src/com/android/systemui/classifier/FalsingManager.java +3 −0 Original line number Diff line number Diff line Loading @@ -201,6 +201,9 @@ public class FalsingManager implements SensorEventListener { return mHumanInteractionClassifier.isEnabled() || mDataCollector.isEnabled(); } public boolean isUnlockingDisabled() { return mDataCollector.isUnlockingDisabled(); } /** * @return true if the classifier determined that this is not a human interacting with the phone */ Loading
packages/SystemUI/src/com/android/systemui/statusbar/DragDownHelper.java +2 −1 Original line number Diff line number Diff line Loading @@ -128,7 +128,8 @@ public class DragDownHelper implements Gefingerpoken { } return true; case MotionEvent.ACTION_UP: if (!isFalseTouch() && mDragDownCallback.onDraggedDown(mStartingChild, if (!mFalsingManager.isUnlockingDisabled() && !isFalseTouch() && mDragDownCallback.onDraggedDown(mStartingChild, (int) (y - mInitialTouchY))) { if (mStartingChild == null) { cancelExpansion(); Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardDismissUtil.java +1 −1 Original line number Diff line number Diff line Loading @@ -35,7 +35,7 @@ public class KeyguardDismissUtil implements KeyguardDismissHandler { } /** * Executes an action that requres the screen to be unlocked. * Executes an action that requires the screen to be unlocked. * * <p>Must be called after {@link #setDismissHandler}. */ Loading