SlideShare a Scribd company logo
1 of 12
Android Permission System
Agenda
● Introduction
● Application Sandbox
● Types Of Permission
● Check For Permission
● Request For Permission
● Handle Permission Request Response
● How Android System Ask For Permission
Introduction
●
To protect android system and user's privacy, Android system runs
each application in a limited access sandbox.
● If the app wants to use resources or info outside of its sandbox,
The app has to explicitly request permission.
●
Earlier all permissions used to set at installation time and can not
change untill the reinstallation, but now in new version of android,
Permissions are asked at the time of usage.
● In order to grant a permission, It should be declared in the
manifest file, The system then evaluates it and make a final
decision on whether to grant or deny.
Application Sandbox
● The Android system assigns a unique (UID) to each
android application and runs it in a separate process.
● Limiting the access of application.
● Any program can ask to Activity Manager to launch
other application, which runs with that application's UID.
● For instance A is not allowed to do something malicious,
like to read application B's data or dial the phone
without permission.
Types Of Permission
● Depending on the type of permission that app requests, The system
may grant the permission automatically, or ask the user to grant the
permission.
● Normal Permissions: Normal permissions do not directly risk the
user's privacy, so the system grant the permision automatically. Ex –
permission for flashlight.
● Dangerous Permissions: Dangerous permissions can give the
access to the user's confidential data, So user has to explicitly give
approval to your app. Ex – permission to read contact.
Check For Permission
● If your app needs a dangerous permission, You must check
every time whether you have permission to perform an
operation that require the permission.
● The user is always free to deny the permission, So even if
the app used the calander yesterday, It can't be assumed
that it still has permission today.
● To check, If the app has permission, Call the method
ContextCompact.checkSelfPermission().
● The method will return an integer, You can
compare it with
PackageManager.PERMISSION_GRANTED or
PackageManager.PERMISSION_DENIED.
● See the code snippet:
//Assume thisActivity is current Activity
int permissionCheck =
ContextCompact.checkSelfPermission(thisActivity,
Manifest.permission.WRITE_CALENDER);
Request For Permission
● If your app doesn't already have the requred permission, The
app must call requestPermission() method to request
appropriate permission.
● You just need to pass required permission and a request
code to identify the permission request as parameter.
● This function works asynchronously.
● After the user responds to the permission dialog box, The
callback goes to overriden method
onRequestPermissionResult() of activity with the request
code and result.
● There may be a situation, Where user deny the requested permission.
It may due to not understandable.
● So when the user again interact with the same feature that have been
rejected, We will show a explanation dialog.
● Android provides a utility method
shouldShowRequestPermissionRationale() to overcome the situation.
●
The method returns true, If the app has been requested the permission
earlier and the uses have denied it.
● If the user check Don't ask again, The method will return false.
Handle Permission Request Response
● When your app requests for permission, The system
shows a dialog box to user.
● When user responds onRequestPermissionsResult()
method of activity will call.
● The dialog box shown by the system describes the
permission group your app needs to access instead of
specific permission.
● For instance: If you request the READ_CONTACT
permission, The system dialog show to access device
contacts.
How Android System Ask For Permission
Demo Code Snippets

More Related Content

Viewers also liked

Android secuirty permission - upload
Android secuirty   permission - uploadAndroid secuirty   permission - upload
Android secuirty permission - uploadBin Yang
 
Android 6.0 permission change
Android 6.0 permission changeAndroid 6.0 permission change
Android 6.0 permission change彥彬 洪
 
Android AsyncTask Tutorial
Android AsyncTask TutorialAndroid AsyncTask Tutorial
Android AsyncTask TutorialPerfect APK
 
Simple JSON parser
Simple JSON parserSimple JSON parser
Simple JSON parserDongjun Lee
 
Android porting for dummies @droidconin 2011
Android porting for dummies @droidconin 2011Android porting for dummies @droidconin 2011
Android porting for dummies @droidconin 2011pundiramit
 
Android webservices
Android webservicesAndroid webservices
Android webservicesKrazy Koder
 
Android json parser tutorial – example
Android json parser tutorial – exampleAndroid json parser tutorial – example
Android json parser tutorial – exampleRajat Ghai
 
