Merge "Add remote control of Instant Apps" into nyc-mr1-dev

This commit is contained in:
TreeHugger Robot
2016-09-22 16:57:11 +00:00
committed by Android (Google) Code Review
2 changed files with 17 additions and 1 deletions

View File

@@ -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.
* <p>
* 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.
* <p>

View File

@@ -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(