packages/apps/Settings
Revision | c2b9a8bd43febe86fa026667dbaf8d3a7ee422ee (tree) |
---|---|
Time | 2016-10-13 01:48:55 |
Author | Jaap Jan Meijer <jjmeijer88@gmai...> |
Commiter | Jaap Jan Meijer |
Merge remote-tracking branch 'cm/cm-14.0' into cm-14.0-x86
@@ -81,7 +81,10 @@ | ||
81 | 81 | <uses-permission android:name="android.permission.CHANGE_APP_IDLE_STATE" /> |
82 | 82 | <uses-permission android:name="android.permission.PEERS_MAC_ADDRESS"/> |
83 | 83 | <uses-permission android:name="android.permission.MANAGE_NOTIFICATIONS"/> |
84 | + | |
84 | 85 | <uses-permission android:name="cyanogenmod.permission.PROTECTED_APP" /> |
86 | + <uses-permission android:name="cyanogenmod.permission.WRITE_SETTINGS" /> | |
87 | + <uses-permission android:name="cyanogenmod.permission.MANAGE_PARTS" /> | |
85 | 88 | |
86 | 89 | <application android:label="@string/settings_label" |
87 | 90 | android:icon="@mipmap/ic_launcher_settings" |
@@ -3146,6 +3146,4 @@ | ||
3146 | 3146 | <string name="profiles_settings_title">情景模式</string> |
3147 | 3147 | |
3148 | 3148 | <string name="mbn_version">MBN 版本</string> |
3149 | - <string name="show_battery_percentage">显示电池电量百分比</string> | |
3150 | - <string name="show_battery_percentage_summary">在状态栏中显示电池电量百分比</string> | |
3151 | 3149 | </resources> |
@@ -283,4 +283,7 @@ | ||
283 | 283 | <string name="pa_login_incorrect_login">Login was incorrect</string> |
284 | 284 | <string name="pa_pattern_or_fingerprint_header">Must draw pattern or use fingerprint to unlock</string> |
285 | 285 | |
286 | + <!-- title for lock screen weather preference --> | |
287 | + <string name="lockscreen_weather_enabled_title">Show weather</string> | |
288 | + | |
286 | 289 | </resources> |
@@ -33,7 +33,4 @@ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
33 | 33 | |
34 | 34 | <!-- Whether to show_kernel version name --> |
35 | 35 | <bool name="def_hide_kernel_version_name">false</bool> |
36 | - <!-- Whether to show a preference item for battery percentage | |
37 | - in ("Battery") for India RJIL --> | |
38 | - <bool name="config_show_battery_percentage">false</bool> | |
39 | 36 | </resources> |
@@ -7603,7 +7603,4 @@ | ||
7603 | 7603 | <string name="lte_data_service_enabled">LTE data service enabled </string> |
7604 | 7604 | <string name="turn_off_wifi_dialog_title">Turn off Wi-Fi</string> |
7605 | 7605 | <string name="turn_off_wifi_dialog_text">Wi-Fi is turned off when Mobile HotSpot is active. To turn on Wi-Fi, please turn off Mobile HotSpot.</string> |
7606 | - <string name="show_battery_percentage">Show battery percentage</string> | |
7607 | - <string name="show_battery_percentage_summary">Show battery level percentage inside the status bar</string> | |
7608 | - | |
7609 | 7606 | </resources> |
@@ -67,6 +67,10 @@ | ||
67 | 67 | android:title="@string/sms_application_title" |
68 | 68 | settings:keywords="@string/keywords_more_default_sms_app" /> |
69 | 69 | |
70 | + <!-- Weather providers --> | |
71 | + <org.cyanogenmod.internal.cmparts.CMPartsPreference | |
72 | + android:key="weather_settings" /> | |
73 | + | |
70 | 74 | </PreferenceCategory> |
71 | 75 | |
72 | 76 | <com.android.settings.WorkOnlyCategory |
@@ -75,11 +75,6 @@ | ||
75 | 75 | android:title="@string/camera_gesture_title" |
76 | 76 | android:summary="@string/camera_gesture_desc" /> |
77 | 77 | |
78 | - <SwitchPreference | |
79 | - android:key="camera_double_tap_power_gesture" | |
80 | - android:title="@string/camera_double_tap_power_gesture_title" | |
81 | - android:summary="@string/camera_double_tap_power_gesture_desc" /> | |
82 | - | |
83 | 78 | <PreferenceScreen |
84 | 79 | android:key="screensaver" |
85 | 80 | android:title="@string/screensaver_settings_title" |
@@ -23,12 +23,6 @@ | ||
23 | 23 | android:title="@string/battery_saver" |
24 | 24 | android:fragment="com.android.settings.fuelgauge.BatterySaverSettings" /> |
25 | 25 | |
26 | - <SwitchPreference | |
27 | - android:key="battery_pct" | |
28 | - android:title="@string/show_battery_percentage" | |
29 | - android:summary="@string/show_battery_percentage_summary" | |
30 | - android:persistent="false" /> | |
31 | - | |
32 | 26 | <com.android.settings.fuelgauge.BatteryHistoryPreference |
33 | 27 | android:key="battery_history" /> |
34 | 28 |
@@ -47,4 +47,9 @@ | ||
47 | 47 | android:title="@string/lockscreen_visualizer_title" |
48 | 48 | android:defaultValue="true"/> |
49 | 49 | |
50 | + <cyanogenmod.preference.CMSecureSettingSwitchPreference | |
51 | + android:key="lock_screen_weather_enabled" | |
52 | + android:title="@string/lockscreen_weather_enabled_title" | |
53 | + android:defaultValue="false"/> | |
54 | + | |
50 | 55 | </PreferenceScreen> |
@@ -51,4 +51,9 @@ | ||
51 | 51 | android:title="@string/lockscreen_visualizer_title" |
52 | 52 | android:defaultValue="true"/> |
53 | 53 | |
54 | + <cyanogenmod.preference.CMSecureSettingSwitchPreference | |
55 | + android:key="lock_screen_weather_enabled" | |
56 | + android:title="@string/lockscreen_weather_enabled_title" | |
57 | + android:defaultValue="false"/> | |
58 | + | |
54 | 59 | </PreferenceScreen> |
@@ -52,4 +52,9 @@ | ||
52 | 52 | android:title="@string/lockscreen_visualizer_title" |
53 | 53 | android:defaultValue="true"/> |
54 | 54 | |
55 | + <cyanogenmod.preference.CMSecureSettingSwitchPreference | |
56 | + android:key="lock_screen_weather_enabled" | |
57 | + android:title="@string/lockscreen_weather_enabled_title" | |
58 | + android:defaultValue="false"/> | |
59 | + | |
55 | 60 | </PreferenceScreen> |
@@ -36,4 +36,9 @@ | ||
36 | 36 | android:title="@string/lockscreen_visualizer_title" |
37 | 37 | android:defaultValue="true"/> |
38 | 38 | |
39 | + <cyanogenmod.preference.CMSecureSettingSwitchPreference | |
40 | + android:key="lock_screen_weather_enabled" | |
41 | + android:title="@string/lockscreen_weather_enabled_title" | |
42 | + android:defaultValue="false"/> | |
43 | + | |
39 | 44 | </PreferenceScreen> |
@@ -102,7 +102,7 @@ public class AppOpsDetails extends InstrumentedFragment { | ||
102 | 102 | CharSequence label = mPm.getApplicationLabel(pkgInfo.applicationInfo); |
103 | 103 | Drawable icon = mPm.getApplicationIcon(pkgInfo.applicationInfo); |
104 | 104 | InstalledAppDetails.setupAppSnippet(appSnippet, label, icon, |
105 | - pkgInfo != null ? pkgInfo.versionName : null); | |
105 | + pkgInfo != null ? pkgInfo.versionName : null, null); | |
106 | 106 | } |
107 | 107 | |
108 | 108 | private String retrieveAppEntry() { |
@@ -475,7 +475,8 @@ public class InstalledAppDetails extends AppInfoBase | ||
475 | 475 | uninstallUpdatesItem, mAppsControlDisallowedAdmin); |
476 | 476 | } |
477 | 477 | |
478 | - menu.findItem(OPEN_PROTECTED_APPS).setVisible(mPackageInfo.applicationInfo.protect); | |
478 | + menu.findItem(OPEN_PROTECTED_APPS).setVisible(mPackageInfo != null && | |
479 | + mPackageInfo.applicationInfo != null && mPackageInfo.applicationInfo.protect); | |
479 | 480 | } |
480 | 481 | |
481 | 482 | @Override |
@@ -553,7 +554,7 @@ public class InstalledAppDetails extends AppInfoBase | ||
553 | 554 | final View appSnippet = mHeader.findViewById(R.id.app_snippet); |
554 | 555 | mState.ensureIcon(mAppEntry); |
555 | 556 | setupAppSnippet(appSnippet, mAppEntry.label, mAppEntry.icon, |
556 | - pkgInfo != null ? pkgInfo.versionName : null); | |
557 | + pkgInfo != null ? pkgInfo.versionName : null, pkgInfo.packageName); | |
557 | 558 | } |
558 | 559 | |
559 | 560 | private boolean signaturesMatch(String pkg1, String pkg2) { |
@@ -1042,7 +1043,7 @@ public class InstalledAppDetails extends AppInfoBase | ||
1042 | 1043 | } |
1043 | 1044 | |
1044 | 1045 | public static void setupAppSnippet(View appSnippet, CharSequence label, Drawable icon, |
1045 | - CharSequence versionName) { | |
1046 | + CharSequence versionName, String packageName) { | |
1046 | 1047 | LayoutInflater.from(appSnippet.getContext()).inflate(R.layout.widget_text_views, |
1047 | 1048 | (ViewGroup) appSnippet.findViewById(android.R.id.widget_frame)); |
1048 | 1049 |
@@ -1054,6 +1055,12 @@ public class InstalledAppDetails extends AppInfoBase | ||
1054 | 1055 | // Version number of application |
1055 | 1056 | TextView appVersion = (TextView) appSnippet.findViewById(R.id.widget_text1); |
1056 | 1057 | |
1058 | + if (packageName != null) { | |
1059 | + TextView appPackage = (TextView) appSnippet.findViewById(R.id.widget_text2); | |
1060 | + appPackage.setText(packageName); | |
1061 | + appPackage.setSelected(true); | |
1062 | + } | |
1063 | + | |
1057 | 1064 | if (!TextUtils.isEmpty(versionName)) { |
1058 | 1065 | appVersion.setSelected(true); |
1059 | 1066 | appVersion.setVisibility(View.VISIBLE); |
@@ -28,8 +28,6 @@ import android.os.Process; | ||
28 | 28 | import android.os.UserHandle; |
29 | 29 | import android.support.v7.preference.Preference; |
30 | 30 | import android.support.v7.preference.PreferenceGroup; |
31 | -import android.support.v14.preference.SwitchPreference; | |
32 | -import android.provider.Settings; | |
33 | 31 | import android.text.TextUtils; |
34 | 32 | import android.util.SparseArray; |
35 | 33 | import android.util.TypedValue; |
@@ -58,7 +56,6 @@ import java.util.List; | ||
58 | 56 | */ |
59 | 57 | public class PowerUsageSummary extends PowerUsageBase { |
60 | 58 | |
61 | - public static final String SHOW_PERCENT_SETTING = "status_bar_show_battery_percent"; | |
62 | 59 | private static final boolean DEBUG = false; |
63 | 60 | |
64 | 61 | private static final boolean USE_FAKE_DATA = false; |
@@ -67,7 +64,6 @@ public class PowerUsageSummary extends PowerUsageBase { | ||
67 | 64 | |
68 | 65 | private static final String KEY_APP_LIST = "app_list"; |
69 | 66 | private static final String KEY_BATTERY_HISTORY = "battery_history"; |
70 | - private static final String KEY_BATTERY_PCT = "battery_pct"; | |
71 | 67 | |
72 | 68 | private static final int MENU_STATS_TYPE = Menu.FIRST; |
73 | 69 | private static final int MENU_HIGH_POWER_APPS = Menu.FIRST + 3; |
@@ -75,10 +71,8 @@ public class PowerUsageSummary extends PowerUsageBase { | ||
75 | 71 | |
76 | 72 | private BatteryHistoryPreference mHistPref; |
77 | 73 | private PreferenceGroup mAppListGroup; |
78 | - private SwitchPreference mBatteryPct; | |
79 | 74 | |
80 | 75 | private int mStatsType = BatteryStats.STATS_SINCE_CHARGED; |
81 | - private boolean isShowBatteryPct; | |
82 | 76 | |
83 | 77 | private static final int MIN_POWER_THRESHOLD_MILLI_AMP = 5; |
84 | 78 | private static final int MAX_ITEMS_TO_LIST = USE_FAKE_DATA ? 30 : 10; |
@@ -93,11 +87,6 @@ public class PowerUsageSummary extends PowerUsageBase { | ||
93 | 87 | addPreferencesFromResource(R.xml.power_usage_summary); |
94 | 88 | mHistPref = (BatteryHistoryPreference) findPreference(KEY_BATTERY_HISTORY); |
95 | 89 | mAppListGroup = (PreferenceGroup) findPreference(KEY_APP_LIST); |
96 | - mBatteryPct = (SwitchPreference) findPreference(KEY_BATTERY_PCT); | |
97 | - isShowBatteryPct = getResources().getBoolean(R.bool.config_show_battery_percentage); | |
98 | - if (!isShowBatteryPct) { | |
99 | - getPreferenceScreen().removePreference(mBatteryPct); | |
100 | - } | |
101 | 90 | } |
102 | 91 | |
103 | 92 | @Override |
@@ -108,9 +97,6 @@ public class PowerUsageSummary extends PowerUsageBase { | ||
108 | 97 | @Override |
109 | 98 | public void onResume() { |
110 | 99 | super.onResume(); |
111 | - if (isShowBatteryPct) { | |
112 | - updateBatteryPct(); | |
113 | - } | |
114 | 100 | refreshStats(); |
115 | 101 | } |
116 | 102 |
@@ -493,24 +479,4 @@ public class PowerUsageSummary extends PowerUsageBase { | ||
493 | 479 | return new SummaryProvider(activity, summaryLoader); |
494 | 480 | } |
495 | 481 | }; |
496 | - | |
497 | - private void updateBatteryPct() { | |
498 | - if (mBatteryPct != null) { | |
499 | - mBatteryPct.setChecked( | |
500 | - Settings.System.getInt(getContext().getContentResolver(), | |
501 | - SHOW_PERCENT_SETTING, 0) != 0); | |
502 | - mBatteryPct.setOnPreferenceChangeListener(mBatteryPctChange); | |
503 | - } | |
504 | - } | |
505 | - | |
506 | - private final Preference.OnPreferenceChangeListener mBatteryPctChange = | |
507 | - new Preference.OnPreferenceChangeListener() { | |
508 | - @Override | |
509 | - public boolean onPreferenceChange(Preference preference, Object newValue) { | |
510 | - final boolean v = (Boolean) newValue; | |
511 | - Settings.System.putInt(getContext().getContentResolver(), | |
512 | - SHOW_PERCENT_SETTING, v ? 1 : 0); | |
513 | - return true; | |
514 | - } | |
515 | - }; | |
516 | 482 | } |
@@ -161,6 +161,7 @@ public class Index { | ||
161 | 161 | private static final String NODE_NAME_PREFERENCE_SCREEN = "PreferenceScreen"; |
162 | 162 | private static final String NODE_NAME_CHECK_BOX_PREFERENCE = "CheckBoxPreference"; |
163 | 163 | private static final String NODE_NAME_LIST_PREFERENCE = "ListPreference"; |
164 | + private static final String NODE_NAME_SWITCH_PREFERENCE = "SwitchPreference"; | |
164 | 165 | |
165 | 166 | private static final List<String> EMPTY_LIST = Collections.<String>emptyList(); |
166 | 167 |
@@ -900,7 +901,8 @@ public class Index { | ||
900 | 901 | title = getDataTitle(context, attrs); |
901 | 902 | keywords = getDataKeywords(context, attrs); |
902 | 903 | |
903 | - if (!nodeName.equals(NODE_NAME_CHECK_BOX_PREFERENCE)) { | |
904 | + if (!nodeName.endsWith(NODE_NAME_CHECK_BOX_PREFERENCE) && | |
905 | + !nodeName.endsWith(NODE_NAME_SWITCH_PREFERENCE)) { | |
904 | 906 | summary = getDataSummary(context, attrs); |
905 | 907 | |
906 | 908 | String entries = null; |