summaryrefslogtreecommitdiffstats
path: root/Android.bp
diff options
context:
space:
mode:
authorIgor Murashkin <iam@google.com>2019-10-03 16:39:50 -0700
committerIgor Murashkin <iam@google.com>2019-10-08 10:37:24 -0700
commit03e5b0549ff65af5304654b69467516e00e6d2b1 (patch)
tree505cbbb618befa7933a1bc97c1301f8b5d8f77cb /Android.bp
parent2f1134067947b6d658d8dbf1f143632591078ff6 (diff)
downloadplatform_system_iorap-03e5b0549ff65af5304654b69467516e00e6d2b1.tar.gz
platform_system_iorap-03e5b0549ff65af5304654b69467516e00e6d2b1.tar.bz2
platform_system_iorap-03e5b0549ff65af5304654b69467516e00e6d2b1.zip
db: Track app launch history with sqlite db
Add support for sqlite3 database. Track the application launches' metrics by inserting new rows into the database. Test: manual (launch app and then check /data/misc/iorapd/sqlite.db) Bug: 137786053 Change-Id: I0fa337926a4aad05495b00ebee6a0b3e815d6af7
Diffstat (limited to 'Android.bp')
-rw-r--r--Android.bp64
1 files changed, 64 insertions, 0 deletions
diff --git a/Android.bp b/Android.bp
index 9363a2a..a4e79bd 100644
--- a/Android.bp
+++ b/Android.bp
@@ -127,10 +127,12 @@ cc_defaults {
static_libs: [
"libiorap-perfetto",
"libiorap-prefetcher",
+ "libiorap-db",
],
defaults: [
"libiorap-perfetto-default-dependencies",
"libiorap-prefetcher-default-dependencies",
+ "libiorap-db-default-dependencies",
],
// Users of 'libiorap-manager' also need to include these defaults to avoid
// linking errors.
@@ -519,3 +521,65 @@ cc_binary {
static_libs: [
],
}
+
+// Static libraries cannot export their dependencies,
+// the current convention is to use an extra 'defaults' rule for statics
+// to bring in all the dependencies.
+cc_defaults {
+ name: "libiorap-db-default-dependencies",
+
+ defaults: [
+ ],
+
+ include_dirs: [],
+ static_libs: [
+ ],
+ shared_libs: [
+ "libsqlite",
+ ],
+}
+
+cc_library_static {
+ name: "libiorap-db",
+ defaults: [
+ "iorap-default-flags",
+ "iorap-default-dependencies",
+ "libiorap-db-default-dependencies",
+ ],
+
+ srcs: [
+ "src/db/**/*.cc",
+ ],
+}
+
+cc_binary {
+ name: "iorap.cmd.db",
+ defaults: [
+ "iorap-default-flags",
+ "iorap-default-dependencies",
+ "libiorap-db-default-dependencies",
+ ],
+ shared_libs: [],
+ include_dirs: [],
+ srcs: [
+ "src/db/**/*.cc",
+ ],
+ // Easier debugging. TODO: make a separate debug config.
+ // XX: Using -O0 seems to completely hide some errors.
+ cflags: ["-O2", "-UNDEBUG", "-DIORAP_DB_MAIN=1"],
+ sanitize: {
+ undefined: true,
+ all_undefined: true,
+ // Pretty print when ubsan detects a problem.
+ // Otherwise it just calls abort().
+
+/*
+ diag: {
+ undefined: true,
+ },
+ */ // don't use the diag when you want it to crash.
+ },
+
+ static_libs: [
+ ],
+}