Cleaning lint/checkstyle issues.
Cherry-picking this CL from master branch.
Will annotate method with @Override in a next incoming CL.
Fixes: 150323630
Test: atest CarServiceTest|CarServiceUnitTest|CtsCarTestCases
Change-Id: I450b2222b4c8ba65344d4f9926715a4680ddbff8
Merged-In: I450b2222b4c8ba65344d4f9926715a4680ddbff8
diff --git a/car-lib/src/android/car/storagemonitoring/WearEstimate.java b/car-lib/src/android/car/storagemonitoring/WearEstimate.java
index ee6aa31..07ef4c7 100644
--- a/car-lib/src/android/car/storagemonitoring/WearEstimate.java
+++ b/car-lib/src/android/car/storagemonitoring/WearEstimate.java
@@ -47,11 +47,10 @@
public static final WearEstimate UNKNOWN_ESTIMATE = new WearEstimate(UNKNOWN, UNKNOWN);
public static final Parcelable.Creator<WearEstimate> CREATOR =
- new Parcelable.Creator<WearEstimate>() {
- public WearEstimate createFromParcel(Parcel in) {
+ new Parcelable.Creator<WearEstimate>() {
+ public WearEstimate createFromParcel(Parcel in) {
return new WearEstimate(in);
}
-
public WearEstimate[] newArray(int size) {
return new WearEstimate[size];
}
@@ -60,16 +59,16 @@
/**
* Wear estimate data for "type A" storage.
*/
- @IntRange(from=-1, to=100)
+ @IntRange(from = -1, to = 100)
public final int typeA;
/**
* Wear estimate data for "type B" storage.
*/
- @IntRange(from=-1, to=100)
+ @IntRange(from = -1, to = 100)
public final int typeB;
- private static final int validateWearValue(int value) {
+ private static int validateWearValue(int value) {
if (value == UNKNOWN) return value;
if ((value >= 0) && (value <= 100)) return value;
throw new IllegalArgumentException(value + " is not a valid wear estimate");
@@ -137,7 +136,7 @@
@Override
public boolean equals(Object other) {
if (other instanceof WearEstimate) {
- WearEstimate wo = (WearEstimate)other;
+ WearEstimate wo = (WearEstimate) other;
return wo.typeA == typeA && wo.typeB == typeB;
}
return false;
@@ -148,7 +147,7 @@
return Objects.hash(typeA, typeB);
}
- private static final String wearValueToString(int value) {
+ private static String wearValueToString(int value) {
if (value == UNKNOWN) return "unknown";
return value + "%";
}
diff --git a/car-lib/src/android/car/storagemonitoring/WearEstimateChange.java b/car-lib/src/android/car/storagemonitoring/WearEstimateChange.java
index 2d454b4..a2839d5 100644
--- a/car-lib/src/android/car/storagemonitoring/WearEstimateChange.java
+++ b/car-lib/src/android/car/storagemonitoring/WearEstimateChange.java
@@ -15,15 +15,16 @@
*/
package android.car.storagemonitoring;
+import static java.util.Objects.requireNonNull;
+
import android.annotation.NonNull;
import android.annotation.SystemApi;
import android.os.Parcel;
import android.os.Parcelable;
+
import java.time.Instant;
import java.util.Objects;
-import static java.util.Objects.requireNonNull;
-
/**
* Change in wear-out information.
*
@@ -35,15 +36,15 @@
@SystemApi
public final class WearEstimateChange implements Parcelable {
public static final Parcelable.Creator<WearEstimateChange> CREATOR =
- new Parcelable.Creator<WearEstimateChange>() {
- public WearEstimateChange createFromParcel(Parcel in) {
- return new WearEstimateChange(in);
- }
+ new Parcelable.Creator<WearEstimateChange>() {
+ public WearEstimateChange createFromParcel(Parcel in) {
+ return new WearEstimateChange(in);
+ }
- public WearEstimateChange[] newArray(int size) {
+ public WearEstimateChange[] newArray(int size) {
return new WearEstimateChange[size];
}
- };
+ };
/**
* The previous wear estimate.
@@ -110,12 +111,12 @@
@Override
public boolean equals(Object other) {
if (other instanceof WearEstimateChange) {
- WearEstimateChange wo = (WearEstimateChange)other;
- return wo.isAcceptableDegradation == isAcceptableDegradation &&
- wo.uptimeAtChange == uptimeAtChange &&
- wo.dateAtChange.equals(dateAtChange) &&
- wo.oldEstimate.equals(oldEstimate) &&
- wo.newEstimate.equals(newEstimate);
+ WearEstimateChange wo = (WearEstimateChange) other;
+ return wo.isAcceptableDegradation == isAcceptableDegradation
+ && wo.uptimeAtChange == uptimeAtChange
+ && wo.dateAtChange.equals(dateAtChange)
+ && wo.oldEstimate.equals(oldEstimate)
+ && wo.newEstimate.equals(newEstimate);
}
return false;
}