Skip to content

Commit

Permalink
Code review suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
tejasd committed Jun 24, 2021
1 parent a856774 commit 3ebad98
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public void testEventToJsonAndBack_equals() throws IOException {
@Test
public void testAppExitInfoToJsonAndBack_equals() throws IOException {
final CrashlyticsReport.ApplicationExitInfo testAppExitInfo = makeAppExitInfo();
final String testAppExitInfoJson = transform.appExitInfoToJson(testAppExitInfo);
final String testAppExitInfoJson = transform.applicationExitInfoToJson(testAppExitInfo);
final CrashlyticsReport.ApplicationExitInfo reifiedAppExitInfo =
transform.applicationExitInfoFromJson(testAppExitInfoJson);
assertNotSame(reifiedAppExitInfo, testAppExitInfo);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -889,8 +889,9 @@ private void writeApplicationExitInfoEventIfRelevant(String sessionId) {
if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
ActivityManager activityManager =
(ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
// Gets the latest app exit info.
List<ApplicationExitInfo> applicationExitInfoList =
activityManager.getHistoricalProcessExitReasons(null, 0, 0);
activityManager.getHistoricalProcessExitReasons(null, 0, 1);

// Passes the latest applicationExitInfo to ReportCoordinator, which persists it if it
// happened during the session.
Expand All @@ -905,6 +906,9 @@ private void writeApplicationExitInfoEventIfRelevant(String sessionId) {
relevantSessionLogManager,
relevantUserMetadata);
}
} else {
Logger.getLogger()
.v("ANR feature enabled, but device is API " + android.os.Build.VERSION.SDK_INT);
}
}
// endregion
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public String eventToJson(@NonNull CrashlyticsReport.Session.Event event) {
}

@NonNull
public String appExitInfoToJson(
public String applicationExitInfoToJson(
@NonNull CrashlyticsReport.ApplicationExitInfo applicationExitInfo) {
return CRASHLYTICS_REPORT_JSON_ENCODER.encode(applicationExitInfo);
}
Expand Down

0 comments on commit 3ebad98

Please sign in to comment.