Hi,

During my studying on the function screenOffFinishedAnimatingLocked(),
I feel it's strange that it suspend the system(Power.setScreenState
(false);) first, then do screen off notification
(sendNotificationLocked). By this way seems the notification may not
be executed before system goes into suspend.

Anyone knows if this is function as design or a bug or some
misunderstanding? Attach the source for you reference. Thanks!

    private int screenOffFinishedAnimatingLocked(boolean
becauseOfUser) {
        // I don't think we need to check the current state here
because all of these
        // Power.setScreenState and sendNotificationLocked can both
handle being
        // called multiple times in the same state. -joeo
        EventLog.writeEvent(LOG_POWER_SCREEN_STATE, 0, becauseOfUser ?
1 : 0,
                mTotalTouchDownTime, mTouchCycles);
        mLastTouchDown = 0;
        int err = Power.setScreenState(false);
        if (mScreenOnStartTime != 0) {
            mScreenOnTime += SystemClock.elapsedRealtime() -
mScreenOnStartTime;
            mScreenOnStartTime = 0;
        }
        if (err == 0) {
            int why = becauseOfUser
                    ? WindowManagerPolicy.OFF_BECAUSE_OF_USER
                    : WindowManagerPolicy.OFF_BECAUSE_OF_TIMEOUT;
            sendNotificationLocked(false, why);
        }
        return err;
    }

Best Regards,
Katherine

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to