Skip to content

Commit

Permalink
Update all RegisterReceiver to add ContextCompat.RECEIVER_EXPORTED in…
Browse files Browse the repository at this point in the history
… order to be API34 compliant.
  • Loading branch information
ltrudu committed Sep 3, 2024
1 parent ba557db commit af85e25
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 9 deletions.
4 changes: 2 additions & 2 deletions datawedgeprofileintentswrapper/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ android {
minSdkVersion 21
//noinspection EditedTargetSdkVersion
targetSdkVersion 34
versionCode 144
versionName "14.4"
versionCode 145
versionName "14.5"

testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
import java.util.Arrays;
import java.util.List;

import androidx.core.content.ContextCompat;

/**
* Created by laure on 16/04/2018.
*/
Expand Down Expand Up @@ -87,7 +89,8 @@ public void execute(DWEnumerateScannersSettings settings, onEnumerateScannerResu
broadcastReceiverThreadLooper = broadcastReceiverThread.getLooper();
broadcastReceiverHandler = new Handler(broadcastReceiverThreadLooper);

mContext.registerReceiver(mBroadcastReceiver, intentFilter, null, broadcastReceiverHandler);
ContextCompat.registerReceiver(mContext, mBroadcastReceiver, intentFilter, null, broadcastReceiverHandler, ContextCompat.RECEIVER_EXPORTED);


/*
Ask for DataWedge profile list
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

import java.util.Arrays;

import androidx.core.content.ContextCompat;

/**
* Created by laure on 16/04/2018.
*/
Expand Down Expand Up @@ -74,7 +76,7 @@ public void execute(DWProfileCheckerSettings settings, onProfileExistResult call
broadcastReceiverThreadLooper = broadcastReceiverThread.getLooper();
broadcastReceiverHandler = new Handler(broadcastReceiverThreadLooper);

mContext.registerReceiver(mBroadcastReceiver, intentFilter, null, broadcastReceiverHandler);
ContextCompat.registerReceiver(mContext, mBroadcastReceiver, intentFilter, null, broadcastReceiverHandler, ContextCompat.RECEIVER_EXPORTED);

/*
Ask for DataWedge profile list
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,6 @@ protected void execute(DWProfileBaseSettings settings, onProfileCommandResult ca
broadcastReceiverThreadLooper = broadcastReceiverThread.getLooper();
broadcastReceiverHandler = new Handler(broadcastReceiverThreadLooper);


//mContext.registerReceiver(mBroadcastReceiver, intentFilter);
//mContext.registerReceiver(mBroadcastReceiver, intentFilter, null, broadcastReceiverHandler);
ContextCompat.registerReceiver(mContext, mBroadcastReceiver, intentFilter, null, broadcastReceiverHandler, ContextCompat.RECEIVER_EXPORTED);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ public void startReceive()
mBroadcastReceiverThreadLooper = mBroadcastReceiverThread.getLooper();
mBroadcastReceiverHandler = new Handler(mBroadcastReceiverThreadLooper);

//mContext.registerReceiver(mMessageReceiver, mIntentFilter, null, mBroadcastReceiverHandler);
ContextCompat.registerReceiver(mContext, mMessageReceiver, mIntentFilter, null, mBroadcastReceiverHandler, ContextCompat.RECEIVER_EXPORTED);

} catch (Exception e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
import android.os.HandlerThread;
import android.os.Looper;

import androidx.core.content.ContextCompat;

/**
* Created by laure on 16/04/2018.
*/
Expand Down Expand Up @@ -71,7 +73,7 @@ public void execute(DWProfileBaseSettings settings, onScannerPluginStatus callba
broadcastReceiverThreadLooper = broadcastReceiverThread.getLooper();
broadcastReceiverHandler = new Handler(broadcastReceiverThreadLooper);

mContext.registerReceiver(mBroadcastReceiver, intentFilter, null, broadcastReceiverHandler);
ContextCompat.registerReceiver(mContext, mBroadcastReceiver, intentFilter, null, broadcastReceiverHandler, ContextCompat.RECEIVER_EXPORTED);

/*
Ask for DataWedge profile list
Expand Down

0 comments on commit af85e25

Please sign in to comment.