public synchronized void checkAccess(LicenseCheckerCallback callback){
  if (mPolicy.allowAccess()) {
    Log.i(TAG,"Using cached license response");
    callback.allow(Policy.LICENSED);
  }
 else {
    LicenseValidator validator=new LicenseValidator(mPolicy,new NullDeviceLimiter(),callback,generateNonce(),mPackageName,mVersionCode);
    if (mService == null) {
      Log.i(TAG,"Binding to licensing service.");
      try {
        boolean bindResult=mContext.bindService(new Intent("com.android.vending.licensing.ILicensingService"),this,Context.BIND_AUTO_CREATE);
        if (bindResult) {
          mPendingChecks.offer(validator);
        }
 else {
          Log.e(TAG,"Could not bind to service.");
          handleServiceConnectionError(validator);
        }
      }
 catch (      Exception e) {
        callback.applicationError(LicenseCheckerCallback.ERROR_MISSING_PERMISSION);
      }
    }
 else {
      mPendingChecks.offer(validator);
      runChecks();
    }
  }
}

public synchronized void checkAccess ( LicenseCheckerCallback callback ) { if ( mPolicy . allowAccess ( ) ) { Log . i ( TAG , "Using cached license response" ) ; callback . allow ( Policy . LICENSED ) ; } else { LicenseValidator validator = new LicenseValidator ( mPolicy , new NullDeviceLimiter ( ) , callback , generateNonce ( ) , mPackageName , mVersionCode ) ; if ( mService == null ) { Log . i ( TAG , "Binding to licensing service." ) ; try { boolean bindResult = mContext . bindService ( new Intent ( "com.android.vending.licensing.ILicensingService" ) , this , Context . BIND_AUTO_CREATE ) ; if ( bindResult ) { mPendingChecks . offer ( validator ) ; } else { Log . e ( TAG , "Could not bind to service." ) ; handleServiceConnectionError ( validator ) ; } } catch ( Exception e ) { callback . applicationError ( LicenseCheckerCallback . ERROR_MISSING_PERMISSION ) ; } } else { mPendingChecks . offer ( validator ) ; runChecks ( ) ; } } }
checks if the user should have access to the app . binds the service if necessary . < p > note : we can let dexguard obfuscate the string that is passed into bindservice . < p > source string : " com . android . vending . licensing . ilicensingservice " < p >
