Loading core/java/android/app/AppOpsManager.java +118 −46 Original line number Diff line number Diff line /* * Copyright (c) 2013, The Linux Foundation. All rights reserved. * Not a Contribution. * * Copyright (C) 2012 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); Loading @@ -18,6 +21,7 @@ package android.app; import android.os.Binder; import android.os.IBinder; import android.os.SystemProperties; import android.util.ArrayMap; import com.android.internal.app.IAppOpsService; import com.android.internal.app.IAppOpsCallback; Loading Loading @@ -90,9 +94,15 @@ public class AppOpsManager { */ public static final int MODE_ERRORED = 2; /** @hide This mode should never be returned to caller * Result from {@link #checkOp} the given caller is * not allowed to perform the given operation. */ public static final int MODE_ASK = 3; // when adding one of these: // - increment _NUM_OP // - add rows to sOpToSwitch, sOpToString, sOpNames, sOpPerms, sOpDefaultMode // - add rows to sOpToSwitch, sOpToString, sOpNames, sOpPerms, sOpDefaultMode, sOpDefaultStrictMode // - add descriptive strings to Settings/res/values/arrays.xml // - add the op to the appropriate template in AppOpsState.OpsTemplate (settings app) Loading Loading @@ -408,51 +418,101 @@ public class AppOpsManager { * This specifies the default mode for each operation. */ private static int[] sOpDefaultMode = new int[] { AppOpsManager.MODE_ALLOWED, AppOpsManager.MODE_ALLOWED, AppOpsManager.MODE_ALLOWED, AppOpsManager.MODE_ALLOWED, AppOpsManager.MODE_ALLOWED, AppOpsManager.MODE_ALLOWED, AppOpsManager.MODE_ALLOWED, AppOpsManager.MODE_ALLOWED, AppOpsManager.MODE_ALLOWED, AppOpsManager.MODE_ALLOWED, AppOpsManager.MODE_ALLOWED, AppOpsManager.MODE_ALLOWED, AppOpsManager.MODE_ALLOWED, AppOpsManager.MODE_ALLOWED, AppOpsManager.MODE_ALLOWED, AppOpsManager.MODE_ALLOWED, // OP_WRITE_SMS AppOpsManager.MODE_ALLOWED, AppOpsManager.MODE_ALLOWED, AppOpsManager.MODE_ALLOWED, AppOpsManager.MODE_ALLOWED, AppOpsManager.MODE_ALLOWED, AppOpsManager.MODE_ALLOWED, AppOpsManager.MODE_ALLOWED, AppOpsManager.MODE_ALLOWED, AppOpsManager.MODE_ALLOWED, AppOpsManager.MODE_ALLOWED, AppOpsManager.MODE_ALLOWED, AppOpsManager.MODE_ALLOWED, AppOpsManager.MODE_ALLOWED, AppOpsManager.MODE_ALLOWED, AppOpsManager.MODE_ALLOWED, AppOpsManager.MODE_ALLOWED, AppOpsManager.MODE_ALLOWED, AppOpsManager.MODE_ALLOWED, AppOpsManager.MODE_ALLOWED, AppOpsManager.MODE_ALLOWED, AppOpsManager.MODE_ALLOWED, AppOpsManager.MODE_ALLOWED, AppOpsManager.MODE_ALLOWED, AppOpsManager.MODE_ALLOWED, AppOpsManager.MODE_ALLOWED, AppOpsManager.MODE_ALLOWED, AppOpsManager.MODE_ALLOWED, AppOpsManager.MODE_ALLOWED, // OP_COARSE_LOCATION AppOpsManager.MODE_ALLOWED, // OP_FINE_LOCATION AppOpsManager.MODE_ALLOWED, // OP_GPS AppOpsManager.MODE_ALLOWED, // OP_VIBRATE AppOpsManager.MODE_ALLOWED, // OP_READ_CONTACTS AppOpsManager.MODE_ALLOWED, // OP_WRITE_CONTACTS AppOpsManager.MODE_ALLOWED, // OP_READ_CALL_LOG AppOpsManager.MODE_ALLOWED, // OP_WRITE_CALL_LOG AppOpsManager.MODE_ALLOWED, // OP_READ_CALENDAR AppOpsManager.MODE_ALLOWED, // OP_WRITE_CALENDAR AppOpsManager.MODE_ALLOWED, // OP_WIFI_SCAN AppOpsManager.MODE_ALLOWED, // OP_POST_NOTIFICATION AppOpsManager.MODE_ALLOWED, // OP_NEIGHBORING_CELLS AppOpsManager.MODE_ALLOWED, // OP_CALL_PHONE AppOpsManager.MODE_ALLOWED, // OP_READ_SMS AppOpsManager.MODE_IGNORED, // OP_WRITE_SMS AppOpsManager.MODE_ALLOWED, // OP_RECEIVE_SMS AppOpsManager.MODE_ALLOWED, // OP_RECEIVE_EMERGECY_SMS AppOpsManager.MODE_ALLOWED, // OP_RECEIVE_MMS AppOpsManager.MODE_ALLOWED, // OP_RECEIVE_WAP_PUSH AppOpsManager.MODE_ALLOWED, // OP_SEND_SMS AppOpsManager.MODE_ALLOWED, // OP_READ_ICC_SMS AppOpsManager.MODE_ALLOWED, // OP_WRITE_ICC_SMS AppOpsManager.MODE_ALLOWED, // OP_WRITE_SETTINGS AppOpsManager.MODE_ALLOWED, // OP_SYSTEM_ALERT_WINDOW AppOpsManager.MODE_ALLOWED, // OP_ACCESS_NOTIFICATIONS AppOpsManager.MODE_ALLOWED, // OP_CAMERA AppOpsManager.MODE_ALLOWED, // OP_RECORD_AUDIO AppOpsManager.MODE_ALLOWED, // OP_PLAY_AUDIO AppOpsManager.MODE_ALLOWED, // OP_READ_CLIPBOARD AppOpsManager.MODE_ALLOWED, // OP_WRITE_CLIPBOARD AppOpsManager.MODE_ALLOWED, // OP_TAKE_MEDIA_BUTTONS AppOpsManager.MODE_ALLOWED, // OP_TAKE_AUDIO_FOCUS AppOpsManager.MODE_ALLOWED, // OP_AUDIO_MASTER_VOLUME AppOpsManager.MODE_ALLOWED, // OP_AUDIO_VOICE_VOLUME AppOpsManager.MODE_ALLOWED, // OP_AUDIO_RING_VOLUME AppOpsManager.MODE_ALLOWED, // OP_AUDIO_MEDIA_VOLUME AppOpsManager.MODE_ALLOWED, // OP_AUDIO_ALARM_VOLUME AppOpsManager.MODE_ALLOWED, // OP_AUDIO_NOTIFICATION_VOLUME AppOpsManager.MODE_ALLOWED, // OP_AUDIO_BLUETOOTH_VOLUME AppOpsManager.MODE_ALLOWED, // OP_WAKE_LOCK AppOpsManager.MODE_ALLOWED, // OP_MONITOR_LOCATION AppOpsManager.MODE_ALLOWED, // OP_MONITOR_HIGH_POWER_LOCATION }; /** * This specifies the default mode for each strict operation. */ private static int[] sOpDefaultStrictMode = new int[] { AppOpsManager.MODE_ASK, // OP_COARSE_LOCATION AppOpsManager.MODE_ASK, // OP_FINE_LOCATION AppOpsManager.MODE_ASK, // OP_GPS AppOpsManager.MODE_ALLOWED, // OP_VIBRATE AppOpsManager.MODE_ASK, // OP_READ_CONTACTS AppOpsManager.MODE_ASK, // OP_WRITE_CONTACTS AppOpsManager.MODE_ASK, // OP_READ_CALL_LOG AppOpsManager.MODE_ASK, // OP_WRITE_CALL_LOG AppOpsManager.MODE_ALLOWED, // OP_READ_CALENDAR AppOpsManager.MODE_ALLOWED, // OP_WRITE_CALENDAR AppOpsManager.MODE_ASK, // OP_WIFI_SCAN AppOpsManager.MODE_ALLOWED, // OP_POST_NOTIFICATION AppOpsManager.MODE_ALLOWED, // OP_NEIGHBORING_CELLS AppOpsManager.MODE_ASK, // OP_CALL_PHONE AppOpsManager.MODE_ASK, // OP_READ_SMS AppOpsManager.MODE_ASK, // OP_WRITE_SMS AppOpsManager.MODE_ASK, // OP_RECEIVE_SMS AppOpsManager.MODE_ALLOWED, // OP_RECEIVE_EMERGECY_SMS AppOpsManager.MODE_ASK, // OP_RECEIVE_MMS AppOpsManager.MODE_ALLOWED, // OP_RECEIVE_WAP_PUSH AppOpsManager.MODE_ASK, // OP_SEND_SMS AppOpsManager.MODE_ALLOWED, // OP_READ_ICC_SMS AppOpsManager.MODE_ALLOWED, // OP_WRITE_ICC_SMS AppOpsManager.MODE_ALLOWED, // OP_WRITE_SETTINGS AppOpsManager.MODE_ALLOWED, // OP_SYSTEM_ALERT_WINDOW AppOpsManager.MODE_ALLOWED, // OP_ACCESS_NOTIFICATIONS AppOpsManager.MODE_ASK, // OP_CAMERA AppOpsManager.MODE_ASK, // OP_RECORD_AUDIO AppOpsManager.MODE_ALLOWED, // OP_PLAY_AUDIO AppOpsManager.MODE_ALLOWED, // OP_READ_CLIPBOARD AppOpsManager.MODE_ALLOWED, // OP_WRITE_CLIPBOARD AppOpsManager.MODE_ALLOWED, // OP_TAKE_MEDIA_BUTTONS AppOpsManager.MODE_ALLOWED, // OP_TAKE_AUDIO_FOCUS AppOpsManager.MODE_ALLOWED, // OP_AUDIO_MASTER_VOLUME AppOpsManager.MODE_ALLOWED, // OP_AUDIO_VOICE_VOLUME AppOpsManager.MODE_ALLOWED, // OP_AUDIO_RING_VOLUME AppOpsManager.MODE_ALLOWED, // OP_AUDIO_MEDIA_VOLUME AppOpsManager.MODE_ALLOWED, // OP_AUDIO_ALARM_VOLUME AppOpsManager.MODE_ALLOWED, // OP_AUDIO_NOTIFICATION_VOLUME AppOpsManager.MODE_ALLOWED, // OP_AUDIO_BLUETOOTH_VOLUME AppOpsManager.MODE_ALLOWED, // OP_WAKE_LOCK AppOpsManager.MODE_ALLOWED, // OP_MONITOR_LOCATION AppOpsManager.MODE_ASK, // OP_MONITOR_HIGH_POWER_LOCATION }; /** * This specifies whether each option is allowed to be reset * when resetting all app preferences. Disable reset for Loading Loading @@ -529,6 +589,10 @@ public class AppOpsManager { throw new IllegalStateException("sOpDefaultMode length " + sOpDefaultMode.length + " should be " + _NUM_OP); } if (sOpDefaultStrictMode.length != _NUM_OP) { throw new IllegalStateException("sOpDefaultStrictMode length " + sOpDefaultStrictMode.length + " should be " + _NUM_OP); } if (sOpDisableReset.length != _NUM_OP) { throw new IllegalStateException("sOpDisableReset length " + sOpDisableReset.length + " should be " + _NUM_OP); Loading Loading @@ -569,7 +633,10 @@ public class AppOpsManager { * Retrieve the default mode for the operation. * @hide */ public static int opToDefaultMode(int op) { public static int opToDefaultMode(int op, boolean strict) { if(strict) return sOpDefaultStrictMode[op]; else return sOpDefaultMode[op]; } Loading Loading @@ -1133,4 +1200,9 @@ public class AppOpsManager { public void finishOp(int op) { finishOp(op, Process.myUid(), mContext.getOpPackageName()); } /** @hide */ public static boolean isStrictEnable() { return SystemProperties.getBoolean("persist.sys.strict_op_enable", false); } } core/res/res/layout/permission_confirmation_dialog.xml 0 → 100644 +69 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- /* ** Copyright (c) 2013, The Linux Foundation. All rights reserved. ** Not a Contribution. ** ** Copyright 2012 The Android Open Source Project ** ** Licensed under the Apache License, Version 2.0 (the "License"); ** you may not use this file except in compliance with the License. ** You may obtain a copy of the License at ** ** http://www.apache.org/licenses/LICENSE-2.0 ** ** Unless required by applicable law or agreed to in writing, software ** distributed under the License is distributed on an "AS IS" BASIS, ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ** See the License for the specific language governing permissions and ** limitations under the License. */ --> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/parentPanel" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginLeft="8dip" android:layout_marginRight="8dip" android:orientation="vertical"> <TextView android:id="@+id/permission_text" style="?android:attr/textAppearanceMedium" android:layout_width="match_parent" android:layout_height="wrap_content" android:paddingLeft="20dip" android:paddingRight="20dip" android:paddingTop="16dip" android:paddingBottom="16dip" /> <TableLayout android:id="@+id/permission_remember_layout" android:shrinkColumns="1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:paddingLeft="16dip" android:paddingRight="16dip"> <TableRow android:layout_width="wrap_content" android:layout_height="wrap_content" > <RelativeLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:paddingTop="12dip" android:paddingLeft="8dip" > <CheckBox android:id="@+id/permission_remember_choice_checkbox" android:paddingTop="11dip" android:layout_width="wrap_content" android:layout_height="wrap_content" /> </RelativeLayout> <TextView android:id="@+id/permission_remember_choice_text" android:layout_width="wrap_content" android:layout_height="wrap_content" android:paddingTop="18dip" android:text="@string/permission_remember_choice" /> </TableRow> </TableLayout> </LinearLayout> core/res/res/values/config.xml +47 −0 Original line number Diff line number Diff line Loading @@ -1310,4 +1310,51 @@ <!-- Whether cpu boost is enabled for overscroller fling. --> <bool name="config_enableCpuBoostForOverScrollerFling">false</bool> <!-- User display names for app ops codes --> <string-array name="app_ops_labels"> <item>Trying to access location</item> <item>Trying to access location</item> <item>Trying to access location</item> <item>Trying to use vibrate</item> <item>Trying to read contacts</item> <item>Trying to modify contacts</item> <item>Trying to read call log</item> <item>Trying to modify call log</item> <item>Trying to read calendar</item> <item>Trying to modify calendar</item> <item>Trying to access location</item> <item>Trying to post notification</item> <item>Trying to access location</item> <item>Trying to make phone call</item> <item>Trying to read SMS/MMS</item> <item>Trying to write/modify SMS/MMS</item> <item>Trying to receive SMS/MMS</item> <item>Trying to receive SMS/MMS</item> <item>Trying to receive SMS/MMS</item> <item>Trying to receive SMS/MMS</item> <item>Trying to send SMS/MMS</item> <item>Trying to read SMS/MMS</item> <item>Trying to write/modify SMS/MMS</item> <item>Trying to modify settings</item> <item>Trying to draw on top</item> <item>Trying to access notifications</item> <item>Trying to access Camera</item> <item>Trying to record audio</item> <item>Trying to play audio</item> <item>Trying to read clipboard</item> <item>Trying to modify clipboard</item> <item>Trying to use media buttons</item> <item>Trying to use audio focus</item> <item>Trying to use master volume</item> <item>Trying to use voice volume</item> <item>Trying to use ring volume</item> <item>Trying to use media volume</item> <item>Trying to use alarm volume</item> <item>Trying to use notification volume</item> <item>Trying to use bluetooth volume</item> <item>Trying to Keep device awake</item> <item>Trying to access location</item> <item>Trying to access location</item> </string-array> </resources> core/res/res/values/strings.xml +5 −0 Original line number Diff line number Diff line Loading @@ -2,6 +2,9 @@ <!-- /* //device/apps/common/assets/res/any/strings.xml ** ** Copyright (c) 2013, The Linux Foundation. All rights reserved. ** Not a Contribution. ** ** Copyright 2006, The Android Open Source Project ** ** Licensed under the Apache License, Version 2.0 (the "License"); Loading Loading @@ -4514,4 +4517,6 @@ <string name="stk_cc_ss_to_ussd">SS request is modified to USSD request.</string> <string name="stk_cc_ss_to_ss">SS request is modified to new SS request.</string> <!-- Text of the checkbox for the permission confirmation dialog to remember the user's choice. [CHAR LIMIT=40] --> <string name="permission_remember_choice">Remember</string> </resources> core/res/res/values/symbols.xml +10 −1 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- /* Copyright 2012, The Android Open Source Project /* Copyright (c) 2013, The Linux Foundation. All rights reserved. ** Not a Contribution. ** ** Copyright 2012, The Android Open Source Project ** ** Licensed under the Apache License, Version 2.0 (the "License"); ** you may not use this file except in compliance with the License. Loading Loading @@ -220,6 +223,10 @@ <java-symbol type="id" name="pin_confirm_text" /> <java-symbol type="id" name="pin_error_message" /> <java-symbol type="id" name="timePickerLayout" /> <java-symbol type="id" name="permission_text" /> <java-symbol type="id" name="permission_remember_layout" /> <java-symbol type="id" name="permission_remember_choice_checkbox" /> <java-symbol type="id" name="permission_remember_choice_text" /> <java-symbol type="attr" name="actionModeShareDrawable" /> <java-symbol type="attr" name="alertDialogCenterButtons" /> Loading Loading @@ -1168,6 +1175,7 @@ <java-symbol type="layout" name="locale_picker_item" /> <java-symbol type="layout" name="media_controller" /> <java-symbol type="layout" name="overlay_display_window" /> <java-symbol type="layout" name="permission_confirmation_dialog" /> <java-symbol type="layout" name="preference" /> <java-symbol type="layout" name="preference_header_item" /> <java-symbol type="layout" name="preference_list_content" /> Loading Loading @@ -1430,6 +1438,7 @@ <java-symbol type="anim" name="rotation_animation_jump_exit" /> <java-symbol type="anim" name="rotation_animation_xfade_exit" /> <java-symbol type="anim" name="rotation_animation_enter" /> <java-symbol type="array" name="app_ops_labels" /> <java-symbol type="array" name="config_autoBrightnessButtonBacklightValues" /> <java-symbol type="array" name="config_autoBrightnessKeyboardBacklightValues" /> <java-symbol type="array" name="config_autoBrightnessLcdBacklightValues" /> Loading Loading
core/java/android/app/AppOpsManager.java +118 −46 Original line number Diff line number Diff line /* * Copyright (c) 2013, The Linux Foundation. All rights reserved. * Not a Contribution. * * Copyright (C) 2012 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); Loading @@ -18,6 +21,7 @@ package android.app; import android.os.Binder; import android.os.IBinder; import android.os.SystemProperties; import android.util.ArrayMap; import com.android.internal.app.IAppOpsService; import com.android.internal.app.IAppOpsCallback; Loading Loading @@ -90,9 +94,15 @@ public class AppOpsManager { */ public static final int MODE_ERRORED = 2; /** @hide This mode should never be returned to caller * Result from {@link #checkOp} the given caller is * not allowed to perform the given operation. */ public static final int MODE_ASK = 3; // when adding one of these: // - increment _NUM_OP // - add rows to sOpToSwitch, sOpToString, sOpNames, sOpPerms, sOpDefaultMode // - add rows to sOpToSwitch, sOpToString, sOpNames, sOpPerms, sOpDefaultMode, sOpDefaultStrictMode // - add descriptive strings to Settings/res/values/arrays.xml // - add the op to the appropriate template in AppOpsState.OpsTemplate (settings app) Loading Loading @@ -408,51 +418,101 @@ public class AppOpsManager { * This specifies the default mode for each operation. */ private static int[] sOpDefaultMode = new int[] { AppOpsManager.MODE_ALLOWED, AppOpsManager.MODE_ALLOWED, AppOpsManager.MODE_ALLOWED, AppOpsManager.MODE_ALLOWED, AppOpsManager.MODE_ALLOWED, AppOpsManager.MODE_ALLOWED, AppOpsManager.MODE_ALLOWED, AppOpsManager.MODE_ALLOWED, AppOpsManager.MODE_ALLOWED, AppOpsManager.MODE_ALLOWED, AppOpsManager.MODE_ALLOWED, AppOpsManager.MODE_ALLOWED, AppOpsManager.MODE_ALLOWED, AppOpsManager.MODE_ALLOWED, AppOpsManager.MODE_ALLOWED, AppOpsManager.MODE_ALLOWED, // OP_WRITE_SMS AppOpsManager.MODE_ALLOWED, AppOpsManager.MODE_ALLOWED, AppOpsManager.MODE_ALLOWED, AppOpsManager.MODE_ALLOWED, AppOpsManager.MODE_ALLOWED, AppOpsManager.MODE_ALLOWED, AppOpsManager.MODE_ALLOWED, AppOpsManager.MODE_ALLOWED, AppOpsManager.MODE_ALLOWED, AppOpsManager.MODE_ALLOWED, AppOpsManager.MODE_ALLOWED, AppOpsManager.MODE_ALLOWED, AppOpsManager.MODE_ALLOWED, AppOpsManager.MODE_ALLOWED, AppOpsManager.MODE_ALLOWED, AppOpsManager.MODE_ALLOWED, AppOpsManager.MODE_ALLOWED, AppOpsManager.MODE_ALLOWED, AppOpsManager.MODE_ALLOWED, AppOpsManager.MODE_ALLOWED, AppOpsManager.MODE_ALLOWED, AppOpsManager.MODE_ALLOWED, AppOpsManager.MODE_ALLOWED, AppOpsManager.MODE_ALLOWED, AppOpsManager.MODE_ALLOWED, AppOpsManager.MODE_ALLOWED, AppOpsManager.MODE_ALLOWED, AppOpsManager.MODE_ALLOWED, // OP_COARSE_LOCATION AppOpsManager.MODE_ALLOWED, // OP_FINE_LOCATION AppOpsManager.MODE_ALLOWED, // OP_GPS AppOpsManager.MODE_ALLOWED, // OP_VIBRATE AppOpsManager.MODE_ALLOWED, // OP_READ_CONTACTS AppOpsManager.MODE_ALLOWED, // OP_WRITE_CONTACTS AppOpsManager.MODE_ALLOWED, // OP_READ_CALL_LOG AppOpsManager.MODE_ALLOWED, // OP_WRITE_CALL_LOG AppOpsManager.MODE_ALLOWED, // OP_READ_CALENDAR AppOpsManager.MODE_ALLOWED, // OP_WRITE_CALENDAR AppOpsManager.MODE_ALLOWED, // OP_WIFI_SCAN AppOpsManager.MODE_ALLOWED, // OP_POST_NOTIFICATION AppOpsManager.MODE_ALLOWED, // OP_NEIGHBORING_CELLS AppOpsManager.MODE_ALLOWED, // OP_CALL_PHONE AppOpsManager.MODE_ALLOWED, // OP_READ_SMS AppOpsManager.MODE_IGNORED, // OP_WRITE_SMS AppOpsManager.MODE_ALLOWED, // OP_RECEIVE_SMS AppOpsManager.MODE_ALLOWED, // OP_RECEIVE_EMERGECY_SMS AppOpsManager.MODE_ALLOWED, // OP_RECEIVE_MMS AppOpsManager.MODE_ALLOWED, // OP_RECEIVE_WAP_PUSH AppOpsManager.MODE_ALLOWED, // OP_SEND_SMS AppOpsManager.MODE_ALLOWED, // OP_READ_ICC_SMS AppOpsManager.MODE_ALLOWED, // OP_WRITE_ICC_SMS AppOpsManager.MODE_ALLOWED, // OP_WRITE_SETTINGS AppOpsManager.MODE_ALLOWED, // OP_SYSTEM_ALERT_WINDOW AppOpsManager.MODE_ALLOWED, // OP_ACCESS_NOTIFICATIONS AppOpsManager.MODE_ALLOWED, // OP_CAMERA AppOpsManager.MODE_ALLOWED, // OP_RECORD_AUDIO AppOpsManager.MODE_ALLOWED, // OP_PLAY_AUDIO AppOpsManager.MODE_ALLOWED, // OP_READ_CLIPBOARD AppOpsManager.MODE_ALLOWED, // OP_WRITE_CLIPBOARD AppOpsManager.MODE_ALLOWED, // OP_TAKE_MEDIA_BUTTONS AppOpsManager.MODE_ALLOWED, // OP_TAKE_AUDIO_FOCUS AppOpsManager.MODE_ALLOWED, // OP_AUDIO_MASTER_VOLUME AppOpsManager.MODE_ALLOWED, // OP_AUDIO_VOICE_VOLUME AppOpsManager.MODE_ALLOWED, // OP_AUDIO_RING_VOLUME AppOpsManager.MODE_ALLOWED, // OP_AUDIO_MEDIA_VOLUME AppOpsManager.MODE_ALLOWED, // OP_AUDIO_ALARM_VOLUME AppOpsManager.MODE_ALLOWED, // OP_AUDIO_NOTIFICATION_VOLUME AppOpsManager.MODE_ALLOWED, // OP_AUDIO_BLUETOOTH_VOLUME AppOpsManager.MODE_ALLOWED, // OP_WAKE_LOCK AppOpsManager.MODE_ALLOWED, // OP_MONITOR_LOCATION AppOpsManager.MODE_ALLOWED, // OP_MONITOR_HIGH_POWER_LOCATION }; /** * This specifies the default mode for each strict operation. */ private static int[] sOpDefaultStrictMode = new int[] { AppOpsManager.MODE_ASK, // OP_COARSE_LOCATION AppOpsManager.MODE_ASK, // OP_FINE_LOCATION AppOpsManager.MODE_ASK, // OP_GPS AppOpsManager.MODE_ALLOWED, // OP_VIBRATE AppOpsManager.MODE_ASK, // OP_READ_CONTACTS AppOpsManager.MODE_ASK, // OP_WRITE_CONTACTS AppOpsManager.MODE_ASK, // OP_READ_CALL_LOG AppOpsManager.MODE_ASK, // OP_WRITE_CALL_LOG AppOpsManager.MODE_ALLOWED, // OP_READ_CALENDAR AppOpsManager.MODE_ALLOWED, // OP_WRITE_CALENDAR AppOpsManager.MODE_ASK, // OP_WIFI_SCAN AppOpsManager.MODE_ALLOWED, // OP_POST_NOTIFICATION AppOpsManager.MODE_ALLOWED, // OP_NEIGHBORING_CELLS AppOpsManager.MODE_ASK, // OP_CALL_PHONE AppOpsManager.MODE_ASK, // OP_READ_SMS AppOpsManager.MODE_ASK, // OP_WRITE_SMS AppOpsManager.MODE_ASK, // OP_RECEIVE_SMS AppOpsManager.MODE_ALLOWED, // OP_RECEIVE_EMERGECY_SMS AppOpsManager.MODE_ASK, // OP_RECEIVE_MMS AppOpsManager.MODE_ALLOWED, // OP_RECEIVE_WAP_PUSH AppOpsManager.MODE_ASK, // OP_SEND_SMS AppOpsManager.MODE_ALLOWED, // OP_READ_ICC_SMS AppOpsManager.MODE_ALLOWED, // OP_WRITE_ICC_SMS AppOpsManager.MODE_ALLOWED, // OP_WRITE_SETTINGS AppOpsManager.MODE_ALLOWED, // OP_SYSTEM_ALERT_WINDOW AppOpsManager.MODE_ALLOWED, // OP_ACCESS_NOTIFICATIONS AppOpsManager.MODE_ASK, // OP_CAMERA AppOpsManager.MODE_ASK, // OP_RECORD_AUDIO AppOpsManager.MODE_ALLOWED, // OP_PLAY_AUDIO AppOpsManager.MODE_ALLOWED, // OP_READ_CLIPBOARD AppOpsManager.MODE_ALLOWED, // OP_WRITE_CLIPBOARD AppOpsManager.MODE_ALLOWED, // OP_TAKE_MEDIA_BUTTONS AppOpsManager.MODE_ALLOWED, // OP_TAKE_AUDIO_FOCUS AppOpsManager.MODE_ALLOWED, // OP_AUDIO_MASTER_VOLUME AppOpsManager.MODE_ALLOWED, // OP_AUDIO_VOICE_VOLUME AppOpsManager.MODE_ALLOWED, // OP_AUDIO_RING_VOLUME AppOpsManager.MODE_ALLOWED, // OP_AUDIO_MEDIA_VOLUME AppOpsManager.MODE_ALLOWED, // OP_AUDIO_ALARM_VOLUME AppOpsManager.MODE_ALLOWED, // OP_AUDIO_NOTIFICATION_VOLUME AppOpsManager.MODE_ALLOWED, // OP_AUDIO_BLUETOOTH_VOLUME AppOpsManager.MODE_ALLOWED, // OP_WAKE_LOCK AppOpsManager.MODE_ALLOWED, // OP_MONITOR_LOCATION AppOpsManager.MODE_ASK, // OP_MONITOR_HIGH_POWER_LOCATION }; /** * This specifies whether each option is allowed to be reset * when resetting all app preferences. Disable reset for Loading Loading @@ -529,6 +589,10 @@ public class AppOpsManager { throw new IllegalStateException("sOpDefaultMode length " + sOpDefaultMode.length + " should be " + _NUM_OP); } if (sOpDefaultStrictMode.length != _NUM_OP) { throw new IllegalStateException("sOpDefaultStrictMode length " + sOpDefaultStrictMode.length + " should be " + _NUM_OP); } if (sOpDisableReset.length != _NUM_OP) { throw new IllegalStateException("sOpDisableReset length " + sOpDisableReset.length + " should be " + _NUM_OP); Loading Loading @@ -569,7 +633,10 @@ public class AppOpsManager { * Retrieve the default mode for the operation. * @hide */ public static int opToDefaultMode(int op) { public static int opToDefaultMode(int op, boolean strict) { if(strict) return sOpDefaultStrictMode[op]; else return sOpDefaultMode[op]; } Loading Loading @@ -1133,4 +1200,9 @@ public class AppOpsManager { public void finishOp(int op) { finishOp(op, Process.myUid(), mContext.getOpPackageName()); } /** @hide */ public static boolean isStrictEnable() { return SystemProperties.getBoolean("persist.sys.strict_op_enable", false); } }
core/res/res/layout/permission_confirmation_dialog.xml 0 → 100644 +69 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- /* ** Copyright (c) 2013, The Linux Foundation. All rights reserved. ** Not a Contribution. ** ** Copyright 2012 The Android Open Source Project ** ** Licensed under the Apache License, Version 2.0 (the "License"); ** you may not use this file except in compliance with the License. ** You may obtain a copy of the License at ** ** http://www.apache.org/licenses/LICENSE-2.0 ** ** Unless required by applicable law or agreed to in writing, software ** distributed under the License is distributed on an "AS IS" BASIS, ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ** See the License for the specific language governing permissions and ** limitations under the License. */ --> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/parentPanel" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginLeft="8dip" android:layout_marginRight="8dip" android:orientation="vertical"> <TextView android:id="@+id/permission_text" style="?android:attr/textAppearanceMedium" android:layout_width="match_parent" android:layout_height="wrap_content" android:paddingLeft="20dip" android:paddingRight="20dip" android:paddingTop="16dip" android:paddingBottom="16dip" /> <TableLayout android:id="@+id/permission_remember_layout" android:shrinkColumns="1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:paddingLeft="16dip" android:paddingRight="16dip"> <TableRow android:layout_width="wrap_content" android:layout_height="wrap_content" > <RelativeLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:paddingTop="12dip" android:paddingLeft="8dip" > <CheckBox android:id="@+id/permission_remember_choice_checkbox" android:paddingTop="11dip" android:layout_width="wrap_content" android:layout_height="wrap_content" /> </RelativeLayout> <TextView android:id="@+id/permission_remember_choice_text" android:layout_width="wrap_content" android:layout_height="wrap_content" android:paddingTop="18dip" android:text="@string/permission_remember_choice" /> </TableRow> </TableLayout> </LinearLayout>
core/res/res/values/config.xml +47 −0 Original line number Diff line number Diff line Loading @@ -1310,4 +1310,51 @@ <!-- Whether cpu boost is enabled for overscroller fling. --> <bool name="config_enableCpuBoostForOverScrollerFling">false</bool> <!-- User display names for app ops codes --> <string-array name="app_ops_labels"> <item>Trying to access location</item> <item>Trying to access location</item> <item>Trying to access location</item> <item>Trying to use vibrate</item> <item>Trying to read contacts</item> <item>Trying to modify contacts</item> <item>Trying to read call log</item> <item>Trying to modify call log</item> <item>Trying to read calendar</item> <item>Trying to modify calendar</item> <item>Trying to access location</item> <item>Trying to post notification</item> <item>Trying to access location</item> <item>Trying to make phone call</item> <item>Trying to read SMS/MMS</item> <item>Trying to write/modify SMS/MMS</item> <item>Trying to receive SMS/MMS</item> <item>Trying to receive SMS/MMS</item> <item>Trying to receive SMS/MMS</item> <item>Trying to receive SMS/MMS</item> <item>Trying to send SMS/MMS</item> <item>Trying to read SMS/MMS</item> <item>Trying to write/modify SMS/MMS</item> <item>Trying to modify settings</item> <item>Trying to draw on top</item> <item>Trying to access notifications</item> <item>Trying to access Camera</item> <item>Trying to record audio</item> <item>Trying to play audio</item> <item>Trying to read clipboard</item> <item>Trying to modify clipboard</item> <item>Trying to use media buttons</item> <item>Trying to use audio focus</item> <item>Trying to use master volume</item> <item>Trying to use voice volume</item> <item>Trying to use ring volume</item> <item>Trying to use media volume</item> <item>Trying to use alarm volume</item> <item>Trying to use notification volume</item> <item>Trying to use bluetooth volume</item> <item>Trying to Keep device awake</item> <item>Trying to access location</item> <item>Trying to access location</item> </string-array> </resources>
core/res/res/values/strings.xml +5 −0 Original line number Diff line number Diff line Loading @@ -2,6 +2,9 @@ <!-- /* //device/apps/common/assets/res/any/strings.xml ** ** Copyright (c) 2013, The Linux Foundation. All rights reserved. ** Not a Contribution. ** ** Copyright 2006, The Android Open Source Project ** ** Licensed under the Apache License, Version 2.0 (the "License"); Loading Loading @@ -4514,4 +4517,6 @@ <string name="stk_cc_ss_to_ussd">SS request is modified to USSD request.</string> <string name="stk_cc_ss_to_ss">SS request is modified to new SS request.</string> <!-- Text of the checkbox for the permission confirmation dialog to remember the user's choice. [CHAR LIMIT=40] --> <string name="permission_remember_choice">Remember</string> </resources>
core/res/res/values/symbols.xml +10 −1 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- /* Copyright 2012, The Android Open Source Project /* Copyright (c) 2013, The Linux Foundation. All rights reserved. ** Not a Contribution. ** ** Copyright 2012, The Android Open Source Project ** ** Licensed under the Apache License, Version 2.0 (the "License"); ** you may not use this file except in compliance with the License. Loading Loading @@ -220,6 +223,10 @@ <java-symbol type="id" name="pin_confirm_text" /> <java-symbol type="id" name="pin_error_message" /> <java-symbol type="id" name="timePickerLayout" /> <java-symbol type="id" name="permission_text" /> <java-symbol type="id" name="permission_remember_layout" /> <java-symbol type="id" name="permission_remember_choice_checkbox" /> <java-symbol type="id" name="permission_remember_choice_text" /> <java-symbol type="attr" name="actionModeShareDrawable" /> <java-symbol type="attr" name="alertDialogCenterButtons" /> Loading Loading @@ -1168,6 +1175,7 @@ <java-symbol type="layout" name="locale_picker_item" /> <java-symbol type="layout" name="media_controller" /> <java-symbol type="layout" name="overlay_display_window" /> <java-symbol type="layout" name="permission_confirmation_dialog" /> <java-symbol type="layout" name="preference" /> <java-symbol type="layout" name="preference_header_item" /> <java-symbol type="layout" name="preference_list_content" /> Loading Loading @@ -1430,6 +1438,7 @@ <java-symbol type="anim" name="rotation_animation_jump_exit" /> <java-symbol type="anim" name="rotation_animation_xfade_exit" /> <java-symbol type="anim" name="rotation_animation_enter" /> <java-symbol type="array" name="app_ops_labels" /> <java-symbol type="array" name="config_autoBrightnessButtonBacklightValues" /> <java-symbol type="array" name="config_autoBrightnessKeyboardBacklightValues" /> <java-symbol type="array" name="config_autoBrightnessLcdBacklightValues" /> Loading