Obsolete
Status Update
Comments
ar...@google.com <ar...@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.
ar...@google.com <ar...@google.com> #3
Our engineering team has fixed this issue. It will be available in a future Android release, so please keep an eye on our release notes(https://developer.android.com/preview/release-notes.html ).
Description
* What device are you using? (for example, Nexus 6P)
The Android O DP2 emulator(Google API). with build number
sdk_gphone_x86_userdebug O OPP2.170420.012 3991286 dev-keys
* What are the steps to reproduce the problem? (Please provide the minimal reproducible test case.)
1: Install a new app which targets Api Level less than O(for example 25, 24, 23, 22...)
2: Don't run it after the installation, .
3: Go to settings -> Apps & notifications -> App info -> [the app], then focus on the "Battery" option
* Issue Category e.g. Framework (platform), NDK (platform), Hardware (CPU, GPU, Sensor, Camera), ART (platform), Runtime Permissions etc
* What was the expected result?
the "Battery" option is clickable, and then the user can enter it(the fragment of com.android.settings.fuelgauge.AdvancedPowerUsageDetail), then the user is able to disable the "background activity" option.
Reason:
Modification of the "background activity" option = modifying the appop of RUN_IN_BACKGROUND of the app, which is not related to no matter if the app has ever run.
* What was the actual result?
According to screenshot.jpg
The "Battery" option is grayed out, so it becomes impossible to enter the fragment.
So the user has to run the app once before (s)he can adjust the option.
Unless the appops command(supposed for development purpose) is used:
appops set [package name] RUN_IN_BACKGROUND ignore.
* Relevant logcat output.
I don't think it is needed.
The issue can be reproduced easily with any app's targeting API less than O, which makes it not necessary to provide a "sample apk", or any android bug report.