resolved conflicts for merge of efd91d7c to eclair-mr2-plus-aosp

Signed-off-by: repo sync <lockwood@android.com>
This commit is contained in:
repo sync
2009-11-18 20:12:50 -05:00
4 changed files with 41 additions and 10 deletions

View File

@@ -306,7 +306,7 @@ class PowerManagerService extends IPowerManager.Stub
public void release() {
if (!mRefCounted || --mCount == 0) {
PowerManagerService.this.releaseWakeLockLocked(mToken, false);
PowerManagerService.this.releaseWakeLockLockedmToken, 0, false);
}
if (mCount < 0) {
throw new RuntimeException("WakeLock under-locked " + mTag);
@@ -545,7 +545,7 @@ class PowerManagerService extends IPowerManager.Stub
}
public void binderDied() {
synchronized (mLocks) {
releaseWakeLockLocked(this.binder, true);
releaseWakeLockLocked(this.binder, 0, true);
}
}
final int flags;
@@ -690,18 +690,18 @@ class PowerManagerService extends IPowerManager.Stub
}
}
public void releaseWakeLock(IBinder lock) {
public void releaseWakeLock(IBinder lock, int flags) {
int uid = Binder.getCallingUid();
if (uid != Process.myUid()) {
mContext.enforceCallingOrSelfPermission(android.Manifest.permission.WAKE_LOCK, null);
}
synchronized (mLocks) {
releaseWakeLockLocked(lock, false);
releaseWakeLockLocked(lock, flags, false);
}
}
private void releaseWakeLockLocked(IBinder lock, boolean death) {
private void releaseWakeLockLocked(IBinder lock, int flags, boolean death) {
int releaseUid;
String releaseName;
int releaseType;
@@ -733,7 +733,8 @@ class PowerManagerService extends IPowerManager.Stub
} else if ((wl.flags & LOCK_MASK) == PowerManager.PROXIMITY_SCREEN_OFF_WAKE_LOCK) {
mProximityWakeLockCount--;
if (mProximityWakeLockCount == 0) {
if (mProximitySensorActive) {
if (mProximitySensorActive &&
((flags & PowerManager.WAIT_FOR_PROXIMITY_NEGATIVE) != 0)) {
// wait for proximity sensor to go negative before disabling sensor
if (mDebugProximitySensor) {
Log.d(TAG, "waiting for proximity sensor to go negative");
@@ -1909,6 +1910,11 @@ class PowerManagerService extends IPowerManager.Stub
Log.d(TAG, "ignoring user activity while turning off screen");
return;
}
// Disable proximity sensor if if user presses power key while we are in the
// "waiting for proximity sensor to go negative" state.
if (mProximitySensorActive && mProximityWakeLockCount == 0) {
mProximitySensorActive = false;
}
if (mLastEventTime <= time || force) {
mLastEventTime = time;
if ((mUserActivityAllowed && !mProximitySensorActive) || force) {