Snap for 7005317 from 620c249929 to sc-release
Change-Id: Idaa5b48e4d3fc2283038db426f4927ca94767f42
This commit is contained in:
commit
f7bdb337d3
4 files changed
+58
-11
No files matched your search
@@ -54,6 +54,7 @@ public class OneHandedModeInputConsumer extends DelegateInputConsumer {
|
||||
private final PointF mLastPos = new PointF();
|
||||
|
||||
private boolean mPassedSlop;
|
||||
private boolean mIsStopGesture;
|
||||
|
||||
public OneHandedModeInputConsumer(Context context, RecentsAnimationDeviceState deviceState,
|
||||
InputConsumer delegate, InputMonitorCompat inputMonitor) {
|
||||
@@ -105,7 +106,7 @@ public class OneHandedModeInputConsumer extends DelegateInputConsumer {
|
||||
float distance = (float) Math.hypot(mLastPos.x - mDownPos.x,
|
||||
mLastPos.y - mDownPos.y);
|
||||
if (distance > mDragDistThreshold && mPassedSlop) {
|
||||
onStopGestureDetected();
|
||||
mIsStopGesture = true;
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -113,15 +114,14 @@ public class OneHandedModeInputConsumer extends DelegateInputConsumer {
|
||||
case ACTION_UP: {
|
||||
if (mLastPos.y >= mDownPos.y && mPassedSlop) {
|
||||
onStartGestureDetected();
|
||||
} else if (mIsStopGesture) {
|
||||
onStopGestureDetected();
|
||||
}
|
||||
|
||||
mPassedSlop = false;
|
||||
mState = STATE_INACTIVE;
|
||||
clearState();
|
||||
break;
|
||||
}
|
||||
case ACTION_CANCEL:
|
||||
mPassedSlop = false;
|
||||
mState = STATE_INACTIVE;
|
||||
clearState();
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -130,6 +130,12 @@ public class OneHandedModeInputConsumer extends DelegateInputConsumer {
|
||||
}
|
||||
}
|
||||
|
||||
private void clearState() {
|
||||
mPassedSlop = false;
|
||||
mState = STATE_INACTIVE;
|
||||
mIsStopGesture = false;
|
||||
}
|
||||
|
||||
private void onStartGestureDetected() {
|
||||
if (mDeviceState.isOneHandedModeEnabled()) {
|
||||
if (!mDeviceState.isOneHandedModeActive()) {
|
||||
|
||||
@@ -16,7 +16,13 @@
|
||||
|
||||
package com.android.quickstep.logging;
|
||||
|
||||
import static com.android.launcher3.InvariantDeviceProfile.KEY_MIGRATION_SRC_HOTSEAT_COUNT;
|
||||
import static com.android.launcher3.Utilities.getDevicePrefs;
|
||||
import static com.android.launcher3.Utilities.getPrefs;
|
||||
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_GRID_SIZE_2;
|
||||
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_GRID_SIZE_3;
|
||||
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_GRID_SIZE_4;
|
||||
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_GRID_SIZE_5;
|
||||
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_HOME_SCREEN_SUGGESTIONS_DISABLED;
|
||||
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_HOME_SCREEN_SUGGESTIONS_ENABLED;
|
||||
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_NOTIFICATION_DOT_DISABLED;
|
||||
@@ -34,7 +40,6 @@ import android.util.Xml;
|
||||
|
||||
import com.android.launcher3.AutoInstallsLayout;
|
||||
import com.android.launcher3.R;
|
||||
import com.android.launcher3.Utilities;
|
||||
import com.android.launcher3.logging.InstanceIdSequence;
|
||||
import com.android.launcher3.logging.StatsLogManager;
|
||||
import com.android.launcher3.logging.StatsLogManager.StatsLogger;
|
||||
@@ -69,7 +74,7 @@ public class SettingsChangeLogger implements
|
||||
mLoggablePrefs = loadPrefKeys(context);
|
||||
mNavMode = SysUINavigationMode.INSTANCE.get(context).addModeChangeListener(this);
|
||||
|
||||
Utilities.getPrefs(context).registerOnSharedPreferenceChangeListener(this);
|
||||
getPrefs(context).registerOnSharedPreferenceChangeListener(this);
|
||||
getDevicePrefs(context).registerOnSharedPreferenceChangeListener(this);
|
||||
|
||||
SecureSettingsObserver dotsObserver =
|
||||
@@ -125,7 +130,8 @@ public class SettingsChangeLogger implements
|
||||
|
||||
@Override
|
||||
public void onSharedPreferenceChanged(SharedPreferences prefs, String key) {
|
||||
if (LAST_PREDICTION_ENABLED_STATE.equals(key) || mLoggablePrefs.containsKey(key)) {
|
||||
if (LAST_PREDICTION_ENABLED_STATE.equals(key) || KEY_MIGRATION_SRC_HOTSEAT_COUNT.equals(key)
|
||||
|| mLoggablePrefs.containsKey(key)) {
|
||||
dispatchUserEvent();
|
||||
}
|
||||
}
|
||||
@@ -142,7 +148,28 @@ public class SettingsChangeLogger implements
|
||||
? LAUNCHER_HOME_SCREEN_SUGGESTIONS_ENABLED
|
||||
: LAUNCHER_HOME_SCREEN_SUGGESTIONS_DISABLED);
|
||||
|
||||
SharedPreferences prefs = Utilities.getPrefs(mContext);
|
||||
SharedPreferences prefs = getPrefs(mContext);
|
||||
StatsLogManager.LauncherEvent gridSizeChangedEvent = null;
|
||||
switch (prefs.getInt(KEY_MIGRATION_SRC_HOTSEAT_COUNT, -1)) {
|
||||
case 5:
|
||||
gridSizeChangedEvent = LAUNCHER_GRID_SIZE_5;
|
||||
break;
|
||||
case 4:
|
||||
gridSizeChangedEvent = LAUNCHER_GRID_SIZE_4;
|
||||
break;
|
||||
case 3:
|
||||
gridSizeChangedEvent = LAUNCHER_GRID_SIZE_3;
|
||||
break;
|
||||
case 2:
|
||||
gridSizeChangedEvent = LAUNCHER_GRID_SIZE_2;
|
||||
break;
|
||||
default:
|
||||
// Ignore illegal input.
|
||||
break;
|
||||
}
|
||||
if (gridSizeChangedEvent != null) {
|
||||
logger.log(gridSizeChangedEvent);
|
||||
}
|
||||
mLoggablePrefs.forEach((key, lp) -> logger.log(() ->
|
||||
prefs.getBoolean(key, lp.defaultValue) ? lp.eventIdOn : lp.eventIdOff));
|
||||
}
|
||||
|
||||
@@ -332,6 +332,18 @@ public class StatsLogManager implements ResourceBasedOverride {
|
||||
|
||||
@UiEvent(doc = "Notification dismissed by swiping right.")
|
||||
LAUNCHER_NOTIFICATION_DISMISSED(652),
|
||||
|
||||
@UiEvent(doc = "Current grid size is changed to 5.")
|
||||
LAUNCHER_GRID_SIZE_5(662),
|
||||
|
||||
@UiEvent(doc = "Current grid size is changed to 4.")
|
||||
LAUNCHER_GRID_SIZE_4(663),
|
||||
|
||||
@UiEvent(doc = "Current grid size is changed to 3.")
|
||||
LAUNCHER_GRID_SIZE_3(664),
|
||||
|
||||
@UiEvent(doc = "Current grid size is changed to 2.")
|
||||
LAUNCHER_GRID_SIZE_2(665),
|
||||
;
|
||||
|
||||
// ADD MORE
|
||||
|
||||
@@ -105,6 +105,7 @@ public final class LauncherInstrumentation {
|
||||
static final Pattern EVENT_TOUCH_DOWN_TIS = getTouchEventPatternTIS("ACTION_DOWN");
|
||||
static final Pattern EVENT_TOUCH_UP_TIS = getTouchEventPatternTIS("ACTION_UP");
|
||||
private final String mLauncherPackage;
|
||||
private final boolean mIsLauncher3;
|
||||
|
||||
// Types for launcher containers that the user is interacting with. "Background" is a
|
||||
// pseudo-container corresponding to inactive launcher covered by another app.
|
||||
@@ -205,6 +206,7 @@ public final class LauncherInstrumentation {
|
||||
public LauncherInstrumentation(Instrumentation instrumentation) {
|
||||
mInstrumentation = instrumentation;
|
||||
mDevice = UiDevice.getInstance(instrumentation);
|
||||
mIsLauncher3 = "com.android.launcher3".equals(getLauncherPackageName());
|
||||
|
||||
// Launcher should run in test harness so that custom accessibility protocol between
|
||||
// Launcher and TAPL is enabled. In-process tests enable this protocol with a direct call
|
||||
@@ -1396,7 +1398,7 @@ public final class LauncherInstrumentation {
|
||||
}
|
||||
|
||||
boolean isLauncher3() {
|
||||
return "com.android.launcher3".equals(getLauncherPackageName());
|
||||
return mIsLauncher3;
|
||||
}
|
||||
|
||||
void expectEvent(String sequence, Pattern expected) {
|
||||
|
||||
Reference in new issue
Block a user