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

Commit fa14d824 authored by Jeff Brown's avatar Jeff Brown Committed by Android (Google) Code Review
Browse files

Merge "Move and rename user activity event type constants." into jb-mr1-dev

parents af3fb232 b696de5c
Loading
Loading
Loading
Loading
+0 −6
Original line number Diff line number Diff line
@@ -18,12 +18,6 @@ package android.os;

/** @hide */
public interface LocalPowerManager {
    // Note: be sure to update BatteryStats if adding or modifying event constants.
    
    public static final int OTHER_EVENT = 0;
    public static final int BUTTON_EVENT = 1;
    public static final int TOUCH_EVENT = 2;

    public static final int POKE_LOCK_IGNORE_TOUCH_EVENTS = 0x1;

    public static final int POKE_LOCK_SHORT_TIMEOUT = 0x2;
+21 −0
Original line number Diff line number Diff line
@@ -250,6 +250,27 @@ public final class PowerManager {
     */
    public static final int BRIGHTNESS_OFF = 0;

    // Note: Be sure to update android.os.BatteryStats and PowerManager.h
    // if adding or modifying user activity event constants.

    /**
     * User activity event type: Unspecified event type.
     * @hide
     */
    public static final int USER_ACTIVITY_EVENT_OTHER = 0;

    /**
     * User activity event type: Button or key pressed or released.
     * @hide
     */
    public static final int USER_ACTIVITY_EVENT_BUTTON = 1;

    /**
     * User activity event type: Touch down, move or up.
     * @hide
     */
    public static final int USER_ACTIVITY_EVENT_TOUCH = 2;

    final IPowerManager mService;
    final Handler mHandler;

+4 −4
Original line number Diff line number Diff line
@@ -21,11 +21,11 @@
namespace android {

enum {
    POWER_MANAGER_OTHER_EVENT = 0,
    POWER_MANAGER_BUTTON_EVENT = 1,
    POWER_MANAGER_TOUCH_EVENT = 2,
    USER_ACTIVITY_EVENT_OTHER = 0,
    USER_ACTIVITY_EVENT_BUTTON = 1,
    USER_ACTIVITY_EVENT_TOUCH = 2,

    POWER_MANAGER_LAST_EVENT = POWER_MANAGER_TOUCH_EVENT, // Last valid event code.
    USER_ACTIVITY_EVENT_LAST = USER_ACTIVITY_EVENT_TOUCH, // Last valid event code.
};

} // namespace android
+3 −3
Original line number Diff line number Diff line
@@ -3021,11 +3021,11 @@ public class PhoneWindowManager implements WindowManagerPolicy {
                        KeyEvent.KEYCODE_POWER, mDockMode != Intent.EXTRA_DOCK_STATE_UNDOCKED);
            } else {
                mPowerManager.userActivity(SystemClock.uptimeMillis(), false,
                        LocalPowerManager.BUTTON_EVENT);
                        PowerManager.USER_ACTIVITY_EVENT_BUTTON);
            }
        } else if (!mLidControlsSleep) {
            mPowerManager.userActivity(SystemClock.uptimeMillis(), false,
                    LocalPowerManager.OTHER_EVENT);
                    PowerManager.USER_ACTIVITY_EVENT_OTHER);
        }
    }

@@ -4319,7 +4319,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
        if (mPowerManager.isScreenOn()) {
            if (mKeyguardMediator != null && !mKeyguardMediator.isShowingAndNotHidden()) {
                long curTime = SystemClock.uptimeMillis();
                mPowerManager.userActivity(curTime, false, LocalPowerManager.OTHER_EVENT);
                mPowerManager.userActivity(curTime, false, PowerManager.USER_ACTIVITY_EVENT_OTHER);
            }

            synchronized (mLock) {
+3 −3
Original line number Diff line number Diff line
@@ -1693,7 +1693,7 @@ String8 InputDispatcher::getApplicationWindowLabelLocked(
}

void InputDispatcher::pokeUserActivityLocked(const EventEntry* eventEntry) {
    int32_t eventType = POWER_MANAGER_OTHER_EVENT;
    int32_t eventType = USER_ACTIVITY_EVENT_OTHER;
    switch (eventEntry->type) {
    case EventEntry::TYPE_MOTION: {
        const MotionEntry* motionEntry = static_cast<const MotionEntry*>(eventEntry);
@@ -1702,7 +1702,7 @@ void InputDispatcher::pokeUserActivityLocked(const EventEntry* eventEntry) {
        }

        if (MotionEvent::isTouchEvent(motionEntry->source, motionEntry->action)) {
            eventType = POWER_MANAGER_TOUCH_EVENT;
            eventType = USER_ACTIVITY_EVENT_TOUCH;
        }
        break;
    }
@@ -1711,7 +1711,7 @@ void InputDispatcher::pokeUserActivityLocked(const EventEntry* eventEntry) {
        if (keyEntry->flags & AKEY_EVENT_FLAG_CANCELED) {
            return;
        }
        eventType = POWER_MANAGER_BUTTON_EVENT;
        eventType = USER_ACTIVITY_EVENT_BUTTON;
        break;
    }
    }
Loading