diff options
author | Abhisek Devkota <ciwrl@cyanogenmod.com> | 2014-12-02 15:31:44 -0800 |
---|---|---|
committer | Steve Kondik <steve@cyngn.com> | 2015-11-13 09:01:09 +0100 |
commit | 1bf1d26827d35dca4564c4195bf86bc629c1e93b (patch) | |
tree | cc81b6b5c383339133fa85afc503fbf8921aa1d9 | |
parent | e2bdd4895c967771c6c31b4a037cbd85092e4abf (diff) | |
download | packages_apps_Settings-1bf1d26827d35dca4564c4195bf86bc629c1e93b.zip packages_apps_Settings-1bf1d26827d35dca4564c4195bf86bc629c1e93b.tar.gz packages_apps_Settings-1bf1d26827d35dca4564c4195bf86bc629c1e93b.tar.bz2 |
Move Blacklist and Notif Filter to Privacy
Match CM 11
Change-Id: I5e3f9c26b68a89ba1622d95e2d0e4f4a93361c5e
Cleanup Security/Privacy settings code
Cleanup:
* Mismerges
* Code style
* Copyright headers
* File permissions
Change-Id: I6c34586680f0ccbaa613a0acfee366113c32a81c
-rw-r--r-- | res/values/cm_arrays.xml | 31 | ||||
-rw-r--r-- | res/values/cm_strings.xml | 26 | ||||
-rw-r--r-- | res/xml/privacy_settings_cyanogenmod.xml | 19 | ||||
-rw-r--r-- | res/xml/security_settings_app_cyanogenmod.xml | 31 | ||||
-rw-r--r--[-rwxr-xr-x] | res/xml/security_settings_misc.xml | 0 | ||||
-rw-r--r--[-rwxr-xr-x] | src/com/android/settings/SecuritySettings.java | 36 | ||||
-rw-r--r--[-rwxr-xr-x] | src/com/android/settings/Settings.java | 0 | ||||
-rw-r--r--[-rwxr-xr-x] | src/com/android/settings/SettingsActivity.java | 0 | ||||
-rw-r--r--[-rwxr-xr-x] | src/com/android/settings/SubSettings.java | 0 | ||||
-rw-r--r-- | src/com/android/settings/cyanogenmod/PrivacySettings.java | 34 |
10 files changed, 75 insertions, 102 deletions
diff --git a/res/values/cm_arrays.xml b/res/values/cm_arrays.xml index 7990443..55fe9b0 100644 --- a/res/values/cm_arrays.xml +++ b/res/values/cm_arrays.xml @@ -392,21 +392,6 @@ <item>2</item> </string-array> - <!--- Sms security limit --> - <string-array name="sms_security_check_limit_entries" translatable="false"> - <item>@string/sms_security_check_limit_default</item> - <item>50</item> - <item>100</item> - <item>200</item> - </string-array> - - <string-array name="sms_security_check_limit_values" translatable="false"> - <item>30</item> - <item>50</item> - <item>100</item> - <item>200</item> - </string-array> - <!-- Phone blacklist management --> <string-array name="blacklist_policy_unknown_entries" translatable="false"> <item>@string/blacklist_policy_block_calls</item> @@ -425,4 +410,20 @@ <string-array name="blacklist_policy_private_values" translatable="false"> <item>1</item> </string-array> + + <!-- Sms security limit --> + <string-array name="sms_security_check_limit_entries" translatable="false"> + <item>@string/sms_security_check_limit_default</item> + <item>50</item> + <item>100</item> + <item>200</item> + </string-array> + + <string-array name="sms_security_check_limit_values" translatable="false"> + <item>30</item> + <item>50</item> + <item>100</item> + <item>200</item> + </string-array> + </resources> diff --git a/res/values/cm_strings.xml b/res/values/cm_strings.xml index 9bf77af..7d71b61 100644 --- a/res/values/cm_strings.xml +++ b/res/values/cm_strings.xml @@ -720,18 +720,6 @@ <string name="select_custom_app_title">Select custom app</string> <string name="select_custom_activity_title">Select custom activity</string> - <!--- Sms security limit --> - <string name="app_security_title">App security</string> - <string name="sms_security_check_limit_title">SMS message limit</string> - <string name="sms_security_check_limit_summary">Display an alert dialog to prevent applications from sending SMS messages too frequently. Current limit: %d messages in 15 minutes</string> - <string name="sms_security_check_limit_default">30 (Default)</string> - - <!-- Notification spamfilter --> - <string name="spam_added_title">Added %1$s</string> - <string name="spam_last_blocked_title">Last blocked %1$s</string> - <string name="block_notifications_title">Filter notifications</string> - <string name="no_filters_title">No filters set</string> - <!-- Blacklist preferences --> <string name="blacklist_title">Blacklist</string> <string name="blacklist_edit_dialog_title">Edit blacklist entry</string> @@ -763,4 +751,18 @@ <string name="remove_blacklist_entry">Do you want to remove this blacklist entry?</string> <string name="select_contact">Select contact</string> + <!-- Sms security limit --> + <string name="app_security_title">App security</string> + <string name="sms_security_check_limit_title">SMS message limit</string> + <string name="sms_security_check_limit_summary">Display an alert dialog to prevent applications from sending SMS messages too frequently. Current limit: %d messages in 15 minutes</string> + <string name="sms_security_check_limit_default">30 (Default)</string> + + <!-- Notification spamfilter --> + <string name="spam_added_title">Added %1$s</string> + <string name="spam_last_blocked_title">Last blocked %1$s</string> + <string name="block_notifications_title">Filter notifications</string> + <string name="block_notifications_summary">Manage ignored notifications and filters</string> + <string name="no_filters_title">No filters set</string> + <string name="app_ops_ignored_count">Denied <xliff:g id="count" example="2 times">%s</xliff:g></string> + </resources> diff --git a/res/xml/privacy_settings_cyanogenmod.xml b/res/xml/privacy_settings_cyanogenmod.xml index b9a361d..efdfb6f 100644 --- a/res/xml/privacy_settings_cyanogenmod.xml +++ b/res/xml/privacy_settings_cyanogenmod.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- Copyright (C) 2009-2011 The Android Open Source Project +<!-- + Copyright (C) 2014 The CyanogenMod Project Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -13,14 +14,24 @@ See the License for the specific language governing permissions and limitations under the License. --> - <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" android:title="@string/privacy_settings_title"> <Preference - android:fragment="com.android.settings.privacyguard.PrivacyGuardManager" android:key="privacy_guard_manager" + android:title="@string/privacy_guard_manager_title" android:summary="@string/privacy_guard_manager_summary" - android:title="@string/privacy_guard_manager_title" /> + android:fragment="com.android.settings.privacyguard.PrivacyGuardManager" /> + + <PreferenceScreen + android:key="blacklist" + android:title="@string/blacklist_title" + android:summary="@string/blacklist_summary" + android:fragment="com.android.settings.blacklist.BlacklistSettings" /> + + <PreferenceScreen + android:title="@string/block_notifications_title" + android:summary="@string/block_notifications_summary" + android:fragment="com.android.settings.cyanogenmod.SpamList" /> </PreferenceScreen> diff --git a/res/xml/security_settings_app_cyanogenmod.xml b/res/xml/security_settings_app_cyanogenmod.xml deleted file mode 100644 index a63fba6..0000000 --- a/res/xml/security_settings_app_cyanogenmod.xml +++ /dev/null @@ -1,31 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Copyright (C) 2012 The CyanogenMod 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. ---> - -<PreferenceScreen - xmlns:android="http://schemas.android.com/apk/res/android"> - - <PreferenceCategory - android:key="app_security" - android:title="@string/app_security_title"> - - <PreferenceScreen - android:key="blacklist" - android:title="@string/blacklist_title" - android:fragment="com.android.settings.blacklist.BlacklistSettings" /> - - </PreferenceCategory> - -</PreferenceScreen> diff --git a/res/xml/security_settings_misc.xml b/res/xml/security_settings_misc.xml index 21f4477..21f4477 100755..100644 --- a/res/xml/security_settings_misc.xml +++ b/res/xml/security_settings_misc.xml diff --git a/src/com/android/settings/SecuritySettings.java b/src/com/android/settings/SecuritySettings.java index fd785d3..742f113 100755..100644 --- a/src/com/android/settings/SecuritySettings.java +++ b/src/com/android/settings/SecuritySettings.java @@ -52,7 +52,6 @@ import android.text.TextUtils; import android.util.Log; import com.android.internal.logging.MetricsLogger; -import com.android.internal.telephony.util.BlacklistUtils; import com.android.internal.widget.LockPatternUtils; import com.android.settings.TrustAgentUtils.TrustAgentComponentInfo; import com.android.settings.fingerprint.FingerprintEnrollIntroduction; @@ -61,7 +60,6 @@ import com.android.settings.search.BaseSearchIndexProvider; import com.android.settings.search.Index; import com.android.settings.search.Indexable; import com.android.settings.search.SearchIndexableRaw; -import com.android.settings.R; import java.util.ArrayList; import java.util.List; @@ -105,11 +103,7 @@ public class SecuritySettings extends SettingsPreferenceFragment private static final String PACKAGE_MIME_TYPE = "application/vnd.android.package-archive"; private static final String KEY_TRUST_AGENT = "trust_agent"; private static final String KEY_SCREEN_PINNING = "screen_pinning_settings"; - private static final String KEY_TOGGLE_DM_AUTOBOOT = "toggle_dm_autoboot"; private static final String KEY_SMS_SECURITY_CHECK_PREF = "sms_security_check_limit"; - private static final String DM_AUTOBOOT_SETTING = "dm_selfregist_autoboot"; - private static final int DM_AUTOBOOT_SETTING_ENABLE = 1; - private static final int DM_AUTOBOOT_SETTING_DISABLE = 0; // These switch preferences need special handling since they're not all stored in Settings. private static final String SWITCH_PREFERENCE_KEYS[] = { KEY_LOCK_AFTER_TIMEOUT, @@ -121,10 +115,6 @@ public class SecuritySettings extends SettingsPreferenceFragment private static final int MY_USER_ID = UserHandle.myUserId(); - // CyanogenMod Additions - private static final String KEY_APP_SECURITY_CATEGORY = "app_security"; - private static final String KEY_BLACKLIST = "blacklist"; - private PackageManager mPM; private DevicePolicyManager mDPM; private SubscriptionManager mSubscriptionManager; @@ -157,9 +147,6 @@ public class SecuritySettings extends SettingsPreferenceFragment return MetricsLogger.SECURITY; } - // CyanogenMod Additions - private PreferenceScreen mBlacklist; - @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); @@ -180,7 +167,6 @@ public class SecuritySettings extends SettingsPreferenceFragment private static int getResIdForLockUnlockScreen(Context context, LockPatternUtils lockPatternUtils) { - // Add options for lock/unlock screen int resid = 0; if (!lockPatternUtils.isSecure(MY_USER_ID)) { if (lockPatternUtils.isLockScreenDisabled(MY_USER_ID)) { @@ -361,18 +347,6 @@ public class SecuritySettings extends SettingsPreferenceFragment } } - // App security settings - addPreferencesFromResource(R.xml.security_settings_app_cyanogenmod); - mBlacklist = (PreferenceScreen) root.findPreference(KEY_BLACKLIST); - - // Determine options based on device telephony support - if (!pm.hasSystemFeature(PackageManager.FEATURE_TELEPHONY)) { - // No telephony, remove dependent options - PreferenceGroup appCategory = (PreferenceGroup) - root.findPreference(KEY_APP_SECURITY_CATEGORY); - appCategory.removePreference(mBlacklist); - } - // The above preferences come and go based on security state, so we need to update // the index. This call is expected to be fairly cheap, but we may want to do something // smarter in the future. @@ -674,7 +648,6 @@ public class SecuritySettings extends SettingsPreferenceFragment } updateOwnerInfo(); - updateBlacklistSummary(); } public void updateOwnerInfo() { @@ -928,13 +901,4 @@ public class SecuritySettings extends SettingsPreferenceFragment } } - private void updateBlacklistSummary() { - if (mBlacklist != null) { - if (BlacklistUtils.isBlacklistEnabled(getActivity())) { - mBlacklist.setSummary(R.string.blacklist_summary); - } else { - mBlacklist.setSummary(R.string.blacklist_summary_disabled); - } - } - } } diff --git a/src/com/android/settings/Settings.java b/src/com/android/settings/Settings.java index 06f0149..06f0149 100755..100644 --- a/src/com/android/settings/Settings.java +++ b/src/com/android/settings/Settings.java diff --git a/src/com/android/settings/SettingsActivity.java b/src/com/android/settings/SettingsActivity.java index 74b8ff9..74b8ff9 100755..100644 --- a/src/com/android/settings/SettingsActivity.java +++ b/src/com/android/settings/SettingsActivity.java diff --git a/src/com/android/settings/SubSettings.java b/src/com/android/settings/SubSettings.java index 13ead6e..13ead6e 100755..100644 --- a/src/com/android/settings/SubSettings.java +++ b/src/com/android/settings/SubSettings.java diff --git a/src/com/android/settings/cyanogenmod/PrivacySettings.java b/src/com/android/settings/cyanogenmod/PrivacySettings.java index 76cb9cb..ced0832 100644 --- a/src/com/android/settings/cyanogenmod/PrivacySettings.java +++ b/src/com/android/settings/cyanogenmod/PrivacySettings.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2009 The Android Open Source Project + * Copyright (C) 2014 The CyanogenMod Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,25 +16,39 @@ package com.android.settings.cyanogenmod; -//import android.content.pm.PackageManager; +import android.content.pm.PackageManager; import android.os.Bundle; -//import android.preference.PreferenceScreen; -//import com.android.settings.Utils; +import android.preference.PreferenceScreen; import com.android.internal.logging.MetricsLogger; import com.android.settings.R; import com.android.settings.SettingsPreferenceFragment; import com.android.settings.Utils; +import com.android.internal.telephony.util.BlacklistUtils; /** * Privacy settings */ public class PrivacySettings extends SettingsPreferenceFragment { + private static final String KEY_BLACKLIST = "blacklist"; + + private PreferenceScreen mBlacklist; + @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); addPreferencesFromResource(R.xml.privacy_settings_cyanogenmod); + + // Add package manager to check if features are available + PackageManager pm = getPackageManager(); + + // Determine options based on device telephony support + if (!pm.hasSystemFeature(PackageManager.FEATURE_TELEPHONY)) { + // No telephony, remove dependent options + PreferenceScreen root = getPreferenceScreen(); + root.removePreference(mBlacklist); + } } @Override @@ -45,5 +59,17 @@ public class PrivacySettings extends SettingsPreferenceFragment { @Override public void onResume() { super.onResume(); + updateBlacklistSummary(); } + + private void updateBlacklistSummary() { + if (mBlacklist != null) { + if (BlacklistUtils.isBlacklistEnabled(getActivity())) { + mBlacklist.setSummary(R.string.blacklist_summary); + } else { + mBlacklist.setSummary(R.string.blacklist_summary_disabled); + } + } + } + } |