Android security
Android securityAndroid security
Android securityKrazy Koder
 
Android Security Development - Part 2: Malicious Android App Dynamic Analyzi...
Android Security Development - Part 2: Malicious Android App Dynamic Analyzi...Android Security Development - Part 2: Malicious Android App Dynamic Analyzi...
Android Security Development - Part 2: Malicious Android App Dynamic Analyzi...Cheng-Yi Yu
 
Webservice for android ppt
Webservice for android pptWebservice for android ppt
Webservice for android pptsantosh lamba
 
Connecting to Web Services on Android
Connecting to Web Services on AndroidConnecting to Web Services on Android
Connecting to Web Services on Androidsullis
 
Permission in Android Security: Threats and solution
Permission in Android Security: Threats and solutionPermission in Android Security: Threats and solution
Permission in Android Security: Threats and solutionTandhy Simanjuntak
 
Consulthink @ GDG Meets U - L'Aquila2014 - Codelab: Android Security -Il ke...
Consulthink @ GDG Meets U -  L'Aquila2014  - Codelab: Android Security -Il ke...Consulthink @ GDG Meets U -  L'Aquila2014  - Codelab: Android Security -Il ke...
Consulthink @ GDG Meets U - L'Aquila2014 - Codelab: Android Security -Il ke...Consulthinkspa
 

Viewers also liked (20)

Android secuirty permission - upload
Android secuirty   permission - uploadAndroid secuirty   permission - upload
Android secuirty permission - upload
 
Android 6.0 permission change
Android 6.0 permission changeAndroid 6.0 permission change
Android 6.0 permission change
 
Json Tutorial
Json TutorialJson Tutorial
Json Tutorial
 
Android AsyncTask Tutorial
Android AsyncTask TutorialAndroid AsyncTask Tutorial
Android AsyncTask Tutorial
 
Basic Android Push Notification
Basic Android Push NotificationBasic Android Push Notification
Basic Android Push Notification
 
Android new permission model
Android new permission modelAndroid new permission model
Android new permission model
 
JSON overview and demo
JSON overview and demoJSON overview and demo
JSON overview and demo
 
Simple JSON parser
Simple JSON parserSimple JSON parser
Simple JSON parser
 
App Permissions
App PermissionsApp Permissions
App Permissions
 
Android porting for dummies @droidconin 2011
Android porting for dummies @droidconin 2011Android porting for dummies @droidconin 2011
Android porting for dummies @droidconin 2011
 
Android webservices
Android webservicesAndroid webservices
Android webservices
 
Android json parser tutorial – example
Android json parser tutorial – exampleAndroid json parser tutorial – example
Android json parser tutorial – example
 
Android security
Android securityAndroid security
Android security
 
Android - Bluetooth
Android - BluetoothAndroid - Bluetooth
Android - Bluetooth
 
Android Security Development - Part 2: Malicious Android App Dynamic Analyzi...
Android Security Development - Part 2: Malicious Android App Dynamic Analyzi...Android Security Development - Part 2: Malicious Android App Dynamic Analyzi...
Android Security Development - Part 2: Malicious Android App Dynamic Analyzi...
 
Securing android applications
Securing android applicationsSecuring android applications
Securing android applications
 
Webservice for android ppt
Webservice for android pptWebservice for android ppt
Webservice for android ppt
 
Connecting to Web Services on Android
Connecting to Web Services on AndroidConnecting to Web Services on Android
Connecting to Web Services on Android
 
Permission in Android Security: Threats and solution
Permission in Android Security: Threats and solutionPermission in Android Security: Threats and solution
Permission in Android Security: Threats and solution
 
Consulthink @ GDG Meets U - L'Aquila2014 - Codelab: Android Security -Il ke...
Consulthink @ GDG Meets U -  L'Aquila2014  - Codelab: Android Security -Il ke...Consulthink @ GDG Meets U -  L'Aquila2014  - Codelab: Android Security -Il ke...
Consulthink @ GDG Meets U - L'Aquila2014 - Codelab: Android Security -Il ke...
 

Similar to Android permission system

Android M - Runtime Permissions | Getting ready for Marshmallow
Android M - Runtime Permissions | Getting ready for MarshmallowAndroid M - Runtime Permissions | Getting ready for Marshmallow
Android M - Runtime Permissions | Getting ready for MarshmallowUmair Vatao
 
