mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-12 18:59:06 +01:00
add option to force enable or disable bluetooth adapter
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
package org.briarproject.bramble.api.plugin.event;
|
||||
|
||||
import org.briarproject.bramble.api.event.Event;
|
||||
|
||||
/**
|
||||
* to force enable and disable bluetooth
|
||||
* force enable means that the bluetooth adapter stay enabled until a force DisableBluetoothEvent is called
|
||||
* force disable stop the bluetooth adapter only when we turned it on
|
||||
*/
|
||||
abstract class BluetoothEvent extends Event {
|
||||
private boolean force;
|
||||
|
||||
BluetoothEvent(boolean force){
|
||||
this.force = force;
|
||||
}
|
||||
|
||||
public boolean isForced(){
|
||||
return force;
|
||||
}
|
||||
}
|
||||
@@ -11,5 +11,12 @@ import javax.annotation.concurrent.Immutable;
|
||||
*/
|
||||
@Immutable
|
||||
@NotNullByDefault
|
||||
public class DisableBluetoothEvent extends Event {
|
||||
public class DisableBluetoothEvent extends BluetoothEvent {
|
||||
public DisableBluetoothEvent(){
|
||||
super(false);
|
||||
}
|
||||
|
||||
public DisableBluetoothEvent(boolean force) {
|
||||
super(force);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,5 +10,12 @@ import javax.annotation.concurrent.Immutable;
|
||||
*/
|
||||
@Immutable
|
||||
@NotNullByDefault
|
||||
public class EnableBluetoothEvent extends Event {
|
||||
public class EnableBluetoothEvent extends BluetoothEvent {
|
||||
public EnableBluetoothEvent(){
|
||||
super(false);
|
||||
}
|
||||
|
||||
public EnableBluetoothEvent(boolean force){
|
||||
super(force);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user