summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorGeremy Condra <gcondra@google.com>2012-09-17 13:29:56 -0700
committerGeremy Condra <gcondra@google.com>2012-09-17 16:06:17 -0700
commitbeb9d53971af42db178dfdf6bbcd28d3f823c5f8 (patch)
tree52e9008379dec6a1090d19d809f83e651a46940e /services
parente2fb51900cb6df51b2dffc80c35ecbbaf47d3f4b (diff)
downloadframeworks_base-beb9d53971af42db178dfdf6bbcd28d3f823c5f8.zip
frameworks_base-beb9d53971af42db178dfdf6bbcd28d3f823c5f8.tar.gz
frameworks_base-beb9d53971af42db178dfdf6bbcd28d3f823c5f8.tar.bz2
Add error information to event logs.
Change-Id: Ie4bbb888f4fac4db42a60b9fdd6818af24b834bd
Diffstat (limited to 'services')
-rw-r--r--services/java/com/android/server/updatable/ConfigUpdateInstallReceiver.java17
1 files changed, 12 insertions, 5 deletions
diff --git a/services/java/com/android/server/updatable/ConfigUpdateInstallReceiver.java b/services/java/com/android/server/updatable/ConfigUpdateInstallReceiver.java
index c1f45a8..a74a648 100644
--- a/services/java/com/android/server/updatable/ConfigUpdateInstallReceiver.java
+++ b/services/java/com/android/server/updatable/ConfigUpdateInstallReceiver.java
@@ -89,12 +89,15 @@ public class ConfigUpdateInstallReceiver extends BroadcastReceiver {
// get the hash of the currently used value
String currentHash = getCurrentHash(getCurrentContent());
if (!verifyVersion(currentVersion, altVersion)) {
- Slog.e(TAG, "New version is not greater than current version, aborting!");
+ EventLog.writeEvent(EventLogTags.CONFIG_INSTALL_FAILED,
+ "New version is not greater than current version");
} else if (!verifyPreviousHash(currentHash, altRequiredHash)) {
- Slog.e(TAG, "Current hash did not match required value, aborting!");
+ EventLog.writeEvent(EventLogTags.CONFIG_INSTALL_FAILED,
+ "Current hash did not match required value");
} else if (!verifySignature(altContent, altVersion, altRequiredHash, altSig,
cert)) {
- Slog.e(TAG, "Signature did not verify, aborting!");
+ EventLog.writeEvent(EventLogTags.CONFIG_INSTALL_FAILED,
+ "Signature did not verify");
} else {
// install the new content
Slog.i(TAG, "Found new update, installing...");
@@ -103,8 +106,12 @@ public class ConfigUpdateInstallReceiver extends BroadcastReceiver {
}
} catch (Exception e) {
Slog.e(TAG, "Could not update content!", e);
- EventLog.writeEvent(EventLogTags.CONFIG_INSTALL_FAILED,
- updateDir.toString());
+ // keep the error message <= 100 chars
+ String errMsg = e.toString();
+ if (errMsg.length() > 100) {
+ errMsg = errMsg.substring(0, 99);
+ }
+ EventLog.writeEvent(EventLogTags.CONFIG_INSTALL_FAILED, errMsg);
}
}
}.start();