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

Commit 17f7fa5c authored by Michael Wright's avatar Michael Wright Committed by Android Git Automerger
Browse files

am f7898245: am d0f6975b: Merge "Change constant to...

am f7898245: am d0f6975b: Merge "Change constant to PowerManager#FLAG_WAIT_FOR_DISTANT_PROXIMITY" into lmp-dev

* commit 'f7898245a265106672ff29f35289c703ed50c7ce':
  Change constant to PowerManager#FLAG_WAIT_FOR_DISTANT_PROXIMITY
parents 2f123e65 0f701684
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -22303,7 +22303,7 @@ package android.os {
    field public static final int PROXIMITY_SCREEN_OFF_WAKE_LOCK = 32; // 0x20
    field public static final deprecated int SCREEN_BRIGHT_WAKE_LOCK = 10; // 0xa
    field public static final deprecated int SCREEN_DIM_WAKE_LOCK = 6; // 0x6
    field public static final int WAIT_FOR_PROXIMITY_NEGATIVE = 1; // 0x1
    field public static final int WAIT_FOR_DISTANT_PROXIMITY = 1; // 0x1
  }
  public final class PowerManager.WakeLock {
+3 −2
Original line number Diff line number Diff line
@@ -248,7 +248,7 @@ public final class PowerManager {
     * {@link #PROXIMITY_SCREEN_OFF_WAKE_LOCK} wake lock until the proximity sensor
     * indicates that an object is not in close proximity.
     */
    public static final int WAIT_FOR_PROXIMITY_NEGATIVE = 1;
    public static final int WAIT_FOR_DISTANT_PROXIMITY = 1;

    /**
     * Brightness value for fully on.
@@ -961,7 +961,8 @@ public final class PowerManager {
         * </p>
         *
         * @param flags Combination of flag values to modify the release behavior.
         * Currently only {@link #WAIT_FOR_PROXIMITY_NEGATIVE} is supported.
         * Currently only {@link #WAIT_FOR_DISTANT_PROXIMITY} is supported. Passing 0 is
         * equivalent to calling {@link #release()}.
         */
        public void release(int flags) {
            synchronized (mToken) {
+1 −1
Original line number Diff line number Diff line
@@ -821,7 +821,7 @@ public final class PowerManagerService extends com.android.server.SystemService
                        + " [" + wakeLock.mTag + "], flags=0x" + Integer.toHexString(flags));
            }

            if ((flags & PowerManager.WAIT_FOR_PROXIMITY_NEGATIVE) != 0) {
            if ((flags & PowerManager.WAIT_FOR_DISTANT_PROXIMITY) != 0) {
                mRequestWaitForNegativeProximity = true;
            }

+4 −4
Original line number Diff line number Diff line
@@ -77,9 +77,9 @@ public class PowerTest extends TestActivity
                mProx.release();
            }
        },
        new Test("Disable proximity (WAIT_FOR_PROXIMITY_NEGATIVE)") {
        new Test("Disable proximity (WAIT_FOR_DISTANT_PROXIMITY") {
            public void run() {
                mProx.release(PowerManager.WAIT_FOR_PROXIMITY_NEGATIVE);
                mProx.release(PowerManager.WAIT_FOR_DISTANT_PROXIMITY);
            }
        },
        new Test("Enable proximity, wait 5 seconds then disable") {
@@ -93,13 +93,13 @@ public class PowerTest extends TestActivity
                }, 5000);
            }
        },
        new Test("Enable proximity, wait 5 seconds then disable  (WAIT_FOR_PROXIMITY_NEGATIVE)") {
        new Test("Enable proximity, wait 5 seconds then disable  (WAIT_FOR_DISTANT_PROXIMITY)") {
            public void run() {
                mProx.acquire();
                mHandler.postDelayed(new Runnable() {
                    @Override
                    public void run() {
                        mProx.release(PowerManager.WAIT_FOR_PROXIMITY_NEGATIVE);
                        mProx.release(PowerManager.WAIT_FOR_DISTANT_PROXIMITY);
                    }
                }, 5000);
            }