Snap for 9685341 from 4f98350ba3 to udc-release

Change-Id: I4a583e7d2c086801694dad576e0f7e9e788512d7
This commit is contained in:
Android Build Coastguard Worker
2023-03-04 06:35:18 +00:00
7 changed files with 459 additions and 447 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -5123,9 +5123,9 @@
<!-- Charge to full button for battery defender tips [CHAR LIMIT=NONE] -->
<string name="battery_tip_charge_to_full_button">Charge to full</string>
<!-- Title of incompatible charging battery tip [CHAR LIMIT=NONE] -->
<string name="battery_tip_incompatible_charging_title">Incompatible charging setup</string>
<string name="battery_tip_incompatible_charging_title">Issue with charging accessory</string>
<!-- Message of incompatible charging battery tip [CHAR LIMIT=NONE] -->
<string name="battery_tip_incompatible_charging_message">Your battery is not charging or is charging very slowly</string>
<string name="battery_tip_incompatible_charging_message">Battery charging slowly or won\'t charge. Check if the cable and power adapter work with your phone</string>
<!-- Content description for the incompatible charging battery tip button [CHAR LIMIT=NONE] -->
<string name="battery_tip_incompatible_charging_content_description">Learn more about incompatible charging</string>
@@ -5275,6 +5275,9 @@
<!-- Battery Saver: Title for sticky battery saver preference [CHAR_LIMIT=60] -->
<string name="battery_saver_sticky_title_new">Turn off when charged</string>
<!-- Battery Saver: Title for sticky battery saver preference with percentage [CHAR_LIMIT=60] -->
<string name="battery_saver_sticky_title_percentage">Turn off at <xliff:g id="battery_percentage" example="80%">%1$s</xliff:g></string>
<!-- Battery Saver: Description for sticky battery saver preference [CHAR_LIMIT=NONE] -->
<string name="battery_saver_sticky_description_new">Battery Saver turns off when battery reaches <xliff:g id="battery_percentage" example="80%">%1$s</xliff:g></string>

View File

@@ -131,14 +131,14 @@
<Preference
android:fragment="com.android.settings.accessibility.FlashNotificationsPreferenceFragment"
android:key="flash_notifications_preference"
android:order="18"
android:order="19"
android:persistent="false"
android:title="@string/flash_notifications_title"
settings:controller="com.android.settings.accessibility.FlashNotificationsPreferenceController" />
<com.android.settingslib.RestrictedPreference
android:key="app_and_notif_cell_broadcast_settings"
android:order="19"
android:order="20"
android:title="@string/cell_broadcast_settings"
settings:useAdminDisabledSummary="true">
<intent
@@ -149,33 +149,33 @@
<SwitchPreference
android:key="silent_icons"
android:order="20"
android:order="21"
android:title="@string/silent_notifications_status_bar"
settings:controller="com.android.settings.notification.SilentStatusBarPreferenceController"/>
<SwitchPreference
android:key="show_snooze_options"
android:order="21"
android:order="22"
android:title="@string/snooze_options_title"
settings:controller="com.android.settings.notification.SnoozeNotificationPreferenceController" />
<!-- Notification badging -->
<SwitchPreference
android:key="notification_badging"
android:order="22"
android:order="23"
android:title="@string/notification_badging_title"
settings:controller="com.android.settings.notification.BadgingNotificationPreferenceController"/>
<!-- Pulse notification light, on devices that support it -->
<SwitchPreference
android:key="notification_pulse"
android:order="23"
android:order="24"
android:title="@string/notification_pulse_title"
settings:controller="com.android.settings.notification.PulseNotificationPreferenceController"/>
<com.android.settingslib.PrimarySwitchPreference
android:key="notification_assistant"
android:order="24"
android:order="25"
android:title="@string/notification_assistant_title"
android:summary="@string/notification_assistant_summary"
settings:controller="com.android.settings.notification.NotificationAssistantPreferenceController"/>

