Improved WebView permission handling in EclairUtil.java #3380
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.
General Items:
I have updated the relevant documentation files under docs/
My code follows the:
Google Java style guide (for .java files)
Google JavaScript style guide (for .js files)
ant tests passes on my machine
If Your Code Changes How Something Works on the Device (i.e., It Affects the Companion):
I branched from ucr
My pull request has ucr as the base
Further, If You've Changed the Blocks Language or Another User-Facing Designer/Blocks API (e.g., Added a SimpleProperty, etc.):
I have updated the corresponding version number in appinventor/components/src/.../common/YaVersion.java
I have updated the corresponding upgrader in appinventor/appengine/src/.../client/youngandroid/YoungAndroidFormUpgrader.java (components only)
I have updated the corresponding entries in appinventor/blocklyeditor/src/versioning.js
For All Other Changes:
I branched from master
My pull request has master as the base
What Does This PR Accomplish?
Description:
This PR improves the handling of WebView permissions in EclairUtil.java to enhance security, stability, and user experience.
Key Improvements:
✅ Optimized Geolocation Permissions:
Updated the onGeolocationPermissionsShowPrompt method to request location permissions dynamically.
Improved user prompts to ensure better handling of permission requests.
✅ Enhanced Code Efficiency:
Removed redundant condition checks and improved readability.
Ensured backward compatibility with older Android versions while adhering to modern best practices.
✅ Bug Fixes & Security Enhancements:
Fixed potential security loopholes in handling JavaScript-enabled WebViews.
Ensured compliance with Google's security policies for WebView usage.
Why is This PR Needed?
Fixes inconsistencies in WebView geolocation permissions.
Improves user experience by providing a smoother permission request flow.
Enhances security and code maintainability.
Fixes #3380