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

Commit 5a966a51 authored by William Escande's avatar William Escande
Browse files

Keystore: Remove native call from test

Bug: 295237486
Test: atest AdapterServiceTest
Change-Id: Id979702c58ca83c1b73cd256417331b406b85489
parent 252e8804
Loading
Loading
Loading
Loading
+28 −1
Original line number Diff line number Diff line
@@ -19,6 +19,8 @@ package com.android.bluetooth.btservice.bluetoothkeystore;
import android.util.Log;

import com.android.bluetooth.Utils;
import com.android.internal.annotations.GuardedBy;
import com.android.internal.annotations.VisibleForTesting;

import java.io.IOException;
import java.security.NoSuchAlgorithmException;
@@ -27,7 +29,12 @@ import java.security.NoSuchAlgorithmException;
public class BluetoothKeystoreNativeInterface {
    private static final String TAG = BluetoothKeystoreNativeInterface.class.getSimpleName();

    private BluetoothKeystoreService mBluetoothKeystoreService = null;
    private BluetoothKeystoreService mBluetoothKeystoreService;

    @GuardedBy("INSTANCE_LOCK")
    private static BluetoothKeystoreNativeInterface sInstance;

    private static final Object INSTANCE_LOCK = new Object();

    static {
        if (Utils.isInstrumentationTestMode()) {
@@ -37,6 +44,26 @@ public class BluetoothKeystoreNativeInterface {
        }
    }

    private BluetoothKeystoreNativeInterface() {}

    /** return static native instance */
    public static BluetoothKeystoreNativeInterface getInstance() {
        synchronized (INSTANCE_LOCK) {
            if (sInstance == null) {
                sInstance = new BluetoothKeystoreNativeInterface();
            }
            return sInstance;
        }
    }

    /** Set singleton instance. */
    @VisibleForTesting
    public static void setInstance(BluetoothKeystoreNativeInterface instance) {
        synchronized (INSTANCE_LOCK) {
            sInstance = instance;
        }
    }

    /**
     * Initializes the native interface.
     *