Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c978f275 authored by helencheuk's avatar helencheuk
Browse files

[Contextual Edu] Added methods in aidl for updating edu data

- Added new method updateContextualEduStats in ISystemUiProxy.aidl for Launcher to update edu data.
- In EdgeBackGestureHandler, only updateContextualEduStats when mBackAnimation.onThresholdCrossed() is called, to ensure the action is a back swipe. In previous code, a swiping up to go home would also trigger calling updateContextualEduStats in EdgeBackGestureHandler which is incorrect.

Test: Manual
Bug: 357542123
Flag: com.android.systemui.keyboard_touchpad_contextual_education
Change-Id: I465593ad83ef44d1a399c9e82dfcb448f62439cc
parent 2e7481d1
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -172,5 +172,10 @@ interface ISystemUiProxy {
     */
    oneway void onImeSwitcherLongPress() = 57;

    // Next id = 58
    /**
     * Updates contextual education stats when target gesture type is triggered.
     */
    oneway void updateContextualEduStats(boolean isTrackpadGesture, String gestureType) = 58;

    // Next id = 59
}
+2 −2
Original line number Diff line number Diff line
@@ -1058,8 +1058,6 @@ public class EdgeBackGestureHandler implements PluginListener<NavigationEdgeBack
                mEdgeBackPlugin.setIsLeftPanel(mIsOnLeftEdge);
                mEdgeBackPlugin.onMotionEvent(ev);
                dispatchToBackAnimation(ev);
                mOverviewProxyService.updateContextualEduStats(mIsTrackpadThreeFingerSwipe,
                        GestureType.BACK);
            }
            if (mLogGesture || mIsTrackpadThreeFingerSwipe) {
                mDownPoint.set(ev.getX(), ev.getY());
@@ -1136,6 +1134,8 @@ public class EdgeBackGestureHandler implements PluginListener<NavigationEdgeBack
                        if (mAllowGesture) {
                            if (mBackAnimation != null) {
                                mBackAnimation.onThresholdCrossed();
                                mOverviewProxyService.updateContextualEduStats(
                                        mIsTrackpadThreeFingerSwipe, GestureType.BACK);
                            } else {
                                pilferPointers();
                            }
+7 −0
Original line number Diff line number Diff line
@@ -332,6 +332,13 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis
                    KeyButtonView.NavBarButtonEvent.NAVBAR_IME_SWITCHER_BUTTON_LONGPRESS);
        }

        @Override
        public void updateContextualEduStats(boolean isTrackpadGesture, String gestureType) {
            verifyCallerAndClearCallingIdentityPostMain("updateContextualEduStats",
                    () -> mHandler.post(() -> OverviewProxyService.this.updateContextualEduStats(
                            isTrackpadGesture, GestureType.valueOf(gestureType))));
        }

        @Override
        public void setHomeRotationEnabled(boolean enabled) {
            verifyCallerAndClearCallingIdentityPostMain("setHomeRotationEnabled", () ->