예제 #1
0
 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();
 }
예제 #2
0
  private void beginStatics() {

    if (mViewMediatorCallback.isScreenOn()
        && !mIsSkylightShown
        && mViewMediatorCallback.isShowing()) {
      timeOnKeyguardStart = SystemClock.elapsedRealtime();
    }
  }
예제 #3
0
 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;
   }
 }
예제 #4
0
 public void reset(boolean occluded) {
   if (!mViewMediatorCallback.isScreenOn()) {
     mKeyguardWallpaperManager.onKeyguardLockedWhenScreenOn();
   }
   showBouncerOrKeyguard();
   if (occluded) {
     mKeyguardViewHost.setVisibility(View.GONE);
   }
 }
예제 #5
0
  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();
  }
예제 #6
0
 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);
       }
     }
   }
 }
예제 #7
0
 public boolean isScreenOn() {
   return mViewMediatorCallback.isScreenOn();
 }
예제 #8
0
 public boolean isShowingAndNotOccluded() {
   if (mViewMediatorCallback != null) {
     return mViewMediatorCallback.isShowingAndNotOccluded();
   }
   return false;
 }
예제 #9
0
 private void refreshCacheScreenOn() {
   if (mViewMediatorCallback.isScreenOn() /*&& !mIsSkylightShown*/
       && mViewMediatorCallback.isShowing()) {
     mKeyguardWallpaperManager.refreshCache(false);
   }
 }