From 99d66e10840fd23ec05e972a2c1e93f80f8ad688 Mon Sep 17 00:00:00 2001 From: Adnan Begovic Date: Wed, 10 Dec 2014 20:22:41 -0800 Subject: [PATCH] Settings: Re-add whisperpush settings. Change-Id: I8bdfed313a113ec2cc5d55e9357dee7932604aff --- res/values/cm_strings.xml | 7 +++++ res/xml/privacy_settings_whisperpush.xml | 28 +++++++++++++++++++ .../settings/cyanogenmod/PrivacySettings.java | 7 +++++ 3 files changed, 42 insertions(+) create mode 100644 res/xml/privacy_settings_whisperpush.xml diff --git a/res/values/cm_strings.xml b/res/values/cm_strings.xml index a2a4c8893c..728bd25258 100644 --- a/res/values/cm_strings.xml +++ b/res/values/cm_strings.xml @@ -953,4 +953,11 @@ Default Tap an icon on the left or right to reassign a lock screen shortcut. Choose action + + + WhisperPush + Manage secure SMS settings + Register + Register for WhisperPush to enable encrypted SMS. + Review identity keys diff --git a/res/xml/privacy_settings_whisperpush.xml b/res/xml/privacy_settings_whisperpush.xml new file mode 100644 index 0000000000..9fd64426dd --- /dev/null +++ b/res/xml/privacy_settings_whisperpush.xml @@ -0,0 +1,28 @@ + + + + + + + + + + \ No newline at end of file diff --git a/src/com/android/settings/cyanogenmod/PrivacySettings.java b/src/com/android/settings/cyanogenmod/PrivacySettings.java index 5cf468c1d0..8c7e9fba81 100644 --- a/src/com/android/settings/cyanogenmod/PrivacySettings.java +++ b/src/com/android/settings/cyanogenmod/PrivacySettings.java @@ -44,12 +44,19 @@ public void onCreate(Bundle savedInstanceState) { // Add package manager to check if features are available PackageManager pm = getPackageManager(); + // WhisperPush + // Only add if device has telephony support and has WhisperPush installed. + if (Utils.isPackageInstalled(getActivity(), "org.whispersystems.whisperpush")) { + addPreferencesFromResource(R.xml.privacy_settings_whisperpush); + } + // 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