예제 #1
0
 private void initVersionName(Context context) {
   try {
     PackageManager packageManager = context.getPackageManager();
     PackageInfo packInfo = packageManager.getPackageInfo(context.getPackageName(), 0);
     //            NavilSettings.sVersionName = packInfo.versionName;
     DebugLog.d(TAG, "KeyguardViewHostManager packInfo.versionName:" + packInfo.versionName);
     Common.setVersionName(packInfo.versionName);
   } catch (Exception e) {
     DebugLog.d(TAG, "KeyguardViewHostManager error:" + e);
   }
 }
예제 #2
0
  public KeyguardViewHostManager(
      Context context,
      KeyguardViewHost host,
      SkylightHost skylight,
      LockPatternUtils lockPatternUtils,
      ViewMediatorCallback callback) {

    OtaUtils.checkRomOta(context);

    initVersionName(context);

    mContext = context;
    mKeyguardViewHost = host;
    mSkylightHost = skylight;
    mLockPatternUtils = lockPatternUtils;
    HKAgent.startStatisticThread(context.getApplicationContext());
    DataStatistics.getInstance().onInit(context.getApplicationContext());
    registerReceivers();
    sInstance = this;
    setViewMediatorCallback(callback);
    initKeyguard(callback);
    // GIONEE <Amigo_Keyguard> gexiufeng <2015-06-18> modify [1/2] begin: show haokan in power saver
    // mode.
    // Common.setPowerSaverMode(getPowerSaverMode() == 2);
    Common.setPowerSaverMode(false);
    // GIONEE <Amigo_Keyguard> gexiufeng <2015-06-18> modify [1/2] end: show haokan in power saver
    // mode.

    initHorizontalListView();
    mKeyguardWallpaperManager = new KeyguardWallpaperManager();
    mKeyguardWallpaperManager.setKeyguardListView(mKeyguardListView);
    mKeyguardWallpaperManager.setWallpaperContainer(mContainer);
    mKeyguardWallpaperManager.setViewMediatorCallback(callback);
    mKeyguardWallpaperManager.init(mContext);
    UIController.getInstance().setmViewMediatorCallback(callback);

    mKeyguardViewHost.setConfigChangeCallback(mConfigChangeCallback);
    isSuppotFinger = isSupportFingerPrint();
    if (isSuppotFinger) {
      mFingerIdentifyManager = new FingerIdentifyManager(context);
    }

    // GIONEE <Amigo_Keyguard> gexiufeng <2015-06-18> modify [2/2] begin: show haokan in power saver
    // mode.
    initPowerSaverObserver();
    // GIONEE <Amigo_Keyguard> gexiufeng <2015-06-18> modify [2/2] end: show haokan in power saver
    // mode.

    DebugLog.d(TAG, "isSuppotFinger....isSuppotFinger=" + isSuppotFinger);

    Guide.init(context);
    onBootCompleted();
  }
예제 #3
0
 private void initPowerSaverObserver() {
   ContentObserver obs =
       new ContentObserver(mHandler) {
         @Override
         public void onChange(boolean selfChange) {
           boolean saverMode = getPowerSaverMode() == 2;
           Common.setPowerSaverMode(saverMode);
         }
       };
   final ContentResolver resolver = mContext.getContentResolver();
   resolver.registerContentObserver(Settings.Global.getUriFor(POWERSAVERSETTING), false, obs);
   boolean saverMode = getPowerSaverMode() == 2;
   Common.setPowerSaverMode(saverMode);
 }