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

Commit 1d87c140 authored by Chirayu Desai's avatar Chirayu Desai Committed by Clayton Craft
Browse files

Allow disabling the privacy guard notification - port from cm-12.1 (2/3)

Change-Id: Iab0288f50685220c8be0c11ea5075f91ec1bbe32
parent 31f15ebb
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -71,6 +71,7 @@ import android.view.Display;
import com.android.server.LocalServices;

import cyanogenmod.power.PerformanceManagerInternal;
import cyanogenmod.providers.CMSettings;

import java.io.FileDescriptor;
import java.io.PrintWriter;
@@ -2108,13 +2109,16 @@ final class ActivityStack {

        boolean privacy = mService.mAppOpsService.getPrivacyGuardSettingForPackage(
                next.app.uid, next.packageName);
        boolean privacyNotification = (CMSettings.Secure.getInt(
                mService.mContext.getContentResolver(),
                CMSettings.Secure.PRIVACY_GUARD_NOTIFICATION, 1) == 1);

        if (privacyGuardPackageName != null && !privacy) {
            Message msg = mService.mHandler.obtainMessage(
                    ActivityManagerService.CANCEL_PRIVACY_NOTIFICATION_MSG, next.userId);
            msg.sendToTarget();
            mStackSupervisor.mPrivacyGuardPackageName = null;
        } else if (privacy) {
        } else if (privacy && privacyNotification) {
            Message msg = mService.mHandler.obtainMessage(
                    ActivityManagerService.POST_PRIVACY_NOTIFICATION_MSG, next);
            msg.sendToTarget();