Snap for 9371302 from 674bb29538
to tm-qpr2-release
Change-Id: Ifedfd4c277a53a7eeac513ff832299d7ece506a1
This commit is contained in:
@@ -13747,8 +13747,8 @@
|
||||
<string name="lockscreen_double_line_clock_summary">Show double-line clock when available</string>
|
||||
<!-- Lockscreen double-line clock toggle [CHAR LIMIT=60] -->
|
||||
<string name="lockscreen_double_line_clock_setting_toggle">Double-line clock</string>
|
||||
<!-- Lock screen buttons preference [CHAR LIMIT=60] -->
|
||||
<string name="lockscreen_quick_affordances_title">Buttons</string>
|
||||
<!-- Lock screen shortcuts preference [CHAR LIMIT=60] -->
|
||||
<string name="lockscreen_quick_affordances_title">Shortcuts</string>
|
||||
<!-- Summary for the lock screen button preference [CHAR LIMIT=60] -->
|
||||
<plurals name="lockscreen_quick_affordances_summary">
|
||||
<item quantity="zero">None</item>
|
||||
|
@@ -21,6 +21,7 @@ import android.os.SystemProperties;
|
||||
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.core.TogglePreferenceController;
|
||||
import com.android.settingslib.development.DevelopmentSettingsEnabler;
|
||||
|
||||
/**
|
||||
* The controller (on the transcode settings screen) indicating that by default we assume that apps
|
||||
@@ -47,7 +48,11 @@ public class TranscodeDefaultOptionPreferenceController extends TogglePreference
|
||||
|
||||
@Override
|
||||
public int getAvailabilityStatus() {
|
||||
return AVAILABLE;
|
||||
if (DevelopmentSettingsEnabler.isDevelopmentSettingsEnabled(mContext)) {
|
||||
return AVAILABLE;
|
||||
} else {
|
||||
return CONDITIONALLY_UNAVAILABLE;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -22,6 +22,7 @@ import android.os.SystemProperties;
|
||||
import com.android.internal.annotations.VisibleForTesting;
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.core.TogglePreferenceController;
|
||||
import com.android.settingslib.development.DevelopmentSettingsEnabler;
|
||||
|
||||
/**
|
||||
* The controller (in the Media transcoding settings) indicating the user's preference to disable
|
||||
@@ -49,7 +50,11 @@ public class TranscodeDisableCachePreferenceController extends TogglePreferenceC
|
||||
|
||||
@Override
|
||||
public int getAvailabilityStatus() {
|
||||
return AVAILABLE;
|
||||
if (DevelopmentSettingsEnabler.isDevelopmentSettingsEnabled(mContext)) {
|
||||
return AVAILABLE;
|
||||
} else {
|
||||
return CONDITIONALLY_UNAVAILABLE;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -21,6 +21,7 @@ import android.os.SystemProperties;
|
||||
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.core.TogglePreferenceController;
|
||||
import com.android.settingslib.development.DevelopmentSettingsEnabler;
|
||||
|
||||
/**
|
||||
* The controller for the "Enabling transcoding for all apps" switch on the transcode settings
|
||||
@@ -37,7 +38,11 @@ public class TranscodeGlobalTogglePreferenceController extends TogglePreferenceC
|
||||
|
||||
@Override
|
||||
public int getAvailabilityStatus() {
|
||||
return AVAILABLE;
|
||||
if (DevelopmentSettingsEnabler.isDevelopmentSettingsEnabled(mContext)) {
|
||||
return AVAILABLE;
|
||||
} else {
|
||||
return CONDITIONALLY_UNAVAILABLE;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -22,6 +22,7 @@ import android.os.SystemProperties;
|
||||
import com.android.internal.annotations.VisibleForTesting;
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.core.TogglePreferenceController;
|
||||
import com.android.settingslib.development.DevelopmentSettingsEnabler;
|
||||
|
||||
/**
|
||||
* The controller (in the Media transcoding settings) indicating the user's preference to show
|
||||
@@ -49,7 +50,11 @@ public class TranscodeNotificationPreferenceController extends TogglePreferenceC
|
||||
|
||||
@Override
|
||||
public int getAvailabilityStatus() {
|
||||
return AVAILABLE;
|
||||
if (DevelopmentSettingsEnabler.isDevelopmentSettingsEnabled(mContext)) {
|
||||
return AVAILABLE;
|
||||
} else {
|
||||
return CONDITIONALLY_UNAVAILABLE;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -21,6 +21,7 @@ import android.os.SystemProperties;
|
||||
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.core.TogglePreferenceController;
|
||||
import com.android.settingslib.development.DevelopmentSettingsEnabler;
|
||||
|
||||
/**
|
||||
* The controller for the User's control (over other transcoding preferences) preference switch on
|
||||
@@ -47,7 +48,11 @@ public class TranscodeUserControlPreferenceController extends TogglePreferenceCo
|
||||
|
||||
@Override
|
||||
public int getAvailabilityStatus() {
|
||||
return AVAILABLE;
|
||||
if (DevelopmentSettingsEnabler.isDevelopmentSettingsEnabled(mContext)) {
|
||||
return AVAILABLE;
|
||||
} else {
|
||||
return CONDITIONALLY_UNAVAILABLE;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -50,13 +50,13 @@ public class CustomizableLockScreenQuickAffordancesPreferenceController extends
|
||||
final Preference preference = screen.findPreference(getPreferenceKey());
|
||||
if (preference != null) {
|
||||
preference.setOnPreferenceClickListener(preference1 -> {
|
||||
// TODO(b/258471384): open the buttons destination within wallpaper picker.
|
||||
final Intent intent = new Intent(Intent.ACTION_SET_WALLPAPER);
|
||||
final String packageName =
|
||||
mContext.getString(R.string.config_wallpaper_picker_package);
|
||||
if (!TextUtils.isEmpty(packageName)) {
|
||||
intent.setPackage(packageName);
|
||||
}
|
||||
intent.putExtra("destination", "quick_affordances");
|
||||
mContext.startActivity(intent);
|
||||
return true;
|
||||
});
|
||||
|
@@ -102,6 +102,8 @@ public class CustomizableLockScreenQuickAffordancesPreferenceControllerTest {
|
||||
assertThat(intentCaptor.getValue().getPackage()).isEqualTo(
|
||||
mContext.getString(R.string.config_wallpaper_picker_package));
|
||||
assertThat(intentCaptor.getValue().getAction()).isEqualTo(Intent.ACTION_SET_WALLPAPER);
|
||||
assertThat(intentCaptor.getValue().getStringExtra("destination"))
|
||||
.isEqualTo("quick_affordances");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@@ -20,6 +20,7 @@ import static com.google.common.truth.Truth.assertThat;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.SystemProperties;
|
||||
import android.provider.Settings;
|
||||
|
||||
import androidx.test.core.app.ApplicationProvider;
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||
@@ -36,11 +37,14 @@ public class TranscodeDefaultOptionPreferenceControllerTest {
|
||||
"persist.sys.fuse.transcode_default";
|
||||
|
||||
private TranscodeDefaultOptionPreferenceController mUnderTest;
|
||||
private Context mContext;
|
||||
|
||||
@Before
|
||||
public void setUp() {
|
||||
Context context = ApplicationProvider.getApplicationContext();
|
||||
mUnderTest = new TranscodeDefaultOptionPreferenceController(context, "some_key");
|
||||
mContext = ApplicationProvider.getApplicationContext();
|
||||
mUnderTest = new TranscodeDefaultOptionPreferenceController(mContext, "some_key");
|
||||
Settings.Global.putInt(mContext.getContentResolver(),
|
||||
Settings.Global.DEVELOPMENT_SETTINGS_ENABLED, 1);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -74,4 +78,12 @@ public class TranscodeDefaultOptionPreferenceControllerTest {
|
||||
assertThat(mUnderTest.getAvailabilityStatus()).isEqualTo(
|
||||
BasePreferenceController.AVAILABLE);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getAvailabilityStatus_developerOptionFalse_shouldReturnUNAVAILABLE() {
|
||||
Settings.Global.putInt(mContext.getContentResolver(),
|
||||
Settings.Global.DEVELOPMENT_SETTINGS_ENABLED, 0);
|
||||
assertThat(mUnderTest.getAvailabilityStatus()).isEqualTo(
|
||||
BasePreferenceController.CONDITIONALLY_UNAVAILABLE);
|
||||
}
|
||||
}
|
||||
|
@@ -22,6 +22,7 @@ import static com.google.common.truth.Truth.assertThat;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.SystemProperties;
|
||||
import android.provider.Settings;
|
||||
|
||||
import androidx.test.core.app.ApplicationProvider;
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||
@@ -36,11 +37,14 @@ import org.junit.runner.RunWith;
|
||||
public class TranscodeDisableCachePreferenceControllerTest {
|
||||
|
||||
private TranscodeDisableCachePreferenceController mUnderTest;
|
||||
private Context mContext;
|
||||
|
||||
@Before
|
||||
public void setUp() {
|
||||
Context context = ApplicationProvider.getApplicationContext();
|
||||
mUnderTest = new TranscodeDisableCachePreferenceController(context, "some_key");
|
||||
mContext = ApplicationProvider.getApplicationContext();
|
||||
mUnderTest = new TranscodeDisableCachePreferenceController(mContext, "some_key");
|
||||
Settings.Global.putInt(mContext.getContentResolver(),
|
||||
Settings.Global.DEVELOPMENT_SETTINGS_ENABLED, 1);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -74,4 +78,12 @@ public class TranscodeDisableCachePreferenceControllerTest {
|
||||
assertThat(mUnderTest.getAvailabilityStatus()).isEqualTo(
|
||||
BasePreferenceController.AVAILABLE);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getAvailabilityStatus_developerOptionFalse_shouldReturnUNAVAILABLE() {
|
||||
Settings.Global.putInt(mContext.getContentResolver(),
|
||||
Settings.Global.DEVELOPMENT_SETTINGS_ENABLED, 0);
|
||||
assertThat(mUnderTest.getAvailabilityStatus()).isEqualTo(
|
||||
BasePreferenceController.CONDITIONALLY_UNAVAILABLE);
|
||||
}
|
||||
}
|
||||
|
@@ -20,10 +20,13 @@ import static com.google.common.truth.Truth.assertThat;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.SystemProperties;
|
||||
import android.provider.Settings;
|
||||
|
||||
import androidx.test.core.app.ApplicationProvider;
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||
|
||||
import com.android.settings.core.BasePreferenceController;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
@@ -34,11 +37,14 @@ public class TranscodeGlobalTogglePreferenceControllerTest {
|
||||
private static final String TRANSCODE_ENABLED_PROP_KEY = "persist.sys.fuse.transcode_enabled";
|
||||
|
||||
private TranscodeGlobalTogglePreferenceController mController;
|
||||
private Context mContext;
|
||||
|
||||
@Before
|
||||
public void setUp() {
|
||||
Context context = ApplicationProvider.getApplicationContext();
|
||||
mController = new TranscodeGlobalTogglePreferenceController(context, "test_key");
|
||||
mContext = ApplicationProvider.getApplicationContext();
|
||||
mController = new TranscodeGlobalTogglePreferenceController(mContext, "test_key");
|
||||
Settings.Global.putInt(mContext.getContentResolver(),
|
||||
Settings.Global.DEVELOPMENT_SETTINGS_ENABLED, 1);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -75,4 +81,12 @@ public class TranscodeGlobalTogglePreferenceControllerTest {
|
||||
// Verify the system property was updated.
|
||||
assertThat(SystemProperties.getBoolean(TRANSCODE_ENABLED_PROP_KEY, true)).isFalse();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getAvailabilityStatus_developerOptionFalse_shouldReturnUNAVAILABLE() {
|
||||
Settings.Global.putInt(mContext.getContentResolver(),
|
||||
Settings.Global.DEVELOPMENT_SETTINGS_ENABLED, 0);
|
||||
assertThat(mController.getAvailabilityStatus()).isEqualTo(
|
||||
BasePreferenceController.CONDITIONALLY_UNAVAILABLE);
|
||||
}
|
||||
}
|
||||
|
@@ -22,6 +22,7 @@ import static com.google.common.truth.Truth.assertThat;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.SystemProperties;
|
||||
import android.provider.Settings;
|
||||
|
||||
import androidx.test.core.app.ApplicationProvider;
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||
@@ -36,10 +37,14 @@ import org.junit.runner.RunWith;
|
||||
public class TranscodeNotificationPreferenceControllerTest {
|
||||
private TranscodeNotificationPreferenceController mUnderTest;
|
||||
|
||||
private Context mContext;
|
||||
|
||||
@Before
|
||||
public void setUp() {
|
||||
Context context = ApplicationProvider.getApplicationContext();
|
||||
mUnderTest = new TranscodeNotificationPreferenceController(context, "notification_key");
|
||||
mContext = ApplicationProvider.getApplicationContext();
|
||||
mUnderTest = new TranscodeNotificationPreferenceController(mContext, "notification_key");
|
||||
Settings.Global.putInt(mContext.getContentResolver(),
|
||||
Settings.Global.DEVELOPMENT_SETTINGS_ENABLED, 1);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -73,4 +78,12 @@ public class TranscodeNotificationPreferenceControllerTest {
|
||||
assertThat(mUnderTest.getAvailabilityStatus()).isEqualTo(
|
||||
BasePreferenceController.AVAILABLE);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getAvailabilityStatus_developerOptionFalse_shouldReturnUNAVAILABLE() {
|
||||
Settings.Global.putInt(mContext.getContentResolver(),
|
||||
Settings.Global.DEVELOPMENT_SETTINGS_ENABLED, 0);
|
||||
assertThat(mUnderTest.getAvailabilityStatus()).isEqualTo(
|
||||
BasePreferenceController.CONDITIONALLY_UNAVAILABLE);
|
||||
}
|
||||
}
|
||||
|
@@ -20,6 +20,7 @@ import static com.google.common.truth.Truth.assertThat;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.SystemProperties;
|
||||
import android.provider.Settings;
|
||||
|
||||
import androidx.test.core.app.ApplicationProvider;
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||
@@ -36,11 +37,14 @@ public class TranscodeUserControlPreferenceControllerTest {
|
||||
"persist.sys.fuse.transcode_user_control";
|
||||
|
||||
private TranscodeUserControlPreferenceController mUnderTest;
|
||||
private Context mContext;
|
||||
|
||||
@Before
|
||||
public void setUp() {
|
||||
Context context = ApplicationProvider.getApplicationContext();
|
||||
mUnderTest = new TranscodeUserControlPreferenceController(context, "some_key");
|
||||
mContext = ApplicationProvider.getApplicationContext();
|
||||
mUnderTest = new TranscodeUserControlPreferenceController(mContext, "some_key");
|
||||
Settings.Global.putInt(mContext.getContentResolver(),
|
||||
Settings.Global.DEVELOPMENT_SETTINGS_ENABLED, 1);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -74,4 +78,12 @@ public class TranscodeUserControlPreferenceControllerTest {
|
||||
assertThat(mUnderTest.getAvailabilityStatus()).isEqualTo(
|
||||
BasePreferenceController.AVAILABLE);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getAvailabilityStatus_developerOptionFalse_shouldReturnUNAVAILABLE() {
|
||||
Settings.Global.putInt(mContext.getContentResolver(),
|
||||
Settings.Global.DEVELOPMENT_SETTINGS_ENABLED, 0);
|
||||
assertThat(mUnderTest.getAvailabilityStatus()).isEqualTo(
|
||||
BasePreferenceController.CONDITIONALLY_UNAVAILABLE);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user