@@ -33,14 +33,14 @@ public CodePushTelemetryManager(Context applicationContext, String codePushPrefe
33
33
34
34
public WritableMap getBinaryUpdateReport (String appVersion ) {
35
35
String previousStatusReportIdentifier = this .getPreviousStatusReportIdentifier ();
36
+ WritableNativeMap reportMap = null ;
36
37
if (previousStatusReportIdentifier == null ) {
37
38
this .clearRetryStatusReport ();
38
- WritableNativeMap reportMap = new WritableNativeMap ();
39
+ reportMap = new WritableNativeMap ();
39
40
reportMap .putString (APP_VERSION_KEY , appVersion );
40
- return reportMap ;
41
41
} else if (!previousStatusReportIdentifier .equals (appVersion )) {
42
42
this .clearRetryStatusReport ();
43
- WritableNativeMap reportMap = new WritableNativeMap ();
43
+ reportMap = new WritableNativeMap ();
44
44
if (this .isStatusReportIdentifierCodePushLabel (previousStatusReportIdentifier )) {
45
45
String previousDeploymentKey = this .getDeploymentKeyFromStatusReportIdentifier (previousStatusReportIdentifier );
46
46
String previousLabel = this .getVersionLabelFromStatusReportIdentifier (previousStatusReportIdentifier );
@@ -52,10 +52,9 @@ public WritableMap getBinaryUpdateReport(String appVersion) {
52
52
reportMap .putString (APP_VERSION_KEY , appVersion );
53
53
reportMap .putString (PREVIOUS_LABEL_OR_APP_VERSION_KEY , previousStatusReportIdentifier );
54
54
}
55
- return reportMap ;
56
55
}
57
56
58
- return null ;
57
+ return reportMap ;
59
58
}
60
59
61
60
public WritableMap getRetryStatusReport () {
@@ -68,7 +67,6 @@ public WritableMap getRetryStatusReport() {
68
67
return CodePushUtils .convertJsonObjectToWritable (retryStatusReport );
69
68
} catch (JSONException e ) {
70
69
e .printStackTrace ();
71
- return null ;
72
70
}
73
71
}
74
72
@@ -85,36 +83,33 @@ public WritableMap getRollbackReport(WritableMap lastFailedPackage) {
85
83
public WritableMap getUpdateReport (WritableMap currentPackage ) {
86
84
String currentPackageIdentifier = this .getPackageStatusReportIdentifier (currentPackage );
87
85
String previousStatusReportIdentifier = this .getPreviousStatusReportIdentifier ();
86
+ WritableNativeMap reportMap = null ;
88
87
if (currentPackageIdentifier != null ) {
89
88
if (previousStatusReportIdentifier == null ) {
90
89
this .clearRetryStatusReport ();
91
- WritableNativeMap reportMap = new WritableNativeMap ();
90
+ reportMap = new WritableNativeMap ();
92
91
reportMap .putMap (PACKAGE_KEY , currentPackage );
93
92
reportMap .putString (STATUS_KEY , DEPLOYMENT_SUCCEEDED_STATUS );
94
- return reportMap ;
95
93
} else if (!previousStatusReportIdentifier .equals (currentPackageIdentifier )) {
96
94
this .clearRetryStatusReport ();
95
+ reportMap = new WritableNativeMap ();
97
96
if (this .isStatusReportIdentifierCodePushLabel (previousStatusReportIdentifier )) {
98
97
String previousDeploymentKey = this .getDeploymentKeyFromStatusReportIdentifier (previousStatusReportIdentifier );
99
98
String previousLabel = this .getVersionLabelFromStatusReportIdentifier (previousStatusReportIdentifier );
100
- WritableNativeMap reportMap = new WritableNativeMap ();
101
99
reportMap .putMap (PACKAGE_KEY , currentPackage );
102
100
reportMap .putString (STATUS_KEY , DEPLOYMENT_SUCCEEDED_STATUS );
103
101
reportMap .putString (PREVIOUS_DEPLOYMENT_KEY_KEY , previousDeploymentKey );
104
102
reportMap .putString (PREVIOUS_LABEL_OR_APP_VERSION_KEY , previousLabel );
105
- return reportMap ;
106
103
} else {
107
104
// Previous status report was with a binary app version.
108
- WritableNativeMap reportMap = new WritableNativeMap ();
109
105
reportMap .putMap (PACKAGE_KEY , currentPackage );
110
106
reportMap .putString (STATUS_KEY , DEPLOYMENT_SUCCEEDED_STATUS );
111
107
reportMap .putString (PREVIOUS_LABEL_OR_APP_VERSION_KEY , previousStatusReportIdentifier );
112
- return reportMap ;
113
108
}
114
109
}
115
110
}
116
111
117
- return null ;
112
+ return reportMap ;
118
113
}
119
114
120
115
public void recordStatusReported (ReadableMap statusReport ) {
0 commit comments