Loading AndroidManifest.xml +1 −1 Original line number Diff line number Diff line Loading @@ -2597,7 +2597,7 @@ android:name="Settings$AppUsageAccessSettingsActivity" android:exported="true" android:label="@string/usage_access_title"> <intent-filter> <intent-filter android:priority="1"> <action android:name="android.settings.USAGE_ACCESS_SETTINGS"/> <category android:name="android.intent.category.DEFAULT"/> <data android:scheme="package"/> Loading src/com/android/settings/applications/AppInfoBase.java +20 −0 Original line number Diff line number Diff line Loading @@ -49,6 +49,7 @@ import androidx.fragment.app.Fragment; import com.android.settings.SettingsActivity; import com.android.settings.SettingsPreferenceFragment; import com.android.settings.activityembedding.ActivityEmbeddingUtils; import com.android.settings.applications.manageapplications.ManageApplications; import com.android.settings.core.SubSettingLauncher; import com.android.settings.core.instrumentation.InstrumentedDialogFragment; Loading Loading @@ -180,6 +181,25 @@ public abstract class AppInfoBase extends SettingsPreferenceFragment if (!(activity instanceof SettingsActivity)) { return false; } // Check the permission of the calling package if the device supports multi-pane. if (ActivityEmbeddingUtils.isEmbeddingActivityEnabled(activity)) { final String callingPackageName = ((SettingsActivity) activity).getInitialCallingPackage(); if (TextUtils.isEmpty(callingPackageName)) { Log.w(TAG, "Not able to get calling package name for permission check"); return false; } if (mPm.checkPermission(Manifest.permission.INTERACT_ACROSS_USERS_FULL, callingPackageName) != PackageManager.PERMISSION_GRANTED) { Log.w(TAG, "Package " + callingPackageName + " does not have required permission " + Manifest.permission.INTERACT_ACROSS_USERS_FULL); return false; } return true; } try { int callerUid = ActivityManager.getService().getLaunchedFromUid( activity.getActivityToken()); Loading src/com/android/settings/biometrics/face/FaceEnroll.kt +14 −10 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ import com.android.settings.biometrics.BiometricEnrollBase.RESULT_FINISHED import com.android.settings.biometrics.BiometricEnrollBase.RESULT_SKIP import com.android.settings.biometrics.BiometricEnrollBase.RESULT_TIMEOUT import com.android.settings.biometrics.BiometricsOnboardingProto import com.android.settings.biometrics.MultiBiometricEnrollHelper.EXTRA_ENROLL_AFTER_FACE import com.android.settings.biometrics.combination.CombinedBiometricStatusUtils import com.android.settings.biometrics.metrics.BiometricsLogger import com.android.settings.biometrics.metrics.OnboardingEvent Loading @@ -45,8 +46,7 @@ class FaceEnroll: AppCompatActivity() { private val enrollActivityProvider: FaceEnrollActivityClassProvider get() = featureFactory.faceFeatureProvider.enrollActivityClassProvider @VisibleForTesting var launchedFromProvider: () -> String? = { launchedFromPackage } @VisibleForTesting var launchedFromProvider: () -> String? = { launchedFromPackage } private var isLaunched = false private var startTimeMillis: Long = 0 Loading @@ -65,8 +65,8 @@ class FaceEnroll: AppCompatActivity() { if (!isLaunched) { /** * Logs the next activity to be launched, creates an intent for that activity, * adds flags to forward the result, includes any existing extras from the current intent, * Logs the next activity to be launched, creates an intent for that activity, adds * flags to forward the result, includes any existing extras from the current intent, * starts the new activity and then finishes the current one */ Log.d("FaceEnroll", "forward to $nextActivityClass") Loading @@ -75,6 +75,7 @@ class FaceEnroll: AppCompatActivity() { // drop extras that are not allowed from external packages before launching if (launchedFromProvider() != packageName) { nextIntent.removeExtra(EXTRA_ENROLL_AFTER_FACE) nextIntent.removeExtra(Intent.EXTRA_USER_ID) } startActivityForResult(nextIntent, 0) Loading @@ -93,13 +94,16 @@ class FaceEnroll: AppCompatActivity() { requestCode: Int, resultCode: Int, data: Intent?, caller: ComponentCaller caller: ComponentCaller, ) { super.onActivityResult(requestCode, resultCode, data, caller) isLaunched = false if (intent.getBooleanExtra( CombinedBiometricStatusUtils.EXTRA_LAUNCH_FROM_SAFETY_SOURCE_ISSUE, false) && resultCode != RESULT_FINISHED) { if ( intent.getBooleanExtra( CombinedBiometricStatusUtils.EXTRA_LAUNCH_FROM_SAFETY_SOURCE_ISSUE, false, ) && resultCode != RESULT_FINISHED ) { featureFactory.biometricsFeatureProvider.notifySafetyIssueActionLaunched() } updateOnboardingEvent(resultCode, data) Loading src/com/android/settings/biometrics/face/FaceSettingsAppsPreferenceController.java +15 −2 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.settings.biometrics.face; import static android.provider.Settings.Secure.BIOMETRIC_APP_ENABLED; import static android.provider.Settings.Secure.FACE_APP_ENABLED; import android.app.settings.SettingsEnums; Loading @@ -33,6 +34,7 @@ import com.android.settings.biometrics.activeunlock.ActiveUnlockStatusUtils; public class FaceSettingsAppsPreferenceController extends FaceSettingsPreferenceController { private static final int NOT_SET = -1; private static final int ON = 1; private static final int OFF = 0; private static final int DEFAULT = ON; Loading @@ -53,12 +55,23 @@ public class FaceSettingsAppsPreferenceController extends } } } // For OTA case: if FACE_APP_ENABLED is not set and BIOMETRIC_APP_ENABLED is set, set the // default value of the former to that of the latter. final int defValue = Settings.Secure.getIntForUser(mContext.getContentResolver(), FACE_APP_ENABLED, NOT_SET, getUserId()); final int oldDefValue = Settings.Secure.getIntForUser(mContext.getContentResolver(), BIOMETRIC_APP_ENABLED, NOT_SET, getUserId()); if (defValue == NOT_SET && oldDefValue != NOT_SET) { Settings.Secure.putIntForUser(mContext.getContentResolver(), FACE_APP_ENABLED, oldDefValue, getUserId()); } } @Override public boolean isChecked() { return Settings.Secure.getIntForUser(mContext.getContentResolver(), FACE_APP_ENABLED, DEFAULT, getUserId()) == ON; return Settings.Secure.getIntForUser(mContext.getContentResolver(), FACE_APP_ENABLED, DEFAULT, getUserId()) == ON; } @Override Loading src/com/android/settings/biometrics/face/FaceSettingsKeyguardUnlockPreferenceController.java +13 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.settings.biometrics.face; import static android.provider.Settings.Secure.BIOMETRIC_KEYGUARD_ENABLED; import static android.provider.Settings.Secure.FACE_KEYGUARD_ENABLED; import android.app.settings.SettingsEnums; Loading @@ -32,6 +33,7 @@ import com.android.settings.biometrics.activeunlock.ActiveUnlockStatusUtils; public class FaceSettingsKeyguardUnlockPreferenceController extends FaceSettingsPreferenceController { private static final int NOT_SET = -1; private static final int ON = 1; private static final int OFF = 0; private static final int DEFAULT = ON; Loading @@ -44,6 +46,17 @@ public class FaceSettingsKeyguardUnlockPreferenceController extends super(context, key); mFaceManager = Utils.getFaceManagerOrNull(context); mUserManager = context.getSystemService(UserManager.class); // For OTA case: if FACE_KEYGUARD_ENABLED is not set and BIOMETRIC_KEYGUARD_ENABLED is set, // set the default value of the former to that of the latter. final int defValue = Settings.Secure.getIntForUser(mContext.getContentResolver(), FACE_KEYGUARD_ENABLED, NOT_SET, getUserId()); final int oldDefValue = Settings.Secure.getIntForUser(mContext.getContentResolver(), BIOMETRIC_KEYGUARD_ENABLED, NOT_SET, getUserId()); if (defValue == NOT_SET && oldDefValue != NOT_SET) { Settings.Secure.putIntForUser(mContext.getContentResolver(), FACE_KEYGUARD_ENABLED, oldDefValue, getUserId()); } } @Override Loading Loading
AndroidManifest.xml +1 −1 Original line number Diff line number Diff line Loading @@ -2597,7 +2597,7 @@ android:name="Settings$AppUsageAccessSettingsActivity" android:exported="true" android:label="@string/usage_access_title"> <intent-filter> <intent-filter android:priority="1"> <action android:name="android.settings.USAGE_ACCESS_SETTINGS"/> <category android:name="android.intent.category.DEFAULT"/> <data android:scheme="package"/> Loading
src/com/android/settings/applications/AppInfoBase.java +20 −0 Original line number Diff line number Diff line Loading @@ -49,6 +49,7 @@ import androidx.fragment.app.Fragment; import com.android.settings.SettingsActivity; import com.android.settings.SettingsPreferenceFragment; import com.android.settings.activityembedding.ActivityEmbeddingUtils; import com.android.settings.applications.manageapplications.ManageApplications; import com.android.settings.core.SubSettingLauncher; import com.android.settings.core.instrumentation.InstrumentedDialogFragment; Loading Loading @@ -180,6 +181,25 @@ public abstract class AppInfoBase extends SettingsPreferenceFragment if (!(activity instanceof SettingsActivity)) { return false; } // Check the permission of the calling package if the device supports multi-pane. if (ActivityEmbeddingUtils.isEmbeddingActivityEnabled(activity)) { final String callingPackageName = ((SettingsActivity) activity).getInitialCallingPackage(); if (TextUtils.isEmpty(callingPackageName)) { Log.w(TAG, "Not able to get calling package name for permission check"); return false; } if (mPm.checkPermission(Manifest.permission.INTERACT_ACROSS_USERS_FULL, callingPackageName) != PackageManager.PERMISSION_GRANTED) { Log.w(TAG, "Package " + callingPackageName + " does not have required permission " + Manifest.permission.INTERACT_ACROSS_USERS_FULL); return false; } return true; } try { int callerUid = ActivityManager.getService().getLaunchedFromUid( activity.getActivityToken()); Loading
src/com/android/settings/biometrics/face/FaceEnroll.kt +14 −10 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ import com.android.settings.biometrics.BiometricEnrollBase.RESULT_FINISHED import com.android.settings.biometrics.BiometricEnrollBase.RESULT_SKIP import com.android.settings.biometrics.BiometricEnrollBase.RESULT_TIMEOUT import com.android.settings.biometrics.BiometricsOnboardingProto import com.android.settings.biometrics.MultiBiometricEnrollHelper.EXTRA_ENROLL_AFTER_FACE import com.android.settings.biometrics.combination.CombinedBiometricStatusUtils import com.android.settings.biometrics.metrics.BiometricsLogger import com.android.settings.biometrics.metrics.OnboardingEvent Loading @@ -45,8 +46,7 @@ class FaceEnroll: AppCompatActivity() { private val enrollActivityProvider: FaceEnrollActivityClassProvider get() = featureFactory.faceFeatureProvider.enrollActivityClassProvider @VisibleForTesting var launchedFromProvider: () -> String? = { launchedFromPackage } @VisibleForTesting var launchedFromProvider: () -> String? = { launchedFromPackage } private var isLaunched = false private var startTimeMillis: Long = 0 Loading @@ -65,8 +65,8 @@ class FaceEnroll: AppCompatActivity() { if (!isLaunched) { /** * Logs the next activity to be launched, creates an intent for that activity, * adds flags to forward the result, includes any existing extras from the current intent, * Logs the next activity to be launched, creates an intent for that activity, adds * flags to forward the result, includes any existing extras from the current intent, * starts the new activity and then finishes the current one */ Log.d("FaceEnroll", "forward to $nextActivityClass") Loading @@ -75,6 +75,7 @@ class FaceEnroll: AppCompatActivity() { // drop extras that are not allowed from external packages before launching if (launchedFromProvider() != packageName) { nextIntent.removeExtra(EXTRA_ENROLL_AFTER_FACE) nextIntent.removeExtra(Intent.EXTRA_USER_ID) } startActivityForResult(nextIntent, 0) Loading @@ -93,13 +94,16 @@ class FaceEnroll: AppCompatActivity() { requestCode: Int, resultCode: Int, data: Intent?, caller: ComponentCaller caller: ComponentCaller, ) { super.onActivityResult(requestCode, resultCode, data, caller) isLaunched = false if (intent.getBooleanExtra( CombinedBiometricStatusUtils.EXTRA_LAUNCH_FROM_SAFETY_SOURCE_ISSUE, false) && resultCode != RESULT_FINISHED) { if ( intent.getBooleanExtra( CombinedBiometricStatusUtils.EXTRA_LAUNCH_FROM_SAFETY_SOURCE_ISSUE, false, ) && resultCode != RESULT_FINISHED ) { featureFactory.biometricsFeatureProvider.notifySafetyIssueActionLaunched() } updateOnboardingEvent(resultCode, data) Loading
src/com/android/settings/biometrics/face/FaceSettingsAppsPreferenceController.java +15 −2 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.settings.biometrics.face; import static android.provider.Settings.Secure.BIOMETRIC_APP_ENABLED; import static android.provider.Settings.Secure.FACE_APP_ENABLED; import android.app.settings.SettingsEnums; Loading @@ -33,6 +34,7 @@ import com.android.settings.biometrics.activeunlock.ActiveUnlockStatusUtils; public class FaceSettingsAppsPreferenceController extends FaceSettingsPreferenceController { private static final int NOT_SET = -1; private static final int ON = 1; private static final int OFF = 0; private static final int DEFAULT = ON; Loading @@ -53,12 +55,23 @@ public class FaceSettingsAppsPreferenceController extends } } } // For OTA case: if FACE_APP_ENABLED is not set and BIOMETRIC_APP_ENABLED is set, set the // default value of the former to that of the latter. final int defValue = Settings.Secure.getIntForUser(mContext.getContentResolver(), FACE_APP_ENABLED, NOT_SET, getUserId()); final int oldDefValue = Settings.Secure.getIntForUser(mContext.getContentResolver(), BIOMETRIC_APP_ENABLED, NOT_SET, getUserId()); if (defValue == NOT_SET && oldDefValue != NOT_SET) { Settings.Secure.putIntForUser(mContext.getContentResolver(), FACE_APP_ENABLED, oldDefValue, getUserId()); } } @Override public boolean isChecked() { return Settings.Secure.getIntForUser(mContext.getContentResolver(), FACE_APP_ENABLED, DEFAULT, getUserId()) == ON; return Settings.Secure.getIntForUser(mContext.getContentResolver(), FACE_APP_ENABLED, DEFAULT, getUserId()) == ON; } @Override Loading
src/com/android/settings/biometrics/face/FaceSettingsKeyguardUnlockPreferenceController.java +13 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.settings.biometrics.face; import static android.provider.Settings.Secure.BIOMETRIC_KEYGUARD_ENABLED; import static android.provider.Settings.Secure.FACE_KEYGUARD_ENABLED; import android.app.settings.SettingsEnums; Loading @@ -32,6 +33,7 @@ import com.android.settings.biometrics.activeunlock.ActiveUnlockStatusUtils; public class FaceSettingsKeyguardUnlockPreferenceController extends FaceSettingsPreferenceController { private static final int NOT_SET = -1; private static final int ON = 1; private static final int OFF = 0; private static final int DEFAULT = ON; Loading @@ -44,6 +46,17 @@ public class FaceSettingsKeyguardUnlockPreferenceController extends super(context, key); mFaceManager = Utils.getFaceManagerOrNull(context); mUserManager = context.getSystemService(UserManager.class); // For OTA case: if FACE_KEYGUARD_ENABLED is not set and BIOMETRIC_KEYGUARD_ENABLED is set, // set the default value of the former to that of the latter. final int defValue = Settings.Secure.getIntForUser(mContext.getContentResolver(), FACE_KEYGUARD_ENABLED, NOT_SET, getUserId()); final int oldDefValue = Settings.Secure.getIntForUser(mContext.getContentResolver(), BIOMETRIC_KEYGUARD_ENABLED, NOT_SET, getUserId()); if (defValue == NOT_SET && oldDefValue != NOT_SET) { Settings.Secure.putIntForUser(mContext.getContentResolver(), FACE_KEYGUARD_ENABLED, oldDefValue, getUserId()); } } @Override Loading