More native input dispatch work.
Removed old input dispatch code. Refactored the policy callbacks. Pushed a tiny bit of the power manager state down to native. Fixed long press on MENU. Made the virtual key detection and cancelation a bit more precise. Change-Id: I5d8c1062f7ea0ab3b54c6fadb058c4d5f5a9e02e
This commit is contained in:
@@ -247,6 +247,9 @@ class PowerManagerService extends IPowerManager.Stub
|
||||
private static final boolean mSpew = false;
|
||||
private static final boolean mDebugProximitySensor = (true || mSpew);
|
||||
private static final boolean mDebugLightSensor = (false || mSpew);
|
||||
|
||||
private native void nativeInit();
|
||||
private native void nativeSetPowerState(boolean screenOn, boolean screenBright);
|
||||
|
||||
/*
|
||||
static PrintStream mLog;
|
||||
@@ -481,6 +484,11 @@ class PowerManagerService extends IPowerManager.Stub
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
nativeInit();
|
||||
synchronized (mLocks) {
|
||||
updateNativePowerStateLocked();
|
||||
}
|
||||
}
|
||||
|
||||
void initInThread() {
|
||||
@@ -1557,8 +1565,16 @@ class PowerManagerService extends IPowerManager.Stub
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
updateNativePowerStateLocked();
|
||||
}
|
||||
}
|
||||
|
||||
private void updateNativePowerStateLocked() {
|
||||
nativeSetPowerState(
|
||||
(mPowerState & SCREEN_ON_BIT) != 0,
|
||||
(mPowerState & SCREEN_BRIGHT) == SCREEN_BRIGHT);
|
||||
}
|
||||
|
||||
private int screenOffFinishedAnimatingLocked(int reason) {
|
||||
// I don't think we need to check the current state here because all of these
|
||||
|
||||
Reference in New Issue
Block a user