Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7b6e54c3 authored by Robin Lee's avatar Robin Lee Committed by Android (Google) Code Review
Browse files

Merge "DeviceIdle ignores charging state if no battery."

parents 10c10647 204cb22a
Loading
Loading
Loading
Loading
+4 −2
Original line number Original line Diff line number Diff line
@@ -43,6 +43,7 @@ import android.net.ConnectivityManager;
import android.net.INetworkPolicyManager;
import android.net.INetworkPolicyManager;
import android.net.NetworkInfo;
import android.net.NetworkInfo;
import android.net.Uri;
import android.net.Uri;
import android.os.BatteryManager;
import android.os.BatteryStats;
import android.os.BatteryStats;
import android.os.Binder;
import android.os.Binder;
import android.os.Bundle;
import android.os.Bundle;
@@ -521,9 +522,10 @@ public class DeviceIdleController extends SystemService
                    updateConnectivityState(intent);
                    updateConnectivityState(intent);
                } break;
                } break;
                case Intent.ACTION_BATTERY_CHANGED: {
                case Intent.ACTION_BATTERY_CHANGED: {
                    boolean present = intent.getBooleanExtra(BatteryManager.EXTRA_PRESENT, true);
                    boolean plugged = intent.getIntExtra(BatteryManager.EXTRA_PLUGGED, 0) != 0;
                    synchronized (DeviceIdleController.this) {
                    synchronized (DeviceIdleController.this) {
                        int plugged = intent.getIntExtra("plugged", 0);
                        updateChargingLocked(present && plugged);
                        updateChargingLocked(plugged != 0);
                    }
                    }
                } break;
                } break;
                case Intent.ACTION_PACKAGE_REMOVED: {
                case Intent.ACTION_PACKAGE_REMOVED: {