Snap for 12943675 from 1d28b612fe to 25Q2-release
Change-Id: I7c9116583764a2827ab6cd84e16c4e03900511e6
This commit is contained in:
@@ -531,6 +531,7 @@
|
||||
<string name="title_change_system_locale_region">Change region to %s ?</string>
|
||||
<!-- Message for asking to change system locale region or not. [CHAR LIMIT=50]-->
|
||||
<string name="body_change_system_locale_region">Your device will keep %s as a system language</string>
|
||||
<string name="top_intro_numbering_system_title">The digits used will be dependent on the numbering system</string>
|
||||
|
||||
<!-- Regional Preferences begin -->
|
||||
<!-- The title of the menu entry of regional preferences. [CHAR LIMIT=50] -->
|
||||
@@ -911,6 +912,10 @@
|
||||
<string name="security_settings_face_enroll_improve_face_alert_body_fingerprint">Delete your current face model to set up Face Unlock again.\n\nYour face model will be permanently and securely deleted.\n\nAfter deletion, you will need your fingerprint, PIN, pattern, or password to unlock your phone or for authentication in apps.</string>
|
||||
<!-- Title for a category shown for the face settings page. [CHAR LIMIT=20] -->
|
||||
<string name="security_settings_face_settings_use_face_category">Use Face Unlock for</string>
|
||||
<!-- Title for a category shown for the face settings page. [CHAR LIMIT=20] -->
|
||||
<string name="security_settings_face_settings_face_category">Face</string>
|
||||
<!-- Title for a category shown for the face settings page. [CHAR LIMIT=20] -->
|
||||
<string name="security_settings_face_settings_use_face_to_category">Use Face to</string>
|
||||
<!-- Title for a category shown for the face settings page, followed by items that the user can toggle on/off to require/disable. [CHAR LIMIT=50] -->
|
||||
<string name="security_settings_face_settings_preferences_category">When using Face Unlock</string>
|
||||
<!-- Text shown on a toggle which disables/enables face unlock, depending if the user's eyes are open. [CHAR LIMIT=30] -->
|
||||
@@ -942,6 +947,10 @@
|
||||
<!-- Note: Update FingerprintEnrollParentalConsent.CONSENT_STRING_RESOURCES when any _consent_ strings are added or removed. -->
|
||||
<!-- Title shown for choose lock options [CHAR LIMIT=22] -->
|
||||
<string name="security_settings_fingerprint">Fingerprint</string>
|
||||
<!-- Title shown for a category shown for fingerprint settings page. [CHAR LIMIT=22] -->
|
||||
<string name="security_settings_fingerprint_title">Fingerprints</string>
|
||||
<!-- Fingerprint category title - fingerprint options for unlocking the device. [CHAR LIMIT=60] -->
|
||||
<string name="security_settings_category_use_fingerprint">Use fingerprint to</string>
|
||||
<!-- Title shown for menu item that launches fingerprint settings or enrollment [CHAR LIMIT=22] -->
|
||||
<string name="security_settings_fingerprint_preference_title">Fingerprint</string>
|
||||
<!-- Title for a category shown for the fingerprint settings page, followed by items that the user can toggle on/off to require/disable. [CHAR LIMIT=50] -->
|
||||
|
||||
@@ -19,6 +19,24 @@
|
||||
xmlns:settings="http://schemas.android.com/apk/res-auto"
|
||||
android:title="@string/security_settings_face_preference_title">
|
||||
|
||||
<PreferenceCategory
|
||||
android:key="biometric_settings_use_face_to"
|
||||
android:title="@string/security_settings_face_settings_use_face_to_category"
|
||||
settings:isPreferenceVisible="false">
|
||||
|
||||
<com.android.settingslib.RestrictedSwitchPreference
|
||||
android:key="biometric_settings_face_keyguard"
|
||||
android:title="@string/biometric_settings_use_biometric_unlock_phone"
|
||||
settings:keywords="@string/keywords_biometric_unlock"
|
||||
settings:controller="com.android.settings.biometrics.face.FaceSettingsKeyguardUnlockPreferenceController"/>
|
||||
|
||||
<SwitchPreferenceCompat
|
||||
android:key="biometric_settings_face_app"
|
||||
android:title="@string/biometric_settings_use_biometric_for_apps"
|
||||
settings:keywords="@string/keywords_biometric_unlock"
|
||||
settings:controller="com.android.settings.biometrics.face.FaceSettingsAppsPreferenceController"/>
|
||||
</PreferenceCategory>
|
||||
|
||||
<PreferenceCategory
|
||||
android:key="security_settings_face_unlock_category"
|
||||
android:title="@string/security_settings_face_settings_use_face_category"
|
||||
|
||||
@@ -19,6 +19,24 @@
|
||||
xmlns:settings="http://schemas.android.com/apk/res-auto"
|
||||
android:title="@string/security_settings_fingerprint_preference_title">
|
||||
|
||||
<PreferenceCategory
|
||||
android:key="biometric_settings_use_fingerprint_to"
|
||||
android:title="@string/security_settings_category_use_fingerprint"
|
||||
settings:isPreferenceVisible="false">
|
||||
|
||||
<com.android.settingslib.RestrictedSwitchPreference
|
||||
android:key="biometric_settings_fingerprint_keyguard"
|
||||
android:title="@string/biometric_settings_use_biometric_unlock_phone"
|
||||
settings:keywords="@string/keywords_biometric_unlock"
|
||||
settings:controller="com.android.settings.biometrics.fingerprint.FingerprintSettingsKeyguardUnlockPreferenceController"/>
|
||||
|
||||
<SwitchPreferenceCompat
|
||||
android:key="biometric_settings_fingerprint_app"
|
||||
android:title="@string/biometric_settings_use_biometric_for_apps"
|
||||
settings:keywords="@string/keywords_biometric_unlock"
|
||||
settings:controller="com.android.settings.biometrics.fingerprint.FingerprintSettingsAppsPreferenceController"/>
|
||||
</PreferenceCategory>
|
||||
|
||||
<PreferenceCategory
|
||||
android:key="security_settings_fingerprints_enrolled"
|
||||
settings:controller="com.android.settings.biometrics.fingerprint.FingerprintsEnrolledCategoryPreferenceController">
|
||||
|
||||
@@ -22,8 +22,7 @@
|
||||
|
||||
<com.android.settingslib.widget.TopIntroPreference
|
||||
android:key="top_intro_region"
|
||||
android:title="@string/top_intro_region_title"
|
||||
settings:isPreferenceVisible="false"/>
|
||||
android:title="@string/top_intro_region_title"/>
|
||||
|
||||
<PreferenceCategory
|
||||
android:key="system_language_suggested_category"
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
* 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;
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -41,7 +41,7 @@ import com.android.settingslib.core.lifecycle.events.OnPause;
|
||||
import com.android.settingslib.core.lifecycle.events.OnResume;
|
||||
|
||||
public class MagnificationOneFingerPanningPreferenceController extends
|
||||
MagnificationFeaturePreferenceController implements LifecycleObserver, OnResume, OnPause {
|
||||
MagnificationTogglePreferenceController implements LifecycleObserver, OnResume, OnPause {
|
||||
static final String PREF_KEY = Settings.Secure.ACCESSIBILITY_SINGLE_FINGER_PANNING_ENABLED;
|
||||
|
||||
private TwoStatePreference mSwitchPreference;
|
||||
|
||||
@@ -21,13 +21,13 @@ import android.content.Context;
|
||||
import com.android.settings.core.TogglePreferenceController;
|
||||
|
||||
/**
|
||||
* A base preference controller of magnification feature with common methods.
|
||||
* A base toggle preference controller of magnification feature with common methods.
|
||||
*/
|
||||
public abstract class MagnificationFeaturePreferenceController extends TogglePreferenceController {
|
||||
public abstract class MagnificationTogglePreferenceController extends TogglePreferenceController {
|
||||
|
||||
private boolean mInSetupWizard;
|
||||
|
||||
protected MagnificationFeaturePreferenceController(Context context,
|
||||
protected MagnificationTogglePreferenceController(Context context,
|
||||
String preferenceKey) {
|
||||
super(context, preferenceKey);
|
||||
}
|
||||
@@ -387,6 +387,7 @@ public class ToggleScreenMagnificationPreferenceFragment extends
|
||||
final MagnificationFeedbackPreferenceController magnificationFeedbackPreferenceController =
|
||||
new MagnificationFeedbackPreferenceController(getContext(), this,
|
||||
MagnificationFeedbackPreferenceController.PREF_KEY);
|
||||
magnificationFeedbackPreferenceController.setInSetupWizard(mInSetupWizard);
|
||||
magnificationFeedbackPreferenceController.displayPreference(getPreferenceScreen());
|
||||
addPreferenceController(magnificationFeedbackPreferenceController);
|
||||
}
|
||||
|
||||
@@ -29,6 +29,7 @@ import androidx.activity.result.ActivityResultLauncher;
|
||||
import androidx.activity.result.contract.ActivityResultContracts;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.preference.Preference;
|
||||
import androidx.preference.PreferenceCategory;
|
||||
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.biometrics.BiometricEnrollBase;
|
||||
@@ -76,6 +77,12 @@ public class CombinedBiometricSettings extends BiometricsSettingsBase {
|
||||
if (mActiveUnlockStatusUtils.isAvailable()) {
|
||||
updateUiForActiveUnlock();
|
||||
}
|
||||
if (Flags.biometricsOnboardingEducation()) {
|
||||
final PreferenceCategory category = findPreference(KEY_USE_BIOMETRIC_PREFERENCE);
|
||||
if (category != null) {
|
||||
category.setVisible(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void updateUiForActiveUnlock() {
|
||||
|
||||
@@ -47,6 +47,7 @@ import com.android.settings.biometrics.BiometricEnrollBase;
|
||||
import com.android.settings.biometrics.BiometricUtils;
|
||||
import com.android.settings.biometrics.IdentityCheckBiometricErrorDialog;
|
||||
import com.android.settings.dashboard.DashboardFragment;
|
||||
import com.android.settings.flags.Flags;
|
||||
import com.android.settings.overlay.FeatureFactory;
|
||||
import com.android.settings.password.ChooseLockSettingsHelper;
|
||||
import com.android.settings.password.ConfirmDeviceCredentialActivity;
|
||||
@@ -76,6 +77,8 @@ public class FaceSettings extends DashboardFragment {
|
||||
"security_settings_face_delete_faces_container";
|
||||
private static final String PREF_KEY_ENROLL_FACE_UNLOCK =
|
||||
"security_settings_face_enroll_faces_container";
|
||||
private static final String PREF_KEY_USE_FACE_TO_CATEGORY =
|
||||
"biometric_settings_use_face_to";
|
||||
public static final String SECURITY_SETTINGS_FACE_MANAGE_CATEGORY =
|
||||
"security_settings_face_manage_category";
|
||||
|
||||
@@ -238,6 +241,12 @@ public class FaceSettings extends DashboardFragment {
|
||||
if (savedInstanceState != null) {
|
||||
mToken = savedInstanceState.getByteArray(KEY_TOKEN);
|
||||
}
|
||||
|
||||
if (Flags.biometricsOnboardingEducation()) {
|
||||
final PreferenceCategory category =
|
||||
findPreference(PREF_KEY_USE_FACE_TO_CATEGORY);
|
||||
category.setVisible(true);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
/*
|
||||
* 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.biometrics.face;
|
||||
|
||||
import static android.provider.Settings.Secure.FACE_APP_ENABLED;
|
||||
|
||||
import android.content.Context;
|
||||
import android.hardware.face.FaceManager;
|
||||
import android.provider.Settings;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.android.settings.Utils;
|
||||
import com.android.settings.biometrics.activeunlock.ActiveUnlockStatusUtils;
|
||||
|
||||
public class FaceSettingsAppsPreferenceController extends
|
||||
FaceSettingsPreferenceController {
|
||||
private static final int ON = 1;
|
||||
private static final int OFF = 0;
|
||||
private static final int DEFAULT = ON;
|
||||
|
||||
private FaceManager mFaceManager;
|
||||
|
||||
public FaceSettingsAppsPreferenceController(@NonNull Context context, @NonNull String key) {
|
||||
super(context, key);
|
||||
mFaceManager = Utils.getFaceManagerOrNull(context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isChecked() {
|
||||
return Settings.Secure.getIntForUser(mContext.getContentResolver(), FACE_APP_ENABLED,
|
||||
DEFAULT, getUserId()) == ON;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean setChecked(boolean isChecked) {
|
||||
return Settings.Secure.putIntForUser(mContext.getContentResolver(), FACE_APP_ENABLED,
|
||||
isChecked ? ON : OFF, getUserId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getAvailabilityStatus() {
|
||||
final ActiveUnlockStatusUtils activeUnlockStatusUtils =
|
||||
new ActiveUnlockStatusUtils(mContext);
|
||||
if (!Utils.hasFaceHardware(mContext)
|
||||
&& !activeUnlockStatusUtils.isAvailable()) {
|
||||
return UNSUPPORTED_ON_DEVICE;
|
||||
}
|
||||
if (mFaceManager == null) {
|
||||
return AVAILABLE_UNSEARCHABLE;
|
||||
}
|
||||
// This preference will be available only if the user has registered face.
|
||||
final boolean hasFaceEnrolledUser = mFaceManager.hasEnrolledTemplates(getUserId());
|
||||
if (hasFaceEnrolledUser) {
|
||||
return AVAILABLE;
|
||||
} else {
|
||||
return AVAILABLE_UNSEARCHABLE;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
/*
|
||||
* 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.biometrics.face;
|
||||
|
||||
import static android.provider.Settings.Secure.FACE_KEYGUARD_ENABLED;
|
||||
|
||||
import android.content.Context;
|
||||
import android.provider.Settings;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.android.settings.Utils;
|
||||
import com.android.settings.biometrics.activeunlock.ActiveUnlockStatusUtils;
|
||||
|
||||
public class FaceSettingsKeyguardUnlockPreferenceController extends
|
||||
FaceSettingsPreferenceController {
|
||||
private static final int ON = 1;
|
||||
private static final int OFF = 0;
|
||||
private static final int DEFAULT = ON;
|
||||
|
||||
public FaceSettingsKeyguardUnlockPreferenceController(
|
||||
@NonNull Context context, @NonNull String key) {
|
||||
super(context, key);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isChecked() {
|
||||
return Settings.Secure.getIntForUser(mContext.getContentResolver(),
|
||||
FACE_KEYGUARD_ENABLED, DEFAULT, getUserId()) == ON;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean setChecked(boolean isChecked) {
|
||||
return Settings.Secure.putIntForUser(mContext.getContentResolver(),
|
||||
FACE_KEYGUARD_ENABLED, isChecked ? ON : OFF, getUserId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getAvailabilityStatus() {
|
||||
final ActiveUnlockStatusUtils activeUnlockStatusUtils =
|
||||
new ActiveUnlockStatusUtils(mContext);
|
||||
if (activeUnlockStatusUtils.isAvailable()) {
|
||||
return getAvailabilityFromRestrictingAdmin();
|
||||
}
|
||||
if (!Utils.hasFaceHardware(mContext)) {
|
||||
return UNSUPPORTED_ON_DEVICE;
|
||||
}
|
||||
return getAvailabilityFromRestrictingAdmin();
|
||||
}
|
||||
|
||||
private int getAvailabilityFromRestrictingAdmin() {
|
||||
return getRestrictingAdmin() != null ? DISABLED_FOR_USER : AVAILABLE;
|
||||
}
|
||||
}
|
||||
@@ -273,6 +273,8 @@ public class FingerprintSettings extends SubSettings {
|
||||
"security_settings_fingerprint_footer";
|
||||
private static final String KEY_BIOMETRICS_AUTHENTICATION_REQUESTED =
|
||||
"biometrics_authentication_requested";
|
||||
private static final String KEY_BIOMETRICS_USE_FINGERPRINT_TO_CATEGORY =
|
||||
"biometric_settings_use_fingerprint_to";
|
||||
|
||||
private static final int MSG_REFRESH_FINGERPRINT_TEMPLATES = 1000;
|
||||
private static final int MSG_FINGER_AUTH_SUCCESS = 1001;
|
||||
@@ -656,6 +658,9 @@ public class FingerprintSettings extends SubSettings {
|
||||
private PreferenceScreen createPreferenceHierarchy() {
|
||||
PreferenceScreen root = getPreferenceScreen();
|
||||
addFingerprintPreferences(root);
|
||||
if (Flags.biometricsOnboardingEducation()) {
|
||||
setupUseFingerprintToPreferences();
|
||||
}
|
||||
setPreferenceScreen(root);
|
||||
return root;
|
||||
}
|
||||
@@ -685,6 +690,10 @@ public class FingerprintSettings extends SubSettings {
|
||||
if (mFingerprintsEnrolledCategory != null) {
|
||||
mFingerprintsEnrolledCategory.removeAll();
|
||||
}
|
||||
if (Flags.biometricsOnboardingEducation()) {
|
||||
mFingerprintsEnrolledCategory.setTitle(root.getContext().getString(
|
||||
R.string.security_settings_fingerprint_title));
|
||||
}
|
||||
|
||||
String keyToReturn = mIsExpressiveThemeStyle
|
||||
? KEY_FINGERPRINT_ADD_EXPRESSIVE : KEY_FINGERPRINT_ADD;
|
||||
@@ -815,6 +824,26 @@ public class FingerprintSettings extends SubSettings {
|
||||
});
|
||||
}
|
||||
|
||||
private void setupUseFingerprintToPreferences() {
|
||||
final PreferenceCategory category =
|
||||
findPreference(KEY_BIOMETRICS_USE_FINGERPRINT_TO_CATEGORY);
|
||||
category.setVisible(true);
|
||||
|
||||
// Setup use fingerprint to unlock preference
|
||||
final FingerprintSettingsKeyguardUnlockPreferenceController fpUnlockController =
|
||||
use(FingerprintSettingsKeyguardUnlockPreferenceController.class);
|
||||
fpUnlockController.setUserId(mUserId);
|
||||
findPreference(fpUnlockController.getPreferenceKey())
|
||||
.setOnPreferenceChangeListener(fpUnlockController);
|
||||
|
||||
// Setup use fingerprint to verify it's you in apps preference
|
||||
final FingerprintSettingsAppsPreferenceController fingerprintAppController =
|
||||
use(FingerprintSettingsAppsPreferenceController.class);
|
||||
fingerprintAppController.setUserId(mUserId);
|
||||
findPreference(fingerprintAppController.getPreferenceKey())
|
||||
.setOnPreferenceChangeListener(fingerprintAppController);
|
||||
}
|
||||
|
||||
private void updatePreferencesAfterFingerprintRemoved() {
|
||||
updateAddPreference();
|
||||
if (isSfps() || (screenOffUnlockUdfps() && isUltrasnoicUdfps())) {
|
||||
|
||||
@@ -0,0 +1,76 @@
|
||||
/*
|
||||
* 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.biometrics.fingerprint;
|
||||
|
||||
import static android.provider.Settings.Secure.FINGERPRINT_APP_ENABLED;
|
||||
|
||||
import android.content.Context;
|
||||
import android.hardware.fingerprint.FingerprintManager;
|
||||
import android.provider.Settings;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.android.settings.Utils;
|
||||
import com.android.settings.biometrics.activeunlock.ActiveUnlockStatusUtils;
|
||||
|
||||
public class FingerprintSettingsAppsPreferenceController
|
||||
extends FingerprintSettingsPreferenceController {
|
||||
private static final int ON = 1;
|
||||
private static final int OFF = 0;
|
||||
private static final int DEFAULT = ON;
|
||||
|
||||
private FingerprintManager mFingerprintManager;
|
||||
|
||||
public FingerprintSettingsAppsPreferenceController(
|
||||
@NonNull Context context, @NonNull String key) {
|
||||
super(context, key);
|
||||
mFingerprintManager = Utils.getFingerprintManagerOrNull(context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isChecked() {
|
||||
return Settings.Secure.getIntForUser(mContext.getContentResolver(), FINGERPRINT_APP_ENABLED,
|
||||
DEFAULT, getUserId()) == ON;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean setChecked(boolean isChecked) {
|
||||
return Settings.Secure.putIntForUser(mContext.getContentResolver(), FINGERPRINT_APP_ENABLED,
|
||||
isChecked ? ON : OFF, getUserId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getAvailabilityStatus() {
|
||||
final ActiveUnlockStatusUtils activeUnlockStatusUtils =
|
||||
new ActiveUnlockStatusUtils(mContext);
|
||||
if (!Utils.hasFingerprintHardware(mContext)
|
||||
&& !activeUnlockStatusUtils.isAvailable()) {
|
||||
return UNSUPPORTED_ON_DEVICE;
|
||||
}
|
||||
if (mFingerprintManager == null) {
|
||||
return AVAILABLE_UNSEARCHABLE;
|
||||
}
|
||||
// This preference will be available only if the user has registered fingerprint.
|
||||
final boolean hasFingerprintEnrolledUser =
|
||||
mFingerprintManager.hasEnrolledTemplates(getUserId());
|
||||
if (hasFingerprintEnrolledUser) {
|
||||
return AVAILABLE;
|
||||
} else {
|
||||
return AVAILABLE_UNSEARCHABLE;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
/*
|
||||
* 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.biometrics.fingerprint;
|
||||
|
||||
import static android.provider.Settings.Secure.FINGERPRINT_KEYGUARD_ENABLED;
|
||||
|
||||
import android.content.Context;
|
||||
import android.provider.Settings;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.android.settings.Utils;
|
||||
import com.android.settings.biometrics.activeunlock.ActiveUnlockStatusUtils;
|
||||
|
||||
public class FingerprintSettingsKeyguardUnlockPreferenceController
|
||||
extends FingerprintSettingsPreferenceController {
|
||||
|
||||
private static final int ON = 1;
|
||||
private static final int OFF = 0;
|
||||
private static final int DEFAULT = ON;
|
||||
|
||||
public FingerprintSettingsKeyguardUnlockPreferenceController(
|
||||
@NonNull Context context, @NonNull String key) {
|
||||
super(context, key);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isChecked() {
|
||||
return Settings.Secure.getIntForUser(mContext.getContentResolver(),
|
||||
FINGERPRINT_KEYGUARD_ENABLED, DEFAULT, getUserId()) == ON;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean setChecked(boolean isChecked) {
|
||||
return Settings.Secure.putIntForUser(mContext.getContentResolver(),
|
||||
FINGERPRINT_KEYGUARD_ENABLED, isChecked ? ON : OFF, getUserId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getAvailabilityStatus() {
|
||||
final ActiveUnlockStatusUtils activeUnlockStatusUtils =
|
||||
new ActiveUnlockStatusUtils(mContext);
|
||||
if (activeUnlockStatusUtils.isAvailable()) {
|
||||
return getAvailabilityFromRestrictingAdmin();
|
||||
}
|
||||
if (!Utils.hasFingerprintHardware(mContext)) {
|
||||
return UNSUPPORTED_ON_DEVICE;
|
||||
}
|
||||
return getAvailabilityFromRestrictingAdmin();
|
||||
}
|
||||
|
||||
private int getAvailabilityFromRestrictingAdmin() {
|
||||
return getRestrictingAdmin() != null ? DISABLED_FOR_USER : AVAILABLE;
|
||||
}
|
||||
}
|
||||
@@ -85,6 +85,8 @@ public class BluetoothDetailsProfilesController extends BluetoothDetailsControll
|
||||
"persist.bluetooth.leaudio.toggle_visible";
|
||||
private static final String BYPASS_LE_AUDIO_ALLOWLIST_PROPERTY =
|
||||
"persist.bluetooth.leaudio.bypass_allow_list";
|
||||
private static final String LE_AUDIO_TOGGLE_VISIBLE_FOR_ASHA_PROPERTY =
|
||||
"bluetooth.leaudio.toggle_visible_for_asha";
|
||||
|
||||
private Set<String> mInvisibleProfiles = Collections.emptySet();
|
||||
private final AtomicReference<Set<String>> mAdditionalInvisibleProfiles =
|
||||
@@ -378,6 +380,12 @@ public class BluetoothDetailsProfilesController extends BluetoothDetailsControll
|
||||
// Remove hearing aids toggle anyway since showing the toggle will confuse users
|
||||
if (hearingAidSupported) {
|
||||
result.remove(mManager.getProfileManager().getHearingAidProfile());
|
||||
if (leAudioSupported
|
||||
&& !SystemProperties.getBoolean(BYPASS_LE_AUDIO_ALLOWLIST_PROPERTY, false)
|
||||
&& !SystemProperties.getBoolean(
|
||||
LE_AUDIO_TOGGLE_VISIBLE_FOR_ASHA_PROPERTY, true)) {
|
||||
result.remove(mManager.getProfileManager().getLeAudioProfile());
|
||||
}
|
||||
}
|
||||
if (leAudioSupported && !classicAudioSupported && !hearingAidSupported) {
|
||||
mIsLeAudioOnlyDevice = true;
|
||||
|
||||
@@ -41,11 +41,10 @@ import com.android.settingslib.datastore.SettingsSystemStore
|
||||
import com.android.settingslib.display.BrightnessUtils.GAMMA_SPACE_MAX
|
||||
import com.android.settingslib.display.BrightnessUtils.GAMMA_SPACE_MIN
|
||||
import com.android.settingslib.display.BrightnessUtils.convertLinearToGammaFloat
|
||||
import com.android.settingslib.metadata.PersistentPreference
|
||||
import com.android.settingslib.metadata.IntRangeValuePreference
|
||||
import com.android.settingslib.metadata.PreferenceChangeReason
|
||||
import com.android.settingslib.metadata.PreferenceMetadata
|
||||
import com.android.settingslib.metadata.PreferenceSummaryProvider
|
||||
import com.android.settingslib.metadata.RangeValue
|
||||
import com.android.settingslib.metadata.ReadWritePermit
|
||||
import com.android.settingslib.metadata.SensitivityLevel
|
||||
import com.android.settingslib.preference.PreferenceBinding
|
||||
@@ -55,8 +54,7 @@ import java.text.NumberFormat
|
||||
|
||||
// LINT.IfChange
|
||||
class BrightnessLevelPreference :
|
||||
PersistentPreference<Int>,
|
||||
RangeValue,
|
||||
IntRangeValuePreference,
|
||||
PreferenceBinding,
|
||||
PreferenceRestrictionMixin,
|
||||
PreferenceSummaryProvider,
|
||||
|
||||
@@ -26,11 +26,10 @@ import com.android.settingslib.datastore.KeyValueStore
|
||||
import com.android.settingslib.datastore.NoOpKeyedObservable
|
||||
import com.android.settingslib.datastore.Permissions
|
||||
import com.android.settingslib.fuelgauge.BatteryUtils
|
||||
import com.android.settingslib.metadata.PersistentPreference
|
||||
import com.android.settingslib.metadata.IntRangeValuePreference
|
||||
import com.android.settingslib.metadata.PreferenceLifecycleContext
|
||||
import com.android.settingslib.metadata.PreferenceLifecycleProvider
|
||||
import com.android.settingslib.metadata.PreferenceMetadata
|
||||
import com.android.settingslib.metadata.RangeValue
|
||||
import com.android.settingslib.metadata.ReadWritePermit
|
||||
import com.android.settingslib.metadata.SensitivityLevel
|
||||
import com.android.settingslib.preference.PreferenceBinding
|
||||
@@ -38,10 +37,9 @@ import com.android.settingslib.widget.UsageProgressBarPreference
|
||||
|
||||
// LINT.IfChange
|
||||
class BatteryHeaderPreference :
|
||||
PersistentPreference<Int>,
|
||||
IntRangeValuePreference,
|
||||
PreferenceBinding,
|
||||
PreferenceLifecycleProvider,
|
||||
RangeValue {
|
||||
PreferenceLifecycleProvider {
|
||||
|
||||
@VisibleForTesting var batteryBroadcastReceiver: BatteryBroadcastReceiver? = null
|
||||
|
||||
|
||||
@@ -2,8 +2,9 @@
|
||||
include platform/frameworks/base:/services/core/java/com/android/server/inputmethod/OWNERS
|
||||
include /OWNERS
|
||||
|
||||
# Settings for physical keyboard, gamepad, and touchpad are better reviewed by the input team
|
||||
# Settings for physical keyboard, mouse, gamepad, and touchpad are better reviewed by the input team
|
||||
per-file GameControllerPreferenceController.java = file:platform/frameworks/base:/INPUT_OWNERS
|
||||
per-file KeyboardLayoutPicker*.java = file:platform/frameworks/base:/INPUT_OWNERS
|
||||
per-file Mouse*.java = file:platform/frameworks/base:/INPUT_OWNERS
|
||||
per-file PhysicalKeyboard*.java = file:platform/frameworks/base:/INPUT_OWNERS
|
||||
per-file Trackpad*.java,Touchpad*.java,PointerTouchpad*.java = file:platform/frameworks/base:/INPUT_OWNERS
|
||||
|
||||
@@ -19,6 +19,7 @@ package com.android.settings.localepicker;
|
||||
import static com.android.settings.localepicker.LocaleListEditor.EXTRA_RESULT_LOCALE;
|
||||
import static com.android.settings.localepicker.RegionAndNumberingSystemPickerFragment.EXTRA_IS_NUMBERING_SYSTEM;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.os.LocaleList;
|
||||
@@ -178,7 +179,9 @@ public abstract class LocalePickerBaseListPreferenceController extends
|
||||
pref.setTitle(localeName);
|
||||
pref.setKey(locale.toString());
|
||||
pref.setOnPreferenceClickListener(clickedPref -> {
|
||||
// TODO: b/390347399 - Should pop up a dialog when changes the region.
|
||||
switchFragment(locale);
|
||||
((Activity) mContext).finish();
|
||||
return true;
|
||||
});
|
||||
mPreferences.put(locale.getId(), pref);
|
||||
|
||||
@@ -116,8 +116,8 @@ public class RegionAndNumberingSystemPickerFragment extends DashboardFragment im
|
||||
}
|
||||
|
||||
TopIntroPreference topIntroPreference = findPreference(KEY_TOP_INTRO_PREFERENCE);
|
||||
if (topIntroPreference != null) {
|
||||
topIntroPreference.setVisible(!mIsNumberingMode);
|
||||
if (topIntroPreference != null && mIsNumberingMode) {
|
||||
topIntroPreference.setTitle(R.string.top_intro_numbering_system_title);
|
||||
}
|
||||
|
||||
if (mSystemLocaleAllListPreferenceController != null) {
|
||||
|
||||
@@ -47,6 +47,7 @@ import com.android.settings.dashboard.DashboardFragment;
|
||||
import com.android.settings.search.BaseSearchIndexProvider;
|
||||
import com.android.settingslib.core.AbstractPreferenceController;
|
||||
import com.android.settingslib.core.lifecycle.Lifecycle;
|
||||
import com.android.settingslib.widget.TopIntroPreference;
|
||||
|
||||
import com.google.android.material.appbar.AppBarLayout;
|
||||
|
||||
@@ -71,14 +72,13 @@ public class SystemLocalePickerFragment extends DashboardFragment implements
|
||||
private static final String KEY_PREFERENCE_SYSTEM_LOCALE_LIST = "system_locale_list";
|
||||
private static final String KEY_PREFERENCE_SYSTEM_LOCALE_SUGGESTED_LIST =
|
||||
"system_locale_suggested_list";
|
||||
private static final String KEY_TOP_INTRO_PREFERENCE = "top_intro_region";
|
||||
|
||||
@Nullable
|
||||
private SearchView mSearchView = null;
|
||||
@Nullable
|
||||
private SearchFilter mSearchFilter = null;
|
||||
@Nullable
|
||||
private Set<LocaleStore.LocaleInfo> mLocaleList;
|
||||
@Nullable
|
||||
private List<LocaleStore.LocaleInfo> mLocaleOptions;
|
||||
@Nullable
|
||||
private List<LocaleStore.LocaleInfo> mOriginalLocaleInfos;
|
||||
@@ -106,8 +106,15 @@ public class SystemLocalePickerFragment extends DashboardFragment implements
|
||||
}
|
||||
|
||||
SystemLocaleCollector systemLocaleCollector = new SystemLocaleCollector(getContext(), null);
|
||||
mLocaleList = systemLocaleCollector.getSupportedLocaleList(null, false, false);
|
||||
mLocaleOptions = new ArrayList<>(mLocaleList.size());
|
||||
Set<LocaleStore.LocaleInfo> localeList = systemLocaleCollector.getSupportedLocaleList(null,
|
||||
false, false);
|
||||
mLocaleOptions = new ArrayList<>(localeList.size());
|
||||
|
||||
TopIntroPreference topIntroPreference = findPreference(KEY_TOP_INTRO_PREFERENCE);
|
||||
if (topIntroPreference != null) {
|
||||
topIntroPreference.setVisible(false);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -175,7 +182,7 @@ public class SystemLocalePickerFragment extends DashboardFragment implements
|
||||
FilterResults results = new FilterResults();
|
||||
|
||||
if (mOriginalLocaleInfos == null) {
|
||||
mOriginalLocaleInfos = new ArrayList<>(mLocaleList);
|
||||
mOriginalLocaleInfos = new ArrayList<>(mLocaleOptions);
|
||||
}
|
||||
|
||||
if (TextUtils.isEmpty(prefix)) {
|
||||
|
||||
@@ -32,20 +32,18 @@ import com.android.settingslib.datastore.KeyValueStore
|
||||
import com.android.settingslib.datastore.NoOpKeyedObservable
|
||||
import com.android.settingslib.datastore.Permissions
|
||||
import com.android.settingslib.datastore.and
|
||||
import com.android.settingslib.metadata.PersistentPreference
|
||||
import com.android.settingslib.metadata.IntRangeValuePreference
|
||||
import com.android.settingslib.metadata.PreferenceAvailabilityProvider
|
||||
import com.android.settingslib.metadata.PreferenceIconProvider
|
||||
import com.android.settingslib.metadata.PreferenceMetadata
|
||||
import com.android.settingslib.metadata.RangeValue
|
||||
import com.android.settingslib.metadata.ReadWritePermit
|
||||
import com.android.settingslib.metadata.SensitivityLevel
|
||||
import com.android.settingslib.preference.PreferenceBinding
|
||||
|
||||
// LINT.IfChange
|
||||
open class CallVolumePreference :
|
||||
IntRangeValuePreference,
|
||||
PreferenceBinding,
|
||||
PersistentPreference<Int>,
|
||||
RangeValue,
|
||||
PreferenceAvailabilityProvider,
|
||||
PreferenceIconProvider,
|
||||
PreferenceRestrictionMixin {
|
||||
|
||||
@@ -29,20 +29,18 @@ import com.android.settingslib.datastore.KeyValueStore
|
||||
import com.android.settingslib.datastore.NoOpKeyedObservable
|
||||
import com.android.settingslib.datastore.Permissions
|
||||
import com.android.settingslib.datastore.and
|
||||
import com.android.settingslib.metadata.PersistentPreference
|
||||
import com.android.settingslib.metadata.IntRangeValuePreference
|
||||
import com.android.settingslib.metadata.PreferenceAvailabilityProvider
|
||||
import com.android.settingslib.metadata.PreferenceIconProvider
|
||||
import com.android.settingslib.metadata.PreferenceMetadata
|
||||
import com.android.settingslib.metadata.RangeValue
|
||||
import com.android.settingslib.metadata.ReadWritePermit
|
||||
import com.android.settingslib.metadata.SensitivityLevel
|
||||
import com.android.settingslib.preference.PreferenceBinding
|
||||
|
||||
// LINT.IfChange
|
||||
open class MediaVolumePreference :
|
||||
IntRangeValuePreference,
|
||||
PreferenceBinding,
|
||||
PersistentPreference<Int>,
|
||||
RangeValue,
|
||||
PreferenceAvailabilityProvider,
|
||||
PreferenceIconProvider,
|
||||
PreferenceRestrictionMixin {
|
||||
|
||||
@@ -45,22 +45,20 @@ import com.android.settingslib.datastore.KeyValueStore
|
||||
import com.android.settingslib.datastore.NoOpKeyedObservable
|
||||
import com.android.settingslib.datastore.Permissions
|
||||
import com.android.settingslib.datastore.and
|
||||
import com.android.settingslib.metadata.PersistentPreference
|
||||
import com.android.settingslib.metadata.IntRangeValuePreference
|
||||
import com.android.settingslib.metadata.PreferenceAvailabilityProvider
|
||||
import com.android.settingslib.metadata.PreferenceIconProvider
|
||||
import com.android.settingslib.metadata.PreferenceLifecycleContext
|
||||
import com.android.settingslib.metadata.PreferenceLifecycleProvider
|
||||
import com.android.settingslib.metadata.PreferenceMetadata
|
||||
import com.android.settingslib.metadata.RangeValue
|
||||
import com.android.settingslib.metadata.ReadWritePermit
|
||||
import com.android.settingslib.metadata.SensitivityLevel
|
||||
import com.android.settingslib.preference.PreferenceBinding
|
||||
|
||||
// LINT.IfChange
|
||||
open class SeparateRingVolumePreference :
|
||||
IntRangeValuePreference,
|
||||
PreferenceBinding,
|
||||
PersistentPreference<Int>,
|
||||
RangeValue,
|
||||
PreferenceAvailabilityProvider,
|
||||
PreferenceIconProvider,
|
||||
PreferenceLifecycleProvider,
|
||||
|
||||
@@ -18,6 +18,8 @@ package com.android.settings.accessibility;
|
||||
|
||||
import static com.android.settings.accessibility.MagnificationFeedbackPreferenceController.FEEDBACK_KEY;
|
||||
import static com.android.settings.accessibility.MagnificationFeedbackPreferenceController.PREF_KEY;
|
||||
import static com.android.settings.core.BasePreferenceController.AVAILABLE;
|
||||
import static com.android.settings.core.BasePreferenceController.CONDITIONALLY_UNAVAILABLE;
|
||||
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
|
||||
@@ -118,4 +120,18 @@ public class MagnificationFeedbackPreferenceControllerTest {
|
||||
|
||||
verify(mSurveyFeatureProvider).sendActivityIfAvailable(FEEDBACK_KEY);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getAvailableStatus_notInSetupWizard_returnAvailable() {
|
||||
mController.setInSetupWizard(false);
|
||||
|
||||
assertThat(mController.getAvailabilityStatus()).isEqualTo(AVAILABLE);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getAvailableStatus_inSetupWizard_returnConditionallyUnavailable() {
|
||||
mController.setInSetupWizard(true);
|
||||
|
||||
assertThat(mController.getAvailabilityStatus()).isEqualTo(CONDITIONALLY_UNAVAILABLE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -383,6 +383,19 @@ public class FingerprintSettingsFragmentTest {
|
||||
assertThat(checkEnrolledPerf).isNull();
|
||||
}
|
||||
|
||||
@Test
|
||||
@EnableFlags(com.android.settings.flags.Flags.FLAG_BIOMETRICS_ONBOARDING_EDUCATION)
|
||||
public void testUseFingerprintToPreference_isShown() {
|
||||
doReturn(List.of()).when(mFingerprintManager).getEnrolledFingerprints(anyInt());
|
||||
setUpFragment(false, PRIMARY_USER_ID, TYPE_UDFPS_OPTICAL, 5);
|
||||
|
||||
shadowOf(Looper.getMainLooper()).idle();
|
||||
|
||||
final Preference preference =
|
||||
mFragment.findPreference("biometric_settings_use_fingerprint_to");
|
||||
assertThat(preference.isVisible()).isTrue();
|
||||
}
|
||||
|
||||
@Test
|
||||
@EnableFlags(com.android.settings.flags.Flags.FLAG_BIOMETRICS_ONBOARDING_EDUCATION)
|
||||
public void testCheckEnrolledHide_nonUdfps() {
|
||||
|
||||
@@ -29,6 +29,7 @@ import android.bluetooth.BluetoothClass;
|
||||
import android.bluetooth.BluetoothDevice;
|
||||
import android.bluetooth.BluetoothProfile;
|
||||
import android.content.Context;
|
||||
import android.os.SystemProperties;
|
||||
import android.platform.test.flag.junit.CheckFlagsRule;
|
||||
import android.platform.test.flag.junit.DeviceFlagsValueProvider;
|
||||
import android.platform.test.flag.junit.SetFlagsRule;
|
||||
@@ -646,6 +647,7 @@ public class BluetoothDetailsProfilesControllerTest extends BluetoothDetailsCont
|
||||
List<SwitchPreferenceCompat> switches = getProfileSwitches(false);
|
||||
assertThat(switches.isEmpty()).isTrue();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void ashaHearingAidWithLeAudio_showLeAudioToggle() {
|
||||
setupDevice(makeDefaultDeviceConfig());
|
||||
@@ -658,4 +660,16 @@ public class BluetoothDetailsProfilesControllerTest extends BluetoothDetailsCont
|
||||
assertThat(switches.getFirst().getTitle()).isEqualTo(
|
||||
mContext.getString(mLeAudioProfile.getNameResource(mDevice)));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void ashaHearingAidWithLeAudio_hideLeAudioToggleFromSystemProperties() {
|
||||
setupDevice(makeDefaultDeviceConfig());
|
||||
addHearingAidProfileToDevice(false);
|
||||
addLeAudioProfileToDevice(true);
|
||||
SystemProperties.set("bluetooth.leaudio.toggle_visible_for_asha", "false");
|
||||
showScreen(mController);
|
||||
|
||||
List<SwitchPreferenceCompat> switches = getProfileSwitches(false);
|
||||
assertThat(switches.isEmpty()).isTrue();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* 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.biometrics.face;
|
||||
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.test.core.app.ApplicationProvider;
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class FaceSettingsAppsPreferenceControllerTest {
|
||||
private Context mContext;
|
||||
private FaceSettingsAppsPreferenceController mController;
|
||||
|
||||
@Before
|
||||
public void setUp() {
|
||||
mContext = ApplicationProvider.getApplicationContext();
|
||||
mController = new FaceSettingsAppsPreferenceController(
|
||||
mContext, "biometric_settings_face_app");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void isSliceable_returnFalse() {
|
||||
assertThat(mController.isSliceable()).isFalse();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* 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.biometrics.face;
|
||||
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.test.core.app.ApplicationProvider;
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class FaceSettingsKeyguardUnlockPreferenceControllerTest {
|
||||
private Context mContext;
|
||||
private FaceSettingsKeyguardUnlockPreferenceController mController;
|
||||
|
||||
@Before
|
||||
public void setUp() {
|
||||
mContext = ApplicationProvider.getApplicationContext();
|
||||
mController = new FaceSettingsKeyguardUnlockPreferenceController(
|
||||
mContext, "biometric_settings_face_keyguard");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void isSliceable_returnFalse() {
|
||||
assertThat(mController.isSliceable()).isFalse();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* 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.biometrics.fingerprint;
|
||||
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.test.core.app.ApplicationProvider;
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class FingerprintSettingsAppsPreferenceControllerTest {
|
||||
private Context mContext;
|
||||
private FingerprintSettingsAppsPreferenceController mController;
|
||||
|
||||
@Before
|
||||
public void setUp() {
|
||||
mContext = ApplicationProvider.getApplicationContext();
|
||||
mController = new FingerprintSettingsAppsPreferenceController(
|
||||
mContext, "biometric_settings_fingerprint_app");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void isSliceable_returnFalse() {
|
||||
assertThat(mController.isSliceable()).isFalse();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* 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.biometrics.fingerprint;
|
||||
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.test.core.app.ApplicationProvider;
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class FingerprintSettingsKeyguardUnlockPreferenceControllerTest {
|
||||
private Context mContext;
|
||||
private FingerprintSettingsKeyguardUnlockPreferenceController mController;
|
||||
|
||||
@Before
|
||||
public void setUp() {
|
||||
mContext = ApplicationProvider.getApplicationContext();
|
||||
mController = new FingerprintSettingsKeyguardUnlockPreferenceController(
|
||||
mContext, "biometric_settings_fingerprint_keyguard");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void isSliceable_returnFalse() {
|
||||
assertThat(mController.isSliceable()).isFalse();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user