Skip to content

Commit c99e7f7

Browse files
committed
Switch to using new method: AndroidTools.registerReceiver in SdlRouterService and ServiceFinder
1 parent 1485628 commit c99e7f7

2 files changed

Lines changed: 3 additions & 10 deletions

File tree

android/sdl_android/src/main/java/com/smartdevicelink/transport/SdlRouterService.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1210,11 +1210,7 @@ public void startUpSequence() {
12101210

12111211
IntentFilter filter = new IntentFilter();
12121212
filter.addAction(REGISTER_WITH_ROUTER_ACTION);
1213-
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
1214-
registerReceiver(mainServiceReceiver, filter, RECEIVER_EXPORTED);
1215-
} else {
1216-
registerReceiver(mainServiceReceiver, filter);
1217-
}
1213+
AndroidTools.registerReceiver(this, mainServiceReceiver, filter, RECEIVER_EXPORTED);
12181214

12191215
if (!connectAsClient) {
12201216
if (bluetoothAvailable()) {

android/sdl_android/src/main/java/com/smartdevicelink/util/ServiceFinder.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,8 @@ public ServiceFinder(Context context, String packageName, final ServiceFinderCal
7575

7676
this.sdlMultiMap = AndroidTools.getSdlEnabledApps(context, packageName);
7777

78-
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
79-
this.context.registerReceiver(mainServiceReceiver, new IntentFilter(this.receiverLocation), Context.RECEIVER_EXPORTED);
80-
} else {
81-
this.context.registerReceiver(mainServiceReceiver, new IntentFilter(this.receiverLocation));
82-
}
78+
AndroidTools.registerReceiver(this.context, mainServiceReceiver,
79+
new IntentFilter(this.receiverLocation), Context.RECEIVER_EXPORTED);
8380

8481
timeoutRunnable = new Runnable() {
8582
@Override

0 commit comments

Comments
 (0)