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

Commit 4482e4bb authored by Ruchi Kandoi's avatar Ruchi Kandoi Committed by Android (Google) Code Review
Browse files

Merge "Revert "PowerManager: Adds a call to reduce refresh rate while device...

Merge "Revert "PowerManager: Adds a call to reduce refresh rate while device is in BatterySaverMode"" into lmp-dev
parents a4888fba 3d69256f
Loading
Loading
Loading
Loading
+0 −18
Original line number Diff line number Diff line
@@ -58,8 +58,6 @@ import android.os.SystemProperties;
import android.os.SystemService;
import android.os.UserHandle;
import android.os.WorkSource;
import android.os.Parcel;
import android.os.ServiceManager;
import android.provider.Settings;
import android.service.dreams.DreamManagerInternal;
import android.util.EventLog;
@@ -709,7 +707,6 @@ public final class PowerManagerService extends com.android.server.SystemService
        if (mLowPowerModeEnabled != lowPowerModeEnabled) {
            mLowPowerModeEnabled = lowPowerModeEnabled;
            powerHintInternal(POWER_HINT_LOW_POWER_MODE, lowPowerModeEnabled ? 1 : 0);
            setSurfaceFlingerLowPowerMode(lowPowerModeEnabled ? 1 : 0);
            mLowPowerModeEnabled = lowPowerModeEnabled;
            BackgroundThread.getHandler().post(new Runnable() {
                @Override
@@ -2198,21 +2195,6 @@ public final class PowerManagerService extends com.android.server.SystemService
        nativeSendPowerHint(hintId, data);
    }

    private static void setSurfaceFlingerLowPowerMode(int enabled) {
        try {
            final IBinder flinger = ServiceManager.getService("SurfaceFlinger");
            if (flinger != null) {
                final Parcel data = Parcel.obtain();
                data.writeInterfaceToken("android.ui.ISurfaceComposer");
                data.writeInt(enabled);
                flinger.transact(1016, data, null, 0);
                data.recycle();
            }
        } catch (RemoteException ex) {
            Slog.e(TAG, "Failed to reduce refresh rate", ex);
        }
    }

    /**
     * Low-level function turn the device off immediately, without trying
     * to be clean.  Most people should use {@link ShutdownThread} for a clean shutdown.