抑制できるパーミッション
以下のソースチェックしましょう。frameworks/base/core/java/android/app/AppOpsManager.java
ソースを確認すると、次のような値が宣言されています。
これらの値を引数にして、モジュールをコールします。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | public class AppOpsManager { : // when adding one of these: // - increment _NUM_OP // - add rows to sOpToSwitch, sOpNames, sOpPerms // - add descriptive strings to Settings/res/values/arrays.xml public static final int OP_NONE = - 1 ; public static final int OP_COARSE_LOCATION = 0 ; public static final int OP_FINE_LOCATION = 1 ; public static final int OP_GPS = 2 ; public static final int OP_VIBRATE = 3 ; public static final int OP_READ_CONTACTS = 4 ; public static final int OP_WRITE_CONTACTS = 5 ; public static final int OP_READ_CALL_LOG = 6 ; public static final int OP_WRITE_CALL_LOG = 7 ; public static final int OP_READ_CALENDAR = 8 ; public static final int OP_WRITE_CALENDAR = 9 ; public static final int OP_WIFI_SCAN = 10 ; public static final int OP_POST_NOTIFICATION = 11 ; public static final int OP_NEIGHBORING_CELLS = 12 ; public static final int OP_CALL_PHONE = 13 ; public static final int OP_READ_SMS = 14 ; public static final int OP_WRITE_SMS = 15 ; public static final int OP_RECEIVE_SMS = 16 ; public static final int OP_RECEIVE_EMERGECY_SMS = 17 ; public static final int OP_RECEIVE_MMS = 18 ; public static final int OP_RECEIVE_WAP_PUSH = 19 ; public static final int OP_SEND_SMS = 20 ; public static final int OP_READ_ICC_SMS = 21 ; public static final int OP_WRITE_ICC_SMS = 22 ; public static final int OP_WRITE_SETTINGS = 23 ; public static final int OP_SYSTEM_ALERT_WINDOW = 24 ; public static final int OP_ACCESS_NOTIFICATIONS = 25 ; public static final int OP_CAMERA = 26 ; public static final int OP_RECORD_AUDIO = 27 ; public static final int OP_PLAY_AUDIO = 28 ; public static final int OP_READ_CLIPBOARD = 29 ; public static final int OP_WRITE_CLIPBOARD = 30 ; /** @hide */ public static final int _NUM_OP = 31 ; : } |
つまり、次のようなことしか抑制できません。
- 位置情報
- バイブレーション
- 電話帳のR/W
- 電話履歴のR/W
- カレンダーのR/W
- WiFiのスキャン
- ノッティフィケーションのPost
- 電話発信
- SMSのR/W
- SMS/メールの受信
- SMSの送信
- 設定のWrite
- SystemAlertWindowの使用
- ノッティフィケーションの参照
- カメラ
- オーディオの録音/鳴動
- クリップボードのR/W
Internet、Bluetooth、SDカードなど、アプリケーションの再起動が必要そうな機能の抑制できないようです。
(※なぜアプリケーションの再起動が必要なのかは、frameworksのソースを確認しよう)