View File

@@ -14,6 +14,7 @@ import com.android.settings.core.TogglePreferenceController;
public class BatterySaverStickyPreferenceController extends TogglePreferenceController implements
PreferenceControllerMixin, Preference.OnPreferenceChangeListener {
private static final int DEFAULT_STICKY_SHUTOFF_LEVEL = 90;
private Context mContext;
@@ -39,10 +40,13 @@ public class BatterySaverStickyPreferenceController extends TogglePreferenceCont
@Override
protected void refreshSummary(Preference preference) {
super.refreshSummary(preference);
final int stickyShutoffLevel = Settings.Global.getInt(
mContext.getContentResolver(), Global.LOW_POWER_MODE_STICKY_AUTO_DISABLE_LEVEL, 90);
final int stickyShutoffLevel = Settings.Global.getInt(mContext.getContentResolver(),
Global.LOW_POWER_MODE_STICKY_AUTO_DISABLE_LEVEL, DEFAULT_STICKY_SHUTOFF_LEVEL);
final String formatPercentage = Utils.formatPercentage(stickyShutoffLevel);
preference.setTitle(mContext.getString(R.string.battery_saver_sticky_title_percentage,
formatPercentage));
preference.setSummary(mContext.getString(R.string.battery_saver_sticky_description_new,
Utils.formatPercentage(stickyShutoffLevel)));
formatPercentage));
}
@Override

View File

@@ -51,6 +51,7 @@ public class BatteryManagerPreferenceController extends BasePreferenceController
@Override
public int getAvailabilityStatus() {
return mPowerUsageFeatureProvider.isBatteryManagerSupported()
&& mPowerUsageFeatureProvider.isAdaptiveChargingSupported()
? AVAILABLE_UNSEARCHABLE : UNSUPPORTED_ON_DEVICE;
}

View File

@@ -61,12 +61,6 @@ public class TopLevelBatteryPreferenceControllerTest {
assertThat(mController.getAvailabilityStatus()).isEqualTo(AVAILABLE);
}
@Test
@Config(qualifiers = "mcc999")
public void getAvailabilityStatus_unsupportedWhenSet() {
assertThat(mController.getAvailabilityStatus()).isEqualTo(UNSUPPORTED_ON_DEVICE);
}
@Test
public void convertClassPathToComponentName_nullInput_returnsNull() {
assertThat(mController.convertClassPathToComponentName(null)).isNull();
@@ -118,4 +112,4 @@ public class TopLevelBatteryPreferenceControllerTest {
assertThat(mController.getSummary())
.isEqualTo(mContext.getString(R.string.battery_missing_message));
}
}
}

View File

@@ -86,6 +86,7 @@ public class BatteryManagerPreferenceControllerTest {
@Test
public void getAvailabilityStatus_supportBatteryManager_showPrefPage() {
when(mPowerUsageFeatureProvider.isBatteryManagerSupported()).thenReturn(true);
when(mPowerUsageFeatureProvider.isAdaptiveChargingSupported()).thenReturn(true);
assertThat(mController.getAvailabilityStatus()).isEqualTo(
BatteryManagerPreferenceController.AVAILABLE_UNSEARCHABLE);
@@ -98,4 +99,13 @@ public class BatteryManagerPreferenceControllerTest {
assertThat(mController.getAvailabilityStatus()).isEqualTo(
BatteryManagerPreferenceController.UNSUPPORTED_ON_DEVICE);
}
@Test
public void getAvailabilityStatus_supportBatteryManagerWithoutAC_notShowPrefPage() {
when(mPowerUsageFeatureProvider.isBatteryManagerSupported()).thenReturn(true);
when(mPowerUsageFeatureProvider.isAdaptiveChargingSupported()).thenReturn(false);
assertThat(mController.getAvailabilityStatus()).isEqualTo(
BatteryManagerPreferenceController.UNSUPPORTED_ON_DEVICE);
}
}