Пример #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);
   }
 }