public synchronized void checkAccess(LicenseCheckerCallback callback) {
        // If we have a valid recent LICENSED response, we can skip asking
        // Market.
        if (mPolicy.allowAccess()) {
            XLog.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) {
                XLog.i(TAG, "Binding to licensing service.");
                try {
                    boolean bindResult = mContext
                            .bindService(
                                    new Intent(
                                            new String(
                                                    // Base64 encoded -
                                                    // com.android.vending.licensing.ILicensingService
                                                    // Consider encoding this in another way in your
                                                    // code to improve security
                                                    Base64.decode("Y29tLmFuZHJvaWQudmVuZGluZy5saWNlbnNpbmcuSUxpY2Vuc2luZ1NlcnZpY2U=")))
                                            // As of Android 5.0, implicit
                                            // Service Intents are no longer
                                            // allowed because it's not
                                            // possible for the user to
                                            // participate in disambiguating
                                            // them. This does mean we break
                                            // compatibility with Android
                                            // Cupcake devices with this
                                            // release, since setPackage was
                                            // added in Donut.
                                            .setPackage(new String(
                                                    // Base64
                                                    // encoded -
                                                    // com.android.vending
                                                    Base64.decode("Y29tLmFuZHJvaWQudmVuZGluZw=="))),
                                    this, // ServiceConnection.
                                    Context.BIND_AUTO_CREATE);
                    if (bindResult) {
                        mPendingChecks.offer(validator);
                    } else {
                        XLog.e(TAG, "Could not bind to service.");
                        handleServiceConnectionError(validator);
                    }
                } catch (SecurityException e) {
                    callback.applicationError(LicenseCheckerCallback.ERROR_MISSING_PERMISSION);
                } catch (Base64DecoderException e) {
                    XLog.e(e, "checkAccess");
                }
            } else {
                mPendingChecks.offer(validator);
                runChecks();
            }
        }
    }
Checks if the user should have access to the app. Binds the service if necessary.
<p>
NOTE: This call uses a trivially obfuscated string (base64-encoded). For best security, we
recommend obfuscating the string that is passed into bindService using another method of your
own devising.
<p>
source string: "com.android.vending.licensing.ILicensingService"
<p>

@param callback
android/android_framework/base/src/main/java/com/google/android/vending/licensing/LicenseChecker.java