Rogue wakelocks on Xiaomi Mi A1

Excessive Battery Drain on Xiaomi Mi A1? Deal with Wakelocks

The Xiaomi Mi A1 has the chops to run multimedia content like a perfect, budget phone. It packs a Snapdragon 625 chipset, 4GB RAM, and 1080p screen combination. These give it the power to run most content with ease. Yet, users have complained about the excessive battery drain on Xiaomi Mi A1.

Is excessive battery drain on Xiaomi Mi A1 such an issue?

Many people are displeased about how fast their Mi A1s are losing battery power.

For example, XDA member felipovicc complained that his device didn’t go into deep sleep when it was idle. As the screenshot below shows, a kernel service named 7000000.ssusb used up to 59% of the battery power.

Kernel wakelocks causing excessive battery drain
Kernel services consuming battery power on an idle Mi A1. Source: XDA

MIUI senior member Kintsugi also complained about 7000000.ssusb. He found out that it used about half of his Mi A1’s idle battery power. See the screenshot below.

View kernel wakelocks
Kernel wakelocks. Source: Xiaomi MIUI Official Forum

XDA member AkCullen tried out a few things to reduce the excessive battery drain. Yet, despite stopping background apps and calibrating the battery his device lost about 80% of its power while in idle mode.

What are wakelocks?

Smartphones have smaller battery sizes than, say, laptops or PCs. Battery life is thus a key concern for most phone users. Besides, most manufacturers market their devices by claiming that they can last a full day on a single charge.

Android 7 introduced the Doze mode to force devices to go into deep sleep. So, in ideal situations, a Xiaomi Mi A1 phone should activate Doze when its screen is off and a user has not touched it for some time.

Still, at times, apps need to wake up the CPU or screen to complete some tasks. These apps use wakelocks, which prevent devices from going into deep sleep fully.

Android power management

Android’s PowerManager APIs expose wakelocks to apps. Using wakelocks, apps can then prevent devices from entering suspend mode. These APIs assume that wakelocks would work for short periods of time. So, once background services have completed their tasks, they are supposed to release them. Otherwise, wakelocks that linger on may drain battery power quickly.

Examples wakelocks’ states

The Android PowerManager API defines several wakelock states. See below.

    • Wakes up the CPU
    • Wakes up the CPU
    • Activates the screen in dim mode
    • Wakes up the CPU
    • Activates the screen in bright mode
    • Wakes up the CPU
    • Activates the screen in bright mode
    • Lights up the keyboard

Power management on Android 9 pie

Android Pie has introduced new ways of improving battery performance. The OS tries to give resources to those apps that need them the most. It uses two major features:

  1. Restricting resource usage when battery saver is on: It applies the limits on all apps.
  2. App standby buckets: The system monitors app usage patterns. Then, it limits the use of resources, like CPU, depending on the apps’ needs.

Thus, a simple method of improving the battery performance on Xiaomi Mi A1 is to install Android Pie.

Related: Install Android 9 Pie on Xiaomi Mi A1

Wakelocks vs. wakeups

Some apps can wake up devices at a specific time. They use the AlarmManager API to force a device to come out of sleep mode. Using the PARTIAL_WAKE_LOCK flag, they can run given tasks by activating the AlarmManager API.

Yet, poor app design causes some services to make excessive wakeup calls. Such applications may lead to quick battery drainage.

How to deal with rogue wakelocks on Xiaomi Mi A1

An earlier post shared tips on how to make the Xiaomi Mi A1’s last longer. It listed tactics like turning off Google Sync and disabling unused services. It also advised users to install apps like Greenify, BetterBatteryStats, and GSam Battery Monitor.

Likewise, today I’ll share three working methods of dealing with excessive battery drain on Xiaomi Mi A1. The first one requires root while the last two don’t.

How to stop wakelocks on Xiaomi Mi A1 with root

This method uses the Amplify app.

It also needs two things to work:

  1. Root access: See the guide on how to root Xiaomi Mi A1
  2. Xposed Framework: See steps for installation below

Installing the Xposed Framework on Xiaomi Mi A1

Related: Download TWRP custom recovery for Xiaomi Mi A1

With that out of the way, go ahead and install the Amplify app. Find the Play Store link above.

Use the app’s recommended defaults if you’re unsure of how to proceed. Otherwise, the app has ways of customizing the behavior of all services, alarms, and wakelocks running on your device.

How to stop wakelocks on Xiaomi Mi A1 without root

