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

Commit dc9701f4 authored by yyalan's avatar yyalan
Browse files

Launch oobe from Settings

Bug: 344860480
Flag: com.android.systemui.shared.new_touchpad_gestures_tutorial
Test: Manual
Change-Id: Iabc155d2f99717c6489308ffb1e63ef4e59f0332
parent 411d5c15
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -85,6 +85,7 @@ android_library {
        "notification_flags_lib",
        "securebox",
        "android.os.flags-aconfig-java",
        "//frameworks/libs/systemui:com_android_systemui_shared_flags_lib",

        // Settings dependencies
        "FingerprintManagerInteractor",
+14 −3
Original line number Diff line number Diff line
@@ -16,8 +16,11 @@

package com.android.settings.inputmethod;

import static com.android.systemui.shared.Flags.newTouchpadGesturesTutorial;

import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.Intent;
import android.util.FeatureFlagUtils;

import androidx.fragment.app.Fragment;
@@ -34,6 +37,7 @@ public class TouchGesturesButtonPreferenceController extends BasePreferenceContr
    private static final int ORDER_BOTTOM = 100;
    private static final String PREFERENCE_KEY = "trackpad_touch_gesture";
    private static final String GESTURE_DIALOG_TAG = "GESTURE_DIALOG_TAG";
    private static final String TUTORIAL_ACTION = "com.android.systemui.action.TOUCHPAD_TUTORIAL";

    private Fragment mParent;
    private MetricsFeatureProvider mMetricsFeatureProvider;
@@ -73,8 +77,15 @@ public class TouchGesturesButtonPreferenceController extends BasePreferenceContr

    private void showTouchpadGestureEducation() {
        mMetricsFeatureProvider.action(mContext, SettingsEnums.ACTION_LEARN_TOUCHPAD_GESTURE_CLICK);
        if (newTouchpadGesturesTutorial()) {
            Intent intent = new Intent(TUTORIAL_ACTION);
            intent.addCategory(Intent.CATEGORY_DEFAULT);
            intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            mContext.startActivity(intent);
        } else {
            TrackpadGestureDialogFragment fragment = new TrackpadGestureDialogFragment();
            fragment.setTargetFragment(mParent, 0);
            fragment.show(mParent.getActivity().getSupportFragmentManager(), GESTURE_DIALOG_TAG);
        }
    }
}