summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2012-05-08 18:54:22 -0700
committerDianne Hackborn <hackbod@google.com>2012-05-09 14:53:26 -0700
commit555f89d8df316cdc5a25dbedb8614c2ac7a5e0a9 (patch)
tree0fdfb7381cd68f8fbdccad45417653e0231bb3d1 /include
parent161534a3c5ee77bc91e7a73ffb6274f35324f8b5 (diff)
downloadframeworks_native-555f89d8df316cdc5a25dbedb8614c2ac7a5e0a9.zip
frameworks_native-555f89d8df316cdc5a25dbedb8614c2ac7a5e0a9.tar.gz
frameworks_native-555f89d8df316cdc5a25dbedb8614c2ac7a5e0a9.tar.bz2
Add callback hack to find out when to reload system properties.
Every IBinder object can accept a new transaction to tell it that it might want to reload system properties, and in the process anyone can register a callback to be executed when this happens. Use this to reload the trace property. This is very much ONLY for debugging. Change-Id: I55c67c46f8f3fa9073bef0dfaab4577ed1d47eb4
Diffstat (limited to 'include')
-rw-r--r--include/binder/IBinder.h1
-rw-r--r--include/utils/Trace.h5
-rw-r--r--include/utils/misc.h4
3 files changed, 10 insertions, 0 deletions
diff --git a/include/binder/IBinder.h b/include/binder/IBinder.h
index 81b56c2..8b84951 100644
--- a/include/binder/IBinder.h
+++ b/include/binder/IBinder.h
@@ -51,6 +51,7 @@ public:
PING_TRANSACTION = B_PACK_CHARS('_','P','N','G'),
DUMP_TRANSACTION = B_PACK_CHARS('_','D','M','P'),
INTERFACE_TRANSACTION = B_PACK_CHARS('_', 'N', 'T', 'F'),
+ SYSPROPS_TRANSACTION = B_PACK_CHARS('_', 'S', 'P', 'R'),
// Corresponds to TF_ONE_WAY -- an asynchronous call.
FLAG_ONEWAY = 0x00000001
diff --git a/include/utils/Trace.h b/include/utils/Trace.h
index 62f5d6b..984cd46 100644
--- a/include/utils/Trace.h
+++ b/include/utils/Trace.h
@@ -121,11 +121,16 @@ private:
}
}
+ static void changeCallback();
+
// init opens the trace marker file for writing and reads the
// atrace.tags.enableflags system property. It does this only the first
// time it is run, using sMutex for synchronization.
static void init();
+ // retrieve the current value of the system property.
+ static void loadSystemProperty();
+
// sIsReady is a boolean value indicating whether a call to init() has
// completed in this process. It is initialized to 0 and set to 1 when the
// first init() call completes. It is set to 1 even if a failure occurred
diff --git a/include/utils/misc.h b/include/utils/misc.h
index 23f2a4c..d7d5bc1 100644
--- a/include/utils/misc.h
+++ b/include/utils/misc.h
@@ -88,6 +88,10 @@ void strreverse(char* begin, char* end);
void k_itoa(int value, char* str, int base);
char* itoa(int val, int base);
+typedef void (*sysprop_change_callback)(void);
+void add_sysprop_change_callback(sysprop_change_callback cb, int priority);
+void report_sysprop_change();
+
}; // namespace android
#endif // _LIBS_UTILS_MISC_H