Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b8c9dace authored by Daniel Nishi's avatar Daniel Nishi Committed by Android (Google) Code Review
Browse files

Merge "Use the correct Smart Storage flag in SettingsLib." into pi-dev

parents 83924aca 7a118345
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -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;
        }
+2 −2
Original line number Diff line number Diff line
@@ -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();
    }