Fixed
Status Update
Comments
am...@google.com <am...@google.com>
am...@google.com <am...@google.com> #2
Thank you for reporting this issue. We have shared this with our product and engineering team and will update this issue with more information as it becomes available.
am...@google.com <am...@google.com> #3
We've deferred this to a future release, but leaving this open for now.
ms...@atlassian.com <ms...@atlassian.com> #4
Same problem here. What's the status of the issue?
ms...@atlassian.com <ms...@atlassian.com> #5
And is there a workaround for this in the meantime?
sa...@google.com <sa...@google.com> #6
We will be closing this bug due to being logged in a Preview version of Android. If the issue is still relevant and reproducible in the latest public release (Android Q), please capture a bugreport and log the bug in https://goo.gl/TbMiIO . If a reply is not received within the next 14 days, this issue will be closed. Thank you for your understanding.
Description
OPP3.170518.006
* What device are you using? (for example, Nexus 6P)
Nexus 6P
* What are the steps to reproduce the problem? (Please provide the minimal reproducible test case.)
1. Open password protected pdf with ParcelFileDescriptor and try to instantiate PdfRenderer.
-> SecurityException occurs (as expected), so close the ParcelFileDescriptor.
2. Then open another normal (NOT protected) pdf and try to instantiate PdfRenderer again.
-> This also cause SecurityException althought opened pdf is NOT protected.
The problem is repeated until the application task is killed.
Here is a sample code.
-----------
try{
pdf = ParcelFileDescriptor.open(sourceFile, ParcelFileDescriptor.MODE_READ_ONLY);
renderer = new PdfRenderer(pdf);
result = true;
} catch (IOException e) {
e.printStackTrace();
result =false;
} catch (SecurityException e){
e.printStackTrace();
isSecured = true;
result = false;
}
private void close(){
if(renderer != null){
renderer.close();
renderer = null;
}
if(pdf != null){
try {
pdf.close();
pdf = null;
} catch (IOException e) {
e.printStackTrace();
pdf = null;
}
}
}
-----------
* Issue Category e.g. Framework (platform), NDK (platform), Hardware (CPU, GPU, Sensor, Camera), ART (platform), Runtime Permissions etc
Framework (platform)
* What was the expected result?
Even after the protected pdf is opened and SecurityException is thrown by PdfRenderer, normal pdf can be opened as usual.
(SecurityException is thrown only when the target pdf is protected.)
* What was the actual result?
Once sercured pdf is opened by PdfRenderer, it throws SecurityException repeatedly whenever opening normal pdf.
So application never can open pdf as long as SecurityException is handled.
Before Android O, application crashes with "Fatal signal 11 (SIGSEGV)", without throwing SecurityException, but application can open normal pdf after crash.
* Relevant logcat output.
-----------
[First, open password protected pdf]
W/System.err: java.lang.SecurityException: password required or incorrect password
W/System.err: at android.graphics.pdf.PdfRenderer.nativeCreate(Native Method)
W/System.err: at android.graphics.pdf.PdfRenderer.<init>(PdfRenderer.java:166)
...
E/System: Uncaught exception thrown by finalizer
E/System: java.lang.SecurityException: password required or incorrect password
at android.graphics.pdf.PdfRenderer.nativeClose(Native Method)
at android.graphics.pdf.PdfRenderer.doClose(PdfRenderer.java:247)
at android.graphics.pdf.PdfRenderer.finalize(PdfRenderer.java:235)
at java.lang.Daemons$FinalizerDaemon.doFinalize(Daemons.java:250)
at java.lang.Daemons$FinalizerDaemon.runInternal(Daemons.java:237)
at java.lang.Daemons$Daemon.run(Daemons.java:103)
at java.lang.Thread.run(Thread.java:764)
[Next, open normal pdf after the above operation]
W/System.err: java.lang.SecurityException: password required or incorrect password
W/System.err: at android.graphics.pdf.PdfRenderer.nativeCreate(Native Method)
W/System.err: at android.graphics.pdf.PdfRenderer.<init>(PdfRenderer.java:166)
...
E/System: Uncaught exception thrown by finalizer
E/System: java.lang.SecurityException: password required or incorrect password
at android.graphics.pdf.PdfRenderer.nativeClose(Native Method)
at android.graphics.pdf.PdfRenderer.doClose(PdfRenderer.java:247)
at android.graphics.pdf.PdfRenderer.finalize(PdfRenderer.java:235)
at java.lang.Daemons$FinalizerDaemon.doFinalize(Daemons.java:250)
at java.lang.Daemons$FinalizerDaemon.runInternal(Daemons.java:237)
at java.lang.Daemons$Daemon.run(Daemons.java:103)
at java.lang.Thread.run(Thread.java:764)
-----------
* Optional: Link to any screenshot(s) that demonstrate the issue (shared privately in Drive.)
* Optional: Link to captured Android bug report (shared privately in Drive.)
To avoid leaking private information, please share screenshots and downloads only in Google Drive. Share files with android-bugreport@google.com and include only links in your bug reports. Bug report attachments should not be included directly in issue reports.