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

Commit c291f227 authored by Yalan Yiue's avatar Yalan Yiue Committed by Android (Google) Code Review
Browse files

Merge "Launch oobe from Settings" into main

parents 0037dfe9 dc9701f4
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);
        }
    }
}