Fix formatting string in PolicyVersionUpgrade
The format string had an extra '%s' which was presumably for the
Exception string, but Slog.e already captures that.
Bug: 217923092
Test: errorprone build
Change-Id: I523bd94b65f00bc0332a2c3e3c8ed28de2df1974
diff --git a/services/Android.bp b/services/Android.bp
index 654e8d0..b40034a 100644
--- a/services/Android.bp
+++ b/services/Android.bp
@@ -20,6 +20,7 @@
"-Xep:NullTernary:ERROR",
"-Xep:TryFailThrowable:ERROR",
"-Xep:HashtableContains:ERROR",
+ "-Xep:FormatString:ERROR",
// NOTE: only enable to generate local patchfiles
// "-XepPatchChecks:refaster:frameworks/base/errorprone/refaster/EfficientXml.java.refaster",
// "-XepPatchLocation:/tmp/refaster/",
diff --git a/services/devicepolicy/java/com/android/server/devicepolicy/PolicyVersionUpgrader.java b/services/devicepolicy/java/com/android/server/devicepolicy/PolicyVersionUpgrader.java
index 6bc7ba6..f0ceb31 100644
--- a/services/devicepolicy/java/com/android/server/devicepolicy/PolicyVersionUpgrader.java
+++ b/services/devicepolicy/java/com/android/server/devicepolicy/PolicyVersionUpgrader.java
@@ -184,7 +184,7 @@
Files.write(file.toPath(), versionBytes);
versionFile.commit();
} catch (IOException e) {
- Slog.e(LOG_TAG, String.format("Writing version %d failed: %s", version), e);
+ Slog.e(LOG_TAG, String.format("Writing version %d failed", version), e);
versionFile.rollback();
}
}