Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Android Marshmallow - New System Permissions

Sponsored · Your Podcast. Everywhere. Effortlessly. Share. Educate. Inspire. Entertain. You do you. We'll handle the rest. →

Android Marshmallow - New System Permissions

droidCon 2016 - Tunisia

Avatar for Slim BENHAMMOUDA

Slim BENHAMMOUDA

March 06, 2016

More Decks by Slim BENHAMMOUDA

Other Decks in Programming

Transcript

  1. Normal There's no great risk to the user's privacy or

    security in letting apps have those permissions • Internet • Network state • flashlight …. Two types of permissions Dangerous App wants data or resources that involve the user's private information, or could potentially affect the user's stored data or the operation of other apps
  2. Dangerous permissions groups Calendar Managing calendars. Camera Taking photos and

    recording videos. Contacts Managing contacts. Location Current device location. Microphone Audio recording. Phone Dialing and managing phone calls. Body Sensors Heart rate and similar data. SMS Sending and viewing messages. Storage Accessing photos, media, and files.
  3. Call Method Flow SDK < 23 Check SDK version User

    Already granted Permission Display Why We need Permission Disable Feature Check if permission was previously denied Request Permission Handle Permission Request SDK >= 23 No Yes Denied Granted Yes No Check if app has permission
  4. Request permissions • Explain why the app needs permissions •

    Using shouldShowRequestPermissionRationale(), we check if permission was previously denied. • If permission wasn’t denied, request it using ActivityCompat.requestPermissions()
  5. Handle the permissions request response • Implement onRequestPermissionsResult in your

    activity • Handle the permission request result : PackageManager.PERMISSION_GRANTED or PackageManager.PERMISSION_DENIED • Disable the feature if permission denied