cmparts: Add protected apps linkage
* And make PrivacySettings work the same way as everything else.
Change-Id: I7d39322fb05b9973b6ed19571c62e10a5bb70c04
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 2d7ede6..d08e3cb 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -64,10 +64,11 @@
<!-- Privacy settings (dashboard) -->
- <activity
+ <activity-alias
android:name="PrivacySettings"
- android:label="@string/privacy_settings_title">
- <intent-filter android:priority="1">
+ android:label="@string/privacy_settings_title"
+ android:targetActivity="PartsActivity">
+ <intent-filter android:priority="-2">
<action android:name="com.android.settings.action.EXTRA_SETTINGS" />
<action android:name="org.cyanogenmod.cmparts.PRIVACY_SETTINGS" />
<category android:name="android.intent.category.DEFAULT" />
@@ -78,7 +79,7 @@
<meta-data
android:name="com.android.settings.icon"
android:resource="@drawable/ic_settings_privacy" />
- </activity>
+ </activity-alias>
<!-- Button settings (dashboard) -->
<activity-alias
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 4d18333..169e873 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -447,4 +447,8 @@
<string name="status_bar_icons_title">Status bar icons</string>
<string name="status_bar_icons_summary">Control which status bar icons are shown</string>
+ <!-- Protected apps -->
+ <string name="protected_apps_manager_title">Protected apps</string>
+ <string name="protected_apps_manager_summary">Manage which apps are hidden behind a secure lock</string>
+
</resources>
diff --git a/res/xml/parts_catalog.xml b/res/xml/parts_catalog.xml
index bfb3d7f..e9a133c 100644
--- a/res/xml/parts_catalog.xml
+++ b/res/xml/parts_catalog.xml
@@ -30,6 +30,10 @@
android:summary="@string/live_display_summary"
android:fragment="org.cyanogenmod.cmparts.livedisplay.LiveDisplay" />
+ <part android:key="privacy_settings"
+ android:title="@string/privacy_settings_title"
+ android:fragment="org.cyanogenmod.cmparts.PrivacySettings" />
+
<part android:key="button_settings"
android:title="@string/button_pref_title"
android:fragment="org.cyanogenmod.cmparts.input.ButtonSettings" />
diff --git a/res/xml/privacy_settings.xml b/res/xml/privacy_settings.xml
index fe6fd39..02abaf4 100644
--- a/res/xml/privacy_settings.xml
+++ b/res/xml/privacy_settings.xml
@@ -15,11 +15,23 @@
limitations under the License.
-->
-<preference-headers xmlns:android="http://schemas.android.com/apk/res/android">
+<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
+ android:title="@string/privacy_settings_title"
+ android:key="privacy_settings">
- <header
+ <PreferenceScreen
+ android:key="privacy_guard_manager"
android:title="@*cyanogenmod.platform:string/privacy_guard_manager_title"
android:summary="@string/privacy_guard_manager_summary"
android:fragment="org.cyanogenmod.cmparts.privacyguard.PrivacyGuardManager" />
-</preference-headers>
+ <Preference
+ android:title="@string/protected_apps_manager_title"
+ android:summary="@string/protected_apps_manager_summary">
+ <intent
+ android:action="android.intent.action.VIEW"
+ android:targetPackage="com.android.settings"
+ android:targetClass="com.android.settings.applications.ProtectedAppsActivity" />
+ </Preference>
+
+</PreferenceScreen>
diff --git a/src/org/cyanogenmod/cmparts/PrivacySettings.java b/src/org/cyanogenmod/cmparts/PrivacySettings.java
index 4ca6e0b..8b74c93 100644
--- a/src/org/cyanogenmod/cmparts/PrivacySettings.java
+++ b/src/org/cyanogenmod/cmparts/PrivacySettings.java
@@ -17,23 +17,16 @@
package org.cyanogenmod.cmparts;
import android.os.Bundle;
-import android.preference.PreferenceActivity;
-import android.preference.PreferenceActivity.Header;
-
-import java.util.List;
/**
* Privacy settings
*/
-public class PrivacySettings extends PreferenceActivity {
+public class PrivacySettings extends SettingsPreferenceFragment {
@Override
- public void onBuildHeaders(List<Header> target) {
- loadHeadersFromResource(R.xml.privacy_settings, target);
- }
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
- @Override
- public boolean isValidFragment(String fragmentName) {
- return fragmentName.startsWith("org.cyanogenmod.cmparts.privacy");
+ addPreferencesFromResource(R.xml.privacy_settings);
}
}