Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save er-abhishek-luthra/9e438c1361f720e85c022a2dc5b74eaf to your computer and use it in GitHub Desktop.
Save er-abhishek-luthra/9e438c1361f720e85c022a2dc5b74eaf to your computer and use it in GitHub Desktop.

Android 12 Restricted on Background Services

Apps that target Android 12 or higher can't start foreground services while running in the background, except for a few special cases. If an app attempts to start a foreground service while running in the background, an exception occurs (except for the few special cases).

Chargingwatts Battery Alarm needs to work in background to work properly. Because of this Android 12 users must remove Chargingwatts Battery Alarm from the Battery Optimization.

On main page of Chargingwatts Battery Alarm, when you click "Charge Alarm" button, you will see the dialog.

Updated to Android 8/Oreo and noticed extra notifications?

Google have decided that all apps doing background operations must show a notification or finish the process in 5 seconds. Since Chargingwatts Battery Alarm might not finish this process in 5 seconds it show notification.

However, if you have Android 8 you would also see a notification. This due to changes Android 8 brought and cannot be avoided.

You would also see "Waiting battery information" notifications because Chargingwatts Battery Alarm needs to be started on boot or after it is closed by the system. We had to add intermediate notification to workaround Android 8 limitations related to background operations.

Why permissions?

It may look simple but Chargingwatts Battery Alarm is a very advanced app. It has many features that require many permissions.

For example:

It requires storage access, which called Photos and Videos on Android so you can select external ringtones from your sdcard. Beside this Chargingwatts Battery Alarm needs this permission to save log file and application settings backup/restore.

There is nothing malicious about permissions requested by Chargingwatts Battery Alarm.

Chargingwatts Battery Alarm closes after a while

This is currently the most common issue we hear from our users.

System power managers Most manufacturers added some sort of power management to their phones. Power managers close 3rd party apps like Chargingwatts Battery Alarm. You need to keep Chargingwatts Battery Alarm Battery Percentage notification on to prevent it from being closed. Unfortunately, even notification does not help on some phones. Please see this article explaining how to add an application to excluded list of your phone's power manager. Examples for ACR application.

Battery or memory saving apps Other culprit are Battery saving and memory cleaning apps. Android does not need battery manager app, they cause more harm than good. Remove any battery or memory cleaner apps.

Clenaning recent apps Another issue is cleaning recent apps by swiping them away. You are removing apps form the cache and forcing Android to recreate them on next lunch. Therefore causing more battery drain. You do not need remove recent apps.

Chargingwatts Battery Alarm doesn't start automatically when connect to charger

Please see "Chargingwatts Battery Alarm closes after a while" topic.

####Chargingwatts Battery Alarm doesn't work when battery is fully charged Please see "Chargingwatts Battery Alarm closes after a while" topic. Please check your ringtone. If you select a specific ringtone from your sdcard, check storage permission. Chargingwatts Battery Alarm needs this permission to play external ringtones. If you select "Actual full battery" alarm level, be sure your device reach to actual full battery level. For example, on Samsung phones, you can see green led notification light when reach to actual full battery level.

Low Battery Alarm doesn't work

Please see "Chargingwatts Battery Alarm closes after a while" topic. Low battery alarm only works while your screen is OFF. When your device battery level reach to low battery alarm level, if you screen is ON you will see only a notification about low battery alarm. This system have developed to prevent user interruptions.

Do you have any other issue? Contact us from within Chargingwatts Battery Alarm settings menu by tapping on "Contact Us" button if you cannot find any solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment