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

Commit 9237a1d0 authored by William Escande's avatar William Escande
Browse files

SystemServer: remove avoid_static_loading_of_native

Bug: 339554081
Flag: com.android.bluetooth.flags.avoid_static_loading_of_native
Test: m . | any test that turn on & off the Bluetooth
Change-Id: I838a8a6574a48567e75c4e66b622bcabaf9c2203
parent b0fa765e
Loading
Loading
Loading
Loading
+5 −18
Original line number Diff line number Diff line
@@ -369,17 +369,6 @@ public class AdapterService extends Service {
        }
    };

    static {
        if (!Flags.avoidStaticLoadingOfNative()) {
            Log.d(TAG, "Loading JNI Library");
            if (Utils.isInstrumentationTestMode()) {
                Log.w(TAG, "App is instrumented. Skip loading the native");
            } else {
                System.loadLibrary("bluetooth_jni");
            }
        }
    }

    // Keep a constructor for ActivityThread.handleCreateService
    AdapterService() {
        this(Looper.getMainLooper());
@@ -669,14 +658,12 @@ public class AdapterService extends Service {
                getApplicationContext()
                        .getPackageManager()
                        .hasSystemFeature(PackageManager.FEATURE_LEANBACK_ONLY);
        if (Flags.avoidStaticLoadingOfNative()) {
        if (Utils.isInstrumentationTestMode()) {
            Log.w(TAG, "This Bluetooth App is instrumented. ** Skip loading the native **");
        } else {
            Log.d(TAG, "Loading JNI Library");
            System.loadLibrary("bluetooth_jni");
        }
        }
        mNativeInterface.init(
                this,
                mAdapterProperties,
+0 −10
Original line number Diff line number Diff line
package: "com.android.bluetooth.flags"
container: "com.android.btservices"

flag {
    name: "avoid_static_loading_of_native"
    namespace: "bluetooth"
    description: "Prevent loading native during static initialization and prefer doing it during init"
    metadata {
        purpose: PURPOSE_BUGFIX
    }
    bug: "339554081"
}

flag {
    name: "enforce_resolve_system_service_behavior"
    namespace: "bluetooth"