[Android General] voguemaster:
Intro

This post aims to help Android users handle both the data and battery drain caused by Google Play Service's SystemUpdateService.

A small recap -

It is already well known that any Android user who have a custom aftermarket ROM may suffer from data drain due to SystemUpdateService attempts at downloading and installing the latest version of Android for the selected device. Usually the devices are from the Nexus, OnePlus series and mostly those based on AOSP. However, some manufacturer's phones have also exhibited this behavior including LG and Samsung's.

There were quite a few attempts at solving the issue. Some methods, like disabling SystemUpdateService itself cause a permanent wakelock in the device (as of Google Play Services 7 - this is caused by play services code that acquires a wakelock and attempt to start the SystemUpdateService which never happens; hence the wakelock is never released). You stop the data drain but replace it with a battery drain, which is even worse. What's worse than that - Google isn't particularly interested in fixing this problem for us. They care much less for aftermarket ROMs.

The only working, simple fix, today is to disable some of its receivers. However, one of them (SystemUpdateService.ActiveReceiver) will always be re-enabled by Play Services upon reboot.

The Cyanogenmod team has taken steps to fix this in version 12.x of their OS. But, what about users who use an older version or an entirely different ROM not based on CM 12?

Requirements

The manual procedure here requires the following:

Root

My Android Tools

Root Explorer / ES File Explorer (with Root enabled)

It has been tested to work with Google Play Services 7.x and 8.x. It does not require disabling of receivers and it will persist after a system reboot. It will also persist after an update to Google Play Services as long as Google don't change the meaning of the fields that appear in the steps section below.

Note

- One can always re-enable the system update if needed.

Procedure Steps

This procedure does not require disabling any of the receivers of SystemUpdateService or the service itself. The only disabled parts of the service are its activities. In Android, activities are an application's component that interact with the user.

Step 1 - Disable activities

Open My Android Tools

From the left pane select "Activity".

Swipe left to move to the System tab and scroll to Google Play Services. Tap "SystemUpdateActivity" and make sure it gets disabled (red).

Go back and click "Google Services Framework". Tap to disable "SystemUpdatePanoActivity" and make sure it gets disabled (red).

Exit My Android Tools

The purpose of disabling the UI components of the service is to make sure the user doesn't easily initiate a new system update.

Step 2 - Make changes to SystemUpdateService's shared preferences

Ok, now the fun stuff begins. In this section we'll edit the shared preferences of SystemUdpateService to fool it into thinking it doesn't need to download anything. Even more - it won't even ask to perform an update or check for one.

Open Root Explorer (or ES File Explorer in Root mode).

Navigate to:

/data/data/com.google.android.gms/shared_prefs/

(This works for Nexus phones; for other manufacturers the path may be slightly different)

Scroll down to the bottom to find update.xml. Long press it and choose "open in text editor" (In ES File Explorer tap the file and open in ES Note Editor).

The file is an XML file (not surprising). Find a boolean named "required_setup". Change the value from false to true. It should look like this:

<boolean name="required_setup" value="true" />

A bit further down, find an integer with the name "status". Change it's value to 1. It should look like this:

<int name="status" value="1" />

Note - make sure all changes are done carefully, otherwise the file is just recreated (this also happens when it is deleted).

Save the file. Open it again to make sure it was properly updated.

Reboot your device. There should no longer be any notifications and Google Play Services shouldn't attempt to download any system updates anymore.

Rollback

To roll back the change simply re-enable the activities disabled in step 1 and initiate a system update. :cool: