diff options
Diffstat (limited to 'android/hello_sdl_android/src/main/java/com/sdl/hellosdlandroid/SdlReceiver.java')
-rwxr-xr-x | android/hello_sdl_android/src/main/java/com/sdl/hellosdlandroid/SdlReceiver.java | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/android/hello_sdl_android/src/main/java/com/sdl/hellosdlandroid/SdlReceiver.java b/android/hello_sdl_android/src/main/java/com/sdl/hellosdlandroid/SdlReceiver.java index 2690d153f..e130d3d78 100755 --- a/android/hello_sdl_android/src/main/java/com/sdl/hellosdlandroid/SdlReceiver.java +++ b/android/hello_sdl_android/src/main/java/com/sdl/hellosdlandroid/SdlReceiver.java @@ -22,8 +22,8 @@ public class SdlReceiver extends SdlBroadcastReceiver { // We will check the intent for a pendingIntent parcelable extra // This pendingIntent allows us to start the SdlService from the context of the active router service which is in the foreground if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) { - if (intent.getParcelableExtra(TransportConstants.PENDING_INTENT_EXTRA) != null) { - PendingIntent pendingIntent = (PendingIntent) intent.getParcelableExtra(TransportConstants.PENDING_INTENT_EXTRA); + PendingIntent pendingIntent = (PendingIntent) intent.getParcelableExtra(TransportConstants.PENDING_INTENT_EXTRA); + if (pendingIntent != null) { try { pendingIntent.send(context, 0, intent); } catch (PendingIntent.CanceledException e) { @@ -54,6 +54,6 @@ public class SdlReceiver extends SdlBroadcastReceiver { @Override public String getSdlServiceName() { - return "SdlService"; + return SdlService.class.getSimpleName(); } }
\ No newline at end of file |