• Home
  • Raw
  • Download

Lines Matching refs:permission

57   lists a normal permission in its manifest, the system grants the permission
62 data. If your app lists a normal permission in its manifest, the system
63 grants the permission automatically. If you list a dangerous permission, the
84 is 22 or lower: If you list a dangerous permission in your manifest, the user
85 has to grant the permission when they install the app; if they do not grant
86 the permission, the system does not install the app at all.
91 <em>and</em> it must request each dangerous permission it needs while the app
92 is running. The user can grant or deny each permission, and the app can
94 permission request.
102 it's missing a needed permission, regardless of what API level your app
118 If your app needs a dangerous permission, you must check whether you have
119 that permission every time you perform an operation that requires that
120 permission. The user is always free to revoke the permission, so even if the
121 app used the camera yesterday, it can't assume it still has that permission
126 To check if you have a permission, call the {@link
129 check if the activity has permission to write to the calendar:
134 Manifest.permission.WRITE_CALENDAR);</pre>
137 If the app has the permission, the method returns {@link
140 operation. If the app does not have the permission, the method returns {@link
142 the app has to explicitly ask the user for permission.
148 If your app needs a dangerous permission that was listed in the app manifest,
149 it must ask the user to grant the permission. Android provides several
150 methods you can use to request a permission. Calling these methods brings up a
162 a permission.
168 app needs a permission. For example, if a user launches a photography app,
169 the user probably won't be surprised that the app asks for permission to use
171 user's location or contacts. Before you request a permission, you should
179 already turned down that permission request. If a user keeps trying to use
180 functionality that requires a permission, but keeps turning down the
181 permission request, that probably shows that the user doesn't understand why
182 the app needs the permission to provide that functionality. In a situation
191 has requested this permission previously and the user denied the request.
195 <strong>Note:</strong> If the user turned down the permission request in the
196 past and chose the <strong>Don't ask again</strong> option in the permission
199 having that permission.
205 If your app doesn't already have the permission it needs, the app must call
209 an integer <em>request code</em> that you specify to identify this permission
219 The following code checks if the app has permission to read the user's
220 contacts, and requests the permission if necessary:
225 Manifest.permission.READ_CONTACTS)
230 Manifest.permission.READ_CONTACTS)) {
234 // sees the explanation, try again to request the permission.
238 // No explanation needed, we can request the permission.
241 new String[]{Manifest.permission.READ_CONTACTS},
269 has to override that method to find out whether the permission was granted.
273 android.Manifest.permission#READ_CONTACTS READ_CONTACTS} access it might have
286 // permission was granted, yay! Do the
291 // permission denied, boo! Disable the
292 // functionality that depends on this permission.
304 "{@docRoot}guide/topics/security/permissions.html#perm-groups">permission
305 group</a> your app needs access to; it does not list the specific permission.
307 android.Manifest.permission#READ_CONTACTS READ_CONTACTS} permission, the
309 The user only needs to grant permission once for each permission group. If
312 the permission, the system calls your {@link
322 permission it needs, even if the user has already granted another permission
331 android.Manifest.permission#READ_CONTACTS READ_CONTACTS} and {@link
332 android.Manifest.permission#WRITE_CONTACTS WRITE_CONTACTS} in your app
334 {@link android.Manifest.permission#READ_CONTACTS READ_CONTACTS} and the user
335 grants the permission, and you then request {@link
336 android.Manifest.permission#WRITE_CONTACTS WRITE_CONTACTS}, the system
337 immediately grants you that permission without interacting with the user.
341 If the user denies a permission request, your app should take appropriate
343 perform the user's requested action that needs that permission.
347 When the system asks the user to grant a permission, the user has the option
348 of telling the system not to ask for that permission again. In that case, any
351 requestPermissions()} to ask for that permission again, the system