Android Marshmallow APIs and Changes
Android Marshmallow APIs and ChangesAndroid Marshmallow APIs and Changes
Android Marshmallow APIs and ChangesMalwinder Singh
 
Introduction to Android M
Introduction to Android MIntroduction to Android M
Introduction to Android Mamsanjeev
 
Request permissions in Android App.pdf
Request permissions in Android App.pdfRequest permissions in Android App.pdf
Request permissions in Android App.pdfMaria440434
 
Enhancing user privacy by permission removal in android phones
Enhancing user privacy by permission removal in android phonesEnhancing user privacy by permission removal in android phones
Enhancing user privacy by permission removal in android phonesRumana Firdose
 
Android app code mediator
Android app code mediatorAndroid app code mediator
Android app code mediatorFatimaYousif11
 
A Framework for Providing Selective Permissions to Android Applications
A Framework for Providing Selective Permissions to Android ApplicationsA Framework for Providing Selective Permissions to Android Applications
A Framework for Providing Selective Permissions to Android ApplicationsIOSR Journals
 
android_mod_3.useful for bca students for their last sem
android_mod_3.useful for bca students for their last semandroid_mod_3.useful for bca students for their last sem
android_mod_3.useful for bca students for their last semaswinbiju1652
 
A journey through android development
A journey through android developmentA journey through android development
A journey through android developmentraditya gumay
 
Learn more about the Connected Apps | MuleSoft Mysore Meetup #19
Learn more about the Connected Apps | MuleSoft Mysore Meetup #19Learn more about the Connected Apps | MuleSoft Mysore Meetup #19
Learn more about the Connected Apps | MuleSoft Mysore Meetup #19MysoreMuleSoftMeetup
 
Presentation on Android application life cycle and saved instancestate
Presentation on Android application life cycle and saved instancestatePresentation on Android application life cycle and saved instancestate
Presentation on Android application life cycle and saved instancestateOsahon Gino Ediagbonya
 
Chapter 2 - Mobile Application Test Types
Chapter 2 - Mobile Application Test TypesChapter 2 - Mobile Application Test Types
Chapter 2 - Mobile Application Test TypesNeeraj Kumar Singh
 
MAD Unit 5.pptxxxxxxxxxxxxxxxxxxxxxxxxxx
MAD Unit 5.pptxxxxxxxxxxxxxxxxxxxxxxxxxxMAD Unit 5.pptxxxxxxxxxxxxxxxxxxxxxxxxxx
MAD Unit 5.pptxxxxxxxxxxxxxxxxxxxxxxxxxx34ShreyaChauhan
 
Android building blocks and application life cycle-chapter3
Android building blocks and application life cycle-chapter3Android building blocks and application life cycle-chapter3
Android building blocks and application life cycle-chapter3Dr. Ramkumar Lakshminarayanan
 
Android Permissions DemystifiedAdrienne Porter Felt, Erika.docx
Android Permissions DemystifiedAdrienne Porter Felt, Erika.docxAndroid Permissions DemystifiedAdrienne Porter Felt, Erika.docx
Android Permissions DemystifiedAdrienne Porter Felt, Erika.docxdurantheseldine
 

Similar to Android permission system (20)

Android Security
Android SecurityAndroid Security
Android Security
 
Android M - Runtime Permissions | Getting ready for Marshmallow
Android M - Runtime Permissions | Getting ready for MarshmallowAndroid M - Runtime Permissions | Getting ready for Marshmallow
Android M - Runtime Permissions | Getting ready for Marshmallow
 
Android Marshmallow APIs and Changes
Android Marshmallow APIs and ChangesAndroid Marshmallow APIs and Changes
Android Marshmallow APIs and Changes
 
Introduction to Android M
Introduction to Android MIntroduction to Android M
Introduction to Android M
 
Request permissions in Android App.pdf
Request permissions in Android App.pdfRequest permissions in Android App.pdf
Request permissions in Android App.pdf
 
Enhancing user privacy by permission removal in android phones
Enhancing user privacy by permission removal in android phonesEnhancing user privacy by permission removal in android phones
Enhancing user privacy by permission removal in android phones
 
