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

Commit 48a229cb authored by Menghan Li's avatar Menghan Li Committed by Android (Google) Code Review
Browse files

Merge "chore(magnification suw): Hide feedback preference in setup wizard" into main

parents 12a64f35 4c9bf742
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -44,7 +44,7 @@ import com.android.settingslib.core.lifecycle.events.OnResume;
 * to 100%.
 */
public class MagnificationAlwaysOnPreferenceController extends
        MagnificationFeaturePreferenceController implements LifecycleObserver, OnResume, OnPause {
        MagnificationTogglePreferenceController implements LifecycleObserver, OnResume, OnPause {

    private static final String TAG =
            MagnificationAlwaysOnPreferenceController.class.getSimpleName();
+42 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2025 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.android.settings.accessibility;

import android.content.Context;

import com.android.settings.core.BasePreferenceController;

/**
 * A base preference controller of magnification feature with common methods.
 */
public abstract class MagnificationBasePreferenceController extends BasePreferenceController {

    private boolean mInSetupWizard;

    protected MagnificationBasePreferenceController(Context context,
            String preferenceKey) {
        super(context, preferenceKey);
    }

    protected final boolean isInSetupWizard() {
        return mInSetupWizard;
    }

    protected final void setInSetupWizard(boolean inSetupWizard) {
        mInSetupWizard = inSetupWizard;
    }
}
+2 −3
Original line number Diff line number Diff line
@@ -25,7 +25,6 @@ import androidx.lifecycle.DefaultLifecycleObserver;
import androidx.preference.Preference;

import com.android.settings.R;
import com.android.settings.core.BasePreferenceController;
import com.android.settings.dashboard.DashboardFragment;
import com.android.settings.overlay.FeatureFactory;
import com.android.settings.overlay.SurveyFeatureProvider;
@@ -35,7 +34,7 @@ import com.android.settings.overlay.SurveyFeatureProvider;
 * visibility and click behavior of the preference based on the availability of a user survey
 * related to magnification.
 */
public class MagnificationFeedbackPreferenceController extends BasePreferenceController
public class MagnificationFeedbackPreferenceController extends MagnificationBasePreferenceController
        implements DefaultLifecycleObserver {
    private static final String TAG = "MagnificationFeedbackPreferenceController";
    public static final String PREF_KEY = "magnification_feedback";
@@ -53,7 +52,7 @@ public class MagnificationFeedbackPreferenceController extends BasePreferenceCon

    @Override
    public int getAvailabilityStatus() {
        return AVAILABLE;
        return isInSetupWizard() ? CONDITIONALLY_UNAVAILABLE : AVAILABLE;
    }

    @Override
+1 −1
Original line number Diff line number Diff line
@@ -26,7 +26,7 @@ import com.android.settings.R;

/** Controller that accesses and switches the preference status of following typing feature */
public class MagnificationFollowTypingPreferenceController extends
        MagnificationFeaturePreferenceController {
        MagnificationTogglePreferenceController {

    private static final String TAG =
            MagnificationFollowTypingPreferenceController.class.getSimpleName();
+1 −1
Original line number Diff line number Diff line
@@ -28,7 +28,7 @@ import com.android.settings.R;
 * Controller that accesses and switches the preference status of the magnification joystick feature
 */
public class MagnificationJoystickPreferenceController extends
        MagnificationFeaturePreferenceController {
        MagnificationTogglePreferenceController {

    private static final String TAG =
            MagnificationJoystickPreferenceController.class.getSimpleName();
Loading