Merge "Use the correct Smart Storage flag in SettingsLib." into pi-dev
This commit is contained in:
@@ -35,8 +35,8 @@ public class Utils {
|
||||
private static final String CURRENT_MODE_KEY = "CURRENT_MODE";
|
||||
private static final String NEW_MODE_KEY = "NEW_MODE";
|
||||
@VisibleForTesting
|
||||
static final String STORAGE_MANAGER_SHOW_OPT_IN_PROPERTY =
|
||||
"ro.storage_manager.show_opt_in";
|
||||
static final String STORAGE_MANAGER_ENABLED_PROPERTY =
|
||||
"ro.storage_manager.enabled";
|
||||
|
||||
private static Signature[] sSystemSignature;
|
||||
private static String sPermissionControllerPackageName;
|
||||
@@ -353,8 +353,7 @@ public class Utils {
|
||||
public static boolean isStorageManagerEnabled(Context context) {
|
||||
boolean isDefaultOn;
|
||||
try {
|
||||
// Turn off by default if the opt-in was shown.
|
||||
isDefaultOn = !SystemProperties.getBoolean(STORAGE_MANAGER_SHOW_OPT_IN_PROPERTY, true);
|
||||
isDefaultOn = SystemProperties.getBoolean(STORAGE_MANAGER_ENABLED_PROPERTY, false);
|
||||
} catch (Resources.NotFoundException e) {
|
||||
isDefaultOn = false;
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ package com.android.settingslib;
|
||||
|
||||
import static android.Manifest.permission.WRITE_SECURE_SETTINGS;
|
||||
|
||||
import static com.android.settingslib.Utils.STORAGE_MANAGER_SHOW_OPT_IN_PROPERTY;
|
||||
import static com.android.settingslib.Utils.STORAGE_MANAGER_ENABLED_PROPERTY;
|
||||
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
import static org.mockito.ArgumentMatchers.argThat;
|
||||
@@ -160,7 +160,7 @@ public class UtilsTest {
|
||||
|
||||
@Test
|
||||
public void testIsStorageManagerEnabled_UsesSystemProperties() {
|
||||
SystemProperties.set(STORAGE_MANAGER_SHOW_OPT_IN_PROPERTY, "false");
|
||||
SystemProperties.set(STORAGE_MANAGER_ENABLED_PROPERTY, "true");
|
||||
assertThat(Utils.isStorageManagerEnabled(mContext)).isTrue();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user