Update the default wellbeing package config.
defaultWellbeingPackage is now deprecated and should not be used. Instead, point all references to the new systemWellbeing config. Bug: 233363529 Test: atest AmbientDisplayAlwaysOnPreferenceControllerTest Test: atest DarkModeCustomBedtimePreferenceControllerTest Test: atest DarkModeScheduleSelectorControllerTest Test: atest WhenToDreamPreferenceControllerTest Change-Id: Ia55ce505c5010e401ec0dc18a2fed41d3a692c7a
This commit is contained in:
@@ -121,7 +121,7 @@ public class AmbientDisplayAlwaysOnPreferenceController extends TogglePreference
|
|||||||
final PowerManager powerManager = context.getSystemService(PowerManager.class);
|
final PowerManager powerManager = context.getSystemService(PowerManager.class);
|
||||||
final PackageManager packageManager = context.getPackageManager();
|
final PackageManager packageManager = context.getPackageManager();
|
||||||
final String packageName = context.getString(
|
final String packageName = context.getString(
|
||||||
com.android.internal.R.string.config_defaultWellbeingPackage);
|
com.android.internal.R.string.config_systemWellbeing);
|
||||||
try {
|
try {
|
||||||
uid = packageManager.getApplicationInfo(packageName, /* flags= */ 0).uid;
|
uid = packageManager.getApplicationInfo(packageName, /* flags= */ 0).uid;
|
||||||
} catch (PackageManager.NameNotFoundException e) {
|
} catch (PackageManager.NameNotFoundException e) {
|
||||||
|
@@ -37,7 +37,7 @@ public final class BedtimeSettings {
|
|||||||
mContext = context;
|
mContext = context;
|
||||||
mPackageManager = context.getPackageManager();
|
mPackageManager = context.getPackageManager();
|
||||||
mWellbeingPackage = mContext.getResources().getString(
|
mWellbeingPackage = mContext.getResources().getString(
|
||||||
com.android.internal.R.string.config_defaultWellbeingPackage);
|
com.android.internal.R.string.config_systemWellbeing);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -74,7 +74,7 @@ public class AmbientDisplayAlwaysOnPreferenceControllerTest {
|
|||||||
mController.setConfig(mConfig);
|
mController.setConfig(mConfig);
|
||||||
|
|
||||||
mApplicationInfo.uid = 1;
|
mApplicationInfo.uid = 1;
|
||||||
when(mContext.getString(R.string.config_defaultWellbeingPackage)).thenReturn(TEST_PACKAGE);
|
when(mContext.getString(R.string.config_systemWellbeing)).thenReturn(TEST_PACKAGE);
|
||||||
|
|
||||||
when(mContext.getPackageManager()).thenReturn(mPackageManager);
|
when(mContext.getPackageManager()).thenReturn(mPackageManager);
|
||||||
doReturn(mApplicationInfo).when(mPackageManager).getApplicationInfo(
|
doReturn(mApplicationInfo).when(mPackageManager).getApplicationInfo(
|
||||||
|
@@ -77,7 +77,7 @@ public class DarkModeCustomBedtimePreferenceControllerTest {
|
|||||||
when(mContext.getSystemService(UiModeManager.class)).thenReturn(mService);
|
when(mContext.getSystemService(UiModeManager.class)).thenReturn(mService);
|
||||||
|
|
||||||
when(mContext.getResources()).thenReturn(mResources);
|
when(mContext.getResources()).thenReturn(mResources);
|
||||||
when(mResources.getString(com.android.internal.R.string.config_defaultWellbeingPackage))
|
when(mResources.getString(com.android.internal.R.string.config_systemWellbeing))
|
||||||
.thenReturn("wellbeing");
|
.thenReturn("wellbeing");
|
||||||
|
|
||||||
when(mScreen.findPreference(anyString())).thenReturn(mFooterPreference);
|
when(mScreen.findPreference(anyString())).thenReturn(mFooterPreference);
|
||||||
|
@@ -84,7 +84,7 @@ public class DarkModeScheduleSelectorControllerTest {
|
|||||||
when(mContext.getSystemService(LocationManager.class)).thenReturn(mLocationManager);
|
when(mContext.getSystemService(LocationManager.class)).thenReturn(mLocationManager);
|
||||||
when(mContext.getResources()).thenReturn(mResources);
|
when(mContext.getResources()).thenReturn(mResources);
|
||||||
when(mResources.getConfiguration()).thenReturn(mConfigNightNo);
|
when(mResources.getConfiguration()).thenReturn(mConfigNightNo);
|
||||||
when(mResources.getString(com.android.internal.R.string.config_defaultWellbeingPackage))
|
when(mResources.getString(com.android.internal.R.string.config_systemWellbeing))
|
||||||
.thenReturn("wellbeing");
|
.thenReturn("wellbeing");
|
||||||
|
|
||||||
when(mContext.getString(R.string.dark_ui_auto_mode_never)).thenReturn("never");
|
when(mContext.getString(R.string.dark_ui_auto_mode_never)).thenReturn("never");
|
||||||
|
@@ -72,7 +72,7 @@ public class WhenToDreamPreferenceControllerTest {
|
|||||||
|
|
||||||
mApplicationInfo.uid = 1;
|
mApplicationInfo.uid = 1;
|
||||||
when(mContext.getString(
|
when(mContext.getString(
|
||||||
com.android.internal.R.string.config_defaultWellbeingPackage)).thenReturn(
|
com.android.internal.R.string.config_systemWellbeing)).thenReturn(
|
||||||
TEST_PACKAGE);
|
TEST_PACKAGE);
|
||||||
|
|
||||||
when(mContext.getPackageManager()).thenReturn(mPackageManager);
|
when(mContext.getPackageManager()).thenReturn(mPackageManager);
|
||||||
|
Reference in New Issue
Block a user