New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(android): Ti.Media.previewImage() fails to display in-memory blobs as of 9.1.0 #12271
Conversation
- Regression introduced by Titanium 9.1.0 Fixes TIMOB-28246
|
@@ -1038,7 +992,6 @@ public void dispose() | |||
{ | |||
TiActivityWindows.dispose(); | |||
TiActivitySupportHelpers.dispose(); | |||
TiFileHelper.getInstance().destroyTempFiles(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not destroy temp files here now? I assume because this no longer an active API and this just happens automatically implicitly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've changed TiFileHelper
to use the same temp directory we expose in JavaScript. This temp directory gets deleted on app startup and every time the JS runtime terminates. See the deleteTiTempFiles()
method calls below...
https://github.com/appcelerator/titanium_mobile/blob/master/android/titanium/src/java/org/appcelerator/titanium/TiApplication.java#L363-L384
Also, the old TiFileHelper
code wasn't deleting temp files if the app was forced-quit, which happens all the time by the Android OS while the app is backgrounded. This needed to be fixed.
android/titanium/src/java/org/appcelerator/titanium/util/TiFileHelper.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CR: PASS
FR Passed. |
JIRA:
https://jira.appcelerator.org/browse/TIMOB-28246
Github Issue:
#12265
Summary:
TiFileHelper.getTempFile()
to create file like it did before 9.1.0.TiFileHelper.getTempFileFromInputStream()
method which always failed to create file.Ti.Media.previewImage()
method from working.TiFileHelper
would not delete files if app was force-quit.Test: