Skip to content

Commit 3012196

Browse files
committed
release: SDK 1.17.3
1 parent 7c9353a commit 3012196

File tree

10 files changed

+8889
-36
lines changed

10 files changed

+8889
-36
lines changed

Sources/sdk/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ android {
2626
minSdkVersion 15
2727
targetSdkVersion 30
2828
versionCode 1
29-
versionName "1.17.2"
29+
versionName "1.17.3"
3030
buildConfigField "String", SDK_VERSION, "\"$versionName\""
3131
buildConfigField "Integer", API_LEVEL, '36'
3232
buildConfigField "Integer", MESSAGING_API_LEVEL, '10'
@@ -64,8 +64,8 @@ android {
6464

6565
lintOptions {
6666
abortOnError true
67-
warningsAsErrors true
6867
baseline file("lint-baseline.xml")
68+
lintConfig file("lint.xml")
6969
}
7070

7171
testOptions {

Sources/sdk/lint-baseline.xml

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,4 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<issues format="5" by="lint 4.1.1" client="gradle" variant="debug" version="4.1.1">
3-
4-
<issue
5-
id="KtxExtensionAvailable"
6-
message="Add suffix `-ktx` to enable the Kotlin extensions for this library"
7-
errorLine1=" api &quot;androidx.core:core:$androidXLibraryVersion&quot;"
8-
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
9-
<location
10-
file="build.gradle"
11-
line="107"
12-
column="5"/>
13-
</issue>
2+
<issues format="5" by="lint 4.2.0" client="gradle" variant="debug" version="4.2.0">
143

154
</issues>

Sources/sdk/lint.xml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<lint>
3-
<issue id="GradleDependency">
4-
<ignore path="build.gradle" />
5-
</issue>
3+
<issue id="OldTargetApi" severity="warning" />
4+
5+
<!-- android.lintOptions.warningsAsErrors should do this but ... IDK -->
6+
<!--<issue id="all" severity="error" /> -->
67
</lint>

Sources/sdk/src/main/java/com/batch/android/BatchNotificationAction.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.batch.android;
22

3+
import android.annotation.SuppressLint;
34
import android.app.PendingIntent;
45
import android.content.Context;
56
import android.content.Intent;
@@ -71,12 +72,16 @@ public class BatchNotificationAction
7172
* @return A list of {@link NotificationCompat.Action} instances matching the provided {@link BatchNotificationAction},
7273
* if they've been successfully converted
7374
*/
75+
@SuppressLint("UnspecifiedImmutableFlag")
7476
@NonNull
7577
public static List<NotificationCompat.Action> getSupportActions(@NonNull Context context,
7678
@NonNull List<BatchNotificationAction> batchActions,
7779
@Nullable BatchPushPayload pushPayload,
7880
@Nullable Integer notificationId)
7981
{
82+
// UnspecifiedImmutableFlag is suppressed as the linter can't recognize our conditional
83+
// Android M immutability flag.
84+
8085
if (context == null) {
8186
throw new IllegalArgumentException("Context cannot be null");
8287
}
@@ -109,6 +114,8 @@ public static List<NotificationCompat.Action> getSupportActions(@NonNull Context
109114

110115
int actionIntentFlags = PendingIntent.FLAG_ONE_SHOT;
111116
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
117+
// Remove @SuppressLint("UnspecifiedImmutableFlag") if you ever delete this line,
118+
// so that the linter can warn appropriately
112119
actionIntentFlags = actionIntentFlags | PendingIntent.FLAG_IMMUTABLE;
113120
}
114121

Sources/sdk/src/main/java/com/batch/android/BatchPushNotificationPresenter.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.batch.android;
22

3+
import android.annotation.SuppressLint;
34
import android.app.Activity;
45
import android.app.Notification;
56
import android.app.PendingIntent;
@@ -392,6 +393,10 @@ public static void presentNotification(Context context,
392393
contentIntentFlags = contentIntentFlags | PendingIntent.FLAG_IMMUTABLE;
393394
}
394395

396+
// UnspecifiedImmutableFlag is suppressed as the linter can't recognize our conditional
397+
// Android M immutability flag.
398+
399+
@SuppressLint("UnspecifiedImmutableFlag")
395400
PendingIntent contentIntent = PendingIntent.getActivity(context,
396401
0,
397402
launchIntent,
@@ -414,6 +419,10 @@ public static void presentNotification(Context context,
414419
deleteIntentFlags = deleteIntentFlags | PendingIntent.FLAG_IMMUTABLE;
415420
}
416421

422+
// UnspecifiedImmutableFlag is suppressed as the linter can't recognize our conditional
423+
// Android M immutability flag.
424+
425+
@SuppressLint("UnspecifiedImmutableFlag")
417426
PendingIntent deleteIntent =
418427
PendingIntent.getBroadcast(context.getApplicationContext(),
419428
notificationId, dismissIntent, deleteIntentFlags);

Sources/sdk/src/main/java/com/batch/android/module/EventDispatcherModule.java

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public class EventDispatcherModule extends BatchModule
2828
"com.batch.android.eventdispatcher.DispatcherRegistrar";
2929
private static final String COMPONENT_KEY_PREFIX = "com.batch.android.eventdispatcher:";
3030

31-
private Set<BatchEventDispatcher> eventDispatchers = new LinkedHashSet<>();
31+
private final Set<BatchEventDispatcher> eventDispatchers = new LinkedHashSet<>();
3232
private OptOutModule optOutModule;
3333

3434
private boolean isContextLoaded = false;
@@ -56,20 +56,6 @@ public int getState()
5656
return 1;
5757
}
5858

59-
@Override
60-
public void batchDidStop()
61-
{
62-
clear();
63-
}
64-
65-
public void clear()
66-
{
67-
synchronized (eventDispatchers) {
68-
eventDispatchers.clear();
69-
isContextLoaded = false;
70-
}
71-
}
72-
7359
private void printLoadedDispatcher(@NonNull String name)
7460
{
7561
Logger.internal(TAG,
@@ -111,11 +97,13 @@ public void loadDispatcherFromContext(Context context)
11197
return;
11298
}
11399

114-
// Ensure once because of NotificationPresenter
115-
if (isContextLoaded) {
116-
return;
100+
synchronized (eventDispatchers) {
101+
// Ensure once because of NotificationPresenter
102+
if (isContextLoaded) {
103+
return;
104+
}
105+
isContextLoaded = true;
117106
}
118-
isContextLoaded = true;
119107

120108
List<String> registrarNames = DiscoveryServiceHelper.getComponentNames(context,
121109
DispatcherDiscoveryService.class,

Sources/sdk/src/main/java/com/batch/android/push/formats/APENFormat.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.batch.android.push.formats;
22

3+
import android.annotation.SuppressLint;
34
import android.graphics.Bitmap;
45
import android.os.Build;
56
import android.view.View;
@@ -113,6 +114,7 @@ ImageView.ScaleType getImageScaleType()
113114
return imageScaleType;
114115
}
115116

117+
@SuppressLint("AnnotateVersionCheck")
116118
public static boolean isSupported()
117119
{
118120
return android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP;

proguard-mappings/1.17.3/checksum.md5

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
MD5 (public-sdk/Batch.aar) = 218df77fae5bf42bcc8f1ab08e9d7fca

proguard-mappings/1.17.3/checksum.sha

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
a819def06da69a82082a9d164df22d6f6cd33c8a public-sdk/Batch.aar

0 commit comments

Comments
 (0)