[@nativescript/geolocation] Android 11 - One-time location permission revoked when app is moved to the background
還沒有人認領這個 Issue。
評估
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 新手友好度
- 35/100
- Issue 類型
- 缺陷
- 描述清晰度
- 基本清楚
- 活躍度
- 停滯
- 技術堆疊
- android, typescript
- 領域
- mobile
研究方向
從 enableLocationRequest 進入點開始,按照列出的步驟並使用裝置記錄,在 Android 11 模擬器上重現此行為。判斷一次性權限撤銷是 Android 的預設行為,還是 plugin 提供了受支援的修正方案;完成的標準是確定並記錄結果,或實作並驗證修正方案。
由索引模型根據 Issue 內容生成。
描述
On Android 11 and above, when the location permission is requested the user can allow the app to access the device location "Only this time". When this option is selected and the app is moved to the background, after a short time (around one minute) the one time session expires and the app is killed. This behavior also occurs when an in-app browser is launched from the main NativeScript activity, which is how I found this issue.
I tested on an Android 11 emulator. The manifest includes ACCESS_COARSE_LOCATION, ACCESS_FINE_LOCATION, ACCESS_BACKGROUND_LOCATION permissions.
These are the device logs:
05-30 17:52:29.386 524 524 I OneTimePermissionUserManager: One time session expired for org.nativescript.temp (10163).
05-30 17:52:29.428 4559 4580 V PermissionControllerServiceImpl: Permission grant result requestId=-2574434414935562278 callingUid=10163 callingPackage=org.nativescript.temp permission=android.permission.ACCESS_FINE_LOCATION isImplicit=false result=15
05-30 17:52:29.428 4559 4580 V PermissionControllerServiceImpl: Permission grant result requestId=-2574434414935562278 callingUid=10163 callingPackage=org.nativescript.temp permission=android.permission.ACCESS_COARSE_LOCATION isImplicit=false result=15
05-30 17:52:29.473 524 3731 W AppOps : setUidMode() called with a mode inconsistent with runtime permission state, this is discouraged and you should revoke the runtime permission instead: uid=10163, switchCode=0, mode=1, permission=android.permission.ACCESS_COARSE_LOCATION
05-30 17:52:29.473 524 574 I ActivityManager: Killing 9104:org.nativescript.temp/u0a163 (adj 700): one-time permission revoked
05-30 17:52:29.583 524 4992 I WindowManager: WIN DEATH: Window{49ce565 u0 org.nativescript.temp/com.tns.NativeScriptActivity}
05-30 17:52:29.583 524 4992 W InputDispatcher: Attempted to unregister already unregistered input channel '49ce565 org.nativescript.temp/com.tns.NativeScriptActivity (server)'
05-30 17:52:29.588 289 289 I Zygote : Process 9104 exited due to signal 9 (Killed)
05-30 17:52:29.590 524 550 W ActivityManager: setHasOverlayUi called on unknown pid: 9104
05-30 17:52:29.616 524 558 I libprocessgroup: Successfully killed process cgroup uid 10163 pid 9104 in 138ms
05-30 17:52:32.302 209 212 E android.system.suspend@1.0-service: Error opening kernel wakelock stats for: wakeup34: Permission denied
05-30 17:52:32.299 209 209 W Binder:209_2: type=1400 audit(0.0:80): avc: denied { read } for name="wakeup34" dev="sysfs" ino=19014 scontext=u:r:system_suspend:s0 tcontext=u:object_r:sysfs:s0 tclass=dir permissive=0
05-30 17:52:32.320 209 212 E android.system.suspend@1.0-service: Error opening kernel wakelock stats for: wakeup35: Permission denied
05-30 17:52:32.315 209 209 W Binder:209_2: type=1400 audit(0.0:81): avc: denied { read } for name="wakeup35" dev="sysfs" ino=19077 scontext=u:r:system_suspend:s0 tcontext=u:object_r:sysfs:s0 tclass=dir permissive=0
To reproduce:
- Create a new NS8 project (I was unable to run the demo app)
- Install and configure the plugin
- Call
enableLocationRequest - Select "Only this time"
- Minimize the app
Is it a default Android behavior or is it possibile to fix this issue, for example extending the one-time session duration?
- 主要語言
- TypeScript
- 星號
- 206
- 分支
- 123
- 平均合併
- 2 天 1 小時
- 30 天內合併 PR
- 1
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
NativeScript/plugins 的其他 Issue
-
難度 1/5 1 小時以內 新手友好度 92/100
NativeScript/plugins#680 ·
-
難度 2/5 1-3 小時 新手友好度 82/100
NativeScript/plugins#671 ·
-
難度 1/5 1 小時以內 新手友好度 72/100
NativeScript/plugins#640 ·
-
難度 4/5 3-5 天 新手友好度 45/100
NativeScript/plugins#668 ·
-
難度 4/5 3-5 天 新手友好度 45/100
NativeScript/plugins#665 · 1 則留言 ·
查看 NativeScript/plugins 的全部 Issue
相似的 Issue
-
Type/Bug
難度 2/5 1-3 小時 新手友好度 78/100
OpenNSW/nsw-srilanka#497 ·
-
難度 2/5 1-3 小時 新手友好度 72/100
0xMiden/bridge-portal#132 ·
-
react-doctor severity:warning tech-debt
難度 1/5 1 小時以內 新手友好度 88/100
digidem/comapeo-cloud-app#403 ·
-
難度 2/5 1-3 小時 新手友好度 72/100
-
難度 2/5 1-3 小時 新手友好度 78/100