Wakelock Detector Lite and BetterBatteryStats do not require root access to manage wakelocks. Still, you’ll need to set up ADB drivers for the two to work.


How to install ADB/Fastboot drivers on PC
How to install ADB and Fastboot Drivers on Mac OS
How to flash recovery.img and install ADB on Linux OS

Using the Wakelock Detector

You can use the Wakelock Detector method in two ways. One, where you install a chrome extension. And two, where you pass permissions to the app using the terminal/command line.

Using a chrome browser extension

The app’s browser extension works on Google Chrome only. Thus, you’ll have to install the browser if you don’t have it on your PC already.


  1. Download and install Wakelock Detector Lite on your Mi A1
  2. Install the Google Chrome extension for Wakelock DetectorUnlocker for WakeLockDetector
  3. Enable USB debugging mode on your device


  1. Connect your device to PC using USB
  2. Connect the phone’s as a media device. Go to Storage/USB computer connection, then, select connect as Media device (MTP).
  3. Run the Wakelock Detector Lite app on your phone
  4. Run the Unlocker for WakelockDetector extension on Chrome browser. You should get a screen like the one below.
  5. Press the USB icon named Connection mode on the extension
  6. The extension will make your phone to bring up a dialog asking for RSA confirmation. Select Allow from this computer, then press OK
  7. As another option, the Grant Battery stats button may turn to a thumbs up icon. If this happens, press it instead of the USB icon to give the app the required permissions
WLD Unlock for Chrome
Xiaomi Mi A1 connected to Unlocker for WakelockDetector Chrome extension
Using the terminal/command line
  1. Connect your device to a computer using a USB cable
  2. Type the commands below on the terminal or command line
$ adb tcpip 5555

$ adb shell pm grant com.uzumapps.wakelockdetector.noroot android.permission.BATTERY_STATS

After that, you may use the app to stop rogue wakelocks by:

  1. Charging your device to full charge
  2. Disconnecting the charger and using the phone for about one to two hours
  3. Opening the app and noting the services or apps showing excessive wakelock usage
  4. Stopping the offending apps from draining your device’s battery

Using BetterBatteryStats

The BetterBatteryStats method is very similar to the one by the Wakelock Detector app. The key difference is that with BetterBatteryStats, you will use the command line alone.

If you have the ADB drivers all set up, you should thus start managing wakelocks using the steps below.

  1. Download and install the Package Name Viewer app from Play Store. You’ll see in a second how the application comes in handy when you need to stop specific wakelocks.
  2. Enable USB debugging on your device
  3. Connect it to a computer using a USB cable
  4. Run the command: adb devices
  5. If the terminal responds with the name of your device (or, if using Linux, it returns: no permissions), you can proceed to the next step. If this step fails, it means that your ADB drivers’ installation has a problem.
  6. Give the BATTERY_STATS permission to the BetterBatteryStats app using the commands below:
$ adb -d shell pm grant com.asksven.betterbatterystats android.permission.BATTERY_STATS

$ adb -d shell pm grant com.asksven.betterbatterystats android.permission.DUMP

$ adb -d shell pm grant com.asksven.betterbatterystats android.permission.PACKAGE_USAGE_STATS

After that, you may run the app on your phone to see which services are running excessive wakelocks.

If you’ve noticed an offending app/service or two, use the steps below to stop their wakelocks.

  1. Run Package Name Viewer to find out the package name of the culprit. Note that package name somewhere. So, let’s say the app draining your battery is Facebook Lite. Its package name is com.facebook.lite
  2. Then, connect your phone to a computer using USB, then run the adb devices command
  3. If successful, run the command: adb shell
  4. Then: cmd appops set com.facebook.lite WAKE_LOCK ignore

That’s it! You’ve managed to force your device to turn down all unruly wakelock requests.

Over to you

In this post, we’ve seen that wakelocks may cause your smartphone to drain its battery power quickly. Remember, some Xiaomi Mi A1 users claim that the problem is so bad that they lose up to 80% of their charge in only two hours of idle time.

Remember, wakelock requests are not bad things per se. Still, if your device seems to lose its battery power without reason, you may have to install apps like the ones we’ve seen above. These will help you kill services or apps that misbehave.

So, these are just but some of the ways that may deal with wakelocks on an Android device. If you’ve tried them out, please share your experience in the comments section. Also, don’t hesitate to point out new, better ways of handling excessive battery drain.