Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 355f8774 authored by Lars Greiss's avatar Lars Greiss Committed by Michael Bestas
Browse files

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
parent 23630569
Loading
Loading
Loading
Loading
+25 −1
Original line number Diff line number Diff line
@@ -857,7 +857,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>
@@ -873,6 +873,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"
+37 −0
Original line number Diff line number Diff line
/**
 * 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;
    }
}