diff options
author | Sven Gothel <[email protected]> | 2020-06-29 15:35:48 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2020-06-29 15:35:48 +0200 |
commit | 25f2918eae9bba977300871d82b03511a75c9346 (patch) | |
tree | 3308092c5214f202776edc7b70eabef3118b4da8 /java/direct_bt | |
parent | cdbf1fd4e081ce94e5c2dec7e6e912ce35247c7e (diff) |
DBTManager: Use system property (int value) 'org.tinyb.default_adapter' for optionally seeding defaultAdapterIndex other than 0
Diffstat (limited to 'java/direct_bt')
-rw-r--r-- | java/direct_bt/tinyb/DBTManager.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/java/direct_bt/tinyb/DBTManager.java b/java/direct_bt/tinyb/DBTManager.java index 263b7365..82aa0545 100644 --- a/java/direct_bt/tinyb/DBTManager.java +++ b/java/direct_bt/tinyb/DBTManager.java @@ -48,6 +48,7 @@ public class DBTManager implements BluetoothManager private static volatile boolean isJVMShuttingDown = false; private static final List<Runnable> userShutdownHooks = new ArrayList<Runnable>(); private static boolean unifyUUID128Bit = true; + private static int DefaultAdapterIndex = 0; static { AccessController.doPrivileged(new PrivilegedAction<Object>() { @@ -61,6 +62,11 @@ public class DBTManager implements BluetoothManager } }, "DBTManager_ShutdownHook" ) ) ; return null; } } ) ; + { + final String v = System.getProperty("org.tinyb.default_adapter", "0"); + DefaultAdapterIndex = Integer.valueOf(v); + } + } private static synchronized void shutdownImpl(final boolean _isJVMShuttingDown) { @@ -148,7 +154,7 @@ public class DBTManager implements BluetoothManager private long nativeInstance; private static DBTManager inst; private final List<BluetoothAdapter> adapters = new ArrayList<BluetoothAdapter>(); - private int defaultAdapterIndex = 0; + private int defaultAdapterIndex = DefaultAdapterIndex; public BluetoothType getBluetoothType() { return BluetoothType.NONE; } |