Fixed
Status Update
Comments
am...@google.com <am...@google.com>
am...@google.com <am...@google.com> #2
Looking so good new version
js...@android.com <js...@android.com> #3
Thank you for reporting this issue.
Please provide the below details to debug this issue further.
1. Please attach your sample android project which reproduces the issue, zip it and share
2. Explain the steps to reproduce the issue with your apk. Provide all necessary information including preconditions if any, to reproduce the issue.
3. Android bug report
After reproducing the issue, press the volume up, volume down, and power button simultaneously. This will capture a bug report on your device in the “bug reports” directory. Attach the bug report file to this issue.
Alternate method:
After reproducing the issue, navigate to developer settings, ensure ‘USB debugging’ is enabled, then enable ‘Bug report shortcut’. To take bug report, hold the power button and select the ‘Take bug report’ option.
4. Screen Record of the issue
Please capture screen record or video of the issue using following steps:
adb shell screenrecord /sdcard/video.mp4
Subsequently use following command to pull the recorded file:
adb pull /sdcard/video.mp4
Attach the file to this issue.
Please provide the below details to debug this issue further.
1. Please attach your sample android project which reproduces the issue, zip it and share
2. Explain the steps to reproduce the issue with your apk. Provide all necessary information including preconditions if any, to reproduce the issue.
3. Android bug report
After reproducing the issue, press the volume up, volume down, and power button simultaneously. This will capture a bug report on your device in the “bug reports” directory. Attach the bug report file to this issue.
Alternate method:
After reproducing the issue, navigate to developer settings, ensure ‘USB debugging’ is enabled, then enable ‘Bug report shortcut’. To take bug report, hold the power button and select the ‘Take bug report’ option.
4. Screen Record of the issue
Please capture screen record or video of the issue using following steps:
adb shell screenrecord /sdcard/video.mp4
Subsequently use following command to pull the recorded file:
adb pull /sdcard/video.mp4
Attach the file to this issue.
mm...@commonsware.com <mm...@commonsware.com> #4
1. Code Sample attached. Cannot attach the original app code because of copyright.
2. Steps to reproduce it:
1. Tap on the first image (this activity is portrait)
2. It will go to a landscape ativity
3. Tap back button
4. Observe that the previous activity goes to portrait, then to landscape and finally portrait again.
Note: On the original app is happening always. On this code sample I was able to reproduce it 5/10 times.
4. Video attached, error on the last seconds.
2. Steps to reproduce it:
1. Tap on the first image (this activity is portrait)
2. It will go to a landscape ativity
3. Tap back button
4. Observe that the previous activity goes to portrait, then to landscape and finally portrait again.
Note: On the original app is happening always. On this code sample I was able to reproduce it 5/10 times.
4. Video attached, error on the last seconds.
he...@gmail.com <he...@gmail.com> #5
Could you please share the bugreport too?
Android bug report
After reproducing the issue, press the volume up, volume down, and power button simultaneously. This will capture a bug report on your device in the “bug reports” directory. Attach the bug report file to this issue.
Alternate method:
After reproducing the issue, navigate to developer settings, ensure ‘USB debugging’ is enabled, then enable ‘Bug report shortcut’. To take bug report, hold the power button and select the ‘Take bug report’ option.
Android bug report
After reproducing the issue, press the volume up, volume down, and power button simultaneously. This will capture a bug report on your device in the “bug reports” directory. Attach the bug report file to this issue.
Alternate method:
After reproducing the issue, navigate to developer settings, ensure ‘USB debugging’ is enabled, then enable ‘Bug report shortcut’. To take bug report, hold the power button and select the ‘Take bug report’ option.
js...@android.com <js...@android.com> #6
Attaching the bug report.
he...@gmail.com <he...@gmail.com> #7
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> #8
Is there any update? I would be great if you can provide more information about this issue. It's getting worse every day and I cannot find any fix.
Thanks
Thanks
he...@gmail.com <he...@gmail.com> #9
We have deferred this to a future release, but leaving the bug open for now.
bk...@gmail.com <bk...@gmail.com> #10
The same happens with Nexus 5X(8.1).
am...@google.com <am...@google.com> #11
Same here, reproducing the bug in some of my apps in a Nexus 5X after upgrading to 8.1. It would be great to have at least a workaround.
Thank you.
Thank you.
jc...@xone.es <jc...@xone.es> #12
The same problem with Nexus 5X(8.1).
But if I hide navigation bar,it will not happen.
But if I hide navigation bar,it will not happen.
am...@google.com <am...@google.com> #13
#12
I'm sorry, I was wrong.
Hide navigation bar not working.
I'm sorry, I was wrong.
Hide navigation bar not working.
[Deleted User] <[Deleted User]> #14
We have run into this issue on one of our apps as well. We were able to reproduce on the given barebones project in Github. Mind that the Activities are written in Kotlin but are very simple.
The issue happens 100% of the time on the device we've witnessed it on.
https://github.com/bodyshopbidsdotcom/Android8.1OrientationBug
Thanks!
-Anthony
The issue happens 100% of the time on the device we've witnessed it on.
Thanks!
-Anthony
mt...@gmail.com <mt...@gmail.com> #15
Also affected with Nexus 5X - Android 8.1... Can you provide more information when can we expect fix for this issue?
cc...@gmail.com <cc...@gmail.com> #16
Also affected Nexus 6p - Android 8.1.
I have my firstActivity with no restrictions on orientation, and my secondActivity with landscape orientation restriction.
When i return from secondActivity to firstActivity, firstActivity flips from portrait to landscape and again to portrait.
Any news about this bug?
Thank you
I have my firstActivity with no restrictions on orientation, and my secondActivity with landscape orientation restriction.
When i return from secondActivity to firstActivity, firstActivity flips from portrait to landscape and again to portrait.
Any news about this bug?
Thank you
mm...@commonsware.com <mm...@commonsware.com> #17
I also have the same issue with Nexus 6p - Android 8.1 and Pixel2 - Android 8.1
Exactly as describe above :"I have my firstActivity with no restrictions on orientation, and my secondActivity with landscape orientation restriction.
When i return from secondActivity to firstActivity, firstActivity flips from portrait to landscape and again to portrait."
Exactly as describe above :"I have my firstActivity with no restrictions on orientation, and my secondActivity with landscape orientation restriction.
When i return from secondActivity to firstActivity, firstActivity flips from portrait to landscape and again to portrait."
ku...@gmail.com <ku...@gmail.com> #18
our app is also experiencing the same issue.
lb...@gmail.com <lb...@gmail.com> #19
We're also experiencing the same issue, rotating back after receiving orientation change in the portrait activity sometimes works, but not always.
mi...@gmail.com <mi...@gmail.com> #20
I found workaround for this issue. In "secondActivity" (landscape) I added additional setRequestOrientation in onPause and onResume method:
onCreate(){
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE);
}
onPause(){
if (android.os.Build.VERSION.SDK_INT >= 27) {
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT);
}
}
onResume(){
if (android.os.Build.VERSION.SDK_INT >= 27) {
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE);
}
}
onCreate(){
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE);
}
onPause(){
if (android.os.Build.VERSION.SDK_INT >= 27) {
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT);
}
}
onResume(){
if (android.os.Build.VERSION.SDK_INT >= 27) {
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE);
}
}
Description
N.
* Which Android build are you using? (e.g. NPC56P)
NPC56P
* What device are you using?
Nexus 9
* What steps will reproduce the problem? (Please provide the minimal
reproducible test case.)
Compile and run the attached sample app, or any other app that has targetSdkVersion of N and uses a file: Uri value.
* What is the expected output?
Given that nothing out of the ordinary with file: Uri values is mentioned in the Behavior Differences page, the expected output is whatever the app normally does. The attached app uses ACTION_IMAGE_CAPTURE to take a photo, then shows the resulting photo using ACTION_VIEW. However, it uses a file: Uri value for EXTRA_OUTPUT.
* What do you see instead?
The app will crash with a FileUriExposedException, such as the following from the attached app:
03-12 09:26:12.731 5419-5419/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.commonsware.android.camcon.n, PID: 5419
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.commonsware.android.camcon.n/com.commonsware.android.camcon.CameraContentDemoActivity}: android.os.FileUriExposedException: file:///storage/emulated/0/DCIM/CameraContentDemo.jpeg exposed beyond app through ClipData.Item.getUri()
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2581)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2641)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1398)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5849)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:763)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:653)
Caused by: android.os.FileUriExposedException: file:///storage/emulated/0/DCIM/CameraContentDemo.jpeg exposed beyond app through ClipData.Item.getUri()
at android.os.StrictMode.onFileUriExposed(StrictMode.java:1791)
at android.net.Uri.checkFileUriExposed(Uri.java:2346)
at android.content.ClipData.prepareToLeaveProcess(ClipData.java:834)
at android.content.Intent.prepareToLeaveProcess(Intent.java:8904)
at android.content.Intent.prepareToLeaveProcess(Intent.java:8889)
at android.app.Instrumentation.execStartActivity(Instrumentation.java:1506)
at android.app.Activity.startActivityForResult(Activity.java:4203)
at android.app.Activity.startActivityForResult(Activity.java:4162)
at com.commonsware.android.camcon.CameraContentDemoActivity.onCreate(CameraContentDemoActivity.java:55)
at android.app.Activity.performCreate(Activity.java:6570)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2534)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2641)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1398)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5849)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:763)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:653)
There is some material on this class in the JavaDocs. However:
1. Using a file: Uri is *very* common behavior in Android. This exception needs to be covered in the Behavior Differences documentation, as it is arguably more common than anything listed there already.
2. We need to know the expected behavior of the production release of N. Will it have this behavior, or will this be opt-in (via penaltyDeathOnFileUriExposure())?
3. We need to know if similar penalties will be placed on apps that fail to handle *receiving* content: Uri values correctly. As the saying goes, it takes two to tango. Forcing developers to use content: Uri values in Intent data and extras will only work if the recipients handle that properly. Google's own apps have had problems with content: Uri values in the past, let alone apps from other brands, both major and minor. In the case of the attached sample app, if the user's or device's camera app does not support content: Uri values, and Android N does not support file: Uri values, there is no means by which we can use ACTION_IMAGE_CAPTURE to take a picture.