diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java index cafdc7193b21c..8f626df8d5803 100755 --- a/core/java/android/provider/Settings.java +++ b/core/java/android/provider/Settings.java @@ -8701,6 +8701,16 @@ public final class Settings { public static final String EPHEMERAL_COOKIE_MAX_SIZE_BYTES = "ephemeral_cookie_max_size_bytes"; + /** + * Toggle to enable/disable the entire ephemeral feature. By default, ephemeral is + * enabled. Set to zero to disable. + *

+ * Type: int (0 for false, 1 for true) + * + * @hide + */ + public static final String ENABLE_EPHEMERAL_FEATURE = "enable_ephemeral_feature"; + /** * A mask applied to the ephemeral hash to generate the hash prefix. *

diff --git a/services/core/java/com/android/server/pm/PackageManagerService.java b/services/core/java/com/android/server/pm/PackageManagerService.java index 783db051f8de1..dfcddd2e211a2 100644 --- a/services/core/java/com/android/server/pm/PackageManagerService.java +++ b/services/core/java/com/android/server/pm/PackageManagerService.java @@ -109,6 +109,7 @@ import android.app.admin.SecurityLog; import android.app.backup.IBackupManager; import android.content.BroadcastReceiver; import android.content.ComponentName; +import android.content.ContentResolver; import android.content.Context; import android.content.IIntentReceiver; import android.content.Intent; @@ -4807,7 +4808,12 @@ public class PackageManagerService extends IPackageManager.Stub { if (!mSystemReady) { return true; } - return Secure.getInt(mContext.getContentResolver(), Secure.WEB_ACTION_ENABLED, 1) == 0; + // we can't get a content resolver until the system is ready; these checks must happen last + final ContentResolver resolver = mContext.getContentResolver(); + if (Global.getInt(resolver, Global.ENABLE_EPHEMERAL_FEATURE, 1) == 0) { + return true; + } + return Secure.getInt(resolver, Secure.WEB_ACTION_ENABLED, 1) == 0; } private boolean isEphemeralAllowed(