Skip to content

Commit

Permalink
Settings: Re-add whisperpush settings.
Browse files Browse the repository at this point in the history
Change-Id: I8bdfed313a113ec2cc5d55e9357dee7932604aff
  • Loading branch information
Adnan Begovic authored and scott committed Jan 30, 2015
1 parent 7a96afc commit 99d66e1
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 0 deletions.
7 changes: 7 additions & 0 deletions res/values/cm_strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -953,4 +953,11 @@
<string name="lockscreen_default_target">Default</string>
<string name="lockscreen_message">Tap an icon on the left or right to reassign a lock screen shortcut.</string>
<string name="lockscreen_choose_action_title">Choose action</string>

<!-- WhisperPush -->
<string name="whisperpush_title">WhisperPush</string>
<string name="whisperpush_summary">Manage secure SMS settings</string>
<string name="whisperpush_registration_title">Register</string>
<string name="whisperpush_registration_summary">Register for WhisperPush to enable encrypted SMS.</string>
<string name="whisperpush_identitykey_title">Review identity keys</string>
</resources>
28 changes: 28 additions & 0 deletions res/xml/privacy_settings_whisperpush.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- 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.
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">

<Preference
android:key="whisperpush"
android:title="@string/whisperpush_title"
android:summary="@string/whisperpush_summary">
<intent android:targetPackage="org.whispersystems.whisperpush"
android:targetClass="org.whispersystems.whisperpush.ui.PreferenceActivity" />
</Preference>

</PreferenceScreen>
7 changes: 7 additions & 0 deletions src/com/android/settings/cyanogenmod/PrivacySettings.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 99d66e1

Please sign in to comment.