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

Commit 06c677cc authored by Danny Baumann's avatar Danny Baumann Committed by Gerrit Code Review
Browse files

Merge "privacyguard: Share privacy package name between activity stacks" into cm-11.0

parents 77e01859 cca42cd6
Loading
Loading
Loading
Loading
+5 −9
Original line number Diff line number Diff line
@@ -220,11 +220,6 @@ final class ActivityStack {
    long mLaunchStartTime = 0;
    long mFullyDrawnStartTime = 0;

    /**
     * Is the privacy guard currently enabled?
     */
    String mPrivacyGuardPackageName = null;

    /**
     * Save the most recent screenshot for reuse. This keeps Recents from taking two identical
     * screenshots, one for the Recents thumbnail and one for the pauseActivity thumbnail.
@@ -1715,23 +1710,24 @@ final class ActivityStack {

    private final void updatePrivacyGuardNotificationLocked(ActivityRecord next) {

        if (mPrivacyGuardPackageName != null && mPrivacyGuardPackageName.equals(next.packageName)) {
        String privacyGuardPackageName = mStackSupervisor.mPrivacyGuardPackageName;
        if (privacyGuardPackageName != null && privacyGuardPackageName.equals(next.packageName)) {
            return;
        }

        boolean privacy = mService.mAppOpsService.getPrivacyGuardSettingForPackage(
                next.app.uid, next.packageName);

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

+5 −0
Original line number Diff line number Diff line
@@ -206,6 +206,11 @@ public final class ActivityStackSupervisor {
    /** Stack id of the front stack when user switched, indexed by userId. */
    SparseIntArray mUserStackInFront = new SparseIntArray(2);

    /**
     * Is the privacy guard currently enabled? Shared between ActivityStacks
     */
    String mPrivacyGuardPackageName = null;

    public ActivityStackSupervisor(ActivityManagerService service, Context context,
            Looper looper) {
        mService = service;