Add remote control of Instant Apps

Bug: 31470039
Test: manual
Change-Id: I82eb47f4d24fb88d0f264eca1176aec55364867c
This commit is contained in:
Todd Kennedy
2016-09-13 16:38:31 -07:00
parent 82f050f736
commit d15bb75af6
2 changed files with 17 additions and 1 deletions

View File

@@ -8673,6 +8673,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(