BootleggersROM / frameworks_base

Our Frameworks/Base, inspired on various ROMs
Other
13 stars 81 forks source link

Fail to screenshot in Settings app when using certain languages #30

Closed neekless closed 5 years ago

neekless commented 5 years ago

Whenever I try taking a screenshot anywhere using certain rarely used languages (such as Outlying Islands or Virgin Islands English) in the Settings app I get a notification "Can't save screenshot due to limited storage space" which is 100% not true and I can take screenshots successfully on all my other apps.

This was an issue I faced on Ezio's ABC ROM in the past. The following is the log from ABC, but I assure you the same problem is happening here. Bootleggers is using Ezio's screenshot commits.

[ 06-06 10:32:49.875 20458:22195 E/SaveImageInBackgroundTask ]
unable to save screenshot
java.io.FileNotFoundException: /storage/emulated/0/Pictures/Screenshots/Screenshot_‎‏‎‎‎‎‎‏‎‏‏‏‎ ‎‎‎‎‏‎‎‏‎‎‎‏‎‏‏‏†â€Žâ€â€â€Žâ€â€â€Žâ€â€Žâ€Žâ€â€Žâ€Žâ€â€Žâ€Žâ €Žâ€â€Žâ€Žâ€â€Žâ€Žâ€â€Žâ€Žâ€Žâ€â€Žâ€Žâ€Žâ€â€ ‎‏‎‏‎‎‎‏‎‎‏‏‎‎‏‏†â€Žâ€Žâ€Žâ€Žâ€â€â€â€â€Žâ€Žâ€Žâ€â€Žâ€ŽSetting s‎‏‎‎‏‎_20180606-103249.png (File name too long)
at java.io.FileOutputStream.open0(Native Method)
at java.io.FileOutputStream.open(FileOutputStream.jav a:287)
at java.io.FileOutputStream.<init>(FileOutputStream.j ava:223)
at java.io.FileOutputStream.<init>(FileOutputStream.j ava:110)
at com.android.systemui.screenshot.SaveImageInBackgro undTask.doInBackground(GlobalScreenshot.java:280)
at com.android.systemui.screenshot.SaveImageInBackgro undTask.doInBackground(GlobalScreenshot.java:257)
at android.os.AsyncTask$2.call(AsyncTask.java:333)
at java.util.concurrent.FutureTask.run(FutureTask.jav a:266)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTas k.java:245)
at java.util.concurrent.ThreadPoolExecutor.runWorker( ThreadPoolExecutor.java:1162)
at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:636)
at java.lang.Thread.run(Thread.java:764)

Ezio fixed it in this commit. https://github.com/ezio84/abc_frameworks_base/commit/54ea6628cf2e9c05ce4750f94ef9337ea0e500a3 Please take a look and maybe you can adapt it for Bootleggers? I know I can use US English or UK English to avoid this problem, but that doesn't mean this shouldn't be fixed right? :p

eldainosor commented 5 years ago

@neekless We'll pick that! Thanks for the report and fix!