summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/linux/seemp_instrumentation.h156
-rw-r--r--include/uapi/linux/Kbuild2
-rw-r--r--include/uapi/linux/seemp_api.h418
-rw-r--r--include/uapi/linux/seemp_param_id.h70
4 files changed, 646 insertions, 0 deletions
diff --git a/include/linux/seemp_instrumentation.h b/include/linux/seemp_instrumentation.h
new file mode 100644
index 000000000000..bd53d0d22ff2
--- /dev/null
+++ b/include/linux/seemp_instrumentation.h
@@ -0,0 +1,156 @@
+/*
+ * Copyright (c) 2015, The Linux Foundation. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 and
+ * only version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+*/
+#ifndef __SEEMP_LOGK_STUB__
+#define __SEEMP_LOGK_STUB__
+
+#ifdef CONFIG_SEEMP_CORE
+#include <linux/kernel.h>
+
+#define MAX_BUF_SIZE 188
+
+#define SEEMP_LOGK_API_SIZE sizeof(int)
+
+/* Write: api_id + skip encoding byte + params */
+#define SEEMP_LOGK_RECORD(api_id, format, ...) do { \
+ *((int *)(buf - SEEMP_LOGK_API_SIZE)) = api_id; \
+ snprintf(buf + 1, MAX_BUF_SIZE - 1, format, ##__VA_ARGS__); \
+} while (0)
+
+extern void *(*seemp_logk_kernel_begin)(char **buf);
+extern void (*seemp_logk_kernel_end)(void *blck);
+
+static inline void *seemp_setup_buf(char **buf)
+{
+ void *blck;
+
+ if (seemp_logk_kernel_begin && seemp_logk_kernel_end) {
+ blck = seemp_logk_kernel_begin(buf);
+ if (!*buf) {
+ seemp_logk_kernel_end(blck);
+ return NULL;
+ }
+ } else {
+ return NULL;
+ }
+ return blck;
+}
+/*
+ * NOTE: only sendto is going to be instrumented
+ * since send sys call internally calls sendto
+ * with 2 extra parameters
+ */
+static inline void seemp_logk_sendto(int fd, void __user *buff, size_t len,
+ unsigned flags, struct sockaddr __user *addr, int addr_len)
+{
+ char *buf = NULL;
+ void *blck = NULL;
+
+ /*sets up buf and blck correctly*/
+ blck = seemp_setup_buf(&buf);
+ if (!blck)
+ return;
+
+ /*fill the buf*/
+ SEEMP_LOGK_RECORD(SEEMP_API_kernel__sendto, "len=%u,fd=%d",
+ (unsigned int)len, fd);
+
+ seemp_logk_kernel_end(blck);
+}
+
+/*
+ * NOTE: only recvfrom is going to be instrumented
+ * since recv sys call internally calls recvfrom
+ * with 2 extra parameters
+ */
+static inline void seemp_logk_recvfrom(int fd, void __user *ubuf,
+ size_t size, unsigned flags, struct sockaddr __user *addr,
+ int __user *addr_len)
+{
+ char *buf = NULL;
+ void *blck = NULL;
+
+ /*sets up buf and blck correctly*/
+ blck = seemp_setup_buf(&buf);
+ if (!blck)
+ return;
+
+ /*fill the buf*/
+ SEEMP_LOGK_RECORD(SEEMP_API_kernel__recvfrom, "size=%u,fd=%d",
+ (unsigned int)size, fd);
+
+ seemp_logk_kernel_end(blck);
+}
+
+static inline void seemp_logk_oom_adjust_write(pid_t pid,
+ kuid_t uid, int oom_adj)
+{
+ char *buf = NULL;
+ void *blck = NULL;
+
+ /*sets up buf and blck correctly*/
+ blck = seemp_setup_buf(&buf);
+ if (!blck)
+ return;
+
+ /*fill the buf*/
+ SEEMP_LOGK_RECORD(SEEMP_API_kernel__oom_adjust_write,
+ "app_uid=%d,app_pid=%d,oom_adj=%d",
+ uid.val, pid, oom_adj);
+
+ seemp_logk_kernel_end(blck);
+}
+
+static inline void seemp_logk_oom_score_adj_write(pid_t pid, kuid_t uid,
+ int oom_adj_score)
+{
+ char *buf = NULL;
+ void *blck = NULL;
+
+ /*sets up buf and blck correctly*/
+ blck = seemp_setup_buf(&buf);
+ if (!blck)
+ return;
+
+ /*fill the buf*/
+ snprintf(buf, MAX_BUF_SIZE,
+ "-1|kernel|oom_score_adj_write|app_uid=%d,app_pid=%d,oom_adj=%d|--end",
+ uid.val, pid, oom_adj_score);
+
+ seemp_logk_kernel_end(blck);
+}
+
+#else
+static inline void seemp_logk_sendto(int fd, void __user *buff,
+ size_t len, unsigned flags, struct sockaddr __user *addr,
+ int addr_len)
+{
+}
+
+static inline void seemp_logk_recvfrom
+ (int fd, void __user *ubuf, size_t size,
+ unsigned flags, struct sockaddr __user *addr,
+ int __user *addr_len)
+{
+}
+
+static inline void seemp_logk_oom_adjust_write
+ (pid_t pid, kuid_t uid, int oom_adj)
+{
+}
+
+static inline void seemp_logk_oom_score_adj_write
+ (pid_t pid, kuid_t uid, int oom_adj_score)
+{
+}
+#endif
+#endif
diff --git a/include/uapi/linux/Kbuild b/include/uapi/linux/Kbuild
index 70585dfddafe..1e9d279b9536 100644
--- a/include/uapi/linux/Kbuild
+++ b/include/uapi/linux/Kbuild
@@ -379,6 +379,8 @@ header-y += sctp.h
header-y += sdla.h
header-y += seccomp.h
header-y += securebits.h
+header-y += seemp_api.h
+header-y += seemp_param_id.h
header-y += selinux_netlink.h
header-y += sem.h
header-y += serial_core.h
diff --git a/include/uapi/linux/seemp_api.h b/include/uapi/linux/seemp_api.h
new file mode 100644
index 000000000000..38ed8e3fba12
--- /dev/null
+++ b/include/uapi/linux/seemp_api.h
@@ -0,0 +1,418 @@
+#ifndef _SEEMP_API_H_
+#define _SEEMP_API_H_
+
+#define SEEMP_API_kernel__oom_adjust_write 0
+#define SEEMP_API_kernel__sendto 1
+#define SEEMP_API_kernel__recvfrom 2
+#define SEEMP_API_View__onTouchEvent 3
+#define SEEMP_API_View__onKeyDown 4
+#define SEEMP_API_View__onKeyUp 5
+#define SEEMP_API_View__onTrackBallEvent 6
+#define SEEMP_API_PhoneNumberUtils__getDeviceSoftwareVersion 7
+#define SEEMP_API_apS__get_ANDROID_ID_ 8
+#define SEEMP_API_TelephonyManager__getDeviceId 9
+#define SEEMP_API_TelephonyManager__getSimSerialNumber 10
+#define SEEMP_API_TelephonyManager__getLine1Number 11
+#define SEEMP_API_PhoneNumberUtils__getNumberFromIntent 12
+#define SEEMP_API_Telephony__query 13
+#define SEEMP_API_CallerInfo__getCallerId 14
+#define SEEMP_API_CallerInfo__getCallerInfo 15
+#define SEEMP_API_ContentResolver__query 16
+#define SEEMP_API_AccountManagerService__getPassword 17
+#define SEEMP_API_AccountManagerService__getUserData 18
+#define SEEMP_API_AccountManagerService__addAccount 19
+#define SEEMP_API_AccountManagerService__removeAccount 20
+#define SEEMP_API_AccountManagerService__setPassword 21
+#define SEEMP_API_AccountManagerService__clearPassword 22
+#define SEEMP_API_AccountManagerService__setUserData 23
+#define SEEMP_API_AccountManagerService__editProperties 24
+#define SEEMP_API_AM__getPassword 25
+#define SEEMP_API_AM__getUserData 26
+#define SEEMP_API_AM__addAccountExplicitly 27
+#define SEEMP_API_AM__removeAccount 28
+#define SEEMP_API_AM__setPassword 29
+#define SEEMP_API_AM__clearPassword 30
+#define SEEMP_API_AM__setUserData 31
+#define SEEMP_API_AM__addAccount 32
+#define SEEMP_API_AM__editProperties 33
+#define SEEMP_API_AM__doWork 34
+#define SEEMP_API_Browser__addSearchUrl 35
+#define SEEMP_API_Browser__canClearHistory 36
+#define SEEMP_API_Browser__ClearHistory 37
+#define SEEMP_API_Browser__deleteFromHistory 38
+#define SEEMP_API_Browser__deleteHistoryTimeFrame 39
+#define SEEMP_API_Browser__deleteHistoryWhere 40
+#define SEEMP_API_Browser__getAllBookmarks 41
+#define SEEMP_API_Browser__getAllVisitedUrls 42
+#define SEEMP_API_Browser__getVisitedHistory 43
+#define SEEMP_API_Browser__getVisitedLike 44
+#define SEEMP_API_Browser__requestAllIcons 45
+#define SEEMP_API_Browser__truncateHistory 46
+#define SEEMP_API_Browser__updateVisitedHistory 47
+#define SEEMP_API_Browser__clearSearches 48
+#define SEEMP_API_WebIconDatabase__bulkRequestIconForPageUrl 49
+#define SEEMP_API_ContentResolver__insert 50
+#define SEEMP_API_CalendarContract__insert 51
+#define SEEMP_API_CalendarContract__alarmExists 52
+#define SEEMP_API_CalendarContract__findNextAlarmTime 53
+#define SEEMP_API_CalendarContract__query 54
+#define SEEMP_API_LocationManager___requestLocationUpdates 55
+#define SEEMP_API_LocationManager__addGpsStatusListener 56
+#define SEEMP_API_LocationManager__addNmeaListener 57
+#define SEEMP_API_LocationManager__addProximityAlert 58
+#define SEEMP_API_LocationManager__getBestProvider 59
+#define SEEMP_API_LocationManager__getLastKnownLocation 60
+#define SEEMP_API_LocationManager__getProvider 61
+#define SEEMP_API_LocationManager__getProviders 62
+#define SEEMP_API_LocationManager__isProviderEnabled 63
+#define SEEMP_API_LocationManager__requestLocationUpdates 64
+#define SEEMP_API_LocationManager__sendExtraCommand 65
+#define SEEMP_API_TelephonyManager__getCellLocation 66
+#define SEEMP_API_TelephonyManager__getNeighboringCellInfo 67
+#define SEEMP_API_GeolocationService__registerForLocationUpdates 68
+#define SEEMP_API_GeolocationService__setEnableGps 69
+#define SEEMP_API_GeolocationService__start 70
+#define SEEMP_API_WebChromeClient__onGeolocationPermissionsShowPrompt 71
+#define SEEMP_API_WifiManager__getScanResults 72
+#define SEEMP_API_abB__enable 73
+#define SEEMP_API_abB__disable 74
+#define SEEMP_API_abB__startDiscovery 75
+#define SEEMP_API_abB__listenUsingInsecureRfcommWithServiceRecord 76
+#define SEEMP_API_abB__listenUsingSecureRfcommWithServiceRecord 77
+#define SEEMP_API_abB__getBondedDevices 78
+#define SEEMP_API_abB__getRemoteDevice 79
+#define SEEMP_API_abB__getState 80
+#define SEEMP_API_abB__getProfileConnectionState 81
+#define SEEMP_API_Camera__takePicture 82
+#define SEEMP_API_Camera__setPreviewCallback 83
+#define SEEMP_API_Camera__setPreviewCallbackWithBuffer 84
+#define SEEMP_API_Camera__setOneShotPreviewCallback 85
+#define SEEMP_API_MediaRecorder__start 86
+#define SEEMP_API_MediaRecorder__stop 87
+#define SEEMP_API_AudioRecord__startRecording 88
+#define SEEMP_API_AudioRecord__start 89
+#define SEEMP_API_AudioRecord__stop 90
+#define SEEMP_API_SpeechRecognizer__startListening 91
+#define SEEMP_API_at_SmsManager__sendDataMessage 92
+#define SEEMP_API_at_SmsManager__sendMultipartTextMessage 93
+#define SEEMP_API_at_SmsManager__sendTextMessage 94
+#define SEEMP_API_at_gsm_SmsManager__sendDataMessage 95
+#define SEEMP_API_at_gsm_SmsManager__sendMultipartTextMessage 96
+#define SEEMP_API_at_gsm_SmsManager__sendTextMessage 97
+#define SEEMP_API_at_SmsManager__copyMessageToIcc 98
+#define SEEMP_API_at_SmsManager__deleteMessageFromIcc 99
+#define SEEMP_API_at_SmsManager__updateMessageOnIcc 100
+#define SEEMP_API_at_gsm_SmsManager__copyMessageToSim 101
+#define SEEMP_API_at_gsm_SmsManager__deleteMessageFromSim 102
+#define SEEMP_API_at_gsm_SmsManager__updateMessageOnSim 103
+#define SEEMP_API_at_gsm_SmsManager__getAllMessagesFromSim 104
+#define SEEMP_API_ah_SEL__onAccuracyChanged_ACCELEROMETER_ 105
+#define SEEMP_API_ah_SEL__onSensorChanged_ACCELEROMETER_ 106
+#define SEEMP_API_ah_SensorManager__registerListener 107
+#define SEEMP_API_ASensorEventQueue__enableSensor 108
+#define SEEMP_API_ContactsContract__getLookupUri 109
+#define SEEMP_API_ContactsContract__lookupContact 110
+#define SEEMP_API_ContactsContract__openContactPhotoInputStream 111
+#define SEEMP_API_ContactsContract__getContactLookupUri 112
+#define SEEMP_API_PackageManagerService__installPackage 113
+#define SEEMP_API_TelephonyManager__getSubscriberId 114
+#define SEEMP_API_URL__openConnection 115
+#define SEEMP_API_AM__confirmCredentials 116
+#define SEEMP_API_AM__invalidateAuthToken 117
+#define SEEMP_API_AM__updateCredentials 118
+#define SEEMP_API_AM__checkManageAccountsOrUseCredentialsPermissions 119
+#define SEEMP_API_AM__checkManageAccountsPermission 120
+#define SEEMP_API_AM__peekAuthToken 121
+#define SEEMP_API_AM__setAuthToken 122
+#define SEEMP_API_AM__checkAuthenticateAccountsPermission 123
+#define SEEMP_API_ah_SEL__onAccuracyChanged_ORIENTATION_ 124
+#define SEEMP_API_ah_SEL__onSensorChanged_ORIENTATION_ 125
+#define SEEMP_API_apS__get_ACCELEROMETER_ROTATION_ 126
+#define SEEMP_API_apS__get_USER_ROTATION_ 127
+#define SEEMP_API_apS__get_ADB_ENABLED_ 128
+#define SEEMP_API_apS__get_DEBUG_APP_ 129
+#define SEEMP_API_apS__get_WAIT_FOR_DEBUGGER_ 130
+#define SEEMP_API_apS__get_AIRPLANE_MODE_ON_ 131
+#define SEEMP_API_apS__get_AIRPLANE_MODE_RADIOS_ 132
+#define SEEMP_API_apS__get_ALARM_ALERT_ 133
+#define SEEMP_API_apS__get_NEXT_ALARM_FORMATTED_ 134
+#define SEEMP_API_apS__get_ALWAYS_FINISH_ACTIVITIES_ 135
+#define SEEMP_API_apS__get_LOGGING_ID_ 136
+#define SEEMP_API_apS__get_ANIMATOR_DURATION_SCALE_ 137
+#define SEEMP_API_apS__get_WINDOW_ANIMATION_SCALE_ 138
+#define SEEMP_API_apS__get_FONT_SCALE_ 139
+#define SEEMP_API_apS__get_SCREEN_BRIGHTNESS_ 140
+#define SEEMP_API_apS__get_SCREEN_BRIGHTNESS_MODE_ 141
+#define SEEMP_API_apS__get_SCREEN_BRIGHTNESS_MODE_AUTOMATIC_ 142
+#define SEEMP_API_apS__get_SCREEN_BRIGHTNESS_MODE_MANUAL_ 143
+#define SEEMP_API_apS__get_SCREEN_OFF_TIMEOUT_ 144
+#define SEEMP_API_apS__get_DIM_SCREEN_ 145
+#define SEEMP_API_apS__get_TS_ANIMATION_SCALE_ 146
+#define SEEMP_API_apS__get_STAY_ON_WHILE_PLUGGED_IN_ 147
+#define SEEMP_API_apS__get_WALLPAPER_ACTIVITY_ 148
+#define SEEMP_API_apS__get_SHOW_PROCESSES_ 149
+#define SEEMP_API_apS__get_SHOW_WEB_SUGGESTIONS_ 150
+#define SEEMP_API_apS__get_SHOW_GTALK_SERVICE_STATUS_ 151
+#define SEEMP_API_apS__get_USE_GOOGLE_MAIL_ 152
+#define SEEMP_API_apS__get_AUTO_TIME_ 153
+#define SEEMP_API_apS__get_AUTO_TIME_ZONE_ 154
+#define SEEMP_API_apS__get_DATE_FORMAT_ 155
+#define SEEMP_API_apS__get_TIME_12_24_ 156
+#define SEEMP_API_apS__get_BLUETOOTH_DISCOVERABILITY_ 157
+#define SEEMP_API_apS__get_BLUETOOTH_DISCOVERABILITY_TIMEOUT_ 158
+#define SEEMP_API_apS__get_BLUETOOTH_ON_ 159
+#define SEEMP_API_apS__get_DEVICE_PROVISIONED_ 160
+#define SEEMP_API_apS__get_SETUP_WIZARD_HAS_RUN_ 161
+#define SEEMP_API_apS__get_DTMF_TONE_WHEN_DIALING_ 162
+#define SEEMP_API_apS__get_END_BUTTON_BEHAVIOR_ 163
+#define SEEMP_API_apS__get_RINGTONE_ 164
+#define SEEMP_API_apS__get_MODE_RINGER_ 165
+#define SEEMP_API_apS__get_INSTALL_NON_MARKET_APPS_ 166
+#define SEEMP_API_apS__get_LOCATION_PROVIDERS_ALLOWED_ 167
+#define SEEMP_API_apS__get_LOCK_PATTERN_ENABLED_ 168
+#define SEEMP_API_apS__get_LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED_ 169
+#define SEEMP_API_apS__get_LOCK_PATTERN_VISIBLE_ 170
+#define SEEMP_API_apS__get_NETWORK_PREFERENCE_ 171
+#define SEEMP_API_apS__get_DATA_ROAMING_ 172
+#define SEEMP_API_apS__get_HTTP_PROXY_ 173
+#define SEEMP_API_apS__get_PARENTAL_CONTROL_ENABLED_ 174
+#define SEEMP_API_apS__get_PARENTAL_CONTROL_LAST_UPDATE_ 175
+#define SEEMP_API_apS__get_PARENTAL_CONTROL_REDIRECT_URL_ 176
+#define SEEMP_API_apS__get_RADIO_BLUETOOTH_ 177
+#define SEEMP_API_apS__get_RADIO_CELL_ 178
+#define SEEMP_API_apS__get_RADIO_NFC_ 179
+#define SEEMP_API_apS__get_RADIO_WIFI_ 180
+#define SEEMP_API_apS__get_SYS_PROP_SETTING_VERSION_ 181
+#define SEEMP_API_apS__get_SETTINGS_CLASSNAME_ 182
+#define SEEMP_API_apS__get_TEXT_AUTO_CAPS_ 183
+#define SEEMP_API_apS__get_TEXT_AUTO_PUNCTUATE_ 184
+#define SEEMP_API_apS__get_TEXT_AUTO_REPLACE_ 185
+#define SEEMP_API_apS__get_TEXT_SHOW_PASSWORD_ 186
+#define SEEMP_API_apS__get_USB_MASS_STORAGE_ENABLED_ 187
+#define SEEMP_API_apS__get_VIBRATE_ON_ 188
+#define SEEMP_API_apS__get_HAPTIC_FEEDBACK_ENABLED_ 189
+#define SEEMP_API_apS__get_VOLUME_ALARM_ 190
+#define SEEMP_API_apS__get_VOLUME_BLUETOOTH_SCO_ 191
+#define SEEMP_API_apS__get_VOLUME_MUSIC_ 192
+#define SEEMP_API_apS__get_VOLUME_NOTIFICATION_ 193
+#define SEEMP_API_apS__get_VOLUME_RING_ 194
+#define SEEMP_API_apS__get_VOLUME_SYSTEM_ 195
+#define SEEMP_API_apS__get_VOLUME_VOICE_ 196
+#define SEEMP_API_apS__get_SOUND_EFFECTS_ENABLED_ 197
+#define SEEMP_API_apS__get_MODE_RINGER_STREAMS_AFFECTED_ 198
+#define SEEMP_API_apS__get_MUTE_STREAMS_AFFECTED_ 199
+#define SEEMP_API_apS__get_NOTIFICATION_SOUND_ 200
+#define SEEMP_API_apS__get_APPEND_FOR_LAST_AUDIBLE_ 201
+#define SEEMP_API_apS__get_WIFI_MAX_DHCP_RETRY_COUNT_ 202
+#define SEEMP_API_apS__get_WIFI_MOBILE_DATA_TS_WAKELOCK_TIMEOUT_MS_ 203
+#define SEEMP_API_apS__get_WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON_ 204
+#define SEEMP_API_apS__get_WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY_ 205
+#define SEEMP_API_apS__get_WIFI_NUM_OPEN_NETWORKS_KEPT_ 206
+#define SEEMP_API_apS__get_WIFI_ON_ 207
+#define SEEMP_API_apS__get_WIFI_SLEEP_POLICY_ 208
+#define SEEMP_API_apS__get_WIFI_SLEEP_POLICY_DEFAULT_ 209
+#define SEEMP_API_apS__get_WIFI_SLEEP_POLICY_NEVER_ 210
+#define SEEMP_API_apS__get_WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED_ 211
+#define SEEMP_API_apS__get_WIFI_STATIC_DNS1_ 212
+#define SEEMP_API_apS__get_WIFI_STATIC_DNS2_ 213
+#define SEEMP_API_apS__get_WIFI_STATIC_GATEWAY_ 214
+#define SEEMP_API_apS__get_WIFI_STATIC_IP_ 215
+#define SEEMP_API_apS__get_WIFI_STATIC_NETMASK_ 216
+#define SEEMP_API_apS__get_WIFI_USE_STATIC_IP_ 217
+#define SEEMP_API_apS__get_WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PR_ 218
+#define SEEMP_API_apS__get_WIFI_WATCHDOG_AP_COUNT_ 219
+#define SEEMP_API_apS__get_WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS_ 220
+#define SEEMP_API_apS__get_WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED_ 221
+#define SEEMP_API_apS__get_WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS_ 222
+#define SEEMP_API_apS__get_WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT_ 223
+#define SEEMP_API_apS__get_WIFI_WATCHDOG_MAX_AP_CHECKS_ 224
+#define SEEMP_API_apS__get_WIFI_WATCHDOG_ON_ 225
+#define SEEMP_API_apS__get_WIFI_WATCHDOG_PING_COUNT_ 226
+#define SEEMP_API_apS__get_WIFI_WATCHDOG_PING_DELAY_MS_ 227
+#define SEEMP_API_apS__get_WIFI_WATCHDOG_PING_TIMEOUT_MS_ 228
+#define SEEMP_API_apS__put_ACCELEROMETER_ROTATION_ 229
+#define SEEMP_API_apS__put_USER_ROTATION_ 230
+#define SEEMP_API_apS__put_ADB_ENABLED_ 231
+#define SEEMP_API_apS__put_DEBUG_APP_ 232
+#define SEEMP_API_apS__put_WAIT_FOR_DEBUGGER_ 233
+#define SEEMP_API_apS__put_AIRPLANE_MODE_ON_ 234
+#define SEEMP_API_apS__put_AIRPLANE_MODE_RADIOS_ 235
+#define SEEMP_API_apS__put_ALARM_ALERT_ 236
+#define SEEMP_API_apS__put_NEXT_ALARM_FORMATTED_ 237
+#define SEEMP_API_apS__put_ALWAYS_FINISH_ACTIVITIES_ 238
+#define SEEMP_API_apS__put_ANDROID_ID_ 239
+#define SEEMP_API_apS__put_LOGGING_ID_ 240
+#define SEEMP_API_apS__put_ANIMATOR_DURATION_SCALE_ 241
+#define SEEMP_API_apS__put_WINDOW_ANIMATION_SCALE_ 242
+#define SEEMP_API_apS__put_FONT_SCALE_ 243
+#define SEEMP_API_apS__put_SCREEN_BRIGHTNESS_ 244
+#define SEEMP_API_apS__put_SCREEN_BRIGHTNESS_MODE_ 245
+#define SEEMP_API_apS__put_SCREEN_BRIGHTNESS_MODE_AUTOMATIC_ 246
+#define SEEMP_API_apS__put_SCREEN_BRIGHTNESS_MODE_MANUAL_ 247
+#define SEEMP_API_apS__put_SCREEN_OFF_TIMEOUT_ 248
+#define SEEMP_API_apS__put_DIM_SCREEN_ 249
+#define SEEMP_API_apS__put_TS_ANIMATION_SCALE_ 250
+#define SEEMP_API_apS__put_STAY_ON_WHILE_PLUGGED_IN_ 251
+#define SEEMP_API_apS__put_WALLPAPER_ACTIVITY_ 252
+#define SEEMP_API_apS__put_SHOW_PROCESSES_ 253
+#define SEEMP_API_apS__put_SHOW_WEB_SUGGESTIONS_ 254
+#define SEEMP_API_apS__put_SHOW_GTALK_SERVICE_STATUS_ 255
+#define SEEMP_API_apS__put_USE_GOOGLE_MAIL_ 256
+#define SEEMP_API_apS__put_AUTO_TIME_ 257
+#define SEEMP_API_apS__put_AUTO_TIME_ZONE_ 258
+#define SEEMP_API_apS__put_DATE_FORMAT_ 259
+#define SEEMP_API_apS__put_TIME_12_24_ 260
+#define SEEMP_API_apS__put_BLUETOOTH_DISCOVERABILITY_ 261
+#define SEEMP_API_apS__put_BLUETOOTH_DISCOVERABILITY_TIMEOUT_ 262
+#define SEEMP_API_apS__put_BLUETOOTH_ON_ 263
+#define SEEMP_API_apS__put_DEVICE_PROVISIONED_ 264
+#define SEEMP_API_apS__put_SETUP_WIZARD_HAS_RUN_ 265
+#define SEEMP_API_apS__put_DTMF_TONE_WHEN_DIALING_ 266
+#define SEEMP_API_apS__put_END_BUTTON_BEHAVIOR_ 267
+#define SEEMP_API_apS__put_RINGTONE_ 268
+#define SEEMP_API_apS__put_MODE_RINGER_ 269
+#define SEEMP_API_apS__put_INSTALL_NON_MARKET_APPS_ 270
+#define SEEMP_API_apS__put_LOCATION_PROVIDERS_ALLOWED_ 271
+#define SEEMP_API_apS__put_LOCK_PATTERN_ENABLED_ 272
+#define SEEMP_API_apS__put_LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED_ 273
+#define SEEMP_API_apS__put_LOCK_PATTERN_VISIBLE_ 274
+#define SEEMP_API_apS__put_NETWORK_PREFERENCE_ 275
+#define SEEMP_API_apS__put_DATA_ROAMING_ 276
+#define SEEMP_API_apS__put_HTTP_PROXY_ 277
+#define SEEMP_API_apS__put_PARENTAL_CONTROL_ENABLED_ 278
+#define SEEMP_API_apS__put_PARENTAL_CONTROL_LAST_UPDATE_ 279
+#define SEEMP_API_apS__put_PARENTAL_CONTROL_REDIRECT_URL_ 280
+#define SEEMP_API_apS__put_RADIO_BLUETOOTH_ 281
+#define SEEMP_API_apS__put_RADIO_CELL_ 282
+#define SEEMP_API_apS__put_RADIO_NFC_ 283
+#define SEEMP_API_apS__put_RADIO_WIFI_ 284
+#define SEEMP_API_apS__put_SYS_PROP_SETTING_VERSION_ 285
+#define SEEMP_API_apS__put_SETTINGS_CLASSNAME_ 286
+#define SEEMP_API_apS__put_TEXT_AUTO_CAPS_ 287
+#define SEEMP_API_apS__put_TEXT_AUTO_PUNCTUATE_ 288
+#define SEEMP_API_apS__put_TEXT_AUTO_REPLACE_ 289
+#define SEEMP_API_apS__put_TEXT_SHOW_PASSWORD_ 290
+#define SEEMP_API_apS__put_USB_MASS_STORAGE_ENABLED_ 291
+#define SEEMP_API_apS__put_VIBRATE_ON_ 292
+#define SEEMP_API_apS__put_HAPTIC_FEEDBACK_ENABLED_ 293
+#define SEEMP_API_apS__put_VOLUME_ALARM_ 294
+#define SEEMP_API_apS__put_VOLUME_BLUETOOTH_SCO_ 295
+#define SEEMP_API_apS__put_VOLUME_MUSIC_ 296
+#define SEEMP_API_apS__put_VOLUME_NOTIFICATION_ 297
+#define SEEMP_API_apS__put_VOLUME_RING_ 298
+#define SEEMP_API_apS__put_VOLUME_SYSTEM_ 299
+#define SEEMP_API_apS__put_VOLUME_VOICE_ 300
+#define SEEMP_API_apS__put_SOUND_EFFECTS_ENABLED_ 301
+#define SEEMP_API_apS__put_MODE_RINGER_STREAMS_AFFECTED_ 302
+#define SEEMP_API_apS__put_MUTE_STREAMS_AFFECTED_ 303
+#define SEEMP_API_apS__put_NOTIFICATION_SOUND_ 304
+#define SEEMP_API_apS__put_APPEND_FOR_LAST_AUDIBLE_ 305
+#define SEEMP_API_apS__put_WIFI_MAX_DHCP_RETRY_COUNT_ 306
+#define SEEMP_API_apS__put_WIFI_MOBILE_DATA_TS_WAKELOCK_TIMEOUT_MS_ 307
+#define SEEMP_API_apS__put_WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON_ 308
+#define SEEMP_API_apS__put_WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY_ 309
+#define SEEMP_API_apS__put_WIFI_NUM_OPEN_NETWORKS_KEPT_ 310
+#define SEEMP_API_apS__put_WIFI_ON_ 311
+#define SEEMP_API_apS__put_WIFI_SLEEP_POLICY_ 312
+#define SEEMP_API_apS__put_WIFI_SLEEP_POLICY_DEFAULT_ 313
+#define SEEMP_API_apS__put_WIFI_SLEEP_POLICY_NEVER_ 314
+#define SEEMP_API_apS__put_WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED_ 315
+#define SEEMP_API_apS__put_WIFI_STATIC_DNS1_ 316
+#define SEEMP_API_apS__put_WIFI_STATIC_DNS2_ 317
+#define SEEMP_API_apS__put_WIFI_STATIC_GATEWAY_ 318
+#define SEEMP_API_apS__put_WIFI_STATIC_IP_ 319
+#define SEEMP_API_apS__put_WIFI_STATIC_NETMASK_ 320
+#define SEEMP_API_apS__put_WIFI_USE_STATIC_IP_ 321
+#define SEEMP_API_apS__put_WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PR_ 322
+#define SEEMP_API_apS__put_WIFI_WATCHDOG_AP_COUNT_ 323
+#define SEEMP_API_apS__put_WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS_ 324
+#define SEEMP_API_apS__put_WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED_ 325
+#define SEEMP_API_apS__put_WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS_ 326
+#define SEEMP_API_apS__put_WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT_ 327
+#define SEEMP_API_apS__put_WIFI_WATCHDOG_MAX_AP_CHECKS_ 328
+#define SEEMP_API_apS__put_WIFI_WATCHDOG_ON_ 329
+#define SEEMP_API_apS__put_WIFI_WATCHDOG_PING_COUNT_ 330
+#define SEEMP_API_apS__put_WIFI_WATCHDOG_PING_DELAY_MS_ 331
+#define SEEMP_API_apS__put_WIFI_WATCHDOG_PING_TIMEOUT_MS_ 332
+#define SEEMP_API_Poll__setCumulativeWifiRxMBytes 333
+#define SEEMP_API_Poll__setInstantaneousWifiRxMBytes 334
+#define SEEMP_API_Poll__setCumulativeWifiRxPackets 335
+#define SEEMP_API_Poll__setInstantaneousWifiRxPackets 336
+#define SEEMP_API_Poll__setCumulativeWifiTxMBytes 337
+#define SEEMP_API_Poll__setInstantaneousWifiTxMBytes 338
+#define SEEMP_API_Poll__setCumulativeWifiTxPackets 339
+#define SEEMP_API_Poll__setInstantaneousWifiTxPackets 340
+#define SEEMP_API_Poll__setCumulativeWifiRxTcpMBytes 341
+#define SEEMP_API_Poll__setInstantaneousWifiRxTcpMBytes 342
+#define SEEMP_API_Poll__setCumulativeWifiRxTcpPackets 343
+#define SEEMP_API_Poll__setInstantaneousWifiRxTcpPackets 344
+#define SEEMP_API_Poll__setCumulativeWifiRxUdpMBytes 345
+#define SEEMP_API_Poll__setInstantaneousWifiRxUdpMBytes 346
+#define SEEMP_API_Poll__setCumulativeWifiRxUdpPackets 347
+#define SEEMP_API_Poll__setInstantaneousWifiRxUdpPackets 348
+#define SEEMP_API_Poll__setCumulativeWifiRxOtherMBytes 349
+#define SEEMP_API_Poll__setInstantaneousWifiRxOtherMBytes 350
+#define SEEMP_API_Poll__setCumulativeWifiRxOtherPackets 351
+#define SEEMP_API_Poll__setInstantaneousWifiRxOtherPackets 352
+#define SEEMP_API_Poll__setCumulativeWifiTxTcpMBytes 353
+#define SEEMP_API_Poll__setInstantaneousWifiTxTcpMBytes 354
+#define SEEMP_API_Poll__setCumulativeWifiTxTcpPackets 355
+#define SEEMP_API_Poll__setInstantaneousWifiTxTcpPackets 356
+#define SEEMP_API_Poll__setCumulativeWifiTxUdpMBytes 357
+#define SEEMP_API_Poll__setInstantaneousWifiTxUdpMBytes 358
+#define SEEMP_API_Poll__setCumulativeWifiTxUdpPackets 359
+#define SEEMP_API_Poll__setInstantaneousWifiTxUdpPackets 360
+#define SEEMP_API_Poll__setCumulativeWifiTxOtherMBytes 361
+#define SEEMP_API_Poll__setInstantaneousWifiTxOtherMBytes 362
+#define SEEMP_API_Poll__setCumulativeWifiTxOtherPackets 363
+#define SEEMP_API_Poll__setInstantaneousWifiTxOtherPackets 364
+#define SEEMP_API_Poll__setCumulativeMobileRxMBytes 365
+#define SEEMP_API_Poll__setInstantaneousMobileRxMBytes 366
+#define SEEMP_API_Poll__setCumulativeMobileRxPackets 367
+#define SEEMP_API_Poll__setInstantaneousMobileRxPackets 368
+#define SEEMP_API_Poll__setCumulativeMobileTxMBytes 369
+#define SEEMP_API_Poll__setInstantaneousMobileTxMBytes 370
+#define SEEMP_API_Poll__setCumulativeMobileTxPackets 371
+#define SEEMP_API_Poll__setInstantaneousMobileTxPackets 372
+#define SEEMP_API_Poll__setCumulativeMobileRxTcpMBytes 373
+#define SEEMP_API_Poll__setInstantaneousMobileRxTcpMBytes 374
+#define SEEMP_API_Poll__setCumulativeMobileRxTcpPackets 375
+#define SEEMP_API_Poll__setInstantaneousMobileRxTcpPackets 376
+#define SEEMP_API_Poll__setCumulativeMobileRxUdpMBytes 377
+#define SEEMP_API_Poll__setInstantaneousMobileRxUdpMBytes 378
+#define SEEMP_API_Poll__setCumulativeMobileRxUdpPackets 379
+#define SEEMP_API_Poll__setInstantaneousMobileRxUdpPackets 380
+#define SEEMP_API_Poll__setCumulativeMobileRxOtherMBytes 381
+#define SEEMP_API_Poll__setInstantaneousMobileRxOtherMBytes 382
+#define SEEMP_API_Poll__setCumulativeMobileRxOtherPackets 383
+#define SEEMP_API_Poll__setInstantaneousMobileRxOtherPackets 384
+#define SEEMP_API_Poll__setCumulativeMobileTxTcpMBytes 385
+#define SEEMP_API_Poll__setInstantaneousMobileTxTcpMBytes 386
+#define SEEMP_API_Poll__setCumulativeMobileTxTcpPackets 387
+#define SEEMP_API_Poll__setInstantaneousMobileTxTcpPackets 388
+#define SEEMP_API_Poll__setCumulativeMobileTxUdpMBytes 389
+#define SEEMP_API_Poll__setInstantaneousMobileTxUdpMBytes 390
+#define SEEMP_API_Poll__setCumulativeMobileTxUdpPackets 391
+#define SEEMP_API_Poll__setInstantaneousMobileTxUdpPackets 392
+#define SEEMP_API_Poll__setCumulativeMobileTxOtherMBytes 393
+#define SEEMP_API_Poll__setInstantaneousMobileTxOtherMBytes 394
+#define SEEMP_API_Poll__setCumulativeMobileTxOtherPackets 395
+#define SEEMP_API_Poll__setInstantaneousMobileTxOtherPackets 396
+#define SEEMP_API_Poll__setNumSockets 397
+#define SEEMP_API_Poll__setNumTcpStateListen 398
+#define SEEMP_API_Poll__setNumTcpStateEstablished 399
+#define SEEMP_API_Poll__setNumLocalIp 400
+#define SEEMP_API_Poll__setNumLocalPort 401
+#define SEEMP_API_Poll__setNumRemoteIp 402
+#define SEEMP_API_Poll__setNumRemotePort 403
+#define SEEMP_API_Poll__setNumRemoteTuple 404
+#define SEEMP_API_Poll__setNumInode 405
+#define SEEMP_API_Instrumentation__startActivitySync 406
+#define SEEMP_API_Instrumentation__execStartActivity 407
+#define SEEMP_API_Instrumentation__execStartActivitiesAsUser 408
+#define SEEMP_API_Instrumentation__execStartActivityAsCaller 409
+#define SEEMP_API_Instrumentation__execStartActivityFromAppTask 410
+#define SEEMP_API_ah_SystemSensorManager__registerListenerImpl 411
+#define SEEMP_API_ah_SystemSensorManager__unregisterListenerImpl 412
+
+#endif /* _SEEMP_API_H_ */
diff --git a/include/uapi/linux/seemp_param_id.h b/include/uapi/linux/seemp_param_id.h
new file mode 100644
index 000000000000..d4f1894dadd1
--- /dev/null
+++ b/include/uapi/linux/seemp_param_id.h
@@ -0,0 +1,70 @@
+#ifndef _PARAM_ID_H_
+#define _PARAM_ID_H_
+
+#define PARAM_ID_LEN 0
+#define PARAM_ID_OOM_ADJ 1
+#define PARAM_ID_APP_PID 2
+#define PARAM_ID_VALUE 3
+#define PARAM_ID_RATE 4
+#define PARAM_ID_SENSOR 5
+#define PARAM_ID_SIZE 6
+#define PARAM_ID_FD 7
+#define NUM_PARAM_IDS 8
+
+#ifndef PROVIDE_PARAM_ID
+int param_id_index(const char *param, const char *end);
+const char *get_param_id_name(int id);
+#else
+int param_id_index(const char *param, const char *end)
+{
+ int id = -1;
+ int len = ((end != NULL) ? (end - param) : (int)strlen(param));
+
+ /**/ if ((len == 3) && !memcmp(param, "len", 3))
+ id = 0;
+ else if ((len == 7) && !memcmp(param, "oom_adj", 7))
+ id = 1;
+ else if ((len == 7) && !memcmp(param, "app_pid", 7))
+ id = 2;
+ else if ((len == 5) && !memcmp(param, "value", 5))
+ id = 3;
+ else if ((len == 4) && !memcmp(param, "rate", 4))
+ id = 4;
+ else if ((len == 6) && !memcmp(param, "sensor", 6))
+ id = 5;
+ else if ((len == 4) && !memcmp(param, "size", 4))
+ id = 6;
+ else if ((len == 2) && !memcmp(param, "fd", 2))
+ id = 7;
+
+ return id;
+}
+
+const char *get_param_id_name(int id)
+{
+ const char *name = "?";
+
+ switch (id) {
+ case 0:
+ name = "len"; break;
+ case 1:
+ name = "oom_adj"; break;
+ case 2:
+ name = "app_pid"; break;
+ case 3:
+ name = "value"; break;
+ case 4:
+ name = "rate"; break;
+ case 5:
+ name = "sensor"; break;
+ case 6:
+ name = "size"; break;
+ case 7:
+ name = "fd"; break;
+ }
+
+ return name;
+}
+#endif /* PROVIDE_PARAM_ID */
+
+#endif /* _PARAM_ID_H_ */