Loading packages/SystemUI/res/values/config.xml +0 −3 Original line number Original line Diff line number Diff line Loading @@ -196,9 +196,6 @@ <!-- Doze: duration to avoid false pickup gestures triggered by notification vibrations --> <!-- Doze: duration to avoid false pickup gestures triggered by notification vibrations --> <integer name="doze_pickup_vibration_threshold">2000</integer> <integer name="doze_pickup_vibration_threshold">2000</integer> <!-- Doze: can we assume the pickup sensor includes a proximity check? --> <bool name="doze_pickup_performs_proximity_check">false</bool> <!-- Type of a sensor that provides a low-power estimate of the desired display <!-- Type of a sensor that provides a low-power estimate of the desired display brightness, suitable to listen to while the device is asleep (e.g. during brightness, suitable to listen to while the device is asleep (e.g. during always-on display) --> always-on display) --> Loading packages/SystemUI/src/com/android/systemui/doze/DozeSensors.java +9 −30 Original line number Original line Diff line number Diff line Loading @@ -107,8 +107,7 @@ public class DozeSensors { config.dozePickupSensorAvailable(), config.dozePickupSensorAvailable(), DozeLog.REASON_SENSOR_PICKUP, false /* touchCoords */, DozeLog.REASON_SENSOR_PICKUP, false /* touchCoords */, false /* touchscreen */, false /* touchscreen */, false /* ignoresSetting */, false /* ignoresSetting */), mDozeParameters.getPickupPerformsProxCheck()), new TriggerSensor( new TriggerSensor( findSensorWithType(config.doubleTapSensorType()), findSensorWithType(config.doubleTapSensorType()), Settings.Secure.DOZE_DOUBLE_TAP_GESTURE, Settings.Secure.DOZE_DOUBLE_TAP_GESTURE, Loading Loading @@ -205,11 +204,8 @@ public class DozeSensors { public void updateListening() { public void updateListening() { boolean anyListening = false; boolean anyListening = false; for (TriggerSensor s : mSensors) { for (TriggerSensor s : mSensors) { // We don't want to be listening while we're PAUSED (prox sensor is covered) s.setListening(mListening); // except when the sensor is already gated by prox. if (mListening) { boolean listen = mListening && (!mPaused || s.performsProxCheck()); s.setListening(listen); if (listen) { anyListening = true; anyListening = true; } } } } Loading Loading @@ -384,7 +380,6 @@ public class DozeSensors { private final boolean mReportsTouchCoordinates; private final boolean mReportsTouchCoordinates; private final boolean mSettingDefault; private final boolean mSettingDefault; private final boolean mRequiresTouchscreen; private final boolean mRequiresTouchscreen; private final boolean mSensorPerformsProxCheck; protected boolean mRequested; protected boolean mRequested; protected boolean mRegistered; protected boolean mRegistered; Loading @@ -401,14 +396,12 @@ public class DozeSensors { boolean configured, int pulseReason, boolean reportsTouchCoordinates, boolean configured, int pulseReason, boolean reportsTouchCoordinates, boolean requiresTouchscreen) { boolean requiresTouchscreen) { this(sensor, setting, settingDef, configured, pulseReason, reportsTouchCoordinates, this(sensor, setting, settingDef, configured, pulseReason, reportsTouchCoordinates, requiresTouchscreen, false /* ignoresSetting */, requiresTouchscreen, false /* ignoresSetting */); false /* sensorPerformsProxCheck */); } } private TriggerSensor(Sensor sensor, String setting, boolean settingDef, private TriggerSensor(Sensor sensor, String setting, boolean settingDef, boolean configured, int pulseReason, boolean reportsTouchCoordinates, boolean configured, int pulseReason, boolean reportsTouchCoordinates, boolean requiresTouchscreen, boolean ignoresSetting, boolean requiresTouchscreen, boolean ignoresSetting) { boolean sensorPerformsProxCheck) { mSensor = sensor; mSensor = sensor; mSetting = setting; mSetting = setting; mSettingDefault = settingDef; mSettingDefault = settingDef; Loading @@ -417,7 +410,6 @@ public class DozeSensors { mReportsTouchCoordinates = reportsTouchCoordinates; mReportsTouchCoordinates = reportsTouchCoordinates; mRequiresTouchscreen = requiresTouchscreen; mRequiresTouchscreen = requiresTouchscreen; mIgnoresSetting = ignoresSetting; mIgnoresSetting = ignoresSetting; mSensorPerformsProxCheck = sensorPerformsProxCheck; } } public void setListening(boolean listen) { public void setListening(boolean listen) { Loading Loading @@ -491,23 +483,13 @@ public class DozeSensors { screenX = event.values[0]; screenX = event.values[0]; screenY = event.values[1]; screenY = event.values[1]; } } mCallback.onSensorPulse(mPulseReason, mSensorPerformsProxCheck, screenX, screenY, mCallback.onSensorPulse(mPulseReason, screenX, screenY, event.values); event.values); if (!mRegistered) { if (!mRegistered) { updateListening(); // reregister, this sensor only fires once updateListening(); // reregister, this sensor only fires once } } })); })); } } /** * If the sensor itself performs proximity checks, to avoid pocket dialing. * Gated sensors don't need to be stopped when the {@link DozeMachine} is * {@link DozeMachine.State#DOZE_AOD_PAUSED}. */ public boolean performsProxCheck() { return mSensorPerformsProxCheck; } public void registerSettingsObserver(ContentObserver settingsObserver) { public void registerSettingsObserver(ContentObserver settingsObserver) { if (mConfigured && !TextUtils.isEmpty(mSetting)) { if (mConfigured && !TextUtils.isEmpty(mSetting)) { mResolver.registerContentObserver( mResolver.registerContentObserver( Loading Loading @@ -603,8 +585,7 @@ public class DozeSensors { return; return; } } if (DEBUG) Log.d(TAG, "onSensorEvent: " + triggerEventToString(event)); if (DEBUG) Log.d(TAG, "onSensorEvent: " + triggerEventToString(event)); mCallback.onSensorPulse(mPulseReason, true /* sensorPerformsProxCheck */, -1, -1, mCallback.onSensorPulse(mPulseReason, -1, -1, event.getValues()); event.getValues()); })); })); } } } } Loading @@ -614,13 +595,11 @@ public class DozeSensors { /** /** * Called when a sensor requests a pulse * Called when a sensor requests a pulse * @param pulseReason Requesting sensor, e.g. {@link DozeLog#REASON_SENSOR_PICKUP} * @param pulseReason Requesting sensor, e.g. {@link DozeLog#REASON_SENSOR_PICKUP} * @param sensorPerformedProxCheck true if the sensor already checked for FAR proximity. * @param screenX the location on the screen where the sensor fired or -1 * @param screenX the location on the screen where the sensor fired or -1 * if the sensor doesn't support reporting screen locations. * if the sensor doesn't support reporting screen locations. * @param screenY the location on the screen where the sensor fired or -1 * @param screenY the location on the screen where the sensor fired or -1 * @param rawValues raw values array from the event. * @param rawValues raw values array from the event. */ */ void onSensorPulse(int pulseReason, boolean sensorPerformedProxCheck, void onSensorPulse(int pulseReason, float screenX, float screenY, float[] rawValues); float screenX, float screenY, float[] rawValues); } } } } packages/SystemUI/src/com/android/systemui/doze/DozeTriggers.java +12 −8 Original line number Original line Diff line number Diff line Loading @@ -41,6 +41,7 @@ import com.android.internal.logging.MetricsLogger; import com.android.internal.logging.nano.MetricsProto.MetricsEvent; import com.android.internal.logging.nano.MetricsProto.MetricsEvent; import com.android.internal.util.Preconditions; import com.android.internal.util.Preconditions; import com.android.systemui.Dependency; import com.android.systemui.Dependency; import com.android.systemui.R; import com.android.systemui.dock.DockManager; import com.android.systemui.dock.DockManager; import com.android.systemui.statusbar.phone.DozeParameters; import com.android.systemui.statusbar.phone.DozeParameters; import com.android.systemui.util.Assert; import com.android.systemui.util.Assert; Loading Loading @@ -156,8 +157,7 @@ public class DozeTriggers implements DozeMachine.Part { } } @VisibleForTesting @VisibleForTesting void onSensor(int pulseReason, boolean sensorPerformedProxCheck, void onSensor(int pulseReason, float screenX, float screenY, float[] rawValues) { float screenX, float screenY, float[] rawValues) { boolean isDoubleTap = pulseReason == DozeLog.REASON_SENSOR_DOUBLE_TAP; boolean isDoubleTap = pulseReason == DozeLog.REASON_SENSOR_DOUBLE_TAP; boolean isTap = pulseReason == DozeLog.REASON_SENSOR_TAP; boolean isTap = pulseReason == DozeLog.REASON_SENSOR_TAP; boolean isPickup = pulseReason == DozeLog.REASON_SENSOR_PICKUP; boolean isPickup = pulseReason == DozeLog.REASON_SENSOR_PICKUP; Loading @@ -169,10 +169,11 @@ public class DozeTriggers implements DozeMachine.Part { if (isWakeDisplay) { if (isWakeDisplay) { onWakeScreen(wakeEvent, mMachine.isExecutingTransition() ? null : mMachine.getState()); onWakeScreen(wakeEvent, mMachine.isExecutingTransition() ? null : mMachine.getState()); } else if (isLongPress) { } else if (isLongPress) { requestPulse(pulseReason, sensorPerformedProxCheck, null /* onPulseSupressedListener */); requestPulse(pulseReason, true /* alreadyPerformedProxCheck */, null /* onPulseSupressedListener */); } else if (isWakeLockScreen) { } else if (isWakeLockScreen) { if (wakeEvent) { if (wakeEvent) { requestPulse(pulseReason, sensorPerformedProxCheck, requestPulse(pulseReason, true /* alreadyPerformedProxCheck */, null /* onPulseSupressedListener */); null /* onPulseSupressedListener */); } } } else { } else { Loading @@ -191,8 +192,7 @@ public class DozeTriggers implements DozeMachine.Part { } else { } else { mDozeHost.extendPulse(pulseReason); mDozeHost.extendPulse(pulseReason); } } }, sensorPerformedProxCheck }, true /* alreadyPerformedProxCheck */, pulseReason); || (mDockManager != null && mDockManager.isDocked()), pulseReason); } } if (isPickup) { if (isPickup) { Loading Loading @@ -278,7 +278,7 @@ public class DozeTriggers implements DozeMachine.Part { .setType(MetricsEvent.TYPE_OPEN) .setType(MetricsEvent.TYPE_OPEN) .setSubtype(DozeLog.REASON_SENSOR_WAKE_UP)); .setSubtype(DozeLog.REASON_SENSOR_WAKE_UP)); } } }, false /* alreadyPerformedProxCheck */, DozeLog.REASON_SENSOR_WAKE_UP); }, true /* alreadyPerformedProxCheck */, DozeLog.REASON_SENSOR_WAKE_UP); } else { } else { boolean paused = (state == DozeMachine.State.DOZE_AOD_PAUSED); boolean paused = (state == DozeMachine.State.DOZE_AOD_PAUSED); boolean pausing = (state == DozeMachine.State.DOZE_AOD_PAUSING); boolean pausing = (state == DozeMachine.State.DOZE_AOD_PAUSING); Loading Loading @@ -433,7 +433,11 @@ public class DozeTriggers implements DozeMachine.Part { public void check() { public void check() { Preconditions.checkState(!mFinished && !mRegistered); Preconditions.checkState(!mFinished && !mRegistered); final Sensor sensor = mSensorManager.getDefaultSensor(Sensor.TYPE_PROXIMITY); Sensor sensor = DozeSensors.findSensorWithType(mSensorManager, mContext.getString(R.string.doze_brightness_sensor_type)); if (sensor == null) { sensor = mSensorManager.getDefaultSensor(Sensor.TYPE_PROXIMITY); } if (sensor == null) { if (sensor == null) { if (DozeMachine.DEBUG) Log.d(TAG, "ProxCheck: No sensor found"); if (DozeMachine.DEBUG) Log.d(TAG, "ProxCheck: No sensor found"); finishWithResult(RESULT_UNKNOWN); finishWithResult(RESULT_UNKNOWN); Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/DozeParameters.java +0 −4 Original line number Original line Diff line number Diff line Loading @@ -207,10 +207,6 @@ public class DozeParameters implements TunerService.Tunable, return SystemProperties.get(propName, mContext.getString(resId)); return SystemProperties.get(propName, mContext.getString(resId)); } } public boolean getPickupPerformsProxCheck() { return mContext.getResources().getBoolean(R.bool.doze_pickup_performs_proximity_check); } public int getPulseVisibleDurationExtended() { public int getPulseVisibleDurationExtended() { return 2 * getPulseVisibleDuration(); return 2 * getPulseVisibleDuration(); } } Loading packages/SystemUI/tests/src/com/android/systemui/doze/DozeConfigurationUtil.java +0 −1 Original line number Original line Diff line number Diff line Loading @@ -37,7 +37,6 @@ public class DozeConfigurationUtil { when(params.getPulseOnSigMotion()).thenReturn(false); when(params.getPulseOnSigMotion()).thenReturn(false); when(params.getPickupVibrationThreshold()).thenReturn(0); when(params.getPickupVibrationThreshold()).thenReturn(0); when(params.getProxCheckBeforePulse()).thenReturn(true); when(params.getProxCheckBeforePulse()).thenReturn(true); when(params.getPickupPerformsProxCheck()).thenReturn(true); when(params.getPolicy()).thenReturn(mock(AlwaysOnDisplayPolicy.class)); when(params.getPolicy()).thenReturn(mock(AlwaysOnDisplayPolicy.class)); when(params.doubleTapReportsTouchCoordinates()).thenReturn(false); when(params.doubleTapReportsTouchCoordinates()).thenReturn(false); when(params.getDisplayNeedsBlanking()).thenReturn(false); when(params.getDisplayNeedsBlanking()).thenReturn(false); Loading Loading
packages/SystemUI/res/values/config.xml +0 −3 Original line number Original line Diff line number Diff line Loading @@ -196,9 +196,6 @@ <!-- Doze: duration to avoid false pickup gestures triggered by notification vibrations --> <!-- Doze: duration to avoid false pickup gestures triggered by notification vibrations --> <integer name="doze_pickup_vibration_threshold">2000</integer> <integer name="doze_pickup_vibration_threshold">2000</integer> <!-- Doze: can we assume the pickup sensor includes a proximity check? --> <bool name="doze_pickup_performs_proximity_check">false</bool> <!-- Type of a sensor that provides a low-power estimate of the desired display <!-- Type of a sensor that provides a low-power estimate of the desired display brightness, suitable to listen to while the device is asleep (e.g. during brightness, suitable to listen to while the device is asleep (e.g. during always-on display) --> always-on display) --> Loading
packages/SystemUI/src/com/android/systemui/doze/DozeSensors.java +9 −30 Original line number Original line Diff line number Diff line Loading @@ -107,8 +107,7 @@ public class DozeSensors { config.dozePickupSensorAvailable(), config.dozePickupSensorAvailable(), DozeLog.REASON_SENSOR_PICKUP, false /* touchCoords */, DozeLog.REASON_SENSOR_PICKUP, false /* touchCoords */, false /* touchscreen */, false /* touchscreen */, false /* ignoresSetting */, false /* ignoresSetting */), mDozeParameters.getPickupPerformsProxCheck()), new TriggerSensor( new TriggerSensor( findSensorWithType(config.doubleTapSensorType()), findSensorWithType(config.doubleTapSensorType()), Settings.Secure.DOZE_DOUBLE_TAP_GESTURE, Settings.Secure.DOZE_DOUBLE_TAP_GESTURE, Loading Loading @@ -205,11 +204,8 @@ public class DozeSensors { public void updateListening() { public void updateListening() { boolean anyListening = false; boolean anyListening = false; for (TriggerSensor s : mSensors) { for (TriggerSensor s : mSensors) { // We don't want to be listening while we're PAUSED (prox sensor is covered) s.setListening(mListening); // except when the sensor is already gated by prox. if (mListening) { boolean listen = mListening && (!mPaused || s.performsProxCheck()); s.setListening(listen); if (listen) { anyListening = true; anyListening = true; } } } } Loading Loading @@ -384,7 +380,6 @@ public class DozeSensors { private final boolean mReportsTouchCoordinates; private final boolean mReportsTouchCoordinates; private final boolean mSettingDefault; private final boolean mSettingDefault; private final boolean mRequiresTouchscreen; private final boolean mRequiresTouchscreen; private final boolean mSensorPerformsProxCheck; protected boolean mRequested; protected boolean mRequested; protected boolean mRegistered; protected boolean mRegistered; Loading @@ -401,14 +396,12 @@ public class DozeSensors { boolean configured, int pulseReason, boolean reportsTouchCoordinates, boolean configured, int pulseReason, boolean reportsTouchCoordinates, boolean requiresTouchscreen) { boolean requiresTouchscreen) { this(sensor, setting, settingDef, configured, pulseReason, reportsTouchCoordinates, this(sensor, setting, settingDef, configured, pulseReason, reportsTouchCoordinates, requiresTouchscreen, false /* ignoresSetting */, requiresTouchscreen, false /* ignoresSetting */); false /* sensorPerformsProxCheck */); } } private TriggerSensor(Sensor sensor, String setting, boolean settingDef, private TriggerSensor(Sensor sensor, String setting, boolean settingDef, boolean configured, int pulseReason, boolean reportsTouchCoordinates, boolean configured, int pulseReason, boolean reportsTouchCoordinates, boolean requiresTouchscreen, boolean ignoresSetting, boolean requiresTouchscreen, boolean ignoresSetting) { boolean sensorPerformsProxCheck) { mSensor = sensor; mSensor = sensor; mSetting = setting; mSetting = setting; mSettingDefault = settingDef; mSettingDefault = settingDef; Loading @@ -417,7 +410,6 @@ public class DozeSensors { mReportsTouchCoordinates = reportsTouchCoordinates; mReportsTouchCoordinates = reportsTouchCoordinates; mRequiresTouchscreen = requiresTouchscreen; mRequiresTouchscreen = requiresTouchscreen; mIgnoresSetting = ignoresSetting; mIgnoresSetting = ignoresSetting; mSensorPerformsProxCheck = sensorPerformsProxCheck; } } public void setListening(boolean listen) { public void setListening(boolean listen) { Loading Loading @@ -491,23 +483,13 @@ public class DozeSensors { screenX = event.values[0]; screenX = event.values[0]; screenY = event.values[1]; screenY = event.values[1]; } } mCallback.onSensorPulse(mPulseReason, mSensorPerformsProxCheck, screenX, screenY, mCallback.onSensorPulse(mPulseReason, screenX, screenY, event.values); event.values); if (!mRegistered) { if (!mRegistered) { updateListening(); // reregister, this sensor only fires once updateListening(); // reregister, this sensor only fires once } } })); })); } } /** * If the sensor itself performs proximity checks, to avoid pocket dialing. * Gated sensors don't need to be stopped when the {@link DozeMachine} is * {@link DozeMachine.State#DOZE_AOD_PAUSED}. */ public boolean performsProxCheck() { return mSensorPerformsProxCheck; } public void registerSettingsObserver(ContentObserver settingsObserver) { public void registerSettingsObserver(ContentObserver settingsObserver) { if (mConfigured && !TextUtils.isEmpty(mSetting)) { if (mConfigured && !TextUtils.isEmpty(mSetting)) { mResolver.registerContentObserver( mResolver.registerContentObserver( Loading Loading @@ -603,8 +585,7 @@ public class DozeSensors { return; return; } } if (DEBUG) Log.d(TAG, "onSensorEvent: " + triggerEventToString(event)); if (DEBUG) Log.d(TAG, "onSensorEvent: " + triggerEventToString(event)); mCallback.onSensorPulse(mPulseReason, true /* sensorPerformsProxCheck */, -1, -1, mCallback.onSensorPulse(mPulseReason, -1, -1, event.getValues()); event.getValues()); })); })); } } } } Loading @@ -614,13 +595,11 @@ public class DozeSensors { /** /** * Called when a sensor requests a pulse * Called when a sensor requests a pulse * @param pulseReason Requesting sensor, e.g. {@link DozeLog#REASON_SENSOR_PICKUP} * @param pulseReason Requesting sensor, e.g. {@link DozeLog#REASON_SENSOR_PICKUP} * @param sensorPerformedProxCheck true if the sensor already checked for FAR proximity. * @param screenX the location on the screen where the sensor fired or -1 * @param screenX the location on the screen where the sensor fired or -1 * if the sensor doesn't support reporting screen locations. * if the sensor doesn't support reporting screen locations. * @param screenY the location on the screen where the sensor fired or -1 * @param screenY the location on the screen where the sensor fired or -1 * @param rawValues raw values array from the event. * @param rawValues raw values array from the event. */ */ void onSensorPulse(int pulseReason, boolean sensorPerformedProxCheck, void onSensorPulse(int pulseReason, float screenX, float screenY, float[] rawValues); float screenX, float screenY, float[] rawValues); } } } }
packages/SystemUI/src/com/android/systemui/doze/DozeTriggers.java +12 −8 Original line number Original line Diff line number Diff line Loading @@ -41,6 +41,7 @@ import com.android.internal.logging.MetricsLogger; import com.android.internal.logging.nano.MetricsProto.MetricsEvent; import com.android.internal.logging.nano.MetricsProto.MetricsEvent; import com.android.internal.util.Preconditions; import com.android.internal.util.Preconditions; import com.android.systemui.Dependency; import com.android.systemui.Dependency; import com.android.systemui.R; import com.android.systemui.dock.DockManager; import com.android.systemui.dock.DockManager; import com.android.systemui.statusbar.phone.DozeParameters; import com.android.systemui.statusbar.phone.DozeParameters; import com.android.systemui.util.Assert; import com.android.systemui.util.Assert; Loading Loading @@ -156,8 +157,7 @@ public class DozeTriggers implements DozeMachine.Part { } } @VisibleForTesting @VisibleForTesting void onSensor(int pulseReason, boolean sensorPerformedProxCheck, void onSensor(int pulseReason, float screenX, float screenY, float[] rawValues) { float screenX, float screenY, float[] rawValues) { boolean isDoubleTap = pulseReason == DozeLog.REASON_SENSOR_DOUBLE_TAP; boolean isDoubleTap = pulseReason == DozeLog.REASON_SENSOR_DOUBLE_TAP; boolean isTap = pulseReason == DozeLog.REASON_SENSOR_TAP; boolean isTap = pulseReason == DozeLog.REASON_SENSOR_TAP; boolean isPickup = pulseReason == DozeLog.REASON_SENSOR_PICKUP; boolean isPickup = pulseReason == DozeLog.REASON_SENSOR_PICKUP; Loading @@ -169,10 +169,11 @@ public class DozeTriggers implements DozeMachine.Part { if (isWakeDisplay) { if (isWakeDisplay) { onWakeScreen(wakeEvent, mMachine.isExecutingTransition() ? null : mMachine.getState()); onWakeScreen(wakeEvent, mMachine.isExecutingTransition() ? null : mMachine.getState()); } else if (isLongPress) { } else if (isLongPress) { requestPulse(pulseReason, sensorPerformedProxCheck, null /* onPulseSupressedListener */); requestPulse(pulseReason, true /* alreadyPerformedProxCheck */, null /* onPulseSupressedListener */); } else if (isWakeLockScreen) { } else if (isWakeLockScreen) { if (wakeEvent) { if (wakeEvent) { requestPulse(pulseReason, sensorPerformedProxCheck, requestPulse(pulseReason, true /* alreadyPerformedProxCheck */, null /* onPulseSupressedListener */); null /* onPulseSupressedListener */); } } } else { } else { Loading @@ -191,8 +192,7 @@ public class DozeTriggers implements DozeMachine.Part { } else { } else { mDozeHost.extendPulse(pulseReason); mDozeHost.extendPulse(pulseReason); } } }, sensorPerformedProxCheck }, true /* alreadyPerformedProxCheck */, pulseReason); || (mDockManager != null && mDockManager.isDocked()), pulseReason); } } if (isPickup) { if (isPickup) { Loading Loading @@ -278,7 +278,7 @@ public class DozeTriggers implements DozeMachine.Part { .setType(MetricsEvent.TYPE_OPEN) .setType(MetricsEvent.TYPE_OPEN) .setSubtype(DozeLog.REASON_SENSOR_WAKE_UP)); .setSubtype(DozeLog.REASON_SENSOR_WAKE_UP)); } } }, false /* alreadyPerformedProxCheck */, DozeLog.REASON_SENSOR_WAKE_UP); }, true /* alreadyPerformedProxCheck */, DozeLog.REASON_SENSOR_WAKE_UP); } else { } else { boolean paused = (state == DozeMachine.State.DOZE_AOD_PAUSED); boolean paused = (state == DozeMachine.State.DOZE_AOD_PAUSED); boolean pausing = (state == DozeMachine.State.DOZE_AOD_PAUSING); boolean pausing = (state == DozeMachine.State.DOZE_AOD_PAUSING); Loading Loading @@ -433,7 +433,11 @@ public class DozeTriggers implements DozeMachine.Part { public void check() { public void check() { Preconditions.checkState(!mFinished && !mRegistered); Preconditions.checkState(!mFinished && !mRegistered); final Sensor sensor = mSensorManager.getDefaultSensor(Sensor.TYPE_PROXIMITY); Sensor sensor = DozeSensors.findSensorWithType(mSensorManager, mContext.getString(R.string.doze_brightness_sensor_type)); if (sensor == null) { sensor = mSensorManager.getDefaultSensor(Sensor.TYPE_PROXIMITY); } if (sensor == null) { if (sensor == null) { if (DozeMachine.DEBUG) Log.d(TAG, "ProxCheck: No sensor found"); if (DozeMachine.DEBUG) Log.d(TAG, "ProxCheck: No sensor found"); finishWithResult(RESULT_UNKNOWN); finishWithResult(RESULT_UNKNOWN); Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/DozeParameters.java +0 −4 Original line number Original line Diff line number Diff line Loading @@ -207,10 +207,6 @@ public class DozeParameters implements TunerService.Tunable, return SystemProperties.get(propName, mContext.getString(resId)); return SystemProperties.get(propName, mContext.getString(resId)); } } public boolean getPickupPerformsProxCheck() { return mContext.getResources().getBoolean(R.bool.doze_pickup_performs_proximity_check); } public int getPulseVisibleDurationExtended() { public int getPulseVisibleDurationExtended() { return 2 * getPulseVisibleDuration(); return 2 * getPulseVisibleDuration(); } } Loading
packages/SystemUI/tests/src/com/android/systemui/doze/DozeConfigurationUtil.java +0 −1 Original line number Original line Diff line number Diff line Loading @@ -37,7 +37,6 @@ public class DozeConfigurationUtil { when(params.getPulseOnSigMotion()).thenReturn(false); when(params.getPulseOnSigMotion()).thenReturn(false); when(params.getPickupVibrationThreshold()).thenReturn(0); when(params.getPickupVibrationThreshold()).thenReturn(0); when(params.getProxCheckBeforePulse()).thenReturn(true); when(params.getProxCheckBeforePulse()).thenReturn(true); when(params.getPickupPerformsProxCheck()).thenReturn(true); when(params.getPolicy()).thenReturn(mock(AlwaysOnDisplayPolicy.class)); when(params.getPolicy()).thenReturn(mock(AlwaysOnDisplayPolicy.class)); when(params.doubleTapReportsTouchCoordinates()).thenReturn(false); when(params.doubleTapReportsTouchCoordinates()).thenReturn(false); when(params.getDisplayNeedsBlanking()).thenReturn(false); when(params.getDisplayNeedsBlanking()).thenReturn(false); Loading