diff --git a/OWNERS b/OWNERS
index cc33111f011..c8f206f02f1 100644
--- a/OWNERS
+++ b/OWNERS
@@ -10,7 +10,6 @@ emilychuang@google.com
millchen@google.com
stanleytfwang@google.com
sunnyshao@google.com
-tmfang@google.com
yantingyang@google.com
ykhung@google.com
diff --git a/res-product/values/strings.xml b/res-product/values/strings.xml
index 18f81acf9bb..93c2a1f306e 100644
--- a/res-product/values/strings.xml
+++ b/res-product/values/strings.xml
@@ -240,11 +240,11 @@
The fingerprint sensor is on the power button. It’s the flat button next to the raised volume button on the edge of the phone.\n\nPressing the power button turns off the screen.
- Now you can use your fingerprint to unlock your tablet or verify it\u2019s you, like when you sign in to apps
+ Now you can use your fingerprint to unlock your tablet or verify it\u2019s you, like when you sign in to apps or approve a purchase
- Now you can use your fingerprint to unlock your device or verify it\u2019s you, like when you sign in to apps
+ Now you can use your fingerprint to unlock your device or verify it\u2019s you, like when you sign in to apps or approve a purchase
- Now you can use your fingerprint to unlock your phone or verify it\u2019s you, like when you sign in to apps
+ Now you can use your fingerprint to unlock your phone or verify it\u2019s you, like when you sign in to apps or approve a purchase
A PIN protects the tablet if it\u2019s lost or stolen
diff --git a/res/layout/sfps_enroll_finish_base.xml b/res/layout/sfps_enroll_finish_base.xml
index e7dbaba337a..f442e9013da 100644
--- a/res/layout/sfps_enroll_finish_base.xml
+++ b/res/layout/sfps_enroll_finish_base.xml
@@ -36,7 +36,7 @@
android:layout_marginTop="24dp"
android:paddingTop="0dp"
android:paddingBottom="0dp"
- android:gravity="center">
+ android:layout_gravity="center">
Enrolling fingerprint %d percent
Fingerprint added
-
- Now you can use your fingerprint to unlock your tablet or verify it\u2019s you, like when you sign in to apps or approve a purchase
Unlock only when screen is on
@@ -2269,19 +2267,19 @@
Make text bigger or smaller
- SIM card lock settings
-
- SIM card lock
-
- Lock SIM card
+ SIM lock settings
+
+ SIM lock
+
+ Lock SIM
Change SIM PIN
SIM PIN
-
- Lock SIM card
-
- Unlock SIM card
+
+ Lock SIM
+
+ Unlock SIM
Old SIM PIN
@@ -2321,7 +2319,7 @@
Use %1$s
- Update preferred SIM card?
+ Update preferred SIM?
%1$s is the only SIM in your device. Do you want to use this SIM for mobile data, calls, and SMS messages?
@@ -2690,7 +2688,7 @@
Erase
- Erase downloaded SIMs
+ Erase eSIMs
This won’t cancel any mobile service plans. To download replacement SIMs, contact your carrier.
@@ -2699,7 +2697,7 @@
Reset all network settings? You can\u2019t undo this action.
- Reset all network settings and erase downloaded SIMs? You can\u2019t undo this action.
+ Reset all network settings and erase eSIMs? You can\u2019t undo this action.
Reset settings
@@ -2711,7 +2709,7 @@
Can\u2019t erase SIMs
- Downloaded SIMs can\u2019t be erased due to an error.\n\nRestart your device and try again.
+ eSIMs can\u2019t be erased due to an error.\n\nRestart your device and try again.
@@ -6279,7 +6277,7 @@
- SIM cards
+ SIMs
Mobile data is unavailable
@@ -6314,8 +6312,8 @@
SIM status (sim slot %1$d)
%1$d dBm %2$d asu
-
- SIM cards changed.
+
+ SIMs changed.
Tap to set up
@@ -8014,7 +8012,7 @@
Confirm SIM deletion
- Verify it\u0027s you before erasing a downloaded SIM
+ Verify it\u0027s you before erasing a eSIM
@@ -10086,7 +10084,7 @@
- No SIM card available
+ No SIM available
@@ -10140,10 +10138,10 @@
Inactive / SIM
- Active / Downloaded SIM
+ Active / eSIM
- Inactive / Downloaded SIM
+ Inactive / eSIM
Only one SIM can be active at a time.\n\nSwitching to %1$s won\u2019t cancel your %2$s service.
-
- Only one downloaded SIM can be active at a time.\n\nSwitching to %1$s won\u2019t cancel your %2$s service.
+
+ Only 1 eSIM can be active at a time.\n\nSwitching to %1$s won\u2019t cancel your %2$s service.
Only one SIM can be active at a time.\n\nSwitching won\u2019t cancel your %1$s service.
@@ -10338,12 +10336,12 @@
To use mobile data, call features, and SMS at a later time, go to your network settings
-
- SIM card
+
+ SIM
-
- Erase this downloaded SIM?
+
+ Erase this eSIM?
Erasing this SIM removes %1$s service from this device.\n\nService for %1$s won\'t be canceled.
@@ -10717,10 +10715,10 @@
W+ network
SIM
-
- DOWNLOADED SIM
-
- DOWNLOADED SIMS
+
+ eSIM
+
+ eSIMs
Active
@@ -10850,7 +10848,7 @@
Call Settings error
- Network or SIM card error.
+ Network or SIM error.
Sim is not activated.
@@ -10911,14 +10909,14 @@
Color preview
-
- SIM card access request
-
- A device wants to access your SIM card. Tap for details.
-
- Allow access to SIM card?
-
- A Bluetooth device, %1$s, wants to access data on your SIM card. This includes your contacts.\n\nWhile connected, %2$s will receive all calls made to %3$s.
+
+ SIM access request
+
+ A device wants to access your SIM. Tap for details.
+
+ Allow access to SIM?
+
+ A Bluetooth device, %1$s, wants to access data from your SIM. This includes your contacts.\n\nWhile connected, %2$s will receive all calls made to %3$s.
Bluetooth device available
diff --git a/src/com/android/settings/SettingsActivity.java b/src/com/android/settings/SettingsActivity.java
index 1553a548c68..076d0e1de7c 100644
--- a/src/com/android/settings/SettingsActivity.java
+++ b/src/com/android/settings/SettingsActivity.java
@@ -24,6 +24,7 @@ import static com.android.settings.applications.appinfo.AppButtonsPreferenceCont
import android.app.ActionBar;
import android.app.ActivityManager;
+import android.app.settings.SettingsEnums;
import android.content.ActivityNotFoundException;
import android.content.BroadcastReceiver;
import android.content.ComponentName;
@@ -230,11 +231,32 @@ public class SettingsActivity extends SettingsBaseActivity
@Override
public SharedPreferences getSharedPreferences(String name, int mode) {
- if (name.equals(getPackageName() + "_preferences")) {
- return new SharedPreferencesLogger(this, getMetricsTag(),
- FeatureFactory.getFactory(this).getMetricsFeatureProvider());
+ if (!TextUtils.equals(name, getPackageName() + "_preferences")) {
+ return super.getSharedPreferences(name, mode);
}
- return super.getSharedPreferences(name, mode);
+
+ String tag = getMetricsTag();
+
+ return new SharedPreferencesLogger(this, tag,
+ FeatureFactory.getFactory(this).getMetricsFeatureProvider(),
+ lookupMetricsCategory());
+ }
+
+ private int lookupMetricsCategory() {
+ int category = SettingsEnums.PAGE_UNKNOWN;
+ Bundle args = null;
+ if (getIntent() != null) {
+ args = getIntent().getBundleExtra(EXTRA_SHOW_FRAGMENT_ARGUMENTS);
+ }
+
+ Fragment fragment = Utils.getTargetFragment(this, getMetricsTag(), args);
+
+ if (fragment instanceof Instrumentable) {
+ category = ((Instrumentable) fragment).getMetricsCategory();
+ }
+ Log.d(LOG_TAG, "MetricsCategory is " + category);
+
+ return category;
}
private String getMetricsTag() {
@@ -242,13 +264,11 @@ public class SettingsActivity extends SettingsBaseActivity
if (getIntent() != null && getIntent().hasExtra(EXTRA_SHOW_FRAGMENT)) {
tag = getInitialFragmentName(getIntent());
}
+
if (TextUtils.isEmpty(tag)) {
Log.w(LOG_TAG, "MetricsTag is invalid " + tag);
tag = getClass().getName();
}
- if (tag.startsWith("com.android.settings.")) {
- tag = tag.replace("com.android.settings.", "");
- }
return tag;
}
@@ -320,7 +340,7 @@ public class SettingsActivity extends SettingsBaseActivity
}
mMainSwitch = findViewById(R.id.switch_bar);
if (mMainSwitch != null) {
- mMainSwitch.setMetricsTag(getMetricsTag());
+ mMainSwitch.setMetricsCategory(lookupMetricsCategory());
mMainSwitch.setTranslationZ(findViewById(R.id.main_content).getTranslationZ() + 1);
}
diff --git a/src/com/android/settings/biometrics/fingerprint/FingerprintEnrollFinish.java b/src/com/android/settings/biometrics/fingerprint/FingerprintEnrollFinish.java
index d4b1eb0ba6b..b8ec5e64841 100644
--- a/src/com/android/settings/biometrics/fingerprint/FingerprintEnrollFinish.java
+++ b/src/com/android/settings/biometrics/fingerprint/FingerprintEnrollFinish.java
@@ -69,11 +69,7 @@ public class FingerprintEnrollFinish extends BiometricEnrollBase {
setContentView(R.layout.fingerprint_enroll_finish);
}
setHeaderText(R.string.security_settings_fingerprint_enroll_finish_title);
- if (mCanAssumeSfps) {
- setDescriptionText(R.string.security_settings_sfps_enroll_finish);
- } else {
- setDescriptionText(R.string.security_settings_fingerprint_enroll_finish_v2_message);
- }
+ setDescriptionText(R.string.security_settings_fingerprint_enroll_finish_v2_message);
mFooterBarMixin = getLayout().getMixin(FooterBarMixin.class);
mFooterBarMixin.setSecondaryButton(
diff --git a/src/com/android/settings/core/instrumentation/SettingsEventLogWriter.java b/src/com/android/settings/core/instrumentation/SettingsEventLogWriter.java
index f1658976c4d..e85576b5420 100644
--- a/src/com/android/settings/core/instrumentation/SettingsEventLogWriter.java
+++ b/src/com/android/settings/core/instrumentation/SettingsEventLogWriter.java
@@ -40,6 +40,22 @@ public class SettingsEventLogWriter extends EventLogWriter {
super.hidden(context, category, visibleTime);
}
+ @Override
+ public void clicked(int sourceCategory, String key) {
+ if (shouldDisableGenericEventLogging()) {
+ return;
+ }
+ super.clicked(sourceCategory, key);
+ }
+
+ @Override
+ public void changed(int category, String key, int value) {
+ if (shouldDisableGenericEventLogging()) {
+ return;
+ }
+ super.changed(category, key, value);
+ }
+
@Override
public void action(Context context, int category, String pkg) {
if (shouldDisableGenericEventLogging()) {
diff --git a/src/com/android/settings/core/instrumentation/SettingsIntelligenceLogWriter.java b/src/com/android/settings/core/instrumentation/SettingsIntelligenceLogWriter.java
index 8dfa095eefd..86ee3d669e6 100644
--- a/src/com/android/settings/core/instrumentation/SettingsIntelligenceLogWriter.java
+++ b/src/com/android/settings/core/instrumentation/SettingsIntelligenceLogWriter.java
@@ -84,6 +84,10 @@ public class SettingsIntelligenceLogWriter implements LogWriter {
public void clicked(int sourceCategory, String key) {
}
+ @Override
+ public void changed(int category, String key, int value) {
+ }
+
@Override
public void action(Context context, int action, Pair... taggedData) {
action(SettingsEnums.PAGE_UNKNOWN /* attribution */,
diff --git a/src/com/android/settings/core/instrumentation/StatsLogWriter.java b/src/com/android/settings/core/instrumentation/StatsLogWriter.java
index 15b589fafb2..7b5915afd62 100644
--- a/src/com/android/settings/core/instrumentation/StatsLogWriter.java
+++ b/src/com/android/settings/core/instrumentation/StatsLogWriter.java
@@ -54,6 +54,16 @@ public class StatsLogWriter implements LogWriter {
0 /* changedPreferenceIntValue */);
}
+ @Override
+ public void changed(int sourceCategory, String key, int value) {
+ SettingsStatsLog.write(SettingsStatsLog.SETTINGS_UI_CHANGED /* Atom name */,
+ sourceCategory /* attribution */,
+ SettingsEnums.ACTION_SETTINGS_PREFERENCE_CHANGE /* action */,
+ SettingsEnums.PAGE_UNKNOWN /* pageId */,
+ key /* changedPreferenceKey */,
+ value /* changedPreferenceIntValue */);
+ }
+
@Override
public void action(Context context, int action, Pair... taggedData) {
action(SettingsEnums.PAGE_UNKNOWN /* attribution */,
diff --git a/src/com/android/settings/dashboard/profileselector/ProfileSelectDialog.java b/src/com/android/settings/dashboard/profileselector/ProfileSelectDialog.java
index f82694c5841..ef6ad832477 100644
--- a/src/com/android/settings/dashboard/profileselector/ProfileSelectDialog.java
+++ b/src/com/android/settings/dashboard/profileselector/ProfileSelectDialog.java
@@ -23,6 +23,7 @@ import android.content.DialogInterface.OnCancelListener;
import android.content.DialogInterface.OnDismissListener;
import android.content.DialogInterface.OnShowListener;
import android.content.Intent;
+import android.content.pm.UserInfo;
import android.os.Bundle;
import android.os.UserHandle;
import android.os.UserManager;
@@ -168,7 +169,8 @@ public class ProfileSelectDialog extends DialogFragment implements UserAdapter.O
}
final UserManager userManager = UserManager.get(context);
for (int i = userHandles.size() - 1; i >= 0; i--) {
- if (userManager.getUserInfo(userHandles.get(i).getIdentifier()) == null) {
+ UserInfo userInfo = userManager.getUserInfo(userHandles.get(i).getIdentifier());
+ if (userInfo == null || userInfo.isCloneProfile()) {
if (DEBUG) {
Log.d(TAG, "Delete the user: " + userHandles.get(i).getIdentifier());
}
diff --git a/src/com/android/settings/fuelgauge/batterysaver/BatterySaverScheduleRadioButtonsController.java b/src/com/android/settings/fuelgauge/batterysaver/BatterySaverScheduleRadioButtonsController.java
index 7b17dcb7d39..c584b9b67fb 100644
--- a/src/com/android/settings/fuelgauge/batterysaver/BatterySaverScheduleRadioButtonsController.java
+++ b/src/com/android/settings/fuelgauge/batterysaver/BatterySaverScheduleRadioButtonsController.java
@@ -22,6 +22,7 @@ import android.os.PowerManager;
import android.provider.Settings;
import android.provider.Settings.Global;
import android.text.TextUtils;
+import android.util.Log;
import com.android.settingslib.fuelgauge.BatterySaverUtils;
@@ -36,9 +37,9 @@ import com.android.settingslib.fuelgauge.BatterySaverUtils;
* See {@link Settings.Global#AUTOMATIC_POWER_SAVE_MODE} for more details.
*/
public class BatterySaverScheduleRadioButtonsController {
+ private static final String TAG = "BatterySaverScheduleRadioButtonsController";
public static final String KEY_NO_SCHEDULE = "key_battery_saver_no_schedule";
- public static final String KEY_ROUTINE = "key_battery_saver_routine";
public static final String KEY_PERCENTAGE = "key_battery_saver_percentage";
public static final int TRIGGER_LEVEL_MIN = 10;
@@ -53,20 +54,17 @@ public class BatterySaverScheduleRadioButtonsController {
public String getDefaultKey() {
final ContentResolver resolver = mContext.getContentResolver();
- // Note: this can also be obtained via PowerManager.getPowerSaveModeTrigger()
final int mode = Settings.Global.getInt(resolver, Global.AUTOMATIC_POWER_SAVE_MODE,
PowerManager.POWER_SAVE_MODE_TRIGGER_PERCENTAGE);
- // if mode is "dynamic" we are in routine mode, percentage with non-zero threshold is
- // percentage mode, otherwise it is no schedule mode
if (mode == PowerManager.POWER_SAVE_MODE_TRIGGER_PERCENTAGE) {
final int threshold =
Settings.Global.getInt(resolver, Global.LOW_POWER_MODE_TRIGGER_LEVEL, 0);
- if (threshold <= 0) {
- return KEY_NO_SCHEDULE;
- }
- return KEY_PERCENTAGE;
+ return threshold <= 0 ? KEY_NO_SCHEDULE : KEY_PERCENTAGE;
}
- return KEY_ROUTINE;
+ // Convert the legacy routine mode into none.
+ BatterySaverUtils.revertScheduleToNoneIfNeeded(mContext);
+ Log.w(TAG, "Found the legacy routine mode and set into none");
+ return KEY_NO_SCHEDULE;
}
public boolean setDefaultKey(String key) {
@@ -89,12 +87,6 @@ public class BatterySaverScheduleRadioButtonsController {
confirmationExtras.putInt(BatterySaverUtils.EXTRA_POWER_SAVE_MODE_TRIGGER_LEVEL,
triggerLevel);
break;
- case KEY_ROUTINE:
- mode = PowerManager.POWER_SAVE_MODE_TRIGGER_DYNAMIC;
- confirmationExtras.putBoolean(BatterySaverUtils.EXTRA_CONFIRM_TEXT_ONLY, true);
- confirmationExtras.putInt(BatterySaverUtils.EXTRA_POWER_SAVE_MODE_TRIGGER,
- PowerManager.POWER_SAVE_MODE_TRIGGER_DYNAMIC);
- break;
default:
throw new IllegalStateException(
"Not a valid key for " + this.getClass().getSimpleName());
diff --git a/src/com/android/settings/inputmethod/PhysicalKeyboardFragment.java b/src/com/android/settings/inputmethod/PhysicalKeyboardFragment.java
index 808129fb690..d7a208c17f9 100644
--- a/src/com/android/settings/inputmethod/PhysicalKeyboardFragment.java
+++ b/src/com/android/settings/inputmethod/PhysicalKeyboardFragment.java
@@ -20,6 +20,7 @@ import android.annotation.NonNull;
import android.annotation.Nullable;
import android.app.Activity;
import android.app.settings.SettingsEnums;
+import android.content.ContentResolver;
import android.content.Context;
import android.content.Intent;
import android.database.ContentObserver;
@@ -211,8 +212,10 @@ public final class PhysicalKeyboardFragment extends SettingsPreferenceFragment
private final OnPreferenceChangeListener mShowVirtualKeyboardSwitchPreferenceChangeListener =
(preference, newValue) -> {
- Secure.putInt(getContentResolver(), Secure.SHOW_IME_WITH_HARD_KEYBOARD,
- ((Boolean) newValue) ? 1 : 0);
+ final ContentResolver cr = getContentResolver();
+ Secure.putInt(cr, Secure.SHOW_IME_WITH_HARD_KEYBOARD, ((Boolean) newValue) ? 1 : 0);
+ cr.notifyChange(Secure.getUriFor(Secure.SHOW_IME_WITH_HARD_KEYBOARD),
+ null /* observer */, ContentResolver.NOTIFY_NO_DELAY);
return true;
};
diff --git a/src/com/android/settings/tts/OWNERS b/src/com/android/settings/tts/OWNERS
index 8d9c2c660e8..7ba7dc13d92 100644
--- a/src/com/android/settings/tts/OWNERS
+++ b/src/com/android/settings/tts/OWNERS
@@ -1,5 +1,2 @@
# Default reviewers for this and subdirectories.
rni@google.com
-
-# Emergency approvers in case the above are not available
-tmfang@google.com
\ No newline at end of file
diff --git a/src/com/android/settings/widget/SettingsMainSwitchBar.java b/src/com/android/settings/widget/SettingsMainSwitchBar.java
index 5f752f9f7d5..5ad16d79f99 100644
--- a/src/com/android/settings/widget/SettingsMainSwitchBar.java
+++ b/src/com/android/settings/widget/SettingsMainSwitchBar.java
@@ -18,7 +18,6 @@ package com.android.settings.widget;
import static com.android.settingslib.RestrictedLockUtils.EnforcedAdmin;
-import android.app.settings.SettingsEnums;
import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
@@ -55,7 +54,7 @@ public class SettingsMainSwitchBar extends MainSwitchBar {
private final MetricsFeatureProvider mMetricsFeatureProvider;
private OnBeforeCheckedChangeListener mOnBeforeListener;
- private String mMetricsTag;
+ private int mMetricsCategory;
public SettingsMainSwitchBar(Context context) {
this(context, null);
@@ -125,12 +124,7 @@ public class SettingsMainSwitchBar extends MainSwitchBar {
}
protected void onRestrictedIconClick() {
- mMetricsFeatureProvider.action(
- SettingsEnums.PAGE_UNKNOWN,
- SettingsEnums.ACTION_SETTINGS_PREFERENCE_CHANGE,
- SettingsEnums.PAGE_UNKNOWN,
- mMetricsTag + "/switch_bar|restricted",
- 1);
+ mMetricsFeatureProvider.clicked(mMetricsCategory, "switch_bar|restricted");
}
@Override
@@ -159,8 +153,8 @@ public class SettingsMainSwitchBar extends MainSwitchBar {
/**
* Set the metrics tag.
*/
- public void setMetricsTag(String tag) {
- mMetricsTag = tag;
+ public void setMetricsCategory(int category) {
+ mMetricsCategory = category;
}
private View getDelegatingView() {
@@ -168,11 +162,6 @@ public class SettingsMainSwitchBar extends MainSwitchBar {
}
private void logMetrics(boolean isChecked) {
- mMetricsFeatureProvider.action(
- SettingsEnums.PAGE_UNKNOWN,
- SettingsEnums.ACTION_SETTINGS_PREFERENCE_CHANGE,
- SettingsEnums.PAGE_UNKNOWN,
- mMetricsTag + "/switch_bar",
- isChecked ? 1 : 0);
+ mMetricsFeatureProvider.changed(mMetricsCategory, "switch_bar", isChecked ? 1 : 0);
}
}
diff --git a/tests/robotests/src/com/android/settings/dashboard/profileselector/ProfileSelectDialogTest.java b/tests/robotests/src/com/android/settings/dashboard/profileselector/ProfileSelectDialogTest.java
index e1cf52b995b..4e81ceeb437 100644
--- a/tests/robotests/src/com/android/settings/dashboard/profileselector/ProfileSelectDialogTest.java
+++ b/tests/robotests/src/com/android/settings/dashboard/profileselector/ProfileSelectDialogTest.java
@@ -53,6 +53,7 @@ public class ProfileSelectDialogTest {
private static final UserHandle NORMAL_USER = new UserHandle(1111);
private static final UserHandle REMOVED_USER = new UserHandle(2222);
+ private static final UserHandle CLONE_USER = new UserHandle(3333);
@Spy
private Context mContext = ApplicationProvider.getApplicationContext();
@@ -101,6 +102,22 @@ public class ProfileSelectDialogTest {
verify(mUserManager, times(2)).getUserInfo(REMOVED_USER.getIdentifier());
}
+ @Test
+ public void updateUserHandlesIfNeeded_removesCloneProfile() {
+ final UserInfo userInfo = new UserInfo(CLONE_USER.getIdentifier(), "clone_user", null,
+ UserInfo.FLAG_PROFILE, UserManager.USER_TYPE_PROFILE_CLONE);
+ when(mUserManager.getUserInfo(CLONE_USER.getIdentifier())).thenReturn(userInfo);
+ final Tile tile = new ActivityTile(mActivityInfo, CategoryKey.CATEGORY_HOMEPAGE);
+ tile.userHandle.add(CLONE_USER);
+ tile.userHandle.add(NORMAL_USER);
+
+ ProfileSelectDialog.updateUserHandlesIfNeeded(mContext, tile);
+
+ assertThat(tile.userHandle).hasSize(1);
+ assertThat(tile.userHandle.get(0).getIdentifier()).isEqualTo(NORMAL_USER.getIdentifier());
+ verify(mUserManager, times(1)).getUserInfo(CLONE_USER.getIdentifier());
+ }
+
@Test
public void createDialog_showsCorrectTitle() {
mContext.setTheme(R.style.Theme_AppCompat);
diff --git a/tests/unit/src/com/android/settings/fuelgauge/batterysaver/BatterySaverScheduleRadioButtonsControllerTest.java b/tests/unit/src/com/android/settings/fuelgauge/batterysaver/BatterySaverScheduleRadioButtonsControllerTest.java
index b807114f412..f708f6c843b 100644
--- a/tests/unit/src/com/android/settings/fuelgauge/batterysaver/BatterySaverScheduleRadioButtonsControllerTest.java
+++ b/tests/unit/src/com/android/settings/fuelgauge/batterysaver/BatterySaverScheduleRadioButtonsControllerTest.java
@@ -52,7 +52,7 @@ public class BatterySaverScheduleRadioButtonsControllerTest {
Settings.Global.putInt(mResolver, Global.AUTOMATIC_POWER_SAVE_MODE,
PowerManager.POWER_SAVE_MODE_TRIGGER_DYNAMIC);
assertThat(mController.getDefaultKey())
- .isEqualTo(BatterySaverScheduleRadioButtonsController.KEY_ROUTINE);
+ .isEqualTo(BatterySaverScheduleRadioButtonsController.KEY_NO_SCHEDULE);
}
@Test
@@ -73,14 +73,6 @@ public class BatterySaverScheduleRadioButtonsControllerTest {
.isEqualTo(BatterySaverScheduleRadioButtonsController.KEY_NO_SCHEDULE);
}
- @Test
- public void setDefaultKey_any_defaultsToNoScheduleIfWarningNotSeen() {
- Secure.putString(
- mContext.getContentResolver(), Secure.LOW_POWER_WARNING_ACKNOWLEDGED, "null");
- mController.setDefaultKey(BatterySaverScheduleRadioButtonsController.KEY_ROUTINE);
- assertThat(mController.getDefaultKey())
- .isEqualTo(BatterySaverScheduleRadioButtonsController.KEY_NO_SCHEDULE);
- }
@Test
public void setDefaultKey_percentage_shouldSuppressNotification() {
@@ -95,17 +87,4 @@ public class BatterySaverScheduleRadioButtonsControllerTest {
Secure.SUPPRESS_AUTO_BATTERY_SAVER_SUGGESTION, 0);
assertThat(result).isEqualTo(1);
}
-
- @Test
- public void setDefaultKey_routine_shouldSuppressNotification() {
- Secure.putInt(
- mContext.getContentResolver(), Secure.LOW_POWER_WARNING_ACKNOWLEDGED, 1);
- Settings.Global.putInt(mResolver, Global.AUTOMATIC_POWER_SAVE_MODE,
- PowerManager.POWER_SAVE_MODE_TRIGGER_DYNAMIC);
- mController.setDefaultKey(BatterySaverScheduleRadioButtonsController.KEY_ROUTINE);
-
- final int result = Settings.Secure.getInt(mResolver,
- Secure.SUPPRESS_AUTO_BATTERY_SAVER_SUGGESTION, 0);
- assertThat(result).isEqualTo(1);
- }
}