"> ">

Presentation is loading. Please wait.

Presentation is loading. Please wait.

Permissions.  Applications can protect resources & data with permissions  Applications statically declare permissions  Required of components interacting.

Similar presentations


Presentation on theme: "Permissions.  Applications can protect resources & data with permissions  Applications statically declare permissions  Required of components interacting."— Presentation transcript:

1 Permissions

2  Applications can protect resources & data with permissions  Applications statically declare permissions  Required of components interacting with them  Required by components they interact with  Android requires users for consent to specific permissions when application is installed

3  Applications can define permissions in an AndroidManifest.xml file <permission android:name="android.permission.VIBRATE” … />

4  Applications can require components interacting with them to have a specified permission by setting android:permission attribute in AndroidManifest.xml  By default, permissions apply to all components hosted by the application

5  AndroidManifest.xml …

6  Individual components can set their own permissions  These override application-level permissions

7  Restricts which components can start the associated activity  Checked during  Context.startActivity()  Activity.startActivityForResult()  Throws SecurityException on permissions failure

8  Restricts which components can start or bind to the associated service  Checked during  Context.startService()  Context.stopService()  Context.bindService()  Throws SecurityException on permissions failure

9  Restricts which components can send broadcasts to the associated receiver  Checked after Context.sendBroadcast() returns  Doesn’t throw SecurityException on permissions failure

10  Restricts which components can read and write the data in a ContentProvider  Will discuss in more detail later, when we cover ContentProviders

11  Applications specify permissions they use … <uses-permission android:name="android.permission.VIBRATE”> …  User must accept permissions before the package can be installed

12  Who can receive Broadcast Intents  Context.sendBroadcast()  Can a calling process access a Service  Context.checkCallingPermission()  Does a given processes have specific permissions  Context.checkPermission(String, int, int)  Does a given application have specific permissions  PackageManager.checkPermission(String, String)  Any others to be discussed in later lectures


Download ppt "Permissions.  Applications can protect resources & data with permissions  Applications statically declare permissions  Required of components interacting."

Similar presentations


Ads by Google