[SPA] Add biometric authentication for package modification
Add an extra step of Lock Screen for disabling, force-stopping or uninstalling updates for protected packages UI Change Details : https://drive.google.com/drive/folders/1w7gKTmCxQ_j-9GQnIpEfF5_gmQ27b8l_?resourcekey=0-brLdN8VfqVPGm2FMwfrmkQ&usp=drive_link Bug: 352504490, 344865740 Test: atest AppButtonsPreferenceControllerTest PackageInfoPresenterTest Flag: EXEMPT High Security Bug Change-Id: I0c494e307b02229d751de118abcc89e4e61a6861
This commit is contained in:
@@ -60,6 +60,7 @@ import com.android.settings.R;
|
||||
import com.android.settings.SettingsActivity;
|
||||
import com.android.settings.core.InstrumentedPreferenceFragment;
|
||||
import com.android.settings.testutils.FakeFeatureFactory;
|
||||
import com.android.settings.testutils.shadow.ShadowUtils;
|
||||
import com.android.settingslib.applications.AppUtils;
|
||||
import com.android.settingslib.applications.ApplicationsState;
|
||||
import com.android.settingslib.applications.instantapps.InstantAppDataProvider;
|
||||
@@ -85,6 +86,7 @@ import org.robolectric.util.ReflectionHelpers;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
@Config(shadows = {ShadowUtils.class})
|
||||
@RunWith(RobolectricTestRunner.class)
|
||||
public class AppButtonsPreferenceControllerTest {
|
||||
|
||||
@@ -168,6 +170,7 @@ public class AppButtonsPreferenceControllerTest {
|
||||
@After
|
||||
public void tearDown() {
|
||||
ShadowAppUtils.reset();
|
||||
ShadowUtils.reset();
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@@ -51,6 +51,7 @@ public class ShadowUtils {
|
||||
private static boolean sIsBatteryPresent;
|
||||
private static boolean sIsMultipleBiometricsSupported;
|
||||
private static boolean sIsPrivateProfile;
|
||||
private static boolean sIsProtectedPackage;
|
||||
|
||||
@Implementation
|
||||
protected static int enforceSameOwner(Context context, int userId) {
|
||||
@@ -84,6 +85,7 @@ public class ShadowUtils {
|
||||
sIsBatteryPresent = true;
|
||||
sIsMultipleBiometricsSupported = false;
|
||||
sIsPrivateProfile = false;
|
||||
sIsProtectedPackage = false;
|
||||
}
|
||||
|
||||
public static void setIsDemoUser(boolean isDemoUser) {
|
||||
@@ -199,4 +201,13 @@ public class ShadowUtils {
|
||||
public static void setIsPrivateProfile(boolean isPrivateProfile) {
|
||||
sIsPrivateProfile = isPrivateProfile;
|
||||
}
|
||||
|
||||
@Implementation
|
||||
protected static boolean isProtectedPackage(Context context, String packageName) {
|
||||
return sIsProtectedPackage;
|
||||
}
|
||||
|
||||
public static void setIsProtectedPackage(boolean isProtectedPackage) {
|
||||
sIsProtectedPackage = isProtectedPackage;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user