Fixed
Status Update
Comments
al...@android.com <al...@android.com>
mo...@google.com <mo...@google.com>
mo...@google.com <mo...@google.com> #2
Fixed by change I6d9fc26be768ba1e338344740e340cf9b56386e9
qu...@gmail.com <qu...@gmail.com> #3
the issue is still there.. It's not fixed.
mo...@google.com <mo...@google.com> #4
The change will most likely be part of the Android P release.
mu...@gmail.com <mu...@gmail.com> #5
This is a huge deal breaker. Releasing the fix in Android P is not enough since users in previous version will face this issue. At least mention this issue in PdfRenderer documentation so that developers are aware of it. Hiding this issue under issuetracker is not going to do any good.
Description
Please describe the problem in detail. Be sure to include:
Reproduce :
try {
mFileDescriptor = ParcelFileDescriptor.open(file, ParcelFileDescriptor.MODE_READ_ONLY);
mPdfRenderer = new PdfRenderer(mFileDescriptor);
} catch (FileNotFoundException e) {
e.printStackTrace();
closeRendererAbnormal();
} catch (IOException e) {
e.printStackTrace();
closeRendererAbnormal();
} catch (SecurityException e) {
e.printStackTrace();
closeRendererAbnormal();
}
private void closeRendererAbnormal() {
if(mPdfRenderer != null) {
mPdfRenderer.close();
mPdfRenderer = null;
}
if(mFileDescriptor != null) {
try {
mFileDescriptor.close();
mFileDescriptor = null;
} catch (IOException e) {
e.printStackTrace();
}
}
}
Problem :
First time when any password protected PDF is opened using below method :
mFileDescriptor = ParcelFileDescriptor.open(file, ParcelFileDescriptor.MODE_READ_ONLY);
mPdfRenderer = new PdfRenderer(mFileDescriptor);
SecurityException is thrown(as expected) and handled accordingly.
Next time try to open same pdf and it crashes(Fatal signal 11 (SIGSEGV)) the application instead of throwing SecurityException
When ParcelFileDescriptor is opened for the first time, mFd is 49 but when it is done for the second time mFd is 52 and this is the case when problem occurs.
Expected : SecurityException should be thrown instead of crash
Android version : 5.1.1
Device : Samsung Galaxy Note 4