Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2b572ea7 authored by Nan Wu's avatar Nan Wu Committed by Android (Google) Code Review
Browse files

Merge "RESTRICT AUTOMERGE Backport preventing BAL bypass via bound service" into tm-dev

parents 33defda5 95b71ad8
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -310,11 +310,13 @@ public final class JobServiceContext implements ServiceConnection {
                    bindFlags = Context.BIND_AUTO_CREATE | Context.BIND_NOT_FOREGROUND
                            | Context.BIND_ALMOST_PERCEPTIBLE
                            | Context.BIND_BYPASS_POWER_NETWORK_RESTRICTIONS
                            | Context.BIND_NOT_APP_COMPONENT_USAGE;
                            | Context.BIND_NOT_APP_COMPONENT_USAGE
                            | Context.BIND_DENY_ACTIVITY_STARTS_PRE_34;
                } else {
                    bindFlags = Context.BIND_AUTO_CREATE | Context.BIND_NOT_FOREGROUND
                            | Context.BIND_NOT_PERCEPTIBLE
                            | Context.BIND_NOT_APP_COMPONENT_USAGE;
                            | Context.BIND_NOT_APP_COMPONENT_USAGE
                            | Context.BIND_DENY_ACTIVITY_STARTS_PRE_34;
                }
                binding = mContext.bindServiceAsUser(intent, this, bindFlags,
                        UserHandle.of(job.getUserId()));
+2 −1
Original line number Diff line number Diff line
@@ -2379,7 +2379,8 @@ public class TextToSpeech {
        boolean connect(String engine) {
            Intent intent = new Intent(Engine.INTENT_ACTION_TTS_SERVICE);
            intent.setPackage(engine);
            return mContext.bindService(intent, this, Context.BIND_AUTO_CREATE);
            return mContext.bindService(intent, this,
                    Context.BIND_AUTO_CREATE | Context.BIND_DENY_ACTIVITY_STARTS_PRE_34);
        }

        @Override
+2 −1
Original line number Diff line number Diff line
@@ -223,7 +223,8 @@ public class SyncManager {

    /** Flags used when connecting to a sync adapter service */
    private static final int SYNC_ADAPTER_CONNECTION_FLAGS = Context.BIND_AUTO_CREATE
            | Context.BIND_NOT_FOREGROUND | Context.BIND_ALLOW_OOM_MANAGEMENT;
            | Context.BIND_NOT_FOREGROUND | Context.BIND_ALLOW_OOM_MANAGEMENT
            | Context.BIND_DENY_ACTIVITY_STARTS_PRE_34;

    /** Singleton instance. */
    @GuardedBy("SyncManager.class")
+2 −1
Original line number Diff line number Diff line
@@ -238,7 +238,8 @@ final class MediaRoute2ProviderServiceProxy extends MediaRoute2Provider
            service.setComponent(mComponentName);
            try {
                mBound = mContext.bindServiceAsUser(service, this,
                        Context.BIND_AUTO_CREATE | Context.BIND_FOREGROUND_SERVICE,
                        Context.BIND_AUTO_CREATE | Context.BIND_FOREGROUND_SERVICE
                                | Context.BIND_DENY_ACTIVITY_STARTS_PRE_34,
                        new UserHandle(mUserId));
                if (!mBound && DEBUG) {
                    Slog.d(TAG, this + ": Bind failed");
+2 −1
Original line number Diff line number Diff line
@@ -572,7 +572,8 @@ final class RemotePrintService implements DeathRecipient {

        boolean wasBound = mContext.bindServiceAsUser(mIntent, mServiceConnection,
                Context.BIND_AUTO_CREATE | Context.BIND_FOREGROUND_SERVICE
                        | Context.BIND_INCLUDE_CAPABILITIES | Context.BIND_ALLOW_INSTANT,
                        | Context.BIND_INCLUDE_CAPABILITIES | Context.BIND_ALLOW_INSTANT
                        | Context.BIND_DENY_ACTIVITY_STARTS_PRE_34,
                new UserHandle(mUserId));

        if (!wasBound) {
Loading