Skip to content

Commit 520f14c

Browse files
committed
Various cleanup
1 parent 24135cf commit 520f14c

File tree

7 files changed

+17
-14
lines changed

7 files changed

+17
-14
lines changed

iterableapi/src/main/java/com/iterable/iterableapi/IterableActionRunner.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@
1111
import java.util.List;
1212

1313
class IterableActionRunner {
14-
static final String TAG = "IterableActionRunner";
14+
private static final String TAG = "IterableActionRunner";
1515

1616
/**
1717
* Execute an {@link IterableAction} as a response to push action
1818
* @param context Context
1919
* @param action The original action object
2020
* @return `true` if the action was handled, `false` if it was not
2121
*/
22-
public static boolean executeAction(@NonNull Context context, @Nullable IterableAction action, @NonNull IterableActionSource source) {
22+
static boolean executeAction(@NonNull Context context, @Nullable IterableAction action, @NonNull IterableActionSource source) {
2323
if (action == null) {
2424
return false;
2525
}

iterableapi/src/main/java/com/iterable/iterableapi/IterableApi.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public class IterableApi {
3232

3333
//region Variables
3434
//---------------------------------------------------------------------------------------
35-
static final String TAG = "IterableApi";
35+
private static final String TAG = "IterableApi";
3636

3737
/**
3838
* {@link IterableApi} singleton instance

iterableapi/src/main/java/com/iterable/iterableapi/IterableNotificationData.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class IterableNotificationData {
4242
// Action buttons
4343
JSONArray actionButtonsJson = iterableJson.optJSONArray(IterableConstants.ITERABLE_DATA_ACTION_BUTTONS);
4444
if (actionButtonsJson != null) {
45-
actionButtons = new ArrayList<Button>();
45+
actionButtons = new ArrayList<>();
4646
for (int i = 0; i < actionButtonsJson.length(); i++) {
4747
JSONObject button = actionButtonsJson.getJSONObject(i);
4848
actionButtons.add(new Button(button));

iterableapi/src/main/java/com/iterable/iterableapi/IterableRequest.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -276,11 +276,11 @@ class IterableApiRequest {
276276
static String GET = "GET";
277277
static String POST = "POST";
278278

279-
String apiKey = "";
280-
String baseUrl = null;
281-
String resourcePath = "";
282-
JSONObject json;
283-
String requestType = "";
279+
final String apiKey;
280+
final String baseUrl;
281+
final String resourcePath;
282+
final JSONObject json;
283+
final String requestType;
284284

285285
IterableHelper.IterableActionHandler legacyCallback;
286286
IterableHelper.SuccessHandler successCallback;
@@ -298,6 +298,7 @@ public IterableApiRequest(String apiKey, String baseUrl, String resourcePath, JS
298298

299299
public IterableApiRequest(String apiKey, String resourcePath, JSONObject json, String requestType, IterableHelper.SuccessHandler onSuccess, IterableHelper.FailureHandler onFailure) {
300300
this.apiKey = apiKey;
301+
this.baseUrl = null;
301302
this.resourcePath = resourcePath;
302303
this.json = json;
303304
this.requestType = requestType;
@@ -307,6 +308,7 @@ public IterableApiRequest(String apiKey, String resourcePath, JSONObject json, S
307308

308309
public IterableApiRequest(String apiKey, String resourcePath, JSONObject json, String requestType, final IterableHelper.IterableActionHandler callback) {
309310
this.apiKey = apiKey;
311+
this.baseUrl = null;
310312
this.resourcePath = resourcePath;
311313
this.json = json;
312314
this.requestType = requestType;

iterableapi/src/main/java/com/iterable/iterableapi/IterableWebViewClient.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package com.iterable.iterableapi;
22

3-
import android.net.Uri;
43
import android.webkit.WebView;
54
import android.webkit.WebViewClient;
65

iterableapi/src/main/java/com/iterable/iterableapi/ddl/DeviceInfo.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,19 @@
66
import android.view.Display;
77
import android.view.WindowManager;
88

9+
import androidx.annotation.RestrictTo;
10+
911
import org.json.JSONException;
1012
import org.json.JSONObject;
1113

1214
import java.util.Date;
1315
import java.util.Locale;
1416
import java.util.TimeZone;
1517

18+
@RestrictTo(RestrictTo.Scope.LIBRARY)
1619
public class DeviceInfo {
17-
String mobileDeviceType = "Android";
18-
DeviceFp deviceFp;
20+
private static final String MOBILE_DEVICE_TYPE = "Android";
21+
private DeviceFp deviceFp;
1922

2023
private DeviceInfo(DeviceFp deviceFp) {
2124
this.deviceFp = deviceFp;
@@ -78,7 +81,7 @@ private static DeviceFp createDeviceFp(Context context) {
7881

7982
public JSONObject toJSONObject() throws JSONException {
8083
JSONObject json = new JSONObject();
81-
json.put("mobileDeviceType", mobileDeviceType);
84+
json.put("mobileDeviceType", MOBILE_DEVICE_TYPE);
8285
json.put("deviceFp", deviceFp.toJSONObject());
8386
return json;
8487
}

iterableapi/src/main/java/com/iterable/iterableapi/util/Future.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import android.os.Handler;
44
import android.os.Looper;
55

6-
import java.lang.ref.WeakReference;
76
import java.util.ArrayList;
87
import java.util.List;
98
import java.util.concurrent.Callable;

0 commit comments

Comments
 (0)