Android new permissions mechanism AppOps

Source: Internet
Author: User

http://blog.csdn.net/hyhyl1990/article/details/46842915

http://m.blog.csdn.net/article/details?id=51693586

The two articles are relatively good, but they are notvoid setMode ( int code,int uid,String packageName,int mode)的参数有具体的说明

Code represents the specific operation permission, mode represents the type to be changed (allow/disable/prompt)

Specific permissions corresponding to the code, you can view the Appopsmanager.java source description.

OK, and find the source code, as follows

Http://tools.oesf.biz/android-4.3.0_r2.1/xref/frameworks/base/core/java/android/app/AppOpsManager.java

  Public Static Final intmode_allowed = 0; 59 Public Static Final intmode_ignored = 1; 60 Public Static Final intmode_errored = 2; 61 62//When adding one of these:63//-Increment _num_op64//-Add rows to Soptoswitch, Sopnames, Sopperms65//-Add descriptive strings to Settings/res/values/arrays.xml66 Public Static Final intOp_none =-1; 67 Public Static Final intop_coarse_location = 0; 68 Public Static Final intOp_fine_location = 1; 69 Public Static Final intOp_gps = 2; 70 Public Static Final intOp_vibrate = 3; 71 Public Static Final intOp_read_contacts = 4; 72 Public Static Final intOp_write_contacts = 5; 73 Public Static Final intOp_read_call_log = 6; 74 Public Static Final intOp_write_call_log = 7; 75 Public Static Final intOp_read_calendar = 8; 76 Public Static Final intOp_write_calendar = 9; 77 Public Static Final intOp_wifi_scan = 10; 78 Public Static Final intOp_post_notification = 11; 79 Public Static Final intOp_neighboring_cells = 12; 80 Public Static Final intOp_call_phone = 13; 81 Public Static Final intOp_read_sms = 14; 82 Public Static Final intOp_write_sms = 15; 83 Public Static Final intOp_receive_sms = 16; 84 Public Static Final intOp_receive_emergecy_sms = 17; 85 Public Static Final intOp_receive_mms = 18; 86 Public Static Final intOp_receive_wap_push = 19; 87 Public Static Final intOp_send_sms = 20; 88 Public Static Final intOp_read_icc_sms = 21; 89 Public Static Final intOp_write_icc_sms = 22; 90 Public Static Final intOp_write_settings = 23; 91 Public Static Final intOp_system_alert_window = 24; 92 Public Static Final intOp_access_notifications = 25; 93 Public Static Final intOp_camera = 26; 94 Public Static Final intOp_record_audio = 27; 95 Public Static Final intOp_play_audio = 28; 96 Public Static Final intOp_read_clipboard = 29; 97 Public Static Final intOp_write_clipboard = 30; 98/**@hide*/99 Public Static Final int_num_op = 31; 100 101/**102 * This maps all operation to the operation, serves as the 103 * switch to determine whether  It is allowed. Generally this was 104 * a 1:1 mapping, but for some things    Vel operations being tracked that should being 106 * presented to hte user as one switch and this can is used to    107 * Make them all controlled by the same single operation. 108*/109Private Static int[] Soptoswitch =New int[] {    110Op_coarse_location,111Op_coarse_location,112Op_coarse_location,113Op_vibrate,114Op_read_contacts,115Op_write_contacts,116Op_read_call_log,117Op_write_call_log,118Op_read_calendar,119Op_write_calendar,120Op_coarse_location,121Op_post_notification,122Op_coarse_location,123Op_call_phone,124Op_read_sms,125Op_write_sms,126Op_read_sms,127Op_read_sms,128Op_read_sms,129Op_read_sms,130Op_write_sms,131Op_read_sms,132Op_write_sms,133Op_write_settings,134Op_system_alert_window,135Op_access_notifications,136Op_camera,137Op_record_audio,138Op_play_audio,139Op_read_clipboard,140Op_write_clipboard,141};

Android new permissions mechanism AppOps

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.