Android app code mediator
Android app code mediatorAndroid app code mediator
Android app code mediator
 
A Framework for Providing Selective Permissions to Android Applications
A Framework for Providing Selective Permissions to Android ApplicationsA Framework for Providing Selective Permissions to Android Applications
A Framework for Providing Selective Permissions to Android Applications
 
Permissions
PermissionsPermissions
Permissions
 
android_mod_3.useful for bca students for their last sem
android_mod_3.useful for bca students for their last semandroid_mod_3.useful for bca students for their last sem
android_mod_3.useful for bca students for their last sem
 
Unit - III.pptx
Unit - III.pptxUnit - III.pptx
Unit - III.pptx
 
A journey through android development
A journey through android developmentA journey through android development
A journey through android development
 
Learn more about the Connected Apps | MuleSoft Mysore Meetup #19
Learn more about the Connected Apps | MuleSoft Mysore Meetup #19Learn more about the Connected Apps | MuleSoft Mysore Meetup #19
Learn more about the Connected Apps | MuleSoft Mysore Meetup #19
 
Presentation on Android application life cycle and saved instancestate
Presentation on Android application life cycle and saved instancestatePresentation on Android application life cycle and saved instancestate
Presentation on Android application life cycle and saved instancestate
 
Chapter 2 - Mobile Application Test Types
Chapter 2 - Mobile Application Test TypesChapter 2 - Mobile Application Test Types
Chapter 2 - Mobile Application Test Types
 
ANDROID
ANDROIDANDROID
ANDROID
 
MAD Unit 5.pptxxxxxxxxxxxxxxxxxxxxxxxxxx
MAD Unit 5.pptxxxxxxxxxxxxxxxxxxxxxxxxxxMAD Unit 5.pptxxxxxxxxxxxxxxxxxxxxxxxxxx
MAD Unit 5.pptxxxxxxxxxxxxxxxxxxxxxxxxxx
 
Android building blocks and application life cycle-chapter3
Android building blocks and application life cycle-chapter3Android building blocks and application life cycle-chapter3
Android building blocks and application life cycle-chapter3
 
Android Permissions DemystifiedAdrienne Porter Felt, Erika.docx
Android Permissions DemystifiedAdrienne Porter Felt, Erika.docxAndroid Permissions DemystifiedAdrienne Porter Felt, Erika.docx
Android Permissions DemystifiedAdrienne Porter Felt, Erika.docx
 
Ppt 2 android_basics
Ppt 2 android_basicsPpt 2 android_basics
Ppt 2 android_basics
 

Recently uploaded

Rums floating Omkareshwar FSPV IM_16112021.pdf
Rums floating Omkareshwar FSPV IM_16112021.pdfRums floating Omkareshwar FSPV IM_16112021.pdf
Rums floating Omkareshwar FSPV IM_16112021.pdfsmsksolar
 
Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxJuliansyahHarahap1
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdfKamal Acharya
 
Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.Kamal Acharya
 
School management system project Report.pdf
School management system project Report.pdfSchool management system project Report.pdf
School management system project Report.pdfKamal Acharya
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptDineshKumar4165
 
Minimum and Maximum Modes of microprocessor 8086
Minimum and Maximum Modes of microprocessor 8086Minimum and Maximum Modes of microprocessor 8086
Minimum and Maximum Modes of microprocessor 8086anil_gaur
 
Air Compressor reciprocating single stage
Air Compressor reciprocating single stageAir Compressor reciprocating single stage
Air Compressor reciprocating single stageAbc194748
 
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best ServiceTamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Servicemeghakumariji156
 
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...HenryBriggs2
 
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments""Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"mphochane1998
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . pptDineshKumar4165
 
Computer Networks Basics of Network Devices
Computer Networks  Basics of Network DevicesComputer Networks  Basics of Network Devices
Computer Networks Basics of Network DevicesChandrakantDivate1
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptMsecMca
 
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...Call Girls Mumbai
 
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptxA CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptxmaisarahman1
 
Block diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptBlock diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptNANDHAKUMARA10
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXssuser89054b
 

Recently uploaded (20)

