TeamAmaze / AmazeFileManager

Material design file manager for Android
https://teamamaze.xyz
GNU General Public License v3.0
5.34k stars 1.58k forks source link

Crash caused by permission denied on the specific device #1965

Closed sjl872964789 closed 4 years ago

sjl872964789 commented 4 years ago

Describe the bug I have noticed that denying the permission of amaze from from the system settings on my Xiaomi phone will eventually cause a crash, and this problem will not occur on my other phone.

To Reproduce Steps to reproduce the behavior:

  1. Install AmazeFileManager and open app
  2. The permission request box appears
  3. Click on "ALLOW"
  4. Turn off the storage permission of amaze in the system settings
  5. Back to amaze
  6. Crash

Expected behavior Non crash

Smartphone (please complete the following information):

Additional context Add any other context about the problem here. ezgif com-video-to-gif (7)

Logcat

08-19 16:19:05.589 18208 18208 E AndroidRuntime: FATAL EXCEPTION: main
08-19 16:19:05.589 18208 18208 E AndroidRuntime: Process: com.amaze.filemanager, PID: 18208
08-19 16:19:05.589 18208 18208 E AndroidRuntime: java.lang.RuntimeException: Unable to resume activity {com.amaze.filemanager/com.amaze.filemanager.activities.MainActivity}: java.lang.IllegalStateException: Unexpected failure to classify SearchResult: SearchResult{key=/sdcard, nodeFound=Node{edge=dcard, value=0, edges=[]}, charsMatched=7, charsMatchedInNodeFound=5, parentNode=Node{edge=/s, value=null, edges=[Node{edge=dcard, value=0, edges=[]}, Node{edge=torage/emulated/0/, value=null, edges=[Node{edge=D, value=null, edges=[Node{edge=CIM, value=1, edges=[]}, Node{edge=ownload, value=2, edges=[]}]}, Node{edge=M, value=null, edges=[Node{edge=ovies, value=3, edges=[]}, Node{edge=usic, value=4, edges=[]}]}, Node{edge=Pictures, value=5, edges=[]}]}]}, parentNodesParent=Node{edge=, value=null, edges=[Node{edge=/s, value=null, edges=[Node{edge=dcard, value=0, edges=[]}, Node{edge=torage/emulated/0/, value=null, edges=[Node{edge=D, value=null, edges=[Node{edge=CIM, value=1, edges=[]}, Node{edge=ownload, value=2, edges=[]}]}, Node{edge=M, value=null, edges=[Node{edge=ovies, value=3, edges=[]}, Node{edge=usic, value=4, edges=[]}]}, Node{edge=Pictures, value=5, edges=[]}]}]}, Node{edge=0, value=8, edges=[]}, Node{edge=1, value=9, edges=[]}, Node{edge=2, value=10, edges=[]}, Node{edge=3, value=11, edges=[]}, Node{edge=4, value=12, edges=[]}, Node{edge=5, value=6, edges=[]}, Node{edge=6, value=7, edges=[]}]}, classification=null}
08-19 16:19:05.589 18208 18208 E AndroidRuntime:        at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3863)
08-19 16:19:05.589 18208 18208 E AndroidRuntime:        at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3895)
08-19 16:19:05.589 18208 18208 E AndroidRuntime:        at android.app.servertransaction.ResumeActivityItem.execute(ResumeActivityItem.java:51)
08-19 16:19:05.589 18208 18208 E AndroidRuntime:        at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:145)
08-19 16:19:05.589 18208 18208 E AndroidRuntime:        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:70)
08-19 16:19:05.589 18208 18208 E AndroidRuntime:        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1839)
08-19 16:19:05.589 18208 18208 E AndroidRuntime:        at android.os.Handler.dispatchMessage(Handler.java:106)
08-19 16:19:05.589 18208 18208 E AndroidRuntime:        at android.os.Looper.loop(Looper.java:201)
08-19 16:19:05.589 18208 18208 E AndroidRuntime:        at android.app.ActivityThread.main(ActivityThread.java:6861)
08-19 16:19:05.589 18208 18208 E AndroidRuntime:        at java.lang.reflect.Method.invoke(Native Method)
08-19 16:19:05.589 18208 18208 E AndroidRuntime:        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
08-19 16:19:05.589 18208 18208 E AndroidRuntime:        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:873)
08-19 16:19:05.589 18208 18208 E AndroidRuntime: Caused by: java.lang.IllegalStateException: Unexpected failure to classify SearchResult: SearchResult{key=/sdcard, nodeFound=Node{edge=dcard, value=0, edges=[]}, charsMatched=7, charsMatchedInNodeFound=5, parentNode=Node{edge=/s, value=null, edges=[Node{edge=dcard, value=0, edges=[]}, Node{edge=torage/emulated/0/, value=null, edges=[Node{edge=D, value=null, edges=[Node{edge=CIM, value=1, edges=[]}, Node{edge=ownload, value=2, edges=[]}]}, Node{edge=M, value=null, edges=[Node{edge=ovies, value=3, edges=[]}, Node{edge=usic, value=4, edges=[]}]}, Node{edge=Pictures, value=5, edges=[]}]}]}, parentNodesParent=Node{edge=, value=null, edges=[Node{edge=/s, value=null, edges=[Node{edge=dcard, value=0, edges=[]}, Node{edge=torage/emulated/0/, value=null, edges=[Node{edge=D, value=null, edges=[Node{edge=CIM, value=1, edges=[]}, Node{edge=ownload, value=2, edges=[]}]}, Node{edge=M, value=null, edges=[Node{edge=ovies, value=3, edges=[]}, Node{edge=usic, value=4, edges=[]}]}, Node{edge=Pictures, value=5, edges=[]}]}]}, Node{edge=0, value=8, edges=[]}, Node{edge=1, value=9, edges=[]}, Node{edge=2, value=10, edges=[]}, Node{edge=3, value=11, edges=[]}, Node{edge=4, value=12, edges=[]}, Node{edge=5, value=6, edges=[]}, Node{edge=6, value=7, edges=[]}]}, classification=null}
08-19 16:19:05.589 18208 18208 E AndroidRuntime:        at com.googlecode.concurrenttrees.radix.ConcurrentRadixTree$SearchResult.classify(ConcurrentRadixTree.java:989)
08-19 16:19:05.589 18208 18208 E AndroidRuntime:        at com.googlecode.concurrenttrees.radix.ConcurrentRadixTree$SearchResult.<init>(ConcurrentRadixTree.java:969)
08-19 16:19:05.589 18208 18208 E AndroidRuntime:        at com.googlecode.concurrenttrees.radix.ConcurrentRadixTree.searchTree(ConcurrentRadixTree.java:932)
08-19 16:19:05.589 18208 18208 E AndroidRuntime:        at com.googlecode.concurrenttrees.radix.ConcurrentRadixTree.putInternal(ConcurrentRadixTree.java:456)
08-19 16:19:05.589 18208 18208 E AndroidRuntime:        at com.googlecode.concurrenttrees.radix.ConcurrentRadixTree.put(ConcurrentRadixTree.java:83)
08-19 16:19:05.589 18208 18208 E AndroidRuntime:        at com.googlecode.concurrenttrees.radixinverted.ConcurrentInvertedRadixTree.put(ConcurrentInvertedRadixTree.java:185)
08-19 16:19:05.589 18208 18208 E AndroidRuntime:        at com.amaze.filemanager.utils.DataUtils.putDrawerMetadata(DataUtils.java:429)
08-19 16:19:05.589 18208 18208 E AndroidRuntime:        at com.amaze.filemanager.ui.views.drawer.Drawer.addNewItem(Drawer.java:483)
08-19 16:19:05.589 18208 18208 E AndroidRuntime:        at com.amaze.filemanager.ui.views.drawer.Drawer.refreshDrawer(Drawer.java:285)
08-19 16:19:05.589 18208 18208 E AndroidRuntime:        at com.amaze.filemanager.activities.MainActivity.onResume(MainActivity.java:1112)
08-19 16:19:05.589 18208 18208 E AndroidRuntime:        at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1413)
08-19 16:19:05.589 18208 18208 E AndroidRuntime:        at android.app.Activity.performResume(Activity.java:7408)
08-19 16:19:05.589 18208 18208 E AndroidRuntime:        at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3855)
08-19 16:19:05.589 18208 18208 E AndroidRuntime:        ... 11 more
TranceLove commented 4 years ago

Seems to be the case. Not able to reproduce on Oneplus 2 running Slim7 (7.1.2), LG Nexus 5x running AOSPExtended (9.0), and Fairphone 3 running LineageOS 16.0 (9.0).

Perhaps a ROM-specific problem?

VishalNehra commented 4 years ago

Confirm, not able to reproduce on v3.5 beta. Can you please update to beta version and check on your device?

sjl872964789 commented 4 years ago

Thanks for your quick reply, I tried it on v3.5 beta, the problem no longer appears, it may be fixed together with other issues, you can close it, thanks!

VishalNehra commented 4 years ago

Awesome! Thanks for confirming (: