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

Commit a646c552 authored by Danesh M's avatar Danesh M Committed by Ricardo Cerqueira
Browse files

Privacy Guard : Reimplement backed by AppOps

Re-implements privacy guard to use appops.

Change-Id: I2b52e8cf0d6e126fb156f83df885b5551503cd9d
parent 5e24b16d
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -1133,4 +1133,20 @@ public class AppOpsManager {
    public void finishOp(int op) {
        finishOp(op, Process.myUid(), mContext.getOpPackageName());
    }

    public boolean getPrivacyGuardSettingForPackage(int uid, String packageName) {
        try {
            return mService.getPrivacyGuardSettingForPackage(uid, packageName);
        } catch (RemoteException e) {
        }
        return false;
    }

    public void setPrivacyGuardSettingForPackage(int uid, String packageName,
            boolean state) {
        try {
            mService.setPrivacyGuardSettingForPackage(uid, packageName, state);
        } catch (RemoteException e) {
        }
    }
}
+8 −1
Original line number Diff line number Diff line
@@ -5219,6 +5219,12 @@ public final class Settings {
         */
        public static final String ADVANCED_REBOOT = "advanced_reboot";

        /**
         * Whether newly installed apps should run with privacy guard by default
         * @hide
         */
         public static final String PRIVACY_GUARD_DEFAULT = "privacy_guard_default";

        /**
         * This are the settings to be backed up.
         *
@@ -5269,7 +5275,8 @@ public final class Settings {
            MOUNT_UMS_PROMPT,
            MOUNT_UMS_NOTIFY_ENABLED,
            UI_NIGHT_MODE,
            ADVANCED_REBOOT
            ADVANCED_REBOOT,
            PRIVACY_GUARD_DEFAULT
        };

        /**
+4 −0
Original line number Diff line number Diff line
@@ -36,4 +36,8 @@ interface IAppOpsService {
    List<AppOpsManager.PackageOps> getOpsForPackage(int uid, String packageName, in int[] ops);
    void setMode(int code, int uid, String packageName, int mode);
    void resetAllModes();

    // Privacy guard methods
    boolean getPrivacyGuardSettingForPackage(int uid, String packageName);
    void setPrivacyGuardSettingForPackage(int uid, String packageName, boolean state);
}
+1.27 KiB
Loading image diff...
+1.16 KiB
Loading image diff...
Loading