Statsd - adb cmd for AppHook; long compare support

1. Create an adb command for statsd to let the adb user write AppHook to
the StatsLog buffer.
This can be used in the CTS tests (instead of relying on screen state
changes, etc. for conditioning), and for local testing.

2. Fixes the fact that AppHook loggers can spoof uids (they can put
whatever uid they want and statsd doesn't validate it - now it will).

3. Allow FieldValueMatcher to compare longs (not just ints).

Fix: 72266788
Fix: 72836157
Fix: 72872130
Fix: 72829733

Test: manually did the adb command.

Test: run cts-dev -m CtsStatsdHostTestCases -t android.cts.statsd.alert.AnomalyDetectionTests

Test: locally modified
android.cts.statsd.alert.BroadcastSubscriberTests#testBroadcastSubscriber
to have the app attempt both valid and invalid AppHook writes.

Change-Id: I68931a71805bcfa6fe56e7a0a0d3f07290cb78d1
diff --git a/cmds/statsd/src/StatsService.h b/cmds/statsd/src/StatsService.h
index fd3ed1d..109752b 100644
--- a/cmds/statsd/src/StatsService.h
+++ b/cmds/statsd/src/StatsService.h
@@ -183,6 +183,11 @@
     status_t cmd_write_data_to_disk(FILE* out);
 
     /**
+     * Write an AppHook event to the StatsLog buffer, as though StatsLog.write(APP_HOOK).
+     */
+    status_t cmd_log_app_hook(FILE* out, const Vector<String8>& args);
+
+    /**
      * Print contents of a pulled metrics source.
      */
     status_t cmd_print_pulled_metrics(FILE* out, const Vector<String8>& args);