Merge "Sending state ordinals from Launcher to TAPL" into ub-launcher3-master
This commit is contained in:
commit
6ffac2ea78
10 files changed
+27
-16
No files matched your search
@@ -22,6 +22,7 @@ package com.android.launcher3;
|
||||
public final class TestProtocol {
|
||||
public static final String GET_SCROLL_MESSAGE = "TAPL_GET_SCROLL";
|
||||
public static final String SCROLL_Y_FIELD = "scrollY";
|
||||
public static final String STATE_FIELD = "state";
|
||||
public static final String SWITCHED_TO_STATE_MESSAGE = "TAPL_SWITCHED_TO_STATE";
|
||||
public static final String RESPONSE_MESSAGE_POSTFIX = "_RESPONSE";
|
||||
}
|
||||
@@ -52,11 +52,14 @@ public class AccessibilityManagerCompat {
|
||||
return (AccessibilityManager) context.getSystemService(Context.ACCESSIBILITY_SERVICE);
|
||||
}
|
||||
|
||||
public static void sendEventToTest(Context context, String eventTag) {
|
||||
public static void sendStateEventToTest(Context context, int stateOrdinal) {
|
||||
final AccessibilityManager accessibilityManager = getAccessibilityManagerForTest(context);
|
||||
if (accessibilityManager == null) return;
|
||||
|
||||
sendEventToTest(accessibilityManager, eventTag, null);
|
||||
final Bundle parcel = new Bundle();
|
||||
parcel.putInt(TestProtocol.STATE_FIELD, stateOrdinal);
|
||||
|
||||
sendEventToTest(accessibilityManager, TestProtocol.SWITCHED_TO_STATE_MESSAGE, parcel);
|
||||
}
|
||||
|
||||
private static void sendEventToTest(
|
||||
|
||||
@@ -522,8 +522,7 @@ public abstract class AbstractStateChangeTouchController
|
||||
}
|
||||
mLauncher.getStateManager().goToState(targetState, false /* animated */);
|
||||
|
||||
AccessibilityManagerCompat.sendEventToTest(
|
||||
mLauncher, TestProtocol.SWITCHED_TO_STATE_MESSAGE);
|
||||
AccessibilityManagerCompat.sendStateEventToTest(mLauncher, targetState.ordinal);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user