List of usage examples for android.bluetooth BluetoothAdapter getClass
@HotSpotIntrinsicCandidate public final native Class<?> getClass();
From source file:com.github.akinaru.hcidebugger.activity.HciDebuggerActivity.java
/** * Activate/Desactivate snoop file log/* w ww.j av a2s .c o m*/ * * @param state true if snoop file log is activated, false elsewhere */ public void configSnoopFile(boolean state) { BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter(); Method[] adapterMethods = adapter.getClass().getDeclaredMethods(); for (Method method : adapterMethods) { if (method.getName().equals("configHciSnoopLog")) { Log.v(TAG, "activating snoop file log"); try { boolean ret = (boolean) method.invoke(adapter, state); Log.v(TAG, "configSnoop return with state " + ret); } catch (IllegalArgumentException e) { e.printStackTrace(); } catch (IllegalAccessException e) { e.printStackTrace(); } catch (InvocationTargetException e) { e.printStackTrace(); } } } }