APISonar


android.content.Context.BIND_ALLOW_BACKGROUND_ACTIVITY_STARTS

> android > content > Context > BIND_ALLOW_BACKGROUND_ACTIVITY_STARTS
android APIs content APIs Context APIs BIND_ALLOW_BACKGROUND_ACTIVITY_STARTS APIs

Example 1
RemoteFillService(Context context, ComponentName componentName, int userId,
            FillServiceCallbacks callbacks, boolean bindInstantServiceAllowed) {
        super(context, AutofillService.SERVICE_INTERFACE, componentName, userId, callbacks,
                context.getMainThreadHandler(), Context.BIND_ALLOW_BACKGROUND_ACTIVITY_STARTS
                | (bindInstantServiceAllowed ? Context.BIND_ALLOW_INSTANT : 0), sVerbose);
        mCallbacks = callbacks;
    }
Example 2
void startLocked() {
        Intent intent = new Intent(VoiceInteractionService.SERVICE_INTERFACE);
        intent.setComponent(mComponent);
        mBound = mContext.bindServiceAsUser(intent, mConnection,
                Context.BIND_AUTO_CREATE | Context.BIND_FOREGROUND_SERVICE
                | Context.BIND_INCLUDE_CAPABILITIES
                | Context.BIND_ALLOW_BACKGROUND_ACTIVITY_STARTS, new UserHandle(mUser));
        if (!mBound) {
            Slog.w(TAG, "Failed binding to voice interaction service " + mComponent);
        }
    }