summaryrefslogtreecommitdiff
path: root/PermissionController/src/com/android/permissioncontroller/DumpableLog.kt
diff options
context:
space:
mode:
authorPhilip P. Moltmann <moltmann@google.com>2020-05-07 22:59:29 -0700
committerPhilip P. Moltmann <moltmann@google.com>2020-05-11 14:30:54 -0700
commit9967c6b39dcf13e56ab29018647c95d0f0161e52 (patch)
treebd5a71799ada83d7c05cb5bac50dc9a7f59a8da8 /PermissionController/src/com/android/permissioncontroller/DumpableLog.kt
parent84852f875a264d9a8984cf6c5cccb5747b1613cf (diff)
downloadPermission-9967c6b39dcf13e56ab29018647c95d0f0161e52.tar.gz
Dump auto revoke state
- encapsulate all state intersting to auto-revoke in live-data - convert the state into proto - dump the proto The proto is more than just a fancy way of formatting data. In S the proto will be official incident report and hence accessible in tests and to automated processing. Bug: 155680199 Test: dumpsys permissionmgr Change-Id: I642dc369a9760cdce9407e82a96793fd3f4f548e
Diffstat (limited to 'PermissionController/src/com/android/permissioncontroller/DumpableLog.kt')
-rw-r--r--PermissionController/src/com/android/permissioncontroller/DumpableLog.kt9
1 files changed, 3 insertions, 6 deletions
diff --git a/PermissionController/src/com/android/permissioncontroller/DumpableLog.kt b/PermissionController/src/com/android/permissioncontroller/DumpableLog.kt
index 0b482fcd3..c7fa577cd 100644
--- a/PermissionController/src/com/android/permissioncontroller/DumpableLog.kt
+++ b/PermissionController/src/com/android/permissioncontroller/DumpableLog.kt
@@ -19,7 +19,6 @@ package com.android.permissioncontroller
import android.util.Log
import com.android.permissioncontroller.Constants.LOGS_TO_DUMP_FILE
import java.io.File
-import java.io.PrintWriter
/**
* Like {@link Log} but stores the logs in a file which can later be dumped via {@link #dump}
@@ -90,13 +89,11 @@ object DumpableLog {
}
/**
- * Write the previously logged entries to the print writer.
- *
- * @param pw the writer to dump to
+ * @return the previously logged entries
*/
- fun dump(pw: PrintWriter) {
+ suspend fun get(): List<String> {
synchronized(lock) {
- file.forEachLine { pw.println(it) }
+ return file.readLines()
}
}
} \ No newline at end of file