Merge "Update strings"
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index a007f99..90aa55f 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -1236,10 +1236,6 @@
android:configChanges="orientation|keyboardHidden|screenSize"
android:parentActivityName="Settings">
<intent-filter>
- <action android:name="android.settings.PRIVACY_SETTINGS" />
- <category android:name="android.intent.category.DEFAULT" />
- </intent-filter>
- <intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.VOICE_LAUNCH" />
@@ -1250,6 +1246,17 @@
android:value="true" />
</activity>
+ <activity android:name="Settings$PrivacyDashboardActivity"
+ android:label="@string/privacy_dashboard_title"
+ android:icon="@drawable/ic_settings_privacy">
+ <intent-filter>
+ <action android:name="android.settings.PRIVACY_SETTINGS" />
+ <category android:name="android.intent.category.DEFAULT" />
+ </intent-filter>
+ <meta-data android:name="com.android.settings.FRAGMENT_CLASS"
+ android:value="com.android.settings.privacy.PrivacyDashboardFragment" />
+ </activity>
+
<activity android:name="SetFullBackupPassword"
android:label="@string/local_backup_password_title"
android:exported="false" />
diff --git a/proguard.flags b/proguard.flags
index d509dba..b66a786 100644
--- a/proguard.flags
+++ b/proguard.flags
@@ -9,7 +9,7 @@
-keep public class com.android.settings.** extends androidx.fragment.app.Fragment
# Keep all preference controllers needed by slice and DashboardFragment.
--keep class !com.google.android.settings.aware.*, * extends com.android.settings.core.BasePreferenceController {
+-keep class * extends com.android.settings.core.BasePreferenceController {
*;
}
diff --git a/res/layout/preference_balance_slider.xml b/res/layout/preference_balance_slider.xml
new file mode 100644
index 0000000..32010c3
--- /dev/null
+++ b/res/layout/preference_balance_slider.xml
@@ -0,0 +1,109 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2019 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<LinearLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:minHeight="?android:attr/listPreferredItemHeightSmall"
+ android:gravity="center_vertical"
+ android:paddingStart="?android:attr/listPreferredItemPaddingStart"
+ android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
+ android:clickable="false"
+ android:orientation="horizontal">
+
+ <LinearLayout
+ android:id="@+id/icon_frame"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:minWidth="56dp"
+ android:gravity="start|center_vertical"
+ android:orientation="horizontal"
+ android:paddingEnd="12dp"
+ android:paddingTop="4dp"
+ android:paddingBottom="4dp">
+ <com.android.internal.widget.PreferenceImageView
+ android:id="@android:id/icon"
+ android:layout_width="24dp"
+ android:layout_height="24dp"/>
+ </LinearLayout>
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical"
+ android:layout_marginTop="8dp"
+ android:layout_marginBottom="8dp">
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content">
+ <TextView
+ android:id="@android:id/title"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:singleLine="true"
+ android:textAppearance="@*android:style/TextAppearance.Material.Subhead"
+ android:textColor="?android:attr/textColorPrimary"
+ android:ellipsize="marquee"
+ android:fadingEdge="horizontal"/>
+ <LinearLayout
+ android:id="@android:id/widget_frame"
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent"
+ android:gravity="center_vertical"
+ android:orientation="vertical"/>
+ </LinearLayout>
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical">
+
+ <com.android.settings.accessibility.BalanceSeekBar
+ android:id="@*android:id/seekbar"
+ android:layout_gravity="center_vertical"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"/>
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center_vertical"
+ android:orientation="horizontal">
+ <TextView
+ android:id="@+id/left_text"
+ android:text="@string/accessibility_toggle_master_balance_left_label"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:maxLines="1"
+ android:textAlignment="viewStart" />
+ <TextView
+ android:id="@+id/right_text"
+ android:text="@string/accessibility_toggle_master_balance_right_label"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:maxLines="1"
+ android:textAlignment="viewEnd" />
+
+ </LinearLayout>
+ </LinearLayout>
+ </LinearLayout>
+
+</LinearLayout>
diff --git a/res/values/bools.xml b/res/values/bools.xml
deleted file mode 100644
index a5043a2..0000000
--- a/res/values/bools.xml
+++ /dev/null
@@ -1,191 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2009 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<resources>
- <!-- Whether or not the dock settings are to be displayed for this device when docked -->
- <bool name="has_dock_settings">false</bool>
- <!-- Whether there is a boot sounds checkbox -->
- <bool name="has_boot_sounds">false</bool>
- <!-- Whether there is a silent mode checkbox -->
- <bool name="has_silent_mode">true</bool>
-
- <!-- Display additional System Update menu if true -->
- <bool name="config_additional_system_update_setting_enable">false</bool>
-
- <!-- Whether the bluetooth activation confirmation dialogs should be auto dismissed.
- Can be overridden for specific product builds. -->
- <bool name="auto_confirm_bluetooth_activation_dialog">false</bool>
-
- <!-- Whether the device name is shown in About device or not -->
- <bool name="config_show_device_name">true</bool>
-
- <!-- Whether to show a preference item for the manual in About phone -->
- <bool name="config_show_manual">false</bool>
- <!-- Whether to show a preference item for regulatory information in About phone -->
- <bool name="config_show_regulatory_info">false</bool>
-
- <!-- Whether to show a preference item for mobile plan -->
- <bool name="config_show_mobile_plan">true</bool>
-
- <!-- Whether none security option is hide or not (country specific). -->
- <bool name="config_hide_none_security_option">false</bool>
-
- <!-- Whether swipe security option is hidden or not -->
- <bool name="config_hide_swipe_security_option">false</bool>
-
- <!--Whether help links are defined. -->
- <bool name="config_has_help">false</bool>
-
- <!-- Whether Wi-Fi settings should be shown or not.
- This also controls whether Wi-fi related sub-settings (e.g. Wi-Fi preferences) will
- surface in search results or not.-->
- <bool name="config_show_wifi_settings">true</bool>
-
- <!-- Whether toggle_airplane is available or not. -->
- <bool name="config_show_toggle_airplane">true</bool>
-
- <!-- Whether private_dns_settings is available or not. -->
- <bool name="config_show_private_dns_settings">true</bool>
-
- <!-- Whether memory from app_info_settings is available or not. -->
- <bool name="config_show_app_info_settings_memory">false</bool>
-
- <!-- Whether battery from app_info_settings is available or not. -->
- <bool name="config_show_app_info_settings_battery">true</bool>
-
- <!-- Whether location mode is available or not. -->
- <bool name="config_location_mode_available">true</bool>
-
- <!-- Whether location scanning is available or not. -->
- <bool name="config_show_location_scanning">true</bool>
-
- <!-- Whether high_power_apps should be shown or not. -->
- <bool name="config_show_high_power_apps">true</bool>
-
- <!-- Whether media_volume should be shown or not. -->
- <bool name="config_show_media_volume">true</bool>
-
- <!-- Whether alarm_volume should be shown or not. -->
- <bool name="config_show_alarm_volume">true</bool>
-
- <!-- Whether call_volume should be shown or not. -->
- <bool name="config_show_call_volume">true</bool>
-
- <!-- Whether notification_volume should be shown or not. -->
- <bool name="config_show_notification_volume">true</bool>
-
- <!-- Whether notification_ringtone should be shown or not. -->
- <bool name="config_show_notification_ringtone">true</bool>
-
- <!-- Whether screen_locking_sounds should be shown or not. -->
- <bool name="config_show_screen_locking_sounds">true</bool>
-
- <!-- Whether charging_sounds should be shown or not. -->
- <bool name="config_show_charging_sounds">true</bool>
-
- <!-- Whether touch_sounds should be shown or not. -->
- <bool name="config_show_touch_sounds">true</bool>
-
- <!-- Whether encryption_and_credentials_encryption_status should be shown or not. -->
- <bool name="config_show_encryption_and_credentials_encryption_status">true</bool>
-
- <!-- Whether premium_sms should be shown or not. -->
- <bool name="config_show_premium_sms">true</bool>
-
- <!-- Whether data_saver should be shown or not. -->
- <bool name="config_show_data_saver">true</bool>
-
- <!-- Whether enabled_vr_listeners should be shown or not. -->
- <bool name="config_show_enabled_vr_listeners">true</bool>
-
- <!-- Whether phone_language should be shown or not. -->
- <bool name="config_show_phone_language">true</bool>
-
- <!-- Whether virtual_keyboard_pref should be shown or not. -->
- <bool name="config_show_virtual_keyboard_pref">true</bool>
-
- <!-- Whether physical_keyboard_pref should be shown or not. -->
- <bool name="config_show_physical_keyboard_pref">true</bool>
-
- <!-- Whether spellcheckers_settings should be shown or not. -->
- <bool name="config_show_spellcheckers_settings">true</bool>
-
- <!-- Whether tts_settings_summary should be shown or not. -->
- <bool name="config_show_tts_settings_summary">true</bool>
-
- <!-- Whether pointer_speed should be shown or not. -->
- <bool name="config_show_pointer_speed">true</bool>
-
- <!-- Whether vibrate_input_devices should be shown or not. -->
- <bool name="config_show_vibrate_input_devices">true</bool>
-
- <!-- Whether manage_device_admin should be shown or not. -->
- <bool name="config_show_manage_device_admin">true</bool>
-
- <!-- Whether unlock_set_or_change should be shown or not. -->
- <bool name="config_show_unlock_set_or_change">true</bool>
-
- <!-- Whether screen_pinning_settings should be shown or not. -->
- <bool name="config_show_screen_pinning_settings">true</bool>
-
- <!-- Whether manage_trust_agents should be shown or not. -->
- <bool name="config_show_manage_trust_agents">true</bool>
-
- <!-- Whether show_password should be shown or not. -->
- <bool name="config_show_show_password">true</bool>
-
- <!-- Whether trust_agent_click_intent should be shown or not. -->
- <bool name="config_show_trust_agent_click_intent">true</bool>
-
- <!-- Whether wallpaper attribution should be shown or not. -->
- <bool name="config_show_wallpaper_attribution">true</bool>
-
- <!-- Whether default_home should be shown or not. -->
- <bool name="config_show_default_home">true</bool>
-
- <!-- Whether assist_and_voice_input should be shown or not. -->
- <bool name="config_show_assist_and_voice_input">true</bool>
-
- <!-- Whether reset_dashboard should be shown or not. -->
- <bool name="config_show_reset_dashboard">true</bool>
-
- <!-- Whether system_update_settings should be shown or not. -->
- <bool name="config_show_system_update_settings">true</bool>
-
- <!-- Whether device_model should be shown or not. -->
- <bool name="config_show_device_model">true</bool>
-
- <!-- Whether top_level_battery should be shown or not. -->
- <bool name="config_show_top_level_battery">true</bool>
-
- <!-- Whether top_level_connected_devices should be shown or not. -->
- <bool name="config_show_top_level_connected_devices">true</bool>
-
- <!-- Whether top_level_display should be shown or not. -->
- <bool name="config_show_top_level_display">true</bool>
-
- <!-- Whether wifi_ip_address should be shown or not. -->
- <bool name="config_show_wifi_ip_address">true</bool>
-
- <!-- Whether wifi_mac_address should be shown or not. -->
- <bool name="config_show_wifi_mac_address">true</bool>
-
- <!-- Whether to disable "Uninstall Updates" menu item for System apps or not. -->
- <bool name="config_disable_uninstall_update">false</bool>
-
- <!-- Whether or not extra preview panels should be used for screen zoom setting. -->
- <bool name="config_enable_extra_screen_zoom_preview">true</bool>
-</resources>
diff --git a/res/values/colors.xml b/res/values/colors.xml
index da01be0..f6723a8 100644
--- a/res/values/colors.xml
+++ b/res/values/colors.xml
@@ -15,9 +15,6 @@
-->
<resources>
- <color name="black">#000</color>
- <color name="red">#F00</color>
- <color name="blue">#00F</color>
<color name="bluetooth_dialog_text_color">#8a000000</color>
diff --git a/res/values/config.xml b/res/values/config.xml
index 0e46200..3023067 100755
--- a/res/values/config.xml
+++ b/res/values/config.xml
@@ -179,4 +179,178 @@
<!-- App intent -->
<string name="config_account_intent_uri" translatable="false"></string>
+
+ <!-- Whether or not the dock settings are to be displayed for this device when docked -->
+ <bool name="has_dock_settings">false</bool>
+ <!-- Whether there is a boot sounds checkbox -->
+ <bool name="has_boot_sounds">false</bool>
+ <!-- Whether there is a silent mode checkbox -->
+ <bool name="has_silent_mode">true</bool>
+
+ <!-- Display additional System Update menu if true -->
+ <bool name="config_additional_system_update_setting_enable">false</bool>
+
+ <!-- Whether the bluetooth activation confirmation dialogs should be auto dismissed.
+ Can be overridden for specific product builds. -->
+ <bool name="auto_confirm_bluetooth_activation_dialog">false</bool>
+
+ <!-- Whether the device name is shown in About device or not -->
+ <bool name="config_show_device_name">true</bool>
+
+ <!-- Whether to show a preference item for the manual in About phone -->
+ <bool name="config_show_manual">false</bool>
+ <!-- Whether to show a preference item for regulatory information in About phone -->
+ <bool name="config_show_regulatory_info">false</bool>
+
+ <!-- Whether to show a preference item for mobile plan -->
+ <bool name="config_show_mobile_plan">true</bool>
+
+ <!-- Whether none security option is hide or not (country specific). -->
+ <bool name="config_hide_none_security_option">false</bool>
+
+ <!-- Whether swipe security option is hidden or not -->
+ <bool name="config_hide_swipe_security_option">false</bool>
+
+ <!--Whether help links are defined. -->
+ <bool name="config_has_help">false</bool>
+
+ <!-- Whether Wi-Fi settings should be shown or not.
+ This also controls whether Wi-fi related sub-settings (e.g. Wi-Fi preferences) will
+ surface in search results or not.-->
+ <bool name="config_show_wifi_settings">true</bool>
+
+ <!-- Whether toggle_airplane is available or not. -->
+ <bool name="config_show_toggle_airplane">true</bool>
+
+ <!-- Whether private_dns_settings is available or not. -->
+ <bool name="config_show_private_dns_settings">true</bool>
+
+ <!-- Whether memory from app_info_settings is available or not. -->
+ <bool name="config_show_app_info_settings_memory">false</bool>
+
+ <!-- Whether battery from app_info_settings is available or not. -->
+ <bool name="config_show_app_info_settings_battery">true</bool>
+
+ <!-- Whether location mode is available or not. -->
+ <bool name="config_location_mode_available">true</bool>
+
+ <!-- Whether location scanning is available or not. -->
+ <bool name="config_show_location_scanning">true</bool>
+
+ <!-- Whether high_power_apps should be shown or not. -->
+ <bool name="config_show_high_power_apps">true</bool>
+
+ <!-- Whether media_volume should be shown or not. -->
+ <bool name="config_show_media_volume">true</bool>
+
+ <!-- Whether alarm_volume should be shown or not. -->
+ <bool name="config_show_alarm_volume">true</bool>
+
+ <!-- Whether call_volume should be shown or not. -->
+ <bool name="config_show_call_volume">true</bool>
+
+ <!-- Whether notification_volume should be shown or not. -->
+ <bool name="config_show_notification_volume">true</bool>
+
+ <!-- Whether notification_ringtone should be shown or not. -->
+ <bool name="config_show_notification_ringtone">true</bool>
+
+ <!-- Whether screen_locking_sounds should be shown or not. -->
+ <bool name="config_show_screen_locking_sounds">true</bool>
+
+ <!-- Whether charging_sounds should be shown or not. -->
+ <bool name="config_show_charging_sounds">true</bool>
+
+ <!-- Whether touch_sounds should be shown or not. -->
+ <bool name="config_show_touch_sounds">true</bool>
+
+ <!-- Whether encryption_and_credentials_encryption_status should be shown or not. -->
+ <bool name="config_show_encryption_and_credentials_encryption_status">true</bool>
+
+ <!-- Whether premium_sms should be shown or not. -->
+ <bool name="config_show_premium_sms">true</bool>
+
+ <!-- Whether data_saver should be shown or not. -->
+ <bool name="config_show_data_saver">true</bool>
+
+ <!-- Whether enabled_vr_listeners should be shown or not. -->
+ <bool name="config_show_enabled_vr_listeners">true</bool>
+
+ <!-- Whether phone_language should be shown or not. -->
+ <bool name="config_show_phone_language">true</bool>
+
+ <!-- Whether virtual_keyboard_pref should be shown or not. -->
+ <bool name="config_show_virtual_keyboard_pref">true</bool>
+
+ <!-- Whether physical_keyboard_pref should be shown or not. -->
+ <bool name="config_show_physical_keyboard_pref">true</bool>
+
+ <!-- Whether spellcheckers_settings should be shown or not. -->
+ <bool name="config_show_spellcheckers_settings">true</bool>
+
+ <!-- Whether tts_settings_summary should be shown or not. -->
+ <bool name="config_show_tts_settings_summary">true</bool>
+
+ <!-- Whether pointer_speed should be shown or not. -->
+ <bool name="config_show_pointer_speed">true</bool>
+
+ <!-- Whether vibrate_input_devices should be shown or not. -->
+ <bool name="config_show_vibrate_input_devices">true</bool>
+
+ <!-- Whether manage_device_admin should be shown or not. -->
+ <bool name="config_show_manage_device_admin">true</bool>
+
+ <!-- Whether unlock_set_or_change should be shown or not. -->
+ <bool name="config_show_unlock_set_or_change">true</bool>
+
+ <!-- Whether screen_pinning_settings should be shown or not. -->
+ <bool name="config_show_screen_pinning_settings">true</bool>
+
+ <!-- Whether manage_trust_agents should be shown or not. -->
+ <bool name="config_show_manage_trust_agents">true</bool>
+
+ <!-- Whether show_password should be shown or not. -->
+ <bool name="config_show_show_password">true</bool>
+
+ <!-- Whether trust_agent_click_intent should be shown or not. -->
+ <bool name="config_show_trust_agent_click_intent">true</bool>
+
+ <!-- Whether wallpaper attribution should be shown or not. -->
+ <bool name="config_show_wallpaper_attribution">true</bool>
+
+ <!-- Whether default_home should be shown or not. -->
+ <bool name="config_show_default_home">true</bool>
+
+ <!-- Whether assist_and_voice_input should be shown or not. -->
+ <bool name="config_show_assist_and_voice_input">true</bool>
+
+ <!-- Whether reset_dashboard should be shown or not. -->
+ <bool name="config_show_reset_dashboard">true</bool>
+
+ <!-- Whether system_update_settings should be shown or not. -->
+ <bool name="config_show_system_update_settings">true</bool>
+
+ <!-- Whether device_model should be shown or not. -->
+ <bool name="config_show_device_model">true</bool>
+
+ <!-- Whether top_level_battery should be shown or not. -->
+ <bool name="config_show_top_level_battery">true</bool>
+
+ <!-- Whether top_level_connected_devices should be shown or not. -->
+ <bool name="config_show_top_level_connected_devices">true</bool>
+
+ <!-- Whether top_level_display should be shown or not. -->
+ <bool name="config_show_top_level_display">true</bool>
+
+ <!-- Whether wifi_ip_address should be shown or not. -->
+ <bool name="config_show_wifi_ip_address">true</bool>
+
+ <!-- Whether wifi_mac_address should be shown or not. -->
+ <bool name="config_show_wifi_mac_address">true</bool>
+
+ <!-- Whether to disable "Uninstall Updates" menu item for System apps or not. -->
+ <bool name="config_disable_uninstall_update">false</bool>
+
+ <!-- Whether or not extra preview panels should be used for screen zoom setting. -->
+ <bool name="config_enable_extra_screen_zoom_preview">true</bool>
</resources>
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index 0a35188..d42f073 100755
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -38,6 +38,9 @@
<dimen name="volume_seekbar_side_margin">8dip</dimen>
+ <dimen name="balance_seekbar_center_marker_height">14dp</dimen>
+ <dimen name="balance_seekbar_center_marker_width">1dp</dimen>
+
<dimen name="crypt_clock_size">100sp</dimen>
<dimen name="divider_height">3dip</dimen>
diff --git a/res/values/donottranslate.xml b/res/values/donottranslate.xml
index 611e2b4..e6bd9a6 100644
--- a/res/values/donottranslate.xml
+++ b/res/values/donottranslate.xml
@@ -33,8 +33,4 @@
<item>@string/input_method_selector_always_show_value</item>
<item>@string/input_method_selector_always_hide_value</item>
</string-array>
- <string name="category_key_wireless">com.android.settings.category.wireless</string>
- <string name="category_key_device">com.android.settings.category.device</string>
- <string name="category_key_personal">com.android.settings.category.personal</string>
- <string name="category_key_system">com.android.settings.category.system</string>
</resources>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 8101114..c891432 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -4717,6 +4717,12 @@
<string name="accessibility_toggle_master_mono_title">Mono audio</string>
<!-- Summary for the accessibility preference for master mono. [CHAR LIMIT=50] -->
<string name="accessibility_toggle_master_mono_summary">Combine channels when playing audio</string>
+ <!-- Title for the accessibility preference for master balance. [CHAR LIMIT=35] -->
+ <string name="accessibility_toggle_master_balance_title">Audio balance</string>
+ <!-- 'Left' balance text for the accessibility preference for master balance. [CHAR LIMIT=20] -->
+ <string name="accessibility_toggle_master_balance_left_label">Left</string>
+ <!-- 'Right' balance text for the accessibility preference for master balance. [CHAR LIMIT=20] -->
+ <string name="accessibility_toggle_master_balance_right_label">Right</string>
<!-- Option heading to leave the timeout requirement for accessibility users at its default level. [CHAR LIMIT=35] -->
<string name="accessibility_timeout_default">Default</string>
@@ -5851,9 +5857,9 @@
<!-- Summary for whether to enable SMS access restriction [CHAR LIMIT=NONE]-->
<string name="sms_access_restriction_enabled_summary">Only default phone and messaging apps have SMS & call log permissions</string>
<!-- Title for the new device identifier access restrictions [CHAR LIMIT=50]-->
- <string name="device_identifier_access_restrictions_title">Enable device identifier restrictions</string>
+ <string name="device_identifier_access_restrictions_title">Disable device identifier restrictions</string>
<!-- Summary for the new device identifier access restrictions [CHAR LIMIT=NONE]-->
- <string name="device_identifier_access_restrictions_summary">Enable the new access restrictions for device identifiers.</string>
+ <string name="device_identifier_access_restrictions_summary">Disable the new access restrictions for device identifiers</string>
<!-- Message when there are no available trust agents to display -->
diff --git a/res/values/styles.xml b/res/values/styles.xml
index 6d153e1..935bbf2 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -419,7 +419,7 @@
<item name="android:layout_marginBottom">@dimen/homepage_card_vertical_margin</item>
<item name="android:layout_marginStart">@dimen/homepage_card_side_margin</item>
<item name="android:layout_marginEnd">@dimen/homepage_card_side_margin</item>
- <item name="cardCornerRadius">8dp</item>
+ <item name="cardCornerRadius">@*android:dimen/config_dialogCornerRadius</item>
<item name="cardElevation">0dp</item>
<item name="strokeColor">@color/homepage_card_stroke_color</item>
<item name="strokeWidth">1dp</item>
diff --git a/res/xml/accessibility_settings.xml b/res/xml/accessibility_settings.xml
index cc07ce1..9cb73a2 100644
--- a/res/xml/accessibility_settings.xml
+++ b/res/xml/accessibility_settings.xml
@@ -130,6 +130,10 @@
android:summary="@string/accessibility_toggle_master_mono_summary"
android:persistent="false"/>
+ <com.android.settings.accessibility.BalanceSeekBarPreference
+ android:key="seekbar_master_balance"
+ android:title="@string/accessibility_toggle_master_balance_title" />
+
<Preference
android:key="hearing_aid_preference"
android:summary="@string/accessibility_hearingaid_not_connected_summary"
diff --git a/src/com/android/settings/Settings.java b/src/com/android/settings/Settings.java
index 8cff5f1..e7f543a 100644
--- a/src/com/android/settings/Settings.java
+++ b/src/com/android/settings/Settings.java
@@ -71,6 +71,7 @@
public static class AppUsageAccessSettingsActivity extends SettingsActivity { /* empty */ }
public static class LocationSettingsActivity extends SettingsActivity { /* empty */ }
public static class ScanningSettingsActivity extends SettingsActivity { /* empty */ }
+ public static class PrivacyDashboardActivity extends SettingsActivity { /* empty */ }
public static class PrivacySettingsActivity extends SettingsActivity { /* empty */ }
public static class FactoryResetActivity extends SettingsActivity { /* empty */ }
public static class RunningServicesActivity extends SettingsActivity { /* empty */ }
diff --git a/src/com/android/settings/accessibility/BalanceSeekBar.java b/src/com/android/settings/accessibility/BalanceSeekBar.java
new file mode 100644
index 0000000..e18a593
--- /dev/null
+++ b/src/com/android/settings/accessibility/BalanceSeekBar.java
@@ -0,0 +1,152 @@
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.settings.accessibility;
+
+import android.content.Context;
+import android.content.res.ColorStateList;
+import android.content.res.Resources;
+import android.graphics.Canvas;
+import android.graphics.Color;
+import android.graphics.Paint;
+import android.graphics.Rect;
+import android.os.UserHandle;
+import android.provider.Settings;
+import android.util.AttributeSet;
+import android.widget.SeekBar;
+
+import com.android.settings.R;
+
+/**
+ * A custom seekbar for the balance setting.
+ *
+ * Adds a center line indicator between left and right, which snaps to if close.
+ * Updates Settings.System for balance on progress changed.
+ */
+public class BalanceSeekBar extends SeekBar {
+ private static final String TAG = "BalanceSeekBar";
+ private final Context mContext;
+ private final Object mListenerLock = new Object();
+ private OnSeekBarChangeListener mOnSeekBarChangeListener;
+ private final OnSeekBarChangeListener mProxySeekBarListener = new OnSeekBarChangeListener() {
+ @Override
+ public void onStopTrackingTouch(SeekBar seekBar) {
+ synchronized(mListenerLock) {
+ if (mOnSeekBarChangeListener != null) {
+ mOnSeekBarChangeListener.onStopTrackingTouch(seekBar);
+ }
+ }
+ }
+
+ @Override
+ public void onStartTrackingTouch(SeekBar seekBar) {
+ synchronized(mListenerLock) {
+ if (mOnSeekBarChangeListener != null) {
+ mOnSeekBarChangeListener.onStartTrackingTouch(seekBar);
+ }
+ }
+ }
+
+ @Override
+ public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
+ if (fromUser) {
+ // Snap to centre when within the specified threshold
+ if (progress != mCenter
+ && progress > mCenter - mSnapThreshold
+ && progress < mCenter + mSnapThreshold) {
+ progress = mCenter;
+ seekBar.setProgress(progress); // direct update (fromUser becomes false)
+ }
+ final float balance = (progress - mCenter) * 0.01f;
+ Settings.System.putFloatForUser(mContext.getContentResolver(),
+ Settings.System.MASTER_BALANCE, balance, UserHandle.USER_CURRENT);
+ }
+ // If fromUser is false, the call is a set from the framework on creation or on
+ // internal update. The progress may be zero, ignore (don't change system settings).
+
+ // after adjusting the seekbar, notify downstream listener.
+ // note that progress may have been adjusted in the code above to mCenter.
+ synchronized(mListenerLock) {
+ if (mOnSeekBarChangeListener != null) {
+ mOnSeekBarChangeListener.onProgressChanged(seekBar, progress, fromUser);
+ }
+ }
+ }
+ };
+
+ // Percentage of max to be used as a snap to threshold
+ private static final float SNAP_TO_PERCENTAGE = 0.03f;
+ private final Paint mCenterMarkerPaint;
+ private final Rect mCenterMarkerRect;
+ // changed in setMax()
+ private float mSnapThreshold;
+ private int mCenter;
+
+ public BalanceSeekBar(Context context, AttributeSet attrs) {
+ this(context, attrs, com.android.internal.R.attr.seekBarStyle);
+ }
+
+ public BalanceSeekBar(Context context, AttributeSet attrs, int defStyleAttr) {
+ this(context, attrs, defStyleAttr, 0 /* defStyleRes */);
+ }
+
+ public BalanceSeekBar(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
+ super(context, attrs, defStyleAttr, defStyleRes);
+ mContext = context;
+ Resources res = getResources();
+ mCenterMarkerRect = new Rect(0 /* left */, 0 /* top */,
+ res.getDimensionPixelSize(R.dimen.balance_seekbar_center_marker_width),
+ res.getDimensionPixelSize(R.dimen.balance_seekbar_center_marker_height));
+ mCenterMarkerPaint = new Paint();
+ // TODO use a more suitable colour?
+ mCenterMarkerPaint.setColor(Color.BLACK);
+ mCenterMarkerPaint.setStyle(Paint.Style.FILL);
+ // Remove the progress colour
+ setProgressTintList(ColorStateList.valueOf(Color.TRANSPARENT));
+
+ super.setOnSeekBarChangeListener(mProxySeekBarListener);
+ }
+
+ @Override
+ public void setOnSeekBarChangeListener(OnSeekBarChangeListener listener) {
+ synchronized(mListenerLock) {
+ mOnSeekBarChangeListener = listener;
+ }
+ }
+
+ // Note: the superclass AbsSeekBar.setMax is synchronized.
+ @Override
+ public synchronized void setMax(int max) {
+ super.setMax(max);
+ // update snap to threshold
+ mCenter = max / 2;
+ mSnapThreshold = max * SNAP_TO_PERCENTAGE;
+ }
+
+ // Note: the superclass AbsSeekBar.onDraw is synchronized.
+ @Override
+ protected synchronized void onDraw(Canvas canvas) {
+ // Draw a vertical line at 50% that represents centred balance
+ int seekBarCenter = (canvas.getHeight() - getPaddingBottom()) / 2;
+ canvas.save();
+ canvas.translate((canvas.getWidth() - mCenterMarkerRect.right) / 2,
+ seekBarCenter - (mCenterMarkerRect.bottom / 2));
+ canvas.drawRect(mCenterMarkerRect, mCenterMarkerPaint);
+ canvas.restore();
+ super.onDraw(canvas);
+ }
+}
+
diff --git a/src/com/android/settings/accessibility/BalanceSeekBarPreference.java b/src/com/android/settings/accessibility/BalanceSeekBarPreference.java
new file mode 100644
index 0000000..a40282c
--- /dev/null
+++ b/src/com/android/settings/accessibility/BalanceSeekBarPreference.java
@@ -0,0 +1,70 @@
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.settings.accessibility;
+
+import android.content.Context;
+import android.media.AudioSystem;
+import android.os.UserHandle;
+import android.provider.Settings;
+import android.util.AttributeSet;
+import android.view.View;
+import android.widget.ImageView;
+import android.widget.SeekBar;
+
+import androidx.core.content.res.TypedArrayUtils;
+import androidx.preference.Preference;
+import androidx.preference.PreferenceViewHolder;
+
+import com.android.settings.R;
+import com.android.settings.widget.SeekBarPreference;
+
+/** A slider preference that directly controls audio balance **/
+public class BalanceSeekBarPreference extends SeekBarPreference {
+ private static final String TAG = "BalanceSeekBarPreference";
+ private final Context mContext;
+ private BalanceSeekBar mSeekBar;
+ private ImageView mIconView;
+
+ public BalanceSeekBarPreference(Context context, AttributeSet attrs) {
+ super(context, attrs, TypedArrayUtils.getAttr(context,
+ R.attr.preferenceStyle,
+ android.R.attr.preferenceStyle));
+ mContext = context;
+ setLayoutResource(R.layout.preference_balance_slider);
+ }
+
+ @Override
+ public void onBindViewHolder(PreferenceViewHolder view) {
+ super.onBindViewHolder(view);
+ mSeekBar = (BalanceSeekBar) view.findViewById(com.android.internal.R.id.seekbar);
+ mIconView = (ImageView) view.findViewById(com.android.internal.R.id.icon);
+ init();
+ }
+
+ private void init() {
+ if (mSeekBar == null) {
+ return;
+ }
+ final float balance = Settings.System.getFloatForUser(
+ mContext.getContentResolver(), Settings.System.MASTER_BALANCE,
+ 0.f /* default */, UserHandle.USER_CURRENT);
+ // Rescale balance to range 0-200 centered at 100.
+ mSeekBar.setMax(200);
+ mSeekBar.setProgress((int)(balance * 100.f) + 100);
+ mSeekBar.setEnabled(isEnabled());
+ }
+}
diff --git a/src/com/android/settings/core/gateway/SettingsGateway.java b/src/com/android/settings/core/gateway/SettingsGateway.java
index bb292a1..fb3d0c5 100644
--- a/src/com/android/settings/core/gateway/SettingsGateway.java
+++ b/src/com/android/settings/core/gateway/SettingsGateway.java
@@ -274,6 +274,7 @@
Settings.StorageDashboardActivity.class.getName(),
Settings.PowerUsageSummaryActivity.class.getName(),
Settings.AccountDashboardActivity.class.getName(),
+ Settings.PrivacySettingsActivity.class.getName(),
Settings.SecurityDashboardActivity.class.getName(),
Settings.AccessibilitySettingsActivity.class.getName(),
Settings.SystemDashboardActivity.class.getName(),
diff --git a/src/com/android/settings/development/DeviceIdentifierAccessRestrictionsPreferenceController.java b/src/com/android/settings/development/DeviceIdentifierAccessRestrictionsPreferenceController.java
index 1fdbe77..05ac8c7 100644
--- a/src/com/android/settings/development/DeviceIdentifierAccessRestrictionsPreferenceController.java
+++ b/src/com/android/settings/development/DeviceIdentifierAccessRestrictionsPreferenceController.java
@@ -50,12 +50,12 @@
private void writeSetting(boolean isEnabled) {
DeviceConfig.setProperty(DeviceConfig.Privacy.NAMESPACE,
DeviceConfig.Privacy.PROPERTY_DEVICE_IDENTIFIER_ACCESS_RESTRICTIONS_DISABLED,
- String.valueOf(!isEnabled), false);
+ String.valueOf(isEnabled), false);
}
@Override
public void updateState(Preference preference) {
- boolean isEnabled = !Boolean.parseBoolean(
+ boolean isEnabled = Boolean.parseBoolean(
DeviceConfig.getProperty(DeviceConfig.Privacy.NAMESPACE,
DeviceConfig.Privacy.PROPERTY_DEVICE_IDENTIFIER_ACCESS_RESTRICTIONS_DISABLED));
((SwitchPreference) mPreference).setChecked(isEnabled);
@@ -64,7 +64,7 @@
@Override
protected void onDeveloperOptionsSwitchDisabled() {
super.onDeveloperOptionsSwitchDisabled();
- writeSetting(true);
+ writeSetting(false);
((SwitchPreference) mPreference).setChecked(true);
}
}
diff --git a/src/com/android/settings/display/NightDisplayPreference.java b/src/com/android/settings/display/NightDisplayPreference.java
index 82e2596..7020c49 100644
--- a/src/com/android/settings/display/NightDisplayPreference.java
+++ b/src/com/android/settings/display/NightDisplayPreference.java
@@ -16,26 +16,25 @@
import android.content.Context;
import android.hardware.display.ColorDisplayManager;
+import android.hardware.display.NightDisplayListener;
import android.util.AttributeSet;
import androidx.preference.SwitchPreference;
-import com.android.internal.app.ColorDisplayController;
-
import java.time.LocalTime;
public class NightDisplayPreference extends SwitchPreference
- implements ColorDisplayController.Callback {
+ implements NightDisplayListener.Callback {
private ColorDisplayManager mColorDisplayManager;
- private ColorDisplayController mController;
+ private NightDisplayListener mNightDisplayListener;
private NightDisplayTimeFormatter mTimeFormatter;
public NightDisplayPreference(Context context, AttributeSet attrs) {
super(context, attrs);
mColorDisplayManager = context.getSystemService(ColorDisplayManager.class);
- mController = new ColorDisplayController(context);
+ mNightDisplayListener = new NightDisplayListener(context);
mTimeFormatter = new NightDisplayTimeFormatter(context);
}
@@ -44,7 +43,7 @@
super.onAttached();
// Listen for changes only while attached.
- mController.setListener(this);
+ mNightDisplayListener.setCallback(this);
// Update the summary since the state may have changed while not attached.
updateSummary();
@@ -55,7 +54,7 @@
super.onDetached();
// Stop listening for state changes.
- mController.setListener(null);
+ mNightDisplayListener.setCallback(null);
}
@Override
diff --git a/src/com/android/settings/display/NightDisplaySettings.java b/src/com/android/settings/display/NightDisplaySettings.java
index 4896b53..6441d71 100644
--- a/src/com/android/settings/display/NightDisplaySettings.java
+++ b/src/com/android/settings/display/NightDisplaySettings.java
@@ -21,12 +21,12 @@
import android.app.settings.SettingsEnums;
import android.content.Context;
import android.hardware.display.ColorDisplayManager;
+import android.hardware.display.NightDisplayListener;
import android.os.Bundle;
import android.provider.SearchIndexableResource;
import androidx.preference.Preference;
-import com.android.internal.app.ColorDisplayController;
import com.android.settings.R;
import com.android.settings.dashboard.DashboardFragment;
import com.android.settings.search.BaseSearchIndexProvider;
@@ -43,7 +43,7 @@
*/
@SearchIndexable(forTarget = SearchIndexable.ALL & ~SearchIndexable.ARC)
public class NightDisplaySettings extends DashboardFragment
- implements ColorDisplayController.Callback {
+ implements NightDisplayListener.Callback {
private static final String TAG = "NightDisplaySettings";
@@ -51,7 +51,7 @@
private static final int DIALOG_END_TIME = 1;
private ColorDisplayManager mColorDisplayManager;
- private ColorDisplayController mController;
+ private NightDisplayListener mNightDisplayListener;
@Override
public void onCreate(Bundle savedInstanceState) {
@@ -59,7 +59,7 @@
final Context context = getContext();
mColorDisplayManager = context.getSystemService(ColorDisplayManager.class);
- mController = new ColorDisplayController(context);
+ mNightDisplayListener = new NightDisplayListener(context);
}
@Override
@@ -67,7 +67,7 @@
super.onStart();
// Listen for changes only while visible.
- mController.setListener(this);
+ mNightDisplayListener.setCallback(this);
}
@Override
@@ -75,7 +75,7 @@
super.onStop();
// Stop listening for state changes.
- mController.setListener(null);
+ mNightDisplayListener.setCallback(null);
}
@Override
diff --git a/src/com/android/settings/homepage/contextualcards/conditional/NightDisplayConditionController.java b/src/com/android/settings/homepage/contextualcards/conditional/NightDisplayConditionController.java
index a673e46..347d4eb 100644
--- a/src/com/android/settings/homepage/contextualcards/conditional/NightDisplayConditionController.java
+++ b/src/com/android/settings/homepage/contextualcards/conditional/NightDisplayConditionController.java
@@ -19,7 +19,8 @@
import android.app.settings.SettingsEnums;
import android.content.Context;
-import com.android.internal.app.ColorDisplayController;
+import android.hardware.display.ColorDisplayManager;
+import android.hardware.display.NightDisplayListener;
import com.android.settings.R;
import com.android.settings.core.SubSettingLauncher;
import com.android.settings.display.NightDisplaySettings;
@@ -28,17 +29,20 @@
import java.util.Objects;
public class NightDisplayConditionController implements ConditionalCardController,
- ColorDisplayController.Callback {
+ NightDisplayListener.Callback {
+
static final int ID = Objects.hash("NightDisplayConditionController");
private final Context mAppContext;
private final ConditionManager mConditionManager;
- private final ColorDisplayController mController;
+ private final ColorDisplayManager mColorDisplayManager;
+ private final NightDisplayListener mNightDisplayListener;
public NightDisplayConditionController(Context appContext, ConditionManager manager) {
- mController = new ColorDisplayController(appContext);
mAppContext = appContext;
mConditionManager = manager;
+ mColorDisplayManager = appContext.getSystemService(ColorDisplayManager.class);
+ mNightDisplayListener = new NightDisplayListener(appContext);
}
@Override
@@ -48,7 +52,7 @@
@Override
public boolean isDisplayable() {
- return mController.isActivated();
+ return mColorDisplayManager.isNightDisplayActivated();
}
@Override
@@ -62,7 +66,7 @@
@Override
public void onActionClick() {
- mController.setActivated(false);
+ mColorDisplayManager.setNightDisplayActivated(false);
}
@Override
@@ -84,12 +88,12 @@
@Override
public void startMonitoringStateChange() {
- mController.setListener(this);
+ mNightDisplayListener.setCallback(this);
}
@Override
public void stopMonitoringStateChange() {
- mController.setListener(null);
+ mNightDisplayListener.setCallback(null);
}
@Override
diff --git a/src/com/android/settings/network/telephony/MobileDataPreferenceController.java b/src/com/android/settings/network/telephony/MobileDataPreferenceController.java
index 9ebeda0..47822b6 100644
--- a/src/com/android/settings/network/telephony/MobileDataPreferenceController.java
+++ b/src/com/android/settings/network/telephony/MobileDataPreferenceController.java
@@ -118,7 +118,8 @@
@Override
public boolean isChecked() {
- return mTelephonyManager.isDataEnabled();
+ return mTelephonyManager.isDataEnabled()
+ && mSubId == SubscriptionManager.getDefaultDataSubscriptionId();
}
public void init(FragmentManager fragmentManager, int subId) {
@@ -129,7 +130,7 @@
@VisibleForTesting
boolean isDialogNeeded() {
- final boolean enableData = !mTelephonyManager.isDataEnabled();
+ final boolean enableData = !isChecked();
final boolean isMultiSim = (mTelephonyManager.getSimCount() > 1);
final int defaultSubId = mSubscriptionManager.getDefaultDataSubscriptionId();
final boolean needToDisableOthers = mSubscriptionManager
diff --git a/src/com/android/settings/password/ConfirmDeviceCredentialActivity.java b/src/com/android/settings/password/ConfirmDeviceCredentialActivity.java
index db0935d..236e3d9 100644
--- a/src/com/android/settings/password/ConfirmDeviceCredentialActivity.java
+++ b/src/com/android/settings/password/ConfirmDeviceCredentialActivity.java
@@ -157,7 +157,6 @@
boolean frp = KeyguardManager.ACTION_CONFIRM_FRP_CREDENTIAL.equals(intent.getAction());
mUserId = UserHandle.myUserId();
- final int effectiveUserId = mUserManager.getCredentialOwnerProfile(mUserId);
if (isInternalActivity()) {
try {
mUserId = Utils.getUserIdFromBundle(this, intent.getExtras());
@@ -165,6 +164,7 @@
Log.e(TAG, "Invalid intent extra", se);
}
}
+ final int effectiveUserId = mUserManager.getCredentialOwnerProfile(mUserId);
final boolean isManagedProfile = UserManager.get(this).isManagedProfile(mUserId);
// if the client app did not hand in a title and we are about to show the work challenge,
// check whether there is a policy setting the organization name and use that as title
diff --git a/src/com/android/settings/sim/SimDialogActivity.java b/src/com/android/settings/sim/SimDialogActivity.java
index 987826c..13148c8 100644
--- a/src/com/android/settings/sim/SimDialogActivity.java
+++ b/src/com/android/settings/sim/SimDialogActivity.java
@@ -118,7 +118,10 @@
private static void setDefaultDataSubId(final Context context, final int subId) {
final SubscriptionManager subscriptionManager = SubscriptionManager.from(context);
+ final TelephonyManager telephonyManager = TelephonyManager.from(context)
+ .createForSubscriptionId(subId);
subscriptionManager.setDefaultDataSubId(subId);
+ telephonyManager.setDataEnabled(true);
Toast.makeText(context, R.string.data_switch_started, Toast.LENGTH_LONG).show();
}
diff --git a/tests/robotests/src/com/android/settings/backup/BackupSettingsHelperTest.java b/tests/robotests/src/com/android/settings/backup/BackupSettingsHelperTest.java
index ee8912a..5587783 100644
--- a/tests/robotests/src/com/android/settings/backup/BackupSettingsHelperTest.java
+++ b/tests/robotests/src/com/android/settings/backup/BackupSettingsHelperTest.java
@@ -31,16 +31,13 @@
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
-import android.content.pm.UserInfo;
import android.content.res.Resources;
import android.os.IBinder;
import android.os.RemoteException;
-
import android.os.UserHandle;
-import android.os.UserManager;
+
import com.android.settings.R;
-import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -57,8 +54,6 @@
@RunWith(RobolectricTestRunner.class)
@Config(shadows = BackupSettingsHelperTest.ShadowBackupManagerStub.class)
public class BackupSettingsHelperTest {
- private static final String DEFAULT_SETTINGS_CLASSNAME =
- "com.android.settings.Settings$PrivacySettingsActivity";
private static final int DEFAULT_SUMMARY_RESOURCE =
R.string.backup_configure_account_default_summary;
@@ -295,16 +290,6 @@
}
@Test
- public void testGetIntentForBackupSettings_WithoutIntentFromTransport() throws Exception {
- when(mBackupManager.getDataManagementIntent(anyString())).thenReturn(null);
-
- Intent backupIntent = mBackupSettingsHelper.getIntentForBackupSettings();
-
- assertThat(backupIntent.getComponent().getClassName())
- .isEqualTo(DEFAULT_SETTINGS_CLASSNAME);
- }
-
- @Test
public void testGetLabelForBackupSettings_WithLabelFromTransport() throws Exception {
String label = "test_label";
diff --git a/tests/robotests/src/com/android/settings/network/telephony/MobileDataPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/network/telephony/MobileDataPreferenceControllerTest.java
index e0bfce4..4c242c1 100644
--- a/tests/robotests/src/com/android/settings/network/telephony/MobileDataPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/network/telephony/MobileDataPreferenceControllerTest.java
@@ -20,7 +20,6 @@
import static com.google.common.truth.Truth.assertThat;
-import static org.mockito.ArgumentMatchers.anyInt;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.spy;
@@ -31,10 +30,6 @@
import android.telephony.SubscriptionManager;
import android.telephony.TelephonyManager;
-import androidx.fragment.app.FragmentManager;
-import androidx.fragment.app.FragmentTransaction;
-import androidx.preference.SwitchPreference;
-
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -42,10 +37,18 @@
import org.mockito.MockitoAnnotations;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.RuntimeEnvironment;
+import org.robolectric.annotation.Config;
+import org.robolectric.shadows.ShadowSubscriptionManager;
+
+import androidx.fragment.app.FragmentManager;
+import androidx.fragment.app.FragmentTransaction;
+import androidx.preference.SwitchPreference;
@RunWith(RobolectricTestRunner.class)
+@Config(shadows = ShadowSubscriptionManager.class)
public class MobileDataPreferenceControllerTest {
private static final int SUB_ID = 2;
+ private static final int SUB_ID_OTHER = 3;
@Mock
private FragmentManager mFragmentManager;
@@ -78,6 +81,7 @@
mPreference = new SwitchPreference(mContext);
mController = new MobileDataPreferenceController(mContext, "mobile_data");
+ ShadowSubscriptionManager.setDefaultDataSubscriptionId(SUB_ID);
mController.init(mFragmentManager, SUB_ID);
mPreference.setKey(mController.getPreferenceKey());
}
@@ -104,7 +108,8 @@
public void isDialogNeeded_enableNonDefaultSimInMultiSimMode_returnTrue() {
doReturn(false).when(mTelephonyManager).isDataEnabled();
doReturn(mSubscriptionInfo).when(mSubscriptionManager).getActiveSubscriptionInfo(SUB_ID);
- doReturn(true).when(mSubscriptionManager).isActiveSubscriptionId(anyInt());
+ doReturn(true).when(mSubscriptionManager).isActiveSubscriptionId(SUB_ID_OTHER);
+ ShadowSubscriptionManager.setDefaultDataSubscriptionId(SUB_ID_OTHER);
doReturn(2).when(mTelephonyManager).getSimCount();
assertThat(mController.isDialogNeeded()).isTrue();