Skip to content

Commit d510cb8

Browse files
Kun Liangcodex-corp
authored andcommitted
AppOps: Add nfc enable control into AppOps
Check user permission before enabling nfc. Change-Id: Ia84e33c299e4fdecfd66ee933d9e7d37ed29c340
1 parent 8155eb9 commit d510cb8

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

core/java/android/app/AppOpsManager.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,9 @@ public class AppOpsManager {
211211
/** @hide */
212212
public static final int OP_BOOT_COMPLETED = 50;
213213
/** @hide */
214-
public static final int _NUM_OP = 51;
214+
public static final int OP_NFC_CHANGE = 51;
215+
/** @hide */
216+
public static final int _NUM_OP = 52;
215217

216218
/** Access to coarse location information. */
217219
public static final String OPSTR_COARSE_LOCATION =
@@ -286,6 +288,7 @@ public class AppOpsManager {
286288
OP_READ_MMS,
287289
OP_WRITE_MMS,
288290
OP_BOOT_COMPLETED,
291+
OP_NFC_CHANGE,
289292
};
290293

291294
/**
@@ -344,6 +347,7 @@ public class AppOpsManager {
344347
null,
345348
null,
346349
null,
350+
null,
347351
};
348352

349353
/**
@@ -402,6 +406,7 @@ public class AppOpsManager {
402406
"READ_MMS",
403407
"WRITE_MMS",
404408
"BOOT_COMPLETED",
409+
"NFC_CHANGE",
405410
};
406411

407412
/**
@@ -460,6 +465,7 @@ public class AppOpsManager {
460465
android.Manifest.permission.READ_SMS,
461466
android.Manifest.permission.WRITE_SMS,
462467
android.Manifest.permission.RECEIVE_BOOT_COMPLETED,
468+
android.Manifest.permission.NFC,
463469
};
464470

465471
/**
@@ -517,6 +523,7 @@ public class AppOpsManager {
517523
AppOpsManager.MODE_ALLOWED, // OP_READ_MMS
518524
AppOpsManager.MODE_ALLOWED, // OP_WRITE_MMS
519525
AppOpsManager.MODE_ALLOWED, // OP_BOOT_COMPLETED
526+
AppOpsManager.MODE_ALLOWED, // OP_NFC_CHANGE
520527
};
521528

522529
/**
@@ -574,6 +581,7 @@ public class AppOpsManager {
574581
AppOpsManager.MODE_ASK, // OP_READ_MMS
575582
AppOpsManager.MODE_ASK, // OP_WRITE_MMS
576583
AppOpsManager.MODE_ALLOWED, // OP_BOOT_COMPLETED
584+
AppOpsManager.MODE_ASK, // OP_NFC_CHANGE
577585
};
578586

579587

@@ -636,6 +644,7 @@ public class AppOpsManager {
636644
false,
637645
false,
638646
false,
647+
false,
639648
};
640649

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

0 commit comments

Comments
 (0)