mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-07-08 22:51:37 +02:00
- Bluetooth connection is now established in BtSocketIOThread - Service is now started as soon as the main activity is started - changed "start service" button to "connect" button - quit button in service notification now also quits the main activity - Service notification now displays "Gadgetbride started", "connected to Pebble XXXXX" and "not connected" depending on connection state
18 lines
566 B
Java
18 lines
566 B
Java
package nodomain.freeyourgadget.gadgetbridge;
|
|
|
|
import android.content.BroadcastReceiver;
|
|
import android.content.Context;
|
|
import android.content.Intent;
|
|
|
|
public class StopServiceReceiver extends BroadcastReceiver {
|
|
@Override
|
|
public void onReceive(Context context, Intent intent) {
|
|
Intent stopIntent = new Intent(context, BluetoothCommunicationService.class);
|
|
context.stopService(stopIntent);
|
|
|
|
Intent quitIntent = new Intent();
|
|
quitIntent.setAction(ControlCenter.ACTION_QUIT);
|
|
context.sendBroadcast(quitIntent);
|
|
}
|
|
}
|