diff options
author | Lars Greiss <kufikugel@googlemail.com> | 2015-04-25 03:15:15 +0300 |
---|---|---|
committer | Michael Bestas <mikeioannina@gmail.com> | 2016-01-03 14:46:10 -0800 |
commit | 895d736d25d0dbbb20a2f574fd0ea2a8901440a9 (patch) | |
tree | 7399c469ebbcce15e57a23d8df5e485f2c42dd4b | |
parent | 10bac9137eb2c7fe6f2a56c2f29bd2e6464e33b2 (diff) | |
download | packages_apps_Settings-895d736d25d0dbbb20a2f574fd0ea2a8901440a9.zip packages_apps_Settings-895d736d25d0dbbb20a2f574fd0ea2a8901440a9.tar.gz packages_apps_Settings-895d736d25d0dbbb20a2f574fd0ea2a8901440a9.tar.bz2 |
Launch app privacy settings when tapping on PG notification (2/2)
Based on https://github.com/SlimRoms/packages_apps_Settings/commit/46bb1442aa96aad6890e3ce7b6f3c0466ababf25
JIRA: CYAN-6077
Change-Id: I8632e8c944c1d5d7ad2fb2a2276bae5fe2d4a0a0
-rwxr-xr-x | AndroidManifest.xml | 26 | ||||
-rw-r--r-- | src/com/android/settings/applications/AppOpsDetailsTop.java | 37 |
2 files changed, 62 insertions, 1 deletions
diff --git a/AndroidManifest.xml b/AndroidManifest.xml index edd3772..53ecd10 100755 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -1118,7 +1118,7 @@ </activity> <activity android:name="Settings$AppOpsSummaryActivity" - android:label="@string/app_ops_settings" + android:label="@string/privacy_guard_manager_title" android:taskAffinity="" android:excludeFromRecents="true"> <intent-filter> @@ -1134,6 +1134,30 @@ android:resource="@id/application_settings" /> </activity> + <!-- Still need a top-level activity for showing app ops details. Aliasing + trick is so the code that is now a fragment can still be called + AppOpsDetails. --> + <activity android:name=".applications.AppOpsDetailsTop" + android:label="@string/privacy_guard_manager_title" + android:exported="true" + android:taskAffinity="" + android:excludeFromRecents="true" + android:parentActivityName="Settings$AppOpsSummaryActivity"> + </activity> + + <!-- Keep compatibility with old shortcuts. --> + <activity-alias android:name=".applications.AppOpsDetails" + android:label="@string/privacy_guard_manager_title" + android:exported="true" + android:excludeFromRecents="true" + android:targetActivity=".applications.AppOpsDetailsTop"> + <intent-filter> + <action android:name="android.settings.APP_OPS_DETAILS_SETTINGS" /> + <category android:name="android.intent.category.DEFAULT" /> + <data android:scheme="package" /> + </intent-filter> + </activity-alias> + <activity android:name="Settings$LocationSettingsActivity" android:label="@string/location_settings_title" android:configChanges="orientation|keyboardHidden|screenSize" diff --git a/src/com/android/settings/applications/AppOpsDetailsTop.java b/src/com/android/settings/applications/AppOpsDetailsTop.java new file mode 100644 index 0000000..c3c7084 --- /dev/null +++ b/src/com/android/settings/applications/AppOpsDetailsTop.java @@ -0,0 +1,37 @@ +/** + * Copyright (C) 2015 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. + */ + +package com.android.settings.applications; + +import android.content.Intent; +import android.preference.PreferenceActivity; + +public class AppOpsDetailsTop extends PreferenceActivity { + + @Override + public Intent getIntent() { + Intent modIntent = new Intent(super.getIntent()); + modIntent.putExtra(EXTRA_SHOW_FRAGMENT, AppOpsDetails.class.getName()); + modIntent.putExtra(EXTRA_NO_HEADERS, true); + return modIntent; + } + + @Override + protected boolean isValidFragment(String fragmentName) { + if (AppOpsDetails.class.getName().equals(fragmentName)) return true; + return false; + } +} |