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

Commit b351a48b authored by Kun Liang's avatar Kun Liang Committed by Ed Carrigan
Browse files

AppOps: Add nfc enable control into AppOps

Check user permission before enabling nfc.

Change-Id: Ia84e33c299e4fdecfd66ee933d9e7d37ed29c340
parent c157db04
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -211,7 +211,9 @@ public class AppOpsManager {
    /** @hide */
    public static final int OP_BOOT_COMPLETED = 50;
    /** @hide */
    public static final int _NUM_OP = 51;
    public static final int OP_NFC_CHANGE = 51;
    /** @hide */
    public static final int _NUM_OP = 52;

    /** Access to coarse location information. */
    public static final String OPSTR_COARSE_LOCATION =
@@ -286,6 +288,7 @@ public class AppOpsManager {
            OP_READ_MMS,
            OP_WRITE_MMS,
            OP_BOOT_COMPLETED,
            OP_NFC_CHANGE,
    };

    /**
@@ -344,6 +347,7 @@ public class AppOpsManager {
            null,
            null,
            null,
            null,
    };

    /**
@@ -402,6 +406,7 @@ public class AppOpsManager {
            "READ_MMS",
            "WRITE_MMS",
            "BOOT_COMPLETED",
            "NFC_CHANGE",
    };

    /**
@@ -460,6 +465,7 @@ public class AppOpsManager {
            android.Manifest.permission.READ_SMS,
            android.Manifest.permission.WRITE_SMS,
            android.Manifest.permission.RECEIVE_BOOT_COMPLETED,
            android.Manifest.permission.NFC,
    };

    /**
@@ -517,6 +523,7 @@ public class AppOpsManager {
            AppOpsManager.MODE_ALLOWED, // OP_READ_MMS
            AppOpsManager.MODE_ALLOWED, // OP_WRITE_MMS
            AppOpsManager.MODE_ALLOWED, // OP_BOOT_COMPLETED
            AppOpsManager.MODE_ALLOWED, // OP_NFC_CHANGE
    };

    /**
@@ -574,6 +581,7 @@ public class AppOpsManager {
            AppOpsManager.MODE_ASK,     // OP_READ_MMS
            AppOpsManager.MODE_ASK,     // OP_WRITE_MMS
            AppOpsManager.MODE_ALLOWED, // OP_BOOT_COMPLETED
            AppOpsManager.MODE_ASK,     // OP_NFC_CHANGE
    };


@@ -636,6 +644,7 @@ public class AppOpsManager {
            false,
            false,
            false,
            false,
    };

    private static HashMap<String, Integer> sOpStrToOp = new HashMap<String, Integer>();