summaryrefslogtreecommitdiff
path: root/startop/iorap
diff options
context:
space:
mode:
authorYan Wang <yawanng@google.com>2020-04-01 18:47:30 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2020-04-01 18:47:30 +0000
commitb4b806dd7a49a505be2609ff5ec0f8a9db9e436b (patch)
treeb097223aa4c301af6ea0eb95593f599cdf6d0336 /startop/iorap
parentb69f2bc126be5882d9759378cf68f0d267bd8983 (diff)
parentb5d1353a6998e97aa4f5250a359fc2589b4af34c (diff)
Merge "startop: Fix a string format bug in EventSequenceValidator." into rvc-dev
Diffstat (limited to 'startop/iorap')
-rw-r--r--startop/iorap/src/com/google/android/startop/iorap/EventSequenceValidator.java23
1 files changed, 8 insertions, 15 deletions
diff --git a/startop/iorap/src/com/google/android/startop/iorap/EventSequenceValidator.java b/startop/iorap/src/com/google/android/startop/iorap/EventSequenceValidator.java
index 47bf14892ccb..6b194550cc11 100644
--- a/startop/iorap/src/com/google/android/startop/iorap/EventSequenceValidator.java
+++ b/startop/iorap/src/com/google/android/startop/iorap/EventSequenceValidator.java
@@ -103,8 +103,7 @@ public class EventSequenceValidator implements ActivityMetricsLaunchObserver {
@Override
public void onIntentStarted(@NonNull Intent intent, long timestampNs) {
if (state == State.UNKNOWN) {
- logWarningWithStackTrace(
- String.format("IntentStarted during UNKNOWN. " + intent));
+ logWarningWithStackTrace("IntentStarted during UNKNOWN. " + intent);
incAccIntentStartedEvents();
return;
}
@@ -128,7 +127,7 @@ public class EventSequenceValidator implements ActivityMetricsLaunchObserver {
@Override
public void onIntentFailed() {
if (state == State.UNKNOWN) {
- logWarningWithStackTrace(String.format("onIntentFailed during UNKNOWN."));
+ logWarningWithStackTrace("onIntentFailed during UNKNOWN.");
decAccIntentStartedEvents();
return;
}
@@ -147,8 +146,7 @@ public class EventSequenceValidator implements ActivityMetricsLaunchObserver {
public void onActivityLaunched(@NonNull @ActivityRecordProto byte[] activity,
@Temperature int temperature) {
if (state == State.UNKNOWN) {
- logWarningWithStackTrace(
- String.format("onActivityLaunched during UNKNOWN."));
+ logWarningWithStackTrace("onActivityLaunched during UNKNOWN.");
return;
}
if (state != State.INTENT_STARTED) {
@@ -165,8 +163,7 @@ public class EventSequenceValidator implements ActivityMetricsLaunchObserver {
@Override
public void onActivityLaunchCancelled(@Nullable @ActivityRecordProto byte[] activity) {
if (state == State.UNKNOWN) {
- logWarningWithStackTrace(
- String.format("onActivityLaunchCancelled during UNKNOWN."));
+ logWarningWithStackTrace("onActivityLaunchCancelled during UNKNOWN.");
decAccIntentStartedEvents();
return;
}
@@ -185,8 +182,7 @@ public class EventSequenceValidator implements ActivityMetricsLaunchObserver {
public void onActivityLaunchFinished(@NonNull @ActivityRecordProto byte[] activity,
long timestampNs) {
if (state == State.UNKNOWN) {
- logWarningWithStackTrace(
- String.format("onActivityLaunchFinished during UNKNOWN."));
+ logWarningWithStackTrace("onActivityLaunchFinished during UNKNOWN.");
decAccIntentStartedEvents();
return;
}
@@ -206,8 +202,7 @@ public class EventSequenceValidator implements ActivityMetricsLaunchObserver {
public void onReportFullyDrawn(@NonNull @ActivityRecordProto byte[] activity,
long timestampNs) {
if (state == State.UNKNOWN) {
- logWarningWithStackTrace(
- String.format("onReportFullyDrawn during UNKNOWN."));
+ logWarningWithStackTrace("onReportFullyDrawn during UNKNOWN.");
return;
}
if (state == State.INIT) {
@@ -237,8 +232,7 @@ public class EventSequenceValidator implements ActivityMetricsLaunchObserver {
private void incAccIntentStartedEvents() {
if (accIntentStartedEvents < 0) {
- throw new AssertionError(
- String.format("The number of unknowns cannot be negative"));
+ throw new AssertionError("The number of unknowns cannot be negative");
}
if (accIntentStartedEvents == 0) {
state = State.UNKNOWN;
@@ -250,8 +244,7 @@ public class EventSequenceValidator implements ActivityMetricsLaunchObserver {
private void decAccIntentStartedEvents() {
if (accIntentStartedEvents <= 0) {
- throw new AssertionError(
- String.format("The number of unknowns cannot be negative"));
+ throw new AssertionError("The number of unknowns cannot be negative");
}
if(accIntentStartedEvents == 1) {
state = State.INIT;