示例#1
0
  /**
   * Controls how quickly the screen times out.
   *
   * <p>The poke lock controls how long it takes before the screen powers down, and therefore has no
   * immediate effect when the current WakeState (see {@link PhoneApp#requestWakeState}) is FULL. If
   * we're in a state where the screen *is* allowed to turn off, though, the poke lock will
   * determine the timeout interval (long or short).
   *
   * @param shortPokeLock tells the device the timeout duration to use before going to sleep {@link
   *     com.android.server.PowerManagerService#SHORT_KEYLIGHT_DELAY}.
   */
  /* package */ void setScreenTimeout(ScreenTimeoutDuration duration) {
    if (VDBG) Log.d(LOG_TAG, "setScreenTimeout(" + duration + ")...");

    // make sure we don't set the poke lock repeatedly so that we
    // avoid triggering the userActivity calls in
    // PowerManagerService.setPokeLock().
    if (duration == mScreenTimeoutDuration) {
      return;
    }
    mScreenTimeoutDuration = duration;
    updatePokeLock();
  }
示例#2
0
 /**
  * Sets or clears the flag that tells the PowerManager that touch (and cheek) events should NOT be
  * considered "user activity".
  *
  * <p>Since the in-call UI is totally insensitive to touch in most states, we set this flag
  * whenever the InCallScreen is in the foreground. (Otherwise, repeated unintentional touches
  * could prevent the device from going to sleep.)
  *
  * <p>There *are* some some touch events that really do count as user activity, though. For those,
  * we need to manually poke the PowerManager's userActivity method; see pokeUserActivity().
  */
 /* package */ void setIgnoreTouchUserActivity(boolean ignore) {
   if (VDBG) Log.d(LOG_TAG, "setIgnoreTouchUserActivity(" + ignore + ")...");
   mIgnoreTouchUserActivity = ignore;
   updatePokeLock();
 }