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

Commit a9023476 authored by William Escande's avatar William Escande
Browse files

SystemServer: remove flag injection

Static approach should be the way to go

Bug: 323981134
Flag: Exempt, No-op change to follow flag recomandation
Test: m service-bluetooth
Change-Id: Ia7f7ef158c2fa35b24ee64bd70e497a2265bcd33
parent 34547377
Loading
Loading
Loading
Loading
+1 −6
Original line number Diff line number Diff line
@@ -75,7 +75,6 @@ import android.util.proto.ProtoOutputStream;
import androidx.annotation.RequiresApi;

import com.android.bluetooth.BluetoothStatsLog;
import com.android.bluetooth.flags.FeatureFlags;
import com.android.bluetooth.flags.Flags;
import com.android.internal.annotations.GuardedBy;
import com.android.internal.annotations.VisibleForTesting;
@@ -197,8 +196,6 @@ class BluetoothManagerService {

    private final ReentrantReadWriteLock mAdapterLock = new ReentrantReadWriteLock();

    private final FeatureFlags mFeatureFlags;

    @GuardedBy("mAdapterLock")
    private AdapterBinder mAdapter = null;

@@ -630,12 +627,10 @@ class BluetoothManagerService {
                }
            };

    BluetoothManagerService(
            @NonNull Context context, @NonNull Looper looper, @NonNull FeatureFlags featureFlags) {
    BluetoothManagerService(@NonNull Context context, @NonNull Looper looper) {
        mContext = requireNonNull(context, "Context cannot be null");
        mContentResolver = requireNonNull(mContext.getContentResolver(), "Resolver cannot be null");
        mLooper = requireNonNull(looper, "Looper cannot be null");
        mFeatureFlags = requireNonNull(featureFlags, "Feature Flags cannot be null");

        mUserManager =
                requireNonNull(
+1 −3
Original line number Diff line number Diff line
@@ -19,7 +19,6 @@ import android.bluetooth.BluetoothAdapter
import android.content.Context
import android.os.HandlerThread
import android.os.UserManager
import com.android.bluetooth.flags.FeatureFlagsImpl
import com.android.server.SystemService
import com.android.server.SystemService.TargetUser

@@ -31,8 +30,7 @@ class BluetoothService(context: Context) : SystemService(context) {
    init {
        mHandlerThread = HandlerThread("BluetoothManagerService")
        mHandlerThread.start()
        mBluetoothManagerService =
            BluetoothManagerService(context, mHandlerThread.getLooper(), FeatureFlagsImpl())
        mBluetoothManagerService = BluetoothManagerService(context, mHandlerThread.getLooper())
    }

    private fun initialize(user: TargetUser) {
+1 −7
Original line number Diff line number Diff line
@@ -60,8 +60,6 @@ import android.provider.Settings;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.runner.AndroidJUnit4;

import com.android.bluetooth.flags.FakeFeatureFlagsImpl;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;
@@ -94,7 +92,6 @@ public class BluetoothManagerServiceTest {

    @Mock IBluetooth mAdapterService;
    @Mock AdapterBinder mAdapterBinder;
    private FakeFeatureFlagsImpl mFakeFlagsImpl;

    TestLooper mLooper;

@@ -158,10 +155,7 @@ public class BluetoothManagerServiceTest {

        mLooper = new TestLooper();

        mFakeFlagsImpl = new FakeFeatureFlagsImpl();

        mManagerService =
                new BluetoothManagerService(mContext, mLooper.getLooper(), mFakeFlagsImpl);
        mManagerService = new BluetoothManagerService(mContext, mLooper.getLooper());
        mManagerService.initialize(mUserHandle);

        mManagerService.registerAdapter(mManagerCallback);