Remove feature flag "settings_dynamic_system"

The API surface of com.android.dynsystem is already protected by
privileged permission android.permission.INSTALL_DYNAMIC_SYSTEM,
which is only granted to system apps or priv apps.
Thus the feature flag check here is redundant, because eligible
callers of this API (system app) can also set the feature flag.

Bug: 176795908
Test: Presubmit
Test: Test DSU installation Intent
Change-Id: Iedac8763372ef6f11754d3f272f70753fb3d4829
This commit is contained in:
Yo Chiang
2021-01-13 12:31:54 +08:00
committed by Yi-yo Chiang
parent d09c22c4e8
commit 091f514bf5
4 changed files with 1 additions and 24 deletions

View File

@@ -1939,7 +1939,6 @@ package android.util {
method public static java.util.Map<java.lang.String,java.lang.String> getAllFeatureFlags();
method public static boolean isEnabled(android.content.Context, String);
method public static void setEnabled(android.content.Context, String, boolean);
field public static final String DYNAMIC_SYSTEM = "settings_dynamic_system";
field public static final String FFLAG_OVERRIDE_PREFIX = "sys.fflag.override.";
field public static final String FFLAG_PREFIX = "sys.fflag.";
field public static final String HEARING_AID_SETTINGS = "settings_bluetooth_hearing_aid";

View File

@@ -40,7 +40,6 @@ public class FeatureFlagUtils {
public static final String PERSIST_PREFIX = "persist." + FFLAG_OVERRIDE_PREFIX;
public static final String HEARING_AID_SETTINGS = "settings_bluetooth_hearing_aid";
public static final String SCREENRECORD_LONG_PRESS = "settings_screenrecord_long_press";
public static final String DYNAMIC_SYSTEM = "settings_dynamic_system";
public static final String SETTINGS_WIFITRACKER2 = "settings_wifitracker2";
/** @hide */
public static final String SETTINGS_DO_NOT_RESTORE_PRESERVED =
@@ -54,7 +53,6 @@ public class FeatureFlagUtils {
DEFAULT_FLAGS = new HashMap<>();
DEFAULT_FLAGS.put("settings_audio_switcher", "true");
DEFAULT_FLAGS.put("settings_systemui_theme", "true");
DEFAULT_FLAGS.put(DYNAMIC_SYSTEM, "false");
DEFAULT_FLAGS.put(HEARING_AID_SETTINGS, "false");
DEFAULT_FLAGS.put(SCREENRECORD_LONG_PRESS, "false");
DEFAULT_FLAGS.put("settings_wifi_details_datausage_header", "false");

View File

@@ -19,11 +19,9 @@ package com.android.dynsystem;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.SystemProperties;
import android.os.UserHandle;
import android.os.image.DynamicSystemClient;
import android.os.image.DynamicSystemManager;
import android.util.FeatureFlagUtils;
/**
@@ -48,7 +46,7 @@ public class BootCompletedReceiver extends BroadcastReceiver {
boolean isInUse = (dynSystem != null) && dynSystem.isInUse();
if (!isInUse && !featureFlagEnabled()) {
if (!isInUse) {
return;
}
@@ -58,9 +56,4 @@ public class BootCompletedReceiver extends BroadcastReceiver {
startServiceIntent.setAction(DynamicSystemClient.ACTION_NOTIFY_IF_IN_USE);
context.startServiceAsUser(startServiceIntent, UserHandle.SYSTEM);
}
private boolean featureFlagEnabled() {
return SystemProperties.getBoolean(
FeatureFlagUtils.PERSIST_PREFIX + FeatureFlagUtils.DYNAMIC_SYSTEM, false);
}
}

View File

@@ -22,10 +22,8 @@ import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.os.SystemProperties;
import android.os.UserHandle;
import android.os.image.DynamicSystemClient;
import android.util.FeatureFlagUtils;
import android.util.Log;
/**
@@ -46,12 +44,6 @@ public class VerificationActivity extends Activity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (!featureFlagEnabled()) {
Log.w(TAG, FeatureFlagUtils.DYNAMIC_SYSTEM + " not enabled; activity aborted.");
finish();
return;
}
KeyguardManager km = (KeyguardManager) getSystemService(Context.KEYGUARD_SERVICE);
if (km != null) {
@@ -101,11 +93,6 @@ public class VerificationActivity extends Activity {
startServiceAsUser(intent, UserHandle.SYSTEM);
}
private boolean featureFlagEnabled() {
return SystemProperties.getBoolean(
FeatureFlagUtils.PERSIST_PREFIX + FeatureFlagUtils.DYNAMIC_SYSTEM, false);
}
static boolean isVerified(String url) {
if (url == null) return true;
return sVerifiedUrl != null && sVerifiedUrl.equals(url);