Rums floating Omkareshwar FSPV IM_16112021.pdf
Rums floating Omkareshwar FSPV IM_16112021.pdfRums floating Omkareshwar FSPV IM_16112021.pdf
Rums floating Omkareshwar FSPV IM_16112021.pdf
 
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
 
Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptx
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdf
 
Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.
 
School management system project Report.pdf
School management system project Report.pdfSchool management system project Report.pdf
School management system project Report.pdf
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
Minimum and Maximum Modes of microprocessor 8086
Minimum and Maximum Modes of microprocessor 8086Minimum and Maximum Modes of microprocessor 8086
Minimum and Maximum Modes of microprocessor 8086
 
Air Compressor reciprocating single stage
Air Compressor reciprocating single stageAir Compressor reciprocating single stage
Air Compressor reciprocating single stage
 
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best ServiceTamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
 
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
 
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments""Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . ppt
 
Computer Networks Basics of Network Devices
Computer Networks  Basics of Network DevicesComputer Networks  Basics of Network Devices
Computer Networks Basics of Network Devices
 
Integrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - NeometrixIntegrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - Neometrix
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.ppt
 
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
 
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptxA CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
 
Block diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptBlock diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.ppt
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 

Android permission system

  • 2. Agenda ● Introduction ● Application Sandbox ● Types Of Permission ● Check For Permission ● Request For Permission ● Handle Permission Request Response ● How Android System Ask For Permission
  • 3. Introduction ● To protect android system and user's privacy, Android system runs each application in a limited access sandbox. ● If the app wants to use resources or info outside of its sandbox, The app has to explicitly request permission. ● Earlier all permissions used to set at installation time and can not change untill the reinstallation, but now in new version of android, Permissions are asked at the time of usage. ● In order to grant a permission, It should be declared in the manifest file, The system then evaluates it and make a final decision on whether to grant or deny.
  • 4. Application Sandbox ● The Android system assigns a unique (UID) to each android application and runs it in a separate process. ● Limiting the access of application. ● Any program can ask to Activity Manager to launch other application, which runs with that application's UID. ● For instance A is not allowed to do something malicious, like to read application B's data or dial the phone without permission.
  • 5. Types Of Permission ● Depending on the type of permission that app requests, The system may grant the permission automatically, or ask the user to grant the permission. ● Normal Permissions: Normal permissions do not directly risk the user's privacy, so the system grant the permision automatically. Ex – permission for flashlight. ● Dangerous Permissions: Dangerous permissions can give the access to the user's confidential data, So user has to explicitly give approval to your app. Ex – permission to read contact.
  • 6. Check For Permission ● If your app needs a dangerous permission, You must check every time whether you have permission to perform an operation that require the permission. ● The user is always free to deny the permission, So even if the app used the calander yesterday, It can't be assumed that it still has permission today. ● To check, If the app has permission, Call the method ContextCompact.checkSelfPermission().
  • 7. ● The method will return an integer, You can compare it with PackageManager.PERMISSION_GRANTED or PackageManager.PERMISSION_DENIED. ● See the code snippet: //Assume thisActivity is current Activity int permissionCheck = ContextCompact.checkSelfPermission(thisActivity, Manifest.permission.WRITE_CALENDER);
  • 8. Request For Permission ● If your app doesn't already have the requred permission, The app must call requestPermission() method to request appropriate permission. ● You just need to pass required permission and a request code to identify the permission request as parameter. ● This function works asynchronously. ● After the user responds to the permission dialog box, The callback goes to overriden method onRequestPermissionResult() of activity with the request code and result.
  • 9. ● There may be a situation, Where user deny the requested permission. It may due to not understandable. ● So when the user again interact with the same feature that have been rejected, We will show a explanation dialog. ● Android provides a utility method shouldShowRequestPermissionRationale() to overcome the situation. ● The method returns true, If the app has been requested the permission earlier and the uses have denied it. ● If the user check Don't ask again, The method will return false.
  • 10. Handle Permission Request Response ● When your app requests for permission, The system shows a dialog box to user. ● When user responds onRequestPermissionsResult() method of activity will call. ● The dialog box shown by the system describes the permission group your app needs to access instead of specific permission. ● For instance: If you request the READ_CONTACT permission, The system dialog show to access device contacts.
  • 11. How Android System Ask For Permission