private void handleHideSkylight(boolean forceHide) { boolean isOpen = SkylightUtil.getIsHallOpen(mContext); if (!isOpen && !forceHide) { return; } mViewMediatorCallback.userActivity(); // xfge add forceHide condition for CR01501015 if (forceHide) destroyAcivityIfNeed(); if (mSkylightHost != null) { mSkylightHost.hideSkylight(); boolean isLockScreenDisabled = mLockPatternUtils.isLockScreenDisabled(); boolean isSimLock = needsFullscreenBouncer(); DebugLog.d(LOG_TAG, "handleHideSkylight isLockScreenDisable: " + isLockScreenDisabled); if (isLockScreenDisabled && isOpen && !isSimLock) { unLockByOther(false); } else { mSkylightHost.setVisibility(View.GONE); } mIsSkylightShown = false; mViewMediatorCallback.adjustStatusBarLocked(); } if (isShowingAndNotOccluded()) { startFingerIdentify(); } beginStatics(); refreshCacheScreenOn(); }
private void beginStatics() { if (mViewMediatorCallback.isScreenOn() && !mIsSkylightShown && mViewMediatorCallback.isShowing()) { timeOnKeyguardStart = SystemClock.elapsedRealtime(); } }
private void finishStatistics() { if (timeOnKeyguardStart < 0) { return; } if (!mViewMediatorCallback.isScreenOn() || mIsSkylightShown || !mViewMediatorCallback.isShowing()) { timeOnKeyguard = SystemClock.elapsedRealtime() - timeOnKeyguardStart; HKAgent.onEventTimeOnKeyguard(mContext, (int) timeOnKeyguard); timeOnKeyguardStart = timeOnKeyguard = -1; } }
public void reset(boolean occluded) { if (!mViewMediatorCallback.isScreenOn()) { mKeyguardWallpaperManager.onKeyguardLockedWhenScreenOn(); } showBouncerOrKeyguard(); if (occluded) { mKeyguardViewHost.setVisibility(View.GONE); } }
private void handleShowSkylight() { if (SkylightUtil.getIsHallOpen(mContext)) { return; } cancelFingerIdentify(); if (DEBUG) { DebugLog.d(LOG_TAG, "showSkylight skylight is null? " + (mSkylightHost == null)); } mViewMediatorCallback.userActivity(); if (mSkylightHost != null) { mSkylightHost.showSkylight(); mSkylightHost.setVisibility(View.VISIBLE); mKeyguardViewHost.resetHostYToHomePosition(); startActivityIfNeed(); mIsSkylightShown = true; mViewMediatorCallback.adjustStatusBarLocked(); } finishStatistics(); // Don't clear cache when skylight be shown // releaseCache(); }
protected void startActivityIfNeed() { /** if alarm boot , do not start activity */ boolean isKeyguardShow = mViewMediatorCallback.isShowingAndNotOccluded(); boolean isAlarmBoot = AmigoKeyguardUtils.isAlarmBoot(); boolean isAlarmOrIncallTop = AmigoKeyguardUtils.isAlarmOrInCallActivityTop(mContext); if (isKeyguardShow && !isAlarmBoot && !isAlarmOrIncallTop) { if (mActivitys.size() == 0) { Intent intent = new Intent(mContext, SkylightActivity.class); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) { Bundle opts = ActivityOptions.makeCustomAnimation(mContext, 0, 0).toBundle(); mContext.startActivity(intent, opts); } else { mContext.startActivity(intent); } } } }
public boolean isScreenOn() { return mViewMediatorCallback.isScreenOn(); }
public boolean isShowingAndNotOccluded() { if (mViewMediatorCallback != null) { return mViewMediatorCallback.isShowingAndNotOccluded(); } return false; }
private void refreshCacheScreenOn() { if (mViewMediatorCallback.isScreenOn() /*&& !mIsSkylightShown*/ && mViewMediatorCallback.isShowing()) { mKeyguardWallpaperManager.refreshCache(false); } }