WAI
Status Update
Comments
pa...@google.com <pa...@google.com>
ra...@gmail.com <ra...@gmail.com> #2
until this is fixed , what is the suggestion..do we need to consider it as a run time permission and request the user ?
pa...@google.com <pa...@google.com> #3
Beginning in Android 6.0 (API level 23), users grant permissions to apps while the app is running, not when they install the app, hence you have to handle the permission at Run time.If your app needs a dangerous permission, you must check whether you have that permission every time you perform an operation that requires that permission. The user is always free to revoke the permission, so even if the app used the camera yesterday, it can't assume it still has that permission today.
If you are using a third party Application to perform some task then the third party application has to take care of the permission at run time else a developer can check the permission at run time to accomplish the same task
If you are using a third party Application to perform some task then the third party application has to take care of the permission at run time else a developer can check the permission at run time to accomplish the same task
[Deleted User] <[Deleted User]> #4
"If you are using a third party Application to perform some task then the third party application has to take care of the permission at run time"
That would contradict the notion that "it's working as intended" then, no? If my app is using a 3rd party app (i.e. Google Camera) to take a picture then, per this statement, that app (Google Camera) is responsible for the camera permission.
I don't understand what difference it makes to the functionality of ACTION_IMAGE_CAPTURE whether the app itself separately asks for the CAMERA permission? Why do I have to check if my app has the camera permission when my app is NOT using the camera but asking another app to use the camera?
That would contradict the notion that "it's working as intended" then, no? If my app is using a 3rd party app (i.e. Google Camera) to take a picture then, per this statement, that app (Google Camera) is responsible for the camera permission.
I don't understand what difference it makes to the functionality of ACTION_IMAGE_CAPTURE whether the app itself separately asks for the CAMERA permission? Why do I have to check if my app has the camera permission when my app is NOT using the camera but asking another app to use the camera?
pa...@google.com <pa...@google.com> #5
Let me make it more clear, If its Third party application then Application will take care of it, If its your application then developer has to check the permission at run time :
If you use permissions:
Your app has full control over the user experience when you perform the operation. However, such broad control adds to the complexity of your task, since you need to design an appropriate UI.
The user is prompted to give permission once, either at run time or at install time (depending on the user's Android version). After that, your app can perform the operation without requiring additional interaction from the user. However, if the user doesn't grant the permission (or revokes it later on), your app becomes unable to perform the operation at all.
If you use an intent:
You do not have to design the UI for the operation. The app that handles the intent provides the UI. However, this means you have no control over the user experience. The user could be interacting with an app you've never seen.
If the user does not have a default app for the operation, the system prompts the user to choose an app. If the user does not designate a default handler, they may have to go through an extra dialog every time they perform the operation
If you use permissions:
Your app has full control over the user experience when you perform the operation. However, such broad control adds to the complexity of your task, since you need to design an appropriate UI.
The user is prompted to give permission once, either at run time or at install time (depending on the user's Android version). After that, your app can perform the operation without requiring additional interaction from the user. However, if the user doesn't grant the permission (or revokes it later on), your app becomes unable to perform the operation at all.
If you use an intent:
You do not have to design the UI for the operation. The app that handles the intent provides the UI. However, this means you have no control over the user experience. The user could be interacting with an app you've never seen.
If the user does not have a default app for the operation, the system prompts the user to choose an app. If the user does not designate a default handler, they may have to go through an extra dialog every time they perform the operation
ra...@gmail.com <ra...@gmail.com> #6
I do understand everything but its still unclear why would we need a permission when use intent, as per the document we don't need to worry about permissions if we are using intents, but In my case i see that every time I launch a intent my app crashes..so you mean even we use intents we need to ask permission from the user
[Deleted User] <[Deleted User]> #7
#5 - I may be dense, but that does not make things more clear. If anything, that adds to the argument that this is NOT working as intended.
I've read the docs - I understand the difference and pros / cons between requesting a permission vs using Intents. THAT'S NOT THE QUESTION HERE.
The question is what should happen if you have BOTH requested a permission and SEPARATELY invoked an implicit intent that uses that same permission (in this case, camera). The issue at hand is that you guys seem to have decided that if you use an Intent to do something for which you've also requested a permission, you're required to treat that as though your own app is using the permission, which it is not.
Here's a great example why this seems broken:
Take my app and disable camera permission.
Now take 3rd party camera app and disable the camera permission.
Start my app and invoke implicit intent for camera image capture.
User is prompted to grant camera permission to my app EVEN THOUGH IN THIS CASE THE APP IS NOT USING THE PERMISSION.
Grant the permission.
App handles this and proceeds to invoke camera capture intent.
User is prompted AGAIN to grant camera permission, this time to the 3rd party camera app which is ACTUALLY using the permission.
If my app never requests the camera permission to begin with, the above flow works as expected (only the camera app requests and needs to be granted permission). So why does requesting a permission change this flow?
Is this not a terrible experience for both the developer and user? Is this honestly intentional?
If so, can you please explain the rational behind this decision? Thank you.
I've read the docs - I understand the difference and pros / cons between requesting a permission vs using Intents. THAT'S NOT THE QUESTION HERE.
The question is what should happen if you have BOTH requested a permission and SEPARATELY invoked an implicit intent that uses that same permission (in this case, camera). The issue at hand is that you guys seem to have decided that if you use an Intent to do something for which you've also requested a permission, you're required to treat that as though your own app is using the permission, which it is not.
Here's a great example why this seems broken:
Take my app and disable camera permission.
Now take 3rd party camera app and disable the camera permission.
Start my app and invoke implicit intent for camera image capture.
User is prompted to grant camera permission to my app EVEN THOUGH IN THIS CASE THE APP IS NOT USING THE PERMISSION.
Grant the permission.
App handles this and proceeds to invoke camera capture intent.
User is prompted AGAIN to grant camera permission, this time to the 3rd party camera app which is ACTUALLY using the permission.
If my app never requests the camera permission to begin with, the above flow works as expected (only the camera app requests and needs to be granted permission). So why does requesting a permission change this flow?
Is this not a terrible experience for both the developer and user? Is this honestly intentional?
If so, can you please explain the rational behind this decision? Thank you.
pa...@google.com <pa...@google.com> #8
This is intended behavior to avoid user frustration where they revoked the camera permission from an app and the app still being able to take photos via the intent. Users are not aware that the photo taken after the permission revocation happens via different mechanism and would question the correctness of the permission model. This applies to MediaStore.ACTION_IMAGE_CAPTURE, MediaStore.ACTION_VIDEO_CAPTURE, and Intent.ACTION_CALL the docs for which document the behavior change for apps targeting M.
[Deleted User] <[Deleted User]> #9
Thank you for clarifying the rationale behind the functionality.
ee...@gmail.com <ee...@gmail.com> #10
I think Google should add this explaination in the "Permissions Best Practices" page as well. Bacause he current documentation is bit confusing from understanding point of view. As I'm seeing i am not the first one who interpreted the documentation wrongly in first reading.
The way it is written right now, seems like you don't have to grant permission if you're using Intent. I request that google should update it asap.
The way it is written right now, seems like you don't have to grant permission if you're using Intent. I request that google should update it asap.
to...@repsly.com <to...@repsly.com> #11
"Permissions Best Practices" is stating that using the intent way, we don't need to ask for permission. Why so badly written and resolved?
ps. I love to see such replies from Google employees, so many misunderstandings and just proving they are humans with flaws. Also, proving that Google Android is full of bugs wherever you look. But still a great OS and will always develop for it.
ps. I love to see such replies from Google employees, so many misunderstandings and just proving they are humans with flaws. Also, proving that Google Android is full of bugs wherever you look. But still a great OS and will always develop for it.
ma...@gmail.com <ma...@gmail.com> #12
"This is intended behavior to avoid user frustration where they revoked the camera permission from an app and the app still being able to take photos via the intent" while that sounds reasonable, it's more confusing then that apps which never asked for that permission can take photos via an intent then...
[Deleted User] <[Deleted User]> #13
@pat
I agree that users who have denied a camera permission request would be confused as to why that app could then still capture images through the system intent.
However, I am not sure I follow the case where an app containing the camera permission in the manifest, which has not yet requested that permission from the user, should still be rejected from accessing the camera intent.
There, the user has a similar lack of revocation that they would have for an app that does not possess the permission in the manifest. Is there a way for the system to identify that the permission is in an 'unasked' state (as opposed to 'explicitly denied'), and therefore permit the intent?
I agree that users who have denied a camera permission request would be confused as to why that app could then still capture images through the system intent.
However, I am not sure I follow the case where an app containing the camera permission in the manifest, which has not yet requested that permission from the user, should still be rejected from accessing the camera intent.
There, the user has a similar lack of revocation that they would have for an app that does not possess the permission in the manifest. Is there a way for the system to identify that the permission is in an 'unasked' state (as opposed to 'explicitly denied'), and therefore permit the intent?
[Deleted User] <[Deleted User]> #14
[Comment deleted]
[Deleted User] <[Deleted User]> #15
This doesn't make sens at all, i don't build a camera app so i shouldn't have to request CAMERA permission for calling ACTION_IMAGE_CAPTURE. That's the whole point of Intents, to delegate.
It's even less secure because once "CAMERA" is granted, you can take pictures anytime you want and not only when the user requests it with Intents.
This is a real issue, you can't says it's "WorkingAsIntended".
It's even less secure because once "CAMERA" is granted, you can take pictures anytime you want and not only when the user requests it with Intents.
This is a real issue, you can't says it's "WorkingAsIntended".
a....@hotmail.com <a....@hotmail.com> #16
By that rationale, users will presumably think that apps who don't declare the permission and are therefore able to do capture intents have somehow hacked their phone? 'Clearly this app is a virus, it was able to take a picture without asking for camera permissions!!'
I understand the rationale, but I don't agree with it. This is doing a disservice to my users, whom I want to offer as much functionality as possible without strongarming them into granting me permissions I don't need.
I understand the rationale, but I don't agree with it. This is doing a disservice to my users, whom I want to offer as much functionality as possible without strongarming them into granting me permissions I don't need.
[Deleted User] <[Deleted User]> #17
I completely agree with two previous commenters.
gr...@gmail.com <gr...@gmail.com> #18
Some apps not access my camera still permission allowed
un...@gmail.com <un...@gmail.com> #19
Comment has been deleted.
Description
1.
Here is the document from Google:
Note: if you app targets M and above and declares as using the CAMERA permission which is not granted, then atempting to use this action will result in a SecurityException.
I run into this SecurityException:
09-28 21:57:15.605: I/ActivityManager(779): START u0 {act=android.media.action.IMAGE_CAPTURE flg=0x3000003 cmp=com.google.android.GoogleCamera/com.android.camera.CaptureActivity (has clip) (has extras)} from uid 10157 on display 0
09-28 21:57:15.605: W/ActivityManager(779): Permission Denial: starting Intent { act=android.media.action.IMAGE_CAPTURE flg=0x3000003 cmp=com.google.android.GoogleCamera/com.android.camera.CaptureActivity (has clip) (has extras) } from null (pid=-1, uid=10157) with revoked permission android.permission.CAMERA
09-28 21:57:15.606: D/audio_hw_primary(200): out_set_parameters: enter: usecase(1: low-latency-playback) kvpairs: routing=2
09-28 21:57:15.606: E/ResolverActivity(18397): Unable to launch as uid 10157 package XXXXXXXXXXXXXXXXX, while running in android:ui
09-28 21:57:15.606: E/ResolverActivity(18397): java.lang.SecurityException: Permission Denial: starting Intent { act=android.media.action.IMAGE_CAPTURE flg=0x3000003 cmp=com.google.android.GoogleCamera/com.android.camera.CaptureActivity (has clip) (has extras) } from null (pid=-1, uid=10157) with revoked permission android.permission.CAMERA
09-28 21:57:15.606: E/ResolverActivity(18397): at android.os.Parcel.readException(Parcel.java:1599)
09-28 21:57:15.606: E/ResolverActivity(18397): at android.os.Parcel.readException(Parcel.java:1552)
09-28 21:57:15.606: E/ResolverActivity(18397): at android.app.ActivityManagerProxy.startActivityAsCaller(ActivityManagerNative.java:2730)
09-28 21:57:15.606: E/ResolverActivity(18397): at android.app.Instrumentation.execStartActivityAsCaller(Instrumentation.java:1725)
09-28 21:57:15.606: E/ResolverActivity(18397): at android.app.Activity.startActivityAsCaller(Activity.java:4047)
09-28 21:57:15.606: E/ResolverActivity(18397): at com.android.internal.app.ResolverActivity$DisplayResolveInfo.startAsCaller(ResolverActivity.java:983)
09-28 21:57:15.606: E/ResolverActivity(18397): at com.android.internal.app.ResolverActivity.safelyStartActivity(ResolverActivity.java:772)
09-28 21:57:15.606: E/ResolverActivity(18397): at com.android.internal.app.ResolverActivity.onTargetSelected(ResolverActivity.java:754)
09-28 21:57:15.606: E/ResolverActivity(18397): at com.android.internal.app.ChooserActivity.onTargetSelected(ChooserActivity.java:305)
09-28 21:57:15.606: E/ResolverActivity(18397): at com.android.internal.app.ResolverActivity.startSelected(ResolverActivity.java:603)
09-28 21:57:15.606: E/ResolverActivity(18397): at com.android.internal.app.ChooserActivity.startSelected(ChooserActivity.java:310)
09-28 21:57:15.606: E/ResolverActivity(18397): at com.android.internal.app.ChooserActivity$ChooserRowAdapter$2.onClick(ChooserActivity.java:990)
09-28 21:57:15.606: E/ResolverActivity(18397): at android.view.View.performClick(View.java:5198)
09-28 21:57:15.606: E/ResolverActivity(18397): at android.view.View$PerformClick.run(View.java:21147)
09-28 21:57:15.606: E/ResolverActivity(18397): at android.os.Handler.handleCallback(Handler.java:739)
09-28 21:57:15.606: E/ResolverActivity(18397): at android.os.Handler.dispatchMessage(Handler.java:95)
09-28 21:57:15.606: E/ResolverActivity(18397): at android.os.Looper.loop(Looper.java:148)
09-28 21:57:15.606: E/ResolverActivity(18397): at android.app.ActivityThread.main(ActivityThread.java:5417)
09-28 21:57:15.606: E/ResolverActivity(18397): at java.lang.reflect.Method.invoke(Native Method)
09-28 21:57:15.606: E/ResolverActivity(18397): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
09-28 21:57:15.606: E/ResolverActivity(18397): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
2. But Google's document also says it doesn't require CAMERA permission if you use intent to start Camera.
Also according to Google Android Doc , section "Permissions versus intents",
" In many cases, you can choose between two ways for your app to perform a task. You can have your app ask for permission to perform the operation itself. Alternatively, you can have the app use an intent to have another app perform the task.
For example, suppose your app needs to be able to take pictures with the device camera. Your app can request the android.permission.CAMERA permission, which allows your app to access the camera directly. Your app would then use the camera APIs to control the camera and take a picture. This approach gives your app full control over the photography process, and lets you incorporate the camera UI into your app.
However, if you don't need such control, you can just use an ACTION_IMAGE_CAPTURE intent to request an image. When you start the intent, the user is prompted to choose a camera app (if there isn't already a default camera app), and that app takes the picture. The camera app returns the picture to your app's onActivityResult() method. "
3. So the 1st statement and 2nd statement are conflicting and cause an issue :
My library using intent to launch camera app, my library is used by 2 apps. One app doesn't declare CAMERA permission while the other one does declare CAMERA permission in the manifest. So the feature is working fine in one app but broken in the other app.
How am I supposed to solve this issue ?