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

Commit 2b8678c5 authored by Jan Tomljanovic's avatar Jan Tomljanovic Committed by Android (Google) Code Review
Browse files

Merge "Enable controllers to use a custom key." into sc-dev

parents a375349c c6667337
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -19,16 +19,20 @@ package com.android.settings.biometrics.face;
import android.content.Context;
import android.os.UserHandle;

import com.android.settings.R;

import androidx.preference.Preference;

import com.android.settings.R;

public class FaceProfileStatusPreferenceController extends FaceStatusPreferenceController {

    private static final String KEY_FACE_SETTINGS = "face_settings_profile";

    public FaceProfileStatusPreferenceController(Context context) {
        super(context, KEY_FACE_SETTINGS);
        this(context, KEY_FACE_SETTINGS);
    }

    public FaceProfileStatusPreferenceController(Context context, String key) {
        super(context, key);
    }

    @Override
+5 −1
Original line number Diff line number Diff line
@@ -25,7 +25,11 @@ public class FingerprintProfileStatusPreferenceController
    public static final String KEY_FINGERPRINT_SETTINGS = "fingerprint_settings_profile";

    public FingerprintProfileStatusPreferenceController(Context context) {
        super(context, KEY_FINGERPRINT_SETTINGS);
        this(context, KEY_FINGERPRINT_SETTINGS);
    }

    public FingerprintProfileStatusPreferenceController(Context context, String key) {
        super(context, key);
    }

    @Override
+10 −4
Original line number Diff line number Diff line
@@ -28,17 +28,23 @@ public class EnterprisePrivacyPreferenceController extends AbstractPreferenceCon

    private static final String KEY_ENTERPRISE_PRIVACY = "enterprise_privacy";
    private final PrivacyPreferenceControllerHelper mPrivacyPreferenceControllerHelper;
    private final String mPreferenceKey;

    public EnterprisePrivacyPreferenceController(Context context) {
        this(Objects.requireNonNull(context), new PrivacyPreferenceControllerHelper(context));
        this(Objects.requireNonNull(context), KEY_ENTERPRISE_PRIVACY);
    }

    public EnterprisePrivacyPreferenceController(Context context, String key) {
        this(Objects.requireNonNull(context), new PrivacyPreferenceControllerHelper(context), key);
    }

    @VisibleForTesting
    EnterprisePrivacyPreferenceController(
            Context context, PrivacyPreferenceControllerHelper privacyPreferenceControllerHelper) {
    EnterprisePrivacyPreferenceController(Context context,
            PrivacyPreferenceControllerHelper privacyPreferenceControllerHelper, String key) {
        super(Objects.requireNonNull(context));
        mPrivacyPreferenceControllerHelper = Objects.requireNonNull(
                privacyPreferenceControllerHelper);
        this.mPreferenceKey = key;
    }

    @Override
@@ -54,6 +60,6 @@ public class EnterprisePrivacyPreferenceController extends AbstractPreferenceCon

    @Override
    public String getPreferenceKey() {
        return KEY_ENTERPRISE_PRIVACY;
        return mPreferenceKey;
    }
}
+10 −4
Original line number Diff line number Diff line
@@ -32,17 +32,23 @@ public class FinancedPrivacyPreferenceController extends AbstractPreferenceContr

    private static final String PREF_KEY_FINANCED_PRIVACY = "financed_privacy";
    private final PrivacyPreferenceControllerHelper mPrivacyPreferenceControllerHelper;
    private final String mPreferenceKey;

    public FinancedPrivacyPreferenceController(Context context) {
        this(Objects.requireNonNull(context), new PrivacyPreferenceControllerHelper(context));
        this(Objects.requireNonNull(context), PREF_KEY_FINANCED_PRIVACY);
    }

    public FinancedPrivacyPreferenceController(Context context, String key) {
        this(Objects.requireNonNull(context), new PrivacyPreferenceControllerHelper(context), key);
    }

    @VisibleForTesting
    FinancedPrivacyPreferenceController(
            Context context, PrivacyPreferenceControllerHelper privacyPreferenceControllerHelper) {
    FinancedPrivacyPreferenceController(Context context,
            PrivacyPreferenceControllerHelper privacyPreferenceControllerHelper, String key) {
        super(Objects.requireNonNull(context));
        mPrivacyPreferenceControllerHelper = Objects.requireNonNull(
                privacyPreferenceControllerHelper);
        this.mPreferenceKey = key;
    }

    @Override
@@ -57,6 +63,6 @@ public class FinancedPrivacyPreferenceController extends AbstractPreferenceContr

    @Override
    public String getPreferenceKey() {
        return PREF_KEY_FINANCED_PRIVACY;
        return mPreferenceKey;
    }
}
+9 −1
Original line number Diff line number Diff line
@@ -37,9 +37,17 @@ public class ChangeProfileScreenLockPreferenceController extends

    private static final String KEY_UNLOCK_SET_OR_CHANGE_PROFILE = "unlock_set_or_change_profile";

    private final String mPreferenceKey;

    public ChangeProfileScreenLockPreferenceController(Context context,
            SettingsPreferenceFragment host) {
        this(context, host, KEY_UNLOCK_SET_OR_CHANGE_PROFILE);
    }

    public ChangeProfileScreenLockPreferenceController(Context context,
            SettingsPreferenceFragment host, String key) {
        super(context, host);
        this.mPreferenceKey = key;
    }

    public boolean isAvailable() {
@@ -65,7 +73,7 @@ public class ChangeProfileScreenLockPreferenceController extends

    @Override
    public String getPreferenceKey() {
        return KEY_UNLOCK_SET_OR_CHANGE_PROFILE;
        return mPreferenceKey;
    }

    @Override
Loading