コード例 #1
0
 public void bindService(Context context) {
   Intent intent = new Intent();
   intent.setClassName(KEYGUARD_PACKAGE, KEYGUARD_CLASS);
   if (!context.bindServiceAsUser(
       intent, mKeyguardConnection, Context.BIND_AUTO_CREATE, UserHandle.OWNER)) {
     Log.v(TAG, "*** Keyguard: can't bind to " + KEYGUARD_CLASS);
     mKeyguardState.showing = false;
     mKeyguardState.showingAndNotOccluded = false;
     mKeyguardState.secure = false;
     mKeyguardState.deviceHasKeyguard = false;
     hideScrim();
   } else {
     if (DEBUG) Log.v(TAG, "*** Keyguard started");
   }
 }
 public boolean isShowing() {
   if (mKeyguardService != null) {
     mKeyguardState.showing = mKeyguardService.isShowing();
   }
   return mKeyguardState.showing;
 }