This repository has been archived by the owner on Jun 3, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
[WEEX-435][android] modify playground app camera runtime permission request behavior #1221
Merged
YorkShen
merged 1 commit into
apache:master
from
shawnlinboy:android-bugfix-add_camera_scan_permission_check
Jan 8, 2019
Merged
[WEEX-435][android] modify playground app camera runtime permission request behavior #1221
YorkShen
merged 1 commit into
apache:master
from
shawnlinboy:android-bugfix-add_camera_scan_permission_check
Jan 8, 2019
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Generated by 🚫 dangerJS |
@misakuo PTAL :) |
@shawnlinboy Thank you for your contribution!!As the development process shows, we need create a jira issue in apache, and format your pull request title and commit log. :) |
shawnlinboy
changed the title
[android] modify playground app camera runtime permission request behavior
[WEEX-435][android] modify playground app camera runtime permission request behavior
Jun 4, 2018
@xuyouyang Thanks for reviewing, already created one. |
in your onRequestPermissionsResult you don't handle WRITE_EXTERNAL_STORAGE_PERMISSION_REQUEST_CODE and give an tips. please add this case. |
@gubaojian They didn't handle that so I'd like not to add extra code to that. |
YorkShen
approved these changes
Jan 8, 2019
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
gubaojian
pushed a commit
to gubaojian/incubator-weex
that referenced
this pull request
Jan 30, 2019
* origin/master: [android] modify playground app camera runtime permission request behavior (apache#1221) [WEEX][Android] Support Downgrade To Full Page Root Instance (apache#1952) [WEEX][Android] Weex Bugfix For Scroller Remove Failed Because Of Edit Of Scroller Touch Event (apache#2005) [WEEX][Android] When View Not InstanceOf WXGestureObservable, mGestureType is Null, remove event has none affect, (apache#1968) [iOS] fix customEnvironment crash * [iOS] Add support for custom event with stoppropagation
katherine95s
pushed a commit
to katherine95s/incubator-weex
that referenced
this pull request
Jul 4, 2019
katherine95s
pushed a commit
to katherine95s/incubator-weex
that referenced
this pull request
Jul 11, 2019
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
For
ActivityCompat.shouldShowRequestPermissionRationale()
, it means your app should display a dialog or something else to explain why you are going to request this permission, and try again to request the permission, see https://developer.android.com/training/permissions/requesting and https://github.com/googlesamples/android-RuntimePermissionsBasic/blob/master/Application/src/main/java/com/example/android/basicpermissions/MainActivity.java#L124For the original code, if the permission was NOT granted, the
ContextCompat.checkSelfPermission(mWXSDKInstance.getContext(), Manifest.permission.CAMERA) != PackageManager.PERMISSION_GRANTED
will always returnstrue
andActivityCompat.shouldShowRequestPermissionRationale((Activity) mWXSDKInstance.getContext(), Manifest.permission.CAMERA)
did the same thing, which means If a user tap扫描二维码
, theWeex playground need the camera permission to scan QR code
toast will always show up without prompting a permission request dialog, users have to navigate to system app management and grant permission manually. If one user was not familiar with this mechanism,the Playground app will always be not able to scan code.This patch fix can show a dialog to tell user that
Weex playground need the camera permission to scan QR code
and then request this code immediately, it will make the a system permission dialog alert and the user can now grant permission directly.