Merge "Fix prox and wake sensor conflict"
This commit is contained in:
committed by
Android (Google) Code Review
commit
a06d12e6bd
@@ -401,7 +401,9 @@ public class DozeSensors {
|
||||
}
|
||||
mCallback.onSensorPulse(mPulseReason, sensorPerformsProxCheck, screenX, screenY,
|
||||
event.values);
|
||||
updateListener(); // reregister, this sensor only fires once
|
||||
if (!mRegistered) {
|
||||
updateListener(); // reregister, this sensor only fires once
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
@@ -440,7 +442,9 @@ public class DozeSensors {
|
||||
mRegistered = false;
|
||||
mCallback.onSensorPulse(mPulseReason, true /* sensorPerformsProxCheck */, -1, -1,
|
||||
event.getValues());
|
||||
updateListener(); // reregister, this sensor only fires once
|
||||
if (!mRegistered) {
|
||||
updateListener(); // reregister, this sensor only fires once
|
||||
}
|
||||
}));
|
||||
};
|
||||
|
||||
@@ -487,7 +491,6 @@ public class DozeSensors {
|
||||
}
|
||||
return sb.append(']').toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public interface Callback {
|
||||
|
||||
@@ -184,6 +184,7 @@ public class DozeTriggers implements DozeMachine.Part {
|
||||
if (DEBUG) Log.i(TAG, "Prox changed, ignore touch = " + ignoreTouch);
|
||||
mDozeHost.onIgnoreTouchWhilePulsing(ignoreTouch);
|
||||
}
|
||||
|
||||
if (far && (paused || pausing)) {
|
||||
if (DEBUG) Log.i(TAG, "Prox FAR, unpausing AOD");
|
||||
mMachine.requestState(DozeMachine.State.DOZE_AOD);
|
||||
@@ -205,13 +206,13 @@ public class DozeTriggers implements DozeMachine.Part {
|
||||
// In pocket, drop event.
|
||||
return;
|
||||
}
|
||||
if (pausing || paused) {
|
||||
if (mMachine.getState() == DozeMachine.State.DOZE) {
|
||||
mMachine.requestState(DozeMachine.State.DOZE_AOD);
|
||||
}
|
||||
}, false /* alreadyPerformedProxCheck */, DozeLog.REASON_SENSOR_WAKE_UP);
|
||||
} else {
|
||||
if (!pausing && !paused) {
|
||||
mMachine.requestState(DozeMachine.State.DOZE_AOD_PAUSING);
|
||||
mMachine.requestState(DozeMachine.State.DOZE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user