nsaito92 / Frock

0 stars 0 forks source link

アラーム設定一覧から設定を開こうとするとクラッシュする。 #39

Closed nsaito92 closed 3 years ago

nsaito92 commented 3 years ago

概要

期待値

対応内容

参考情報

備考

*

nsaito92 commented 3 years ago
11-17 14:59:38.057 14810-14810/com.github.nsaito92.Frock E/AndroidRuntime: FATAL EXCEPTION: main
                                                                           Process: com.github.nsaito92.Frock, PID: 14810
                                                                           java.lang.RuntimeException: Unable to start activity ComponentInfo{com.github.nsaito92.Frock/com.example.naotosaito.clocktest.AlarmPreferenceActivity}: java.lang.SecurityException: Permission Denial: opening provider com.android.externalstorage.ExternalStorageProvider from ProcessRecord{26b7f05d0 14810:com.github.nsaito92.Frock/u0a246} (pid=14810, uid=10246) requires that you obtain access using ACTION_OPEN_DOCUMENT or related APIs
                                                                               at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3162)
                                                                               at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3305)
                                                                               at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
                                                                               at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
                                                                               at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
                                                                               at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1993)
                                                                               at android.os.Handler.dispatchMessage(Handler.java:106)
                                                                               at android.os.Looper.loop(Looper.java:216)
                                                                               at android.app.ActivityThread.main(ActivityThread.java:7285)
                                                                               at java.lang.reflect.Method.invoke(Native Method)
                                                                               at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494)
                                                                               at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:975)
                                                                            Caused by: java.lang.SecurityException: Permission Denial: opening provider com.android.externalstorage.ExternalStorageProvider from ProcessRecord{26b7f05d0 14810:com.github.nsaito92.Frock/u0a246} (pid=14810, uid=10246) requires that you obtain access using ACTION_OPEN_DOCUMENT or related APIs
                                                                               at android.os.Parcel.createException(Parcel.java:1966)
                                                                               at android.os.Parcel.readException(Parcel.java:1934)
                                                                               at android.os.Parcel.readException(Parcel.java:1884)
                                                                               at android.app.IActivityManager$Stub$Proxy.getContentProvider(IActivityManager.java:4029)
                                                                               at android.app.ActivityThread.acquireProvider(ActivityThread.java:6528)
                                                                               at android.app.ContextImpl$ApplicationContentResolver.acquireUnstableProvider(ContextImpl.java:2825)
                                                                               at android.content.ContentResolver.acquireUnstableProvider(ContentResolver.java:1835)
                                                                               at android.content.ContentResolver.query(ContentResolver.java:793)
                                                                               at android.content.ContentResolver.query(ContentResolver.java:759)
                                                                               at android.content.ContentResolver.query(ContentResolver.java:717)
                                                                               at com.example.naotosaito.clocktest.ContentResolverController.getFileNameFromUri(ContentResolverController.java:161)
                                                                               at com.example.naotosaito.clocktest.AlarmPreferenceActivity.updateSettingsView(AlarmPreferenceActivity.java:463)
                                                                               at com.example.naotosaito.clocktest.AlarmPreferenceActivity.onCreate(AlarmPreferenceActivity.java:276)
                                                                               at android.app.Activity.performCreate(Activity.java:7353)
                                                                               at android.app.Activity.performCreate(Activity.java:7344)
                                                                               at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1275)
                                                                               at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3142)
                                                                               at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3305) 
                                                                               at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78) 
                                                                               at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108) 
                                                                               at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68) 
                                                                               at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1993) 
                                                                               at android.os.Handler.dispatchMessage(Handler.java:106) 
                                                                               at android.os.Looper.loop(Looper.java:216) 
                                                                               at android.app.ActivityThread.main(ActivityThread.java:7285) 
                                                                               at java.lang.reflect.Method.invoke(Native Method) 
                                                                               at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494) 
                                                                               at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:975) 
                                                                            Caused by: android.os.RemoteException: Remote stack trace:
                                                                               at com.android.server.am.ActivityManagerService.getContentProviderImpl(ActivityManagerService.java:16058)
                                                                               at com.android.server.am.ActivityManagerService.getContentProviderImpl(ActivityManagerService.java:15826)
                                                                               at com.android.server.am.ActivityManagerService.getContentProvider(ActivityManagerService.java:16391)
                                                                               at android.app.IActivityManager$Stub.onTransact$getContentProvider$(IActivityManager.java:11085)
                                                                               at android.app.IActivityManager$Stub.onTransact(IActivityManager.java:295)
nsaito92 commented 3 years ago
nsaito92 commented 3 years ago

この辺が怪しいので確認中。

takePersistableUriPermission()で永続的パーミッションを得ないと再起動したら見えなくなるのか。

プロバイダの公式資料を再度確認。


Intent#FLAG_GRANT_PERSISTABLE_URI_PERMISSION

nsaito92 commented 3 years ago

クラッシュ事象を確認したが、別要因なので、別チケット化。 アラームONかつ、曜日設定が「無し」のパターンが考慮出来ていないっぽい。

12-06 16:32:03.899 30521-30521/com.github.nsaito92.Frock E/AndroidRuntime: FATAL EXCEPTION: main
                                                                           Process: com.github.nsaito92.Frock, PID: 30521
                                                                           java.lang.NullPointerException: Attempt to get length of null array
                                                                               at com.example.naotosaito.clocktest.FrockSettingsHelperController.getClosestCalender(FrockSettingsHelperController.java:474)
                                                                               at com.example.naotosaito.clocktest.AlarmServiceSetter.getAlarmSetCalender(AlarmServiceSetter.java:87)
                                                                               at com.example.naotosaito.clocktest.AlarmServiceSetter.updateAlarmService(AlarmServiceSetter.java:30)
                                                                               at com.example.naotosaito.clocktest.AlarmPreferenceActivity$5.onPreferenceClick(AlarmPreferenceActivity.java:278)
                                                                               at android.preference.Preference.performClick(Preference.java:1250)
                                                                               at android.preference.PreferenceScreen.onItemClick(PreferenceScreen.java:262)
                                                                               at android.widget.AdapterView.performItemClick(AdapterView.java:362)
                                                                               at android.widget.AbsListView.performItemClick(AbsListView.java:1689)
                                                                               at android.widget.AbsListView$PerformClick.run(AbsListView.java:4130)
                                                                               at android.widget.AbsListView$7.run(AbsListView.java:6594)
                                                                               at android.os.Handler.handleCallback(Handler.java:873)
                                                                               at android.os.Handler.dispatchMessage(Handler.java:99)
                                                                               at android.os.Looper.loop(Looper.java:216)
                                                                               at android.app.ActivityThread.main(ActivityThread.java:7285)
                                                                               at java.lang.reflect.Method.invoke(Native Method)
                                                                               at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494)
                                                                               at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:975)