Obsolete
Status Update
Comments
mm...@commonsware.com <mm...@commonsware.com> #2
This behavior can be reproduced by this sample app:
https://github.com/commonsguy/cw-omnibus/tree/master/AlarmManager/AntiDoze
It appears as though the Settings app is caching the "Not Optimized" list and not refreshing it as needed. Once I get into the state where the Settings app fails to report my app as being not optimized, if I swipe the Settings app off the overview screen and run it again, the list reflects the current state accurately.
It appears as though the Settings app is caching the "Not Optimized" list and not refreshing it as needed. Once I get into the state where the Settings app fails to report my app as being not optimized, if I swipe the Settings app off the overview screen and run it again, the list reflects the current state accurately.
rn...@google.com <rn...@google.com>
rn...@google.com <rn...@google.com> #3
Hi,
We have passed this defect on to the development team and will update this issue with more information as it becomes available.
Thanks
We have passed this defect on to the development team and will update this issue with more information as it becomes available.
Thanks
pu...@gmail.com <pu...@gmail.com> #5
For anyone tempted to use android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS and ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS, beware !
Google is monitoring apps that require this permission and can suspend it if they think said app should not use it:
http://stackoverflow.com/questions/33114063/how-do-i-properly-fire-action-request-ignore-battery-optimizations-intent
An arbitrary slippery slope not mentioned in the documentation.
Google is monitoring apps that require this permission and can suspend it if they think said app should not use it:
An arbitrary slippery slope not mentioned in the documentation.
[Deleted User] <[Deleted User]> #6
There has been no activity on this issue since November; is there any update?
I am also noticing that on Nexus devices the ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS intent does not result in any prompt being shown if the package is not the app that made the request.
If I run the same code on Samsung Galaxy S6 Edge then I am able to show the system prompt for any package (even ones that are not the currently running app).
I am also noticing that on Nexus devices the ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS intent does not result in any prompt being shown if the package is not the app that made the request.
If I run the same code on Samsung Galaxy S6 Edge then I am able to show the system prompt for any package (even ones that are not the currently running app).
jo...@gmail.com <jo...@gmail.com> #7
[Comment deleted]
vi...@google.com <vi...@google.com>
vi...@google.com <vi...@google.com> #8
Can you please check the bug and let us know in case the issue is still reproducible. If yes, kindly share the below details:
Android build
Which Android build are you using? (e.g. OPP1.170223.012)
Device used
Which device did you use to reproduce this issue?
Steps to reproduce
What steps are needed to reproduce this issue?
Frequency
How frequently does this issue occur? (e.g 100% of the time, 10% of the time)
Expected output
What is the expected output?
Current output
What is the current output?
Android bug report capturing
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.
Alternate method
After reproducing the issue, navigate to “developer settings”, ensure “USB debugging” is enabled, then enable “Bug report shortcut”. Capture bug report by holding the power button and selecting the “Take bug report” option.
Note: Please upload the files to google drive and share the folder to android-bugreport@google.com, then share the link here.
Android build
Which Android build are you using? (e.g. OPP1.170223.012)
Device used
Which device did you use to reproduce this issue?
Steps to reproduce
What steps are needed to reproduce this issue?
Frequency
How frequently does this issue occur? (e.g 100% of the time, 10% of the time)
Expected output
What is the expected output?
Current output
What is the current output?
Android bug report capturing
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.
Alternate method
After reproducing the issue, navigate to “developer settings”, ensure “USB debugging” is enabled, then enable “Bug report shortcut”. Capture bug report by holding the power button and selecting the “Take bug report” option.
Note: Please upload the files to google drive and share the folder to android-bugreport@google.com, then share the link here.
[Deleted User] <[Deleted User]> #9
Can you please check the bug and let us know in case the issue is still reproducible. If yes, kindly share the below details:
Android build
Which Android build are you using?
Android P, N
Device used
Which device did you use to reproduce this issue?
Oppo oneplus (Android P), Galaxy S6 (Android N)
Steps to reproduce
What steps are needed to reproduce this issue?
if ( Build.VERSION.SDK_INT > Build.VERSION_CODES.N )
{
try
{
PowerManager powerManager = (PowerManager) getContext().getSystemService(Context.POWER_SERVICE);
String packageName = getApplicationContext().getPackageName();
if ( !powerManager.isIgnoringBatteryOptimizations(packageName) )
{
Intent intent = new Intent();
intent.setAction(Settings.ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS);
intent.setData(Uri.parse("package:" + packageName));
startActivity(intent);
return;
}
}
catch (Exception e)
{
}
}
Frequency
How frequently does this issue occur? (e.g 100% of the time, 10% of the time)
100%
Expected output
What is the expected output?
Application should appear in "Not optimization" List
Current output
What is the current output?
Application does not appear in "Not optimization" List
Android bug report capturing
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.
Alternate method
After reproducing the issue, navigate to “developer settings”, ensure “USB debugging” is enabled, then enable “Bug report shortcut”. Capture bug report by holding the power button and selecting the “Take bug report” option.
Android build
Which Android build are you using?
Android P, N
Device used
Which device did you use to reproduce this issue?
Oppo oneplus (Android P), Galaxy S6 (Android N)
Steps to reproduce
What steps are needed to reproduce this issue?
if ( Build.VERSION.SDK_INT > Build.VERSION_CODES.N )
{
try
{
PowerManager powerManager = (PowerManager) getContext().getSystemService(Context.POWER_SERVICE);
String packageName = getApplicationContext().getPackageName();
if ( !powerManager.isIgnoringBatteryOptimizations(packageName) )
{
Intent intent = new Intent();
intent.setAction(Settings.ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS);
intent.setData(Uri.parse("package:" + packageName));
startActivity(intent);
return;
}
}
catch (Exception e)
{
}
}
Frequency
How frequently does this issue occur? (e.g 100% of the time, 10% of the time)
100%
Expected output
What is the expected output?
Application should appear in "Not optimization" List
Current output
What is the current output?
Application does not appear in "Not optimization" List
Android bug report capturing
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.
Alternate method
After reproducing the issue, navigate to “developer settings”, ensure “USB debugging” is enabled, then enable “Bug report shortcut”. Capture bug report by holding the power button and selecting the “Take bug report” option.
vi...@google.com <vi...@google.com> #10
Please share the details requested in comment #8 , to proceed further with the bug.
vi...@google.com <vi...@google.com> #11
We are closing this issue as we don't have enough actionable information. If you are still facing this problem, please open new issue and add the relevant information along with reference to earlier issue.
[Deleted User] <[Deleted User]> #12
I am still having this issue. Android 9.
1. Install app.
2. Disable Battery optimization.
3. Check Battery Optimization in the program. Showed Not optimized.
4. Uninstall the app and install again.
5. Check Battery Optimization in the program. Showed optimized.
6. Go to Setting. the app's battery optimization is disabled.
1. Install app.
2. Disable Battery optimization.
3. Check Battery Optimization in the program. Showed Not optimized.
4. Uninstall the app and install again.
5. Check Battery Optimization in the program. Showed optimized.
6. Go to Setting. the app's battery optimization is disabled.
sp...@gmail.com <sp...@gmail.com> #13
Still having this problem on Galaxy S21 Ultra
pe...@gmail.com <pe...@gmail.com> #14
Yes, still broken on Galaxy S20 FE too, six years later. Maybe worth spending ten minutes trying to find the issue, despite the OP not having attached the "bug report"? The bug doesn't go away just because the bug report isn't 100 % complete :)
Description
* Which version of the SDK are you using?
Android 6.0 (API 23)
* Which Android build are you using? (e.g. MPZ44Q)
MPA44I
* What device are you using?
Nexus 6 (Android version 6.0)
* What steps will reproduce the problem? (Please provide the minimal
reproducible test case.)
1. Install a simple Hello World app, which checks whitelist via isIgnoringBatteryOptimizations. If FALSE, it fires android.provider.Settings.ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS to prompt user to whitelist the app.
2. On the "Ignore battery optimisation" prompt, user selects YES. See attached doze_1
3. App does show TRUE when query isIgnoringBatteryOptimizations; but the phone's Battery Optimisation still shows HelloWorld in optimised list (All apps). See attached doze_2_not_optimised and doze_3_all_apps
4. Power-cycle the phone, now phone's Battery Optimisation shows HelloWorld in "Not optimised" list. See attached doze_4_phone_after_restarted
* What is the expected output?
The phone's Battery Optimisation should show correct whitelist apps
* What do you see instead?
The phone's Battery Optimisation doesn't show Hello World in "Not optimised" list while the app is indeed white-listed