Loading core/java/android/provider/Settings.java +5 −0 Original line number Diff line number Diff line Loading @@ -9936,6 +9936,11 @@ public final class Settings { * @hide */ public static final String PACKAGE_VERIFIER_TIMEOUT = "verifier_timeout"; /** Timeout for app integrity verification. * @hide */ public static final String APP_INTEGRITY_VERIFICATION_TIMEOUT = "app_integrity_verification_timeout"; /** Default response code for package verification. * @hide */ public static final String PACKAGE_VERIFIER_DEFAULT_RESPONSE = "verifier_default_response"; Loading packages/SettingsProvider/test/src/android/provider/SettingsBackupTest.java +3 −2 Original line number Diff line number Diff line Loading @@ -588,8 +588,9 @@ public class SettingsBackupTest { Settings.Global.POWER_BUTTON_VERY_LONG_PRESS, Settings.Global.SHOW_MEDIA_ON_QUICK_SETTINGS, // Temporary for R beta Settings.Global.INTEGRITY_CHECK_INCLUDES_RULE_PROVIDER, Settings.Global.ADVANCED_BATTERY_USAGE_AMOUNT, Settings.Global.CACHED_APPS_FREEZER_ENABLED); Settings.Global.CACHED_APPS_FREEZER_ENABLED, Settings.Global.APP_INTEGRITY_VERIFICATION_TIMEOUT, Settings.Global.ADVANCED_BATTERY_USAGE_AMOUNT); private static final Set<String> BACKUP_BLACKLISTED_SECURE_SETTINGS = newHashSet( Loading services/core/java/com/android/server/pm/PackageManagerService.java +20 −2 Original line number Diff line number Diff line Loading @@ -607,6 +607,12 @@ public class PackageManagerService extends IPackageManager.Stub */ private static final long DEFAULT_VERIFICATION_TIMEOUT = 10 * 1000; /** * The default maximum time to wait for the integrity verification to return in * milliseconds. */ private static final long DEFAULT_INTEGRITY_VERIFICATION_TIMEOUT = 30 * 1000; /** * Timeout duration in milliseconds for enabling package rollback. If we fail to enable * rollback within that period, the install will proceed without rollback enabled. Loading Loading @@ -13837,6 +13843,19 @@ public class PackageManagerService extends IPackageManager.Stub return Math.max(timeout, DEFAULT_VERIFICATION_TIMEOUT); } /** * Get the integrity verification timeout. * * @return verification timeout in milliseconds */ private long getIntegrityVerificationTimeout() { long timeout = Global.getLong(mContext.getContentResolver(), Global.APP_INTEGRITY_VERIFICATION_TIMEOUT, DEFAULT_INTEGRITY_VERIFICATION_TIMEOUT); // The setting can be used to increase the timeout but not decrease it, since that is // equivalent to disabling the integrity component. return Math.max(timeout, DEFAULT_INTEGRITY_VERIFICATION_TIMEOUT); } /** * Get the default verification agent response code. * Loading Loading @@ -15032,8 +15051,7 @@ public class PackageManagerService extends IPackageManager.Stub final Message msg = mHandler.obtainMessage(CHECK_PENDING_INTEGRITY_VERIFICATION); msg.arg1 = verificationId; // TODO: do we want to use the same timeout? mHandler.sendMessageDelayed(msg, getVerificationTimeout()); mHandler.sendMessageDelayed(msg, getIntegrityVerificationTimeout()); } }, /* scheduler= */ null, /* initialCode= */ 0, Loading
core/java/android/provider/Settings.java +5 −0 Original line number Diff line number Diff line Loading @@ -9936,6 +9936,11 @@ public final class Settings { * @hide */ public static final String PACKAGE_VERIFIER_TIMEOUT = "verifier_timeout"; /** Timeout for app integrity verification. * @hide */ public static final String APP_INTEGRITY_VERIFICATION_TIMEOUT = "app_integrity_verification_timeout"; /** Default response code for package verification. * @hide */ public static final String PACKAGE_VERIFIER_DEFAULT_RESPONSE = "verifier_default_response"; Loading
packages/SettingsProvider/test/src/android/provider/SettingsBackupTest.java +3 −2 Original line number Diff line number Diff line Loading @@ -588,8 +588,9 @@ public class SettingsBackupTest { Settings.Global.POWER_BUTTON_VERY_LONG_PRESS, Settings.Global.SHOW_MEDIA_ON_QUICK_SETTINGS, // Temporary for R beta Settings.Global.INTEGRITY_CHECK_INCLUDES_RULE_PROVIDER, Settings.Global.ADVANCED_BATTERY_USAGE_AMOUNT, Settings.Global.CACHED_APPS_FREEZER_ENABLED); Settings.Global.CACHED_APPS_FREEZER_ENABLED, Settings.Global.APP_INTEGRITY_VERIFICATION_TIMEOUT, Settings.Global.ADVANCED_BATTERY_USAGE_AMOUNT); private static final Set<String> BACKUP_BLACKLISTED_SECURE_SETTINGS = newHashSet( Loading
services/core/java/com/android/server/pm/PackageManagerService.java +20 −2 Original line number Diff line number Diff line Loading @@ -607,6 +607,12 @@ public class PackageManagerService extends IPackageManager.Stub */ private static final long DEFAULT_VERIFICATION_TIMEOUT = 10 * 1000; /** * The default maximum time to wait for the integrity verification to return in * milliseconds. */ private static final long DEFAULT_INTEGRITY_VERIFICATION_TIMEOUT = 30 * 1000; /** * Timeout duration in milliseconds for enabling package rollback. If we fail to enable * rollback within that period, the install will proceed without rollback enabled. Loading Loading @@ -13837,6 +13843,19 @@ public class PackageManagerService extends IPackageManager.Stub return Math.max(timeout, DEFAULT_VERIFICATION_TIMEOUT); } /** * Get the integrity verification timeout. * * @return verification timeout in milliseconds */ private long getIntegrityVerificationTimeout() { long timeout = Global.getLong(mContext.getContentResolver(), Global.APP_INTEGRITY_VERIFICATION_TIMEOUT, DEFAULT_INTEGRITY_VERIFICATION_TIMEOUT); // The setting can be used to increase the timeout but not decrease it, since that is // equivalent to disabling the integrity component. return Math.max(timeout, DEFAULT_INTEGRITY_VERIFICATION_TIMEOUT); } /** * Get the default verification agent response code. * Loading Loading @@ -15032,8 +15051,7 @@ public class PackageManagerService extends IPackageManager.Stub final Message msg = mHandler.obtainMessage(CHECK_PENDING_INTEGRITY_VERIFICATION); msg.arg1 = verificationId; // TODO: do we want to use the same timeout? mHandler.sendMessageDelayed(msg, getVerificationTimeout()); mHandler.sendMessageDelayed(msg, getIntegrityVerificationTimeout()); } }, /* scheduler= */ null, /* initialCode= */ 0,