mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-16 20:59:54 +01:00
"Implicit intents with startService are not safe" - use an explicit one.
This commit is contained in:
@@ -69,8 +69,8 @@ public class BriarActivity extends RoboFragmentActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void startAndBindService() {
|
private void startAndBindService() {
|
||||||
startService(new Intent(BriarService.class.getName()));
|
startService(new Intent(this, BriarService.class));
|
||||||
bound = bindService(new Intent(BriarService.class.getName()),
|
bound = bindService(new Intent(this, BriarService.class),
|
||||||
serviceConnection, 0);
|
serviceConnection, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -124,12 +124,10 @@ public class BriarService extends RoboService implements EventListener {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int onStartCommand(Intent intent, int flags, int startId) {
|
public int onStartCommand(Intent intent, int flags, int startId) {
|
||||||
if(LOG.isLoggable(INFO)) LOG.info("Started");
|
|
||||||
return START_NOT_STICKY; // Don't restart automatically if killed
|
return START_NOT_STICKY; // Don't restart automatically if killed
|
||||||
}
|
}
|
||||||
|
|
||||||
public IBinder onBind(Intent intent) {
|
public IBinder onBind(Intent intent) {
|
||||||
if(LOG.isLoggable(INFO)) LOG.info("Bound");
|
|
||||||
return binder;
|
return binder;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user