Merge "Link overlay emergency app by feature flag"
diff --git a/res/drawable/ic_launcher_settings.xml b/res/drawable/ic_launcher_settings.xml
index cdf9e35..9ede59d 100644
--- a/res/drawable/ic_launcher_settings.xml
+++ b/res/drawable/ic_launcher_settings.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
- <background android:drawable="@*android:color/accent_device_default_light"/>
+ <background android:drawable="@color/icon_launcher_setting_color"/>
<foreground android:drawable="@mipmap/ic_launcher_settings"/>
</adaptive-icon>
diff --git a/res/values/colors.xml b/res/values/colors.xml
index 34885b4..5dfc0b9 100644
--- a/res/values/colors.xml
+++ b/res/values/colors.xml
@@ -149,5 +149,8 @@
<color name="face_anim_particle_color_3">#ff4caf50</color> <!-- Material Green 500 -->
<color name="face_anim_particle_color_4">#fffdd835</color> <!-- Material Yellow 600 -->
<color name="face_anim_particle_error">#ff9e9e9e</color> <!-- Material Gray 500 -->
+
+ <!-- launcher icon color -->
+ <color name="icon_launcher_setting_color">@*android:color/accent_device_default_light</color>
</resources>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index e93e06f..d8d084d 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -5424,9 +5424,9 @@
<string name="battery_saver_turn_on_automatically_pct">at <xliff:g id="percent">%1$s</xliff:g> battery</string>
<!-- [CHAR_LIMIT=40] Battery percentage: Title -->
- <string name="battery_percentage">Battery percentage</string>
+ <string name="battery_info">Battery Information</string>
<!-- [CHAR_LIMIT=NONE] Battery percentage: Description for preference -->
- <string name="battery_percentage_description">Show battery percentage in status bar</string>
+ <string name="battery_info_description">Show percentage and time left before charge is needed</string>
<!-- Process Stats strings -->
<skip />
@@ -10079,6 +10079,9 @@
<!-- Title for HFP(hands free profile) output switch button in settings. -->
<string name="take_call_on_title">Take call on</string>
+ <!-- Toast that appears when users tap an APN for which parameters cannot be viewed. [CHAR LIMIT=NONE] -->
+ <string name="cannot_change_apn_toast">This APN cannot be changed.</string>
+
<!-- Title for battery Suggestion. (tablet) [CHAR LIMIT=46] -->
<string name="battery_suggestion_title" product="tablet" >Improve tablet\'s battery life</string>
<!-- Title for battery Suggestion. (device) [CHAR LIMIT=46] -->
diff --git a/res/xml/app_data_usage.xml b/res/xml/app_data_usage.xml
index 5eaee96..e64a1c5 100644
--- a/res/xml/app_data_usage.xml
+++ b/res/xml/app_data_usage.xml
@@ -21,7 +21,8 @@
android:title="@string/data_usage_app_summary_title">
<com.android.settings.datausage.SpinnerPreference
- android:key="cycle" />
+ android:key="cycle"
+ settings:isPreferenceVisible="false" />
<PreferenceCategory
android:key="app_data_usage_summary_category">
diff --git a/res/xml/power_usage_summary.xml b/res/xml/power_usage_summary.xml
index b4db4ed..48e1276 100644
--- a/res/xml/power_usage_summary.xml
+++ b/res/xml/power_usage_summary.xml
@@ -50,8 +50,8 @@
<SwitchPreference
android:key="battery_percentage"
- android:title="@string/battery_percentage"
- android:summary="@string/battery_percentage_description"
+ android:title="@string/battery_info"
+ android:summary="@string/battery_info_description"
settings:controller="com.android.settings.display.BatteryPercentagePreferenceController" />
diff --git a/res/xml/zen_mode_settings.xml b/res/xml/zen_mode_settings.xml
index 1966484..2014308 100644
--- a/res/xml/zen_mode_settings.xml
+++ b/res/xml/zen_mode_settings.xml
@@ -37,11 +37,6 @@
android:title="@string/zen_mode_messages_title"
android:fragment="com.android.settings.notification.ZenModeMessagesSettings" />
- <!-- Alarms -->
- <SwitchPreference
- android:key="zen_mode_behavior_alarms"
- android:title="@string/zen_mode_alarms"/>
-
<!-- All sounds -->
<Preference
android:key="zen_sound_vibration_settings"
diff --git a/src/com/android/settings/network/ApnPreference.java b/src/com/android/settings/network/ApnPreference.java
index a7fbb6e..f039539 100755
--- a/src/com/android/settings/network/ApnPreference.java
+++ b/src/com/android/settings/network/ApnPreference.java
@@ -27,6 +27,7 @@
import android.view.View;
import android.widget.CompoundButton;
import android.widget.RadioButton;
+import android.widget.Toast;
import androidx.preference.Preference;
import androidx.preference.PreferenceViewHolder;
@@ -54,6 +55,7 @@
private static CompoundButton mCurrentChecked = null;
private boolean mProtectFromCheckedChange = false;
private boolean mSelectable = true;
+ private boolean mHideDetails = false;
@Override
public void onBindViewHolder(PreferenceViewHolder view) {
@@ -113,6 +115,11 @@
super.onClick();
Context context = getContext();
if (context != null) {
+ if (mHideDetails) {
+ Toast.makeText(context, context.getString(
+ R.string.cannot_change_apn_toast), Toast.LENGTH_LONG).show();
+ return;
+ }
int pos = Integer.parseInt(getKey());
Uri url = ContentUris.withAppendedId(Telephony.Carriers.CONTENT_URI, pos);
Intent editIntent = new Intent(Intent.ACTION_EDIT, url);
@@ -132,4 +139,8 @@
public void setSubId(int subId) {
mSubId = subId;
}
+
+ public void setHideDetails() {
+ mHideDetails = true;
+ }
}
diff --git a/src/com/android/settings/network/ApnSettings.java b/src/com/android/settings/network/ApnSettings.java
index a71dfaa..3b1e14c 100755
--- a/src/com/android/settings/network/ApnSettings.java
+++ b/src/com/android/settings/network/ApnSettings.java
@@ -78,12 +78,23 @@
public static final String MVNO_TYPE = "mvno_type";
public static final String MVNO_MATCH_DATA = "mvno_match_data";
+ private static final String[] CARRIERS_PROJECTION = new String[] {
+ Telephony.Carriers._ID,
+ Telephony.Carriers.NAME,
+ Telephony.Carriers.APN,
+ Telephony.Carriers.TYPE,
+ Telephony.Carriers.MVNO_TYPE,
+ Telephony.Carriers.MVNO_MATCH_DATA,
+ Telephony.Carriers.EDITED,
+ };
+
private static final int ID_INDEX = 0;
private static final int NAME_INDEX = 1;
private static final int APN_INDEX = 2;
private static final int TYPES_INDEX = 3;
private static final int MVNO_TYPE_INDEX = 4;
private static final int MVNO_MATCH_DATA_INDEX = 5;
+ private static final int EDITED_INDEX = 6;
private static final int MENU_NEW = Menu.FIRST;
private static final int MENU_RESTORE = Menu.FIRST + 1;
@@ -116,6 +127,7 @@
private boolean mHideImsApn;
private boolean mAllowAddingApns;
+ private boolean mHidePresetApnDetails;
public ApnSettings() {
super(UserManager.DISALLOW_CONFIG_MOBILE_NETWORKS);
@@ -196,6 +208,7 @@
mAllowAddingApns = false;
}
}
+ mHidePresetApnDetails = b.getBoolean(CarrierConfigManager.KEY_HIDE_PRESET_APN_DETAILS_BOOL);
mUserManager = UserManager.get(activity);
}
@@ -277,9 +290,8 @@
where.append(" AND NOT (type='ims')");
}
- Cursor cursor = getContentResolver().query(Telephony.Carriers.CONTENT_URI, new String[] {
- "_id", "name", "apn", "type", "mvno_type", "mvno_match_data"}, where.toString(),
- null, Telephony.Carriers.DEFAULT_SORT_ORDER);
+ Cursor cursor = getContentResolver().query(Telephony.Carriers.CONTENT_URI,
+ CARRIERS_PROJECTION, where.toString(), null, Telephony.Carriers.DEFAULT_SORT_ORDER);
if (cursor != null) {
IccRecords r = null;
@@ -304,14 +316,19 @@
String type = cursor.getString(TYPES_INDEX);
String mvnoType = cursor.getString(MVNO_TYPE_INDEX);
String mvnoMatchData = cursor.getString(MVNO_MATCH_DATA_INDEX);
+ int edited = cursor.getInt(EDITED_INDEX);
ApnPreference pref = new ApnPreference(getPrefContext());
pref.setKey(key);
pref.setTitle(name);
- pref.setSummary(apn);
pref.setPersistent(false);
pref.setSubId(subId);
+ if (mHidePresetApnDetails && edited == Telephony.Carriers.UNEDITED) {
+ pref.setHideDetails();
+ } else {
+ pref.setSummary(apn);
+ }
boolean selectable = ((type == null) || !type.equals("mms"));
pref.setSelectable(selectable);
diff --git a/src/com/android/settings/notification/ZenModeSettings.java b/src/com/android/settings/notification/ZenModeSettings.java
index 3a270d2..293c429 100644
--- a/src/com/android/settings/notification/ZenModeSettings.java
+++ b/src/com/android/settings/notification/ZenModeSettings.java
@@ -86,8 +86,6 @@
"zen_mode_behavior_calls"));
controllers.add(new ZenModeMessagesPreferenceController(context, lifecycle,
"zen_mode_behavior_messages"));
- controllers.add(new ZenModeAlarmsPreferenceController(context, lifecycle,
- "zen_mode_behavior_alarms"));
controllers.add(new ZenModeBlockedEffectsPreferenceController(context, lifecycle));
controllers.add(new ZenModeDurationPreferenceController(context, lifecycle));
controllers.add(new ZenModeAutomationPreferenceController(context));
diff --git a/src/com/android/settings/widget/EntityHeaderController.java b/src/com/android/settings/widget/EntityHeaderController.java
index 853313f..267838c 100644
--- a/src/com/android/settings/widget/EntityHeaderController.java
+++ b/src/com/android/settings/widget/EntityHeaderController.java
@@ -321,7 +321,7 @@
}
actionBar.setBackgroundDrawable(
new ColorDrawable(
- Utils.getColorAttrDefaultColor(activity, android.R.attr.colorPrimary)));
+ Utils.getColorAttrDefaultColor(activity, android.R.attr.colorPrimaryDark)));
actionBar.setElevation(0);
if (mRecyclerView != null && mLifecycle != null) {
ActionBarShadowController.attachToRecyclerView(mActivity, mLifecycle, mRecyclerView);