markzhai / markzhai/AndroidPerformanceMonitor
Android6.0权限问题
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 6.7k
- Forks
- 1k
- PR merge metrics
- No merged PRs in 30d
Description
您好,我在android6.0下集成Blockcanary,出现下面的错误,应该是Runtime Permission机制导致的(后来在系统设置里手工设置权限后重启应用没有再出现)。请教Blockcanary现在处理Runtime Permisssion是不是通过发送权限授权通知?
错误信息如下:
05-10 10:42:03.196 4973-5451/cn.com.panchan.homelauncher.debug E/LogWriter: saveLogToSDCard:
java.io.FileNotFoundException: /data/storage/emulated/0/Android/data/cn.com.example.homelauncher.debug/files/log/blockcanary/looper-2016-05-10_10-42-03.193.txt: open failed: ENOENT (No such file or directory)
at libcore.io.IoBridge.open(IoBridge.java:459)
at java.io.FileOutputStream.(FileOutputStream.java:87)
at java.io.FileOutputStream.(FileOutputStream.java:127)
at com.github.moduth.blockcanary.LogWriter.saveLogToSDCard(LogWriter.java:105)
at com.github.moduth.blockcanary.LogWriter.saveLooperLog(LogWriter.java:53)
at com.github.moduth.blockcanary.BlockCanaryCore$1.onBlockEvent(BlockCanaryCore.java:60)
at com.github.moduth.blockcanary.LooperPrinter$1.run(LooperPrinter.java:72)
at android.os.Handler.handleCallback(Handler.java:743)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:150)
at android.os.HandlerThread.run(HandlerThread.java:61)
Caused by: android.system.ErrnoException: open failed: ENOENT (No such file or directory)
at libcore.io.Posix.open(Native Method)
at libcore.io.BlockGuardOs.open(BlockGuardOs.java:186)
at libcore.io.IoBridge.open(IoBridge.java:445)
at java.io.FileOutputStream.(FileOutputStream.java:87)
at java.io.FileOutputStream.(FileOutputStream.java:127)
at com.github.moduth.blockcanary.LogWriter.saveLogToSDCard(LogWriter.java:105)
at com.github.moduth.blockcanary.LogWriter.saveLooperLog(LogWriter.java:53)
at com.github.moduth.blockcanary.BlockCanaryCore$1.onBlockEvent(BlockCanaryCore.java:60)
at com.github.moduth.blockcanary.LooperPrinter$1.run(LooperPrinter.java:72)
at android.os.Handler.handleCallback(Handler.java:743)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:150)
at android.os.HandlerThread.run(HandlerThread.java:61)
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with LogWriter.java, especially saveLogToSDCard at line 105, and trace the call from saveLooperLog through BlockCanaryCore.java and LooperPrinter.java. Reproduce the reported Android 6.0 failure and determine whether runtime permissions explain the ENOENT error. Done means the permission-related logging behavior is understood and documented or corrected with coverage for the reported path.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, java
- Domain
- mobile, performance
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 32/100