APP开发实战81-Android权限分类

21 Android权限介绍

21.1权限分类

Android6.0及以上系统采用了新的权限,将权限分为两类。

21.1.1NormalPermissions

这类权限一般不涉及用户隐私,是不需要用户进行授权的,只需要在AndroidManifest.xml中声明即可使用,比如使用蓝牙、访问网络等:

android.permission.ACCESS_LOCATION_EXTRA_COMMANDS

android.permission.ACCESS_NETWORK_STATE

android.permission.ACCESS_NOTIFICATION_POLICY

android.permission.ACCESS_WIFI_STATE

android.permission.ACCESS_WIMAX_STATE

android.permission.BLUETOOTH

android.permission.BLUETOOTH_ADMIN

android.permission.BROADCAST_STICKY

android.permission.CHANGE_NETWORK_STATE

android.permission.CHANGE_WIFI_MULTICAST_STATE

android.permission.CHANGE_WIFI_STATE

android.permission.CHANGE_WIMAX_STATE

android.permission.DISABLE_KEYGUARD

android.permission.EXPAND_STATUS_BAR

android.permission.FLASHLIGHT

android.permission.GET_ACCOUNTS

android.permission.GET_PACKAGE_SIZE

android.permission.INTERNET

android.permission.KILL_BACKGROUND_PROCESSES

android.permission.MODIFY_AUDIO_SETTINGS

android.permission.NFC

android.permission.READ_SYNC_SETTINGS

android.permission.READ_SYNC_STATS

android.permission.RECEIVE_BOOT_COMPLETED

android.permission.REORDER_TASKS

android.permission.REQUEST_INSTALL_PACKAGES

android.permission.SET_TIME_ZONE

android.permission.SET_WALLPAPER

android.permission.SET_WALLPAPER_HINTS

android.permission.SUBSCRIBED_FEEDS_READ

android.permission.TRANSMIT_IR

android.permission.USE_FINGERPRINT

android.permission.VIBRATE

android.permission.WAKE_LOCK

android.permission.WRITE_SYNC_SETTINGS

com.android.alarm.permission.SET_ALARM

com.android.launcher.permission.INSTALL_SHORTCUT

com.android.launcher.permission.UNINSTALL_SHORTCUT

21.1.2DangerousPermissions

另一类是DangerousPermission,一般是涉及到用户隐私的,除了需要在AndroidManifest.xml中声明,还需要在APP运行过程中,动态权限申请用户进行授权,比如打电话、发短信等:

Permission Group

Permissions

android.permission-group.CALENDAR

  • android.permission.READ_CALENDAR
  • android.permission.WRITE_CALENDAR

android.permission-group.CAMERA

  • android.permission.CAMERA

android.permission-group.CONTACTS

  • android.permission.READ_CONTACTS
  • android.permission.WRITE_CONTACTS
  • android.permission.GET_ACCOUNTS

android.permission-group.LOCATION

  • android.permission.ACCESS_FINE_LOCATION
  • android.permission.ACCESS_COARSE_LOCATION

android.permission-group.MICROPHONE

  • android.permission.RECORD_AUDIO

android.permission-group.PHONE

  • android.permission.READ_PHONE_STATE
  • android.permission.CALL_PHONE
  • android.permission.READ_CALL_LOG
  • android.permission.WRITE_CALL_LOG
  • com.android.voicemail.permission.ADD_VOICEMAIL
  • android.permission.USE_SIP
  • android.permission.PROCESS_OUTGOING_CALLS

android.permission-group.SENSORS

  • android.permission.BODY_SENSORS

android.permission-group.SMS

  • android.permission.SEND_SMS
  • android.permission.RECEIVE_SMS
  • android.permission.READ_SMS
  • android.permission.RECEIVE_WAP_PUSH
  • android.permission.RECEIVE_MMS
  • android.permission.READ_CELL_BROADCASTS

android.permission-group.STORAGE

  • android.permission.READ_EXTERNAL_STORAGE
  • android.permission.WRITE_EXTERNAL_STORAGE

这些权限被分为九个权限组,同一组的任何一个权限被授权了,其他权限也自动被授权,反之亦然。

你可能感兴趣的:(APP开发实战,Android-权限)