• Raphael Kubo da Costa's avatar
    WebView: Grant sensor permission requests · 4429dfc0
    Raphael Kubo da Costa authored
    Commit b6c4e590 ("Grant generic sensor permission for Android WebView")
    started always granting sensors permission requests in
    GetPermissionStatus().
    
    However, commit 94c082d4 ("[sensors] Add sensors usage indicator") caused
    SensorProviderProxyImpl to query PermissionManager via RequestPermission()
    before making a given sensor available.
    
    The Android WebView case was overlooked, and its RequestPermission()
    implementation was still denying all requests for sensors. Update the policy
    to always-grant, and while at it make CancelPermissionRequest() not show a
    "not implemented" error for sensor requests, as the requests are always
    granted anyway.
    
    Doing so re-allows the WebView to provide device motion/orientation data to
    users, while SensorProviderImpl::GetSensor() still prevents other types of
    sensors from being accessed, just like before.
    
    Bug: 852543
    Change-Id: I3bd45f955f8ff9dca67b7b9bda940590dce258f1
    Reviewed-on: https://chromium-review.googlesource.com/1104417Reviewed-by: default avatarTao Bai <michaelbai@chromium.org>
    Reviewed-by: default avatarJun Cai <juncai@chromium.org>
    Commit-Queue: Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com>
    Cr-Commit-Position: refs/heads/master@{#568068}
    4429dfc0
aw_permission_manager.cc 20.5 KB