Loading InCallUI/src/com/android/incallui/ProximitySensor.java +6 −0 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ import android.hardware.display.DisplayManager.DisplayListener; import android.os.PowerManager; import android.telecom.CallAudioState; import android.view.Display; import android.provider.Settings; import com.android.incallui.AudioModeProvider.AudioModeListener; import com.android.incallui.InCallPresenter.InCallState; Loading @@ -42,6 +43,7 @@ import com.android.incallui.InCallPresenter.InCallStateListener; public class ProximitySensor implements AccelerometerListener.OrientationListener, InCallStateListener, AudioModeListener { private static final String TAG = ProximitySensor.class.getSimpleName(); private static final String PROXIMITY_SENSOR = "proximity_sensor"; private final PowerManager mPowerManager; private final PowerManager.WakeLock mProximityWakeLock; Loading @@ -52,6 +54,7 @@ public class ProximitySensor implements AccelerometerListener.OrientationListene private boolean mUiShowing = false; private boolean mIsPhoneOffhook = false; private boolean mDialpadVisible; private Context mContext; // True if the keyboard is currently *not* hidden // Gets updated whenever there is a Configuration change Loading @@ -59,6 +62,7 @@ public class ProximitySensor implements AccelerometerListener.OrientationListene public ProximitySensor(Context context, AudioModeProvider audioModeProvider, AccelerometerListener accelerometerListener) { mContext = context; mPowerManager = (PowerManager) context.getSystemService(Context.POWER_SERVICE); if (mPowerManager.isWakeLockLevelSupported(PowerManager.PROXIMITY_SCREEN_OFF_WAKE_LOCK)) { mProximityWakeLock = mPowerManager.newWakeLock( Loading Loading @@ -232,6 +236,8 @@ public class ProximitySensor implements AccelerometerListener.OrientationListene || CallAudioState.ROUTE_SPEAKER == audioMode || CallAudioState.ROUTE_BLUETOOTH == audioMode || mIsHardKeyboardOpen); screenOnImmediately |= Settings.System.getInt(mContext.getContentResolver(), PROXIMITY_SENSOR, 1) == 0; // We do not keep the screen off when the user is outside in-call screen and we are // horizontal, but we do not force it on when we become horizontal until the Loading Loading
InCallUI/src/com/android/incallui/ProximitySensor.java +6 −0 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ import android.hardware.display.DisplayManager.DisplayListener; import android.os.PowerManager; import android.telecom.CallAudioState; import android.view.Display; import android.provider.Settings; import com.android.incallui.AudioModeProvider.AudioModeListener; import com.android.incallui.InCallPresenter.InCallState; Loading @@ -42,6 +43,7 @@ import com.android.incallui.InCallPresenter.InCallStateListener; public class ProximitySensor implements AccelerometerListener.OrientationListener, InCallStateListener, AudioModeListener { private static final String TAG = ProximitySensor.class.getSimpleName(); private static final String PROXIMITY_SENSOR = "proximity_sensor"; private final PowerManager mPowerManager; private final PowerManager.WakeLock mProximityWakeLock; Loading @@ -52,6 +54,7 @@ public class ProximitySensor implements AccelerometerListener.OrientationListene private boolean mUiShowing = false; private boolean mIsPhoneOffhook = false; private boolean mDialpadVisible; private Context mContext; // True if the keyboard is currently *not* hidden // Gets updated whenever there is a Configuration change Loading @@ -59,6 +62,7 @@ public class ProximitySensor implements AccelerometerListener.OrientationListene public ProximitySensor(Context context, AudioModeProvider audioModeProvider, AccelerometerListener accelerometerListener) { mContext = context; mPowerManager = (PowerManager) context.getSystemService(Context.POWER_SERVICE); if (mPowerManager.isWakeLockLevelSupported(PowerManager.PROXIMITY_SCREEN_OFF_WAKE_LOCK)) { mProximityWakeLock = mPowerManager.newWakeLock( Loading Loading @@ -232,6 +236,8 @@ public class ProximitySensor implements AccelerometerListener.OrientationListene || CallAudioState.ROUTE_SPEAKER == audioMode || CallAudioState.ROUTE_BLUETOOTH == audioMode || mIsHardKeyboardOpen); screenOnImmediately |= Settings.System.getInt(mContext.getContentResolver(), PROXIMITY_SENSOR, 1) == 0; // We do not keep the screen off when the user is outside in-call screen and we are // horizontal, but we do not force it on when we become horizontal until the Loading