30 lines
925 B
Java
30 lines
925 B
Java
package com.afunx.ble.blelitelib.utils;
|
|
|
|
import android.app.Activity;
|
|
import android.bluetooth.BluetoothAdapter;
|
|
import android.bluetooth.BluetoothDevice;
|
|
import android.content.Intent;
|
|
|
|
/* loaded from: classes.dex */
|
|
public class BleUtils {
|
|
public static boolean disableBluetooth() {
|
|
return BluetoothAdapter.getDefaultAdapter().disable();
|
|
}
|
|
|
|
public static boolean enableBluetooth() {
|
|
return BluetoothAdapter.getDefaultAdapter().enable();
|
|
}
|
|
|
|
public static BluetoothDevice getRemoteDevice(String str) {
|
|
return BluetoothAdapter.getDefaultAdapter().getRemoteDevice(str);
|
|
}
|
|
|
|
public static boolean isBluetoothEnabled() {
|
|
return BluetoothAdapter.getDefaultAdapter().isEnabled();
|
|
}
|
|
|
|
public static void tryEnableBluetooth(Activity activity, int i) {
|
|
activity.startActivityForResult(new Intent("android.bluetooth.adapter.action.REQUEST_ENABLE"), i);
|
|
}
|
|
}
|