Merge "update the .vts files for nfc and vibrate."
diff --git a/audio/2.0/Android.bp b/audio/2.0/Android.bp
index 2fd2d67..984a095 100644
--- a/audio/2.0/Android.bp
+++ b/audio/2.0/Android.bp
@@ -93,9 +93,9 @@
"android.hardware.audio.common@2.0",
"android.hardware.audio.effect@2.0",
],
-export_shared_lib_headers: [
- "libhidl",
- "libhwbinder",
- "libutils",
+ export_shared_lib_headers: [
+ "libhidl",
+ "libhwbinder",
+ "libutils",
],
}
diff --git a/audio/common/2.0/Android.bp b/audio/common/2.0/Android.bp
index 783623a..a00e2bd 100644
--- a/audio/common/2.0/Android.bp
+++ b/audio/common/2.0/Android.bp
@@ -35,9 +35,9 @@
"libutils",
"libcutils",
],
-export_shared_lib_headers: [
- "libhidl",
- "libhwbinder",
- "libutils",
+ export_shared_lib_headers: [
+ "libhidl",
+ "libhwbinder",
+ "libutils",
],
}
diff --git a/audio/effect/2.0/Android.bp b/audio/effect/2.0/Android.bp
index 31c1b90..a7b4131 100644
--- a/audio/effect/2.0/Android.bp
+++ b/audio/effect/2.0/Android.bp
@@ -148,9 +148,9 @@
"libcutils",
"android.hardware.audio.common@2.0",
],
-export_shared_lib_headers: [
- "libhidl",
- "libhwbinder",
- "libutils",
+ export_shared_lib_headers: [
+ "libhidl",
+ "libhwbinder",
+ "libutils",
],
}
diff --git a/benchmarks/msgq/1.0/Android.bp b/benchmarks/msgq/1.0/Android.bp
index b222cfb..5fe6203 100644
--- a/benchmarks/msgq/1.0/Android.bp
+++ b/benchmarks/msgq/1.0/Android.bp
@@ -39,9 +39,9 @@
"libutils",
"libcutils",
],
-export_shared_lib_headers: [
- "libhidl",
- "libhwbinder",
- "libutils",
+ export_shared_lib_headers: [
+ "libhidl",
+ "libhwbinder",
+ "libutils",
],
}
diff --git a/biometrics/fingerprint/2.1/Android.bp b/biometrics/fingerprint/2.1/Android.bp
index e1fd755..5ade9f3 100644
--- a/biometrics/fingerprint/2.1/Android.bp
+++ b/biometrics/fingerprint/2.1/Android.bp
@@ -51,9 +51,9 @@
"libutils",
"libcutils",
],
-export_shared_lib_headers: [
- "libhidl",
- "libhwbinder",
- "libutils",
+ export_shared_lib_headers: [
+ "libhidl",
+ "libhwbinder",
+ "libutils",
],
}
diff --git a/bluetooth/1.0/Android.bp b/bluetooth/1.0/Android.bp
index ef7f109..ab0b1a9 100644
--- a/bluetooth/1.0/Android.bp
+++ b/bluetooth/1.0/Android.bp
@@ -51,9 +51,9 @@
"libutils",
"libcutils",
],
-export_shared_lib_headers: [
- "libhidl",
- "libhwbinder",
- "libutils",
+ export_shared_lib_headers: [
+ "libhidl",
+ "libhwbinder",
+ "libutils",
],
}
diff --git a/boot/1.0/Android.bp b/boot/1.0/Android.bp
index dc30038..6c959d9 100644
--- a/boot/1.0/Android.bp
+++ b/boot/1.0/Android.bp
@@ -43,9 +43,9 @@
"libutils",
"libcutils",
],
-export_shared_lib_headers: [
- "libhidl",
- "libhwbinder",
- "libutils",
+ export_shared_lib_headers: [
+ "libhidl",
+ "libhwbinder",
+ "libutils",
],
}
diff --git a/broadcastradio/1.0/Android.bp b/broadcastradio/1.0/Android.bp
index 7883d67..75736d1 100644
--- a/broadcastradio/1.0/Android.bp
+++ b/broadcastradio/1.0/Android.bp
@@ -67,9 +67,9 @@
"libutils",
"libcutils",
],
-export_shared_lib_headers: [
- "libhidl",
- "libhwbinder",
- "libutils",
+ export_shared_lib_headers: [
+ "libhidl",
+ "libhwbinder",
+ "libutils",
],
}
diff --git a/example/extension/light/2.0/Android.bp b/example/extension/light/2.0/Android.bp
index 3e6d2b1..5d58512 100644
--- a/example/extension/light/2.0/Android.bp
+++ b/example/extension/light/2.0/Android.bp
@@ -44,9 +44,9 @@
"libcutils",
"android.hardware.light@2.0",
],
-export_shared_lib_headers: [
- "libhidl",
- "libhwbinder",
- "libutils",
+ export_shared_lib_headers: [
+ "libhidl",
+ "libhwbinder",
+ "libutils",
],
}
diff --git a/gnss/1.0/Android.bp b/gnss/1.0/Android.bp
index fe90f1e..9b9abe3 100644
--- a/gnss/1.0/Android.bp
+++ b/gnss/1.0/Android.bp
@@ -171,9 +171,9 @@
"libutils",
"libcutils",
],
-export_shared_lib_headers: [
- "libhidl",
- "libhwbinder",
- "libutils",
+ export_shared_lib_headers: [
+ "libhidl",
+ "libhwbinder",
+ "libutils",
],
}
diff --git a/graphics/allocator/2.0/Android.bp b/graphics/allocator/2.0/Android.bp
index 1e9edac..0d800be 100644
--- a/graphics/allocator/2.0/Android.bp
+++ b/graphics/allocator/2.0/Android.bp
@@ -43,9 +43,9 @@
"libutils",
"libcutils",
],
-export_shared_lib_headers: [
- "libhidl",
- "libhwbinder",
- "libutils",
+ export_shared_lib_headers: [
+ "libhidl",
+ "libhwbinder",
+ "libutils",
],
}
diff --git a/graphics/composer/2.1/Android.bp b/graphics/composer/2.1/Android.bp
index 094d09e..bc948e8 100644
--- a/graphics/composer/2.1/Android.bp
+++ b/graphics/composer/2.1/Android.bp
@@ -52,9 +52,9 @@
"libcutils",
"android.hardware.graphics.allocator@2.0",
],
-export_shared_lib_headers: [
- "libhidl",
- "libhwbinder",
- "libutils",
+ export_shared_lib_headers: [
+ "libhidl",
+ "libhwbinder",
+ "libutils",
],
}
diff --git a/light/2.0/Android.bp b/light/2.0/Android.bp
index 33b4af2..ff2414c 100644
--- a/light/2.0/Android.bp
+++ b/light/2.0/Android.bp
@@ -43,9 +43,9 @@
"libutils",
"libcutils",
],
-export_shared_lib_headers: [
- "libhidl",
- "libhwbinder",
- "libutils",
+ export_shared_lib_headers: [
+ "libhidl",
+ "libhwbinder",
+ "libutils",
],
}
diff --git a/memtrack/1.0/Android.bp b/memtrack/1.0/Android.bp
index 996dbb6..4b6864c 100644
--- a/memtrack/1.0/Android.bp
+++ b/memtrack/1.0/Android.bp
@@ -43,9 +43,9 @@
"libutils",
"libcutils",
],
-export_shared_lib_headers: [
- "libhidl",
- "libhwbinder",
- "libutils",
+ export_shared_lib_headers: [
+ "libhidl",
+ "libhwbinder",
+ "libutils",
],
}
diff --git a/nfc/1.0/Android.bp b/nfc/1.0/Android.bp
index 2b8f3af..9c3bb5f 100644
--- a/nfc/1.0/Android.bp
+++ b/nfc/1.0/Android.bp
@@ -51,9 +51,9 @@
"libutils",
"libcutils",
],
-export_shared_lib_headers: [
- "libhidl",
- "libhwbinder",
- "libutils",
+ export_shared_lib_headers: [
+ "libhidl",
+ "libhwbinder",
+ "libutils",
],
}
diff --git a/nfc/1.0/default/android.hardware.nfc@1.0-service.rc b/nfc/1.0/default/android.hardware.nfc@1.0-service.rc
index 1d42718..7b67577 100644
--- a/nfc/1.0/default/android.hardware.nfc@1.0-service.rc
+++ b/nfc/1.0/default/android.hardware.nfc@1.0-service.rc
@@ -1,4 +1,4 @@
service nfc_hal_service /system/bin/hw/android.hardware.nfc@1.0-service
class hal
user nfc
- group nfc readproc
+ group nfc
diff --git a/power/1.0/Android.bp b/power/1.0/Android.bp
index 4b6d34b..52ec33f 100644
--- a/power/1.0/Android.bp
+++ b/power/1.0/Android.bp
@@ -43,9 +43,9 @@
"libutils",
"libcutils",
],
-export_shared_lib_headers: [
- "libhidl",
- "libhwbinder",
- "libutils",
+ export_shared_lib_headers: [
+ "libhidl",
+ "libhwbinder",
+ "libutils",
],
}
diff --git a/radio/1.0/Android.bp b/radio/1.0/Android.bp
index 34eaf33..5927549 100644
--- a/radio/1.0/Android.bp
+++ b/radio/1.0/Android.bp
@@ -7,12 +7,18 @@
srcs: [
"types.hal",
"IRadio.hal",
- "IRadioCallback.hal",
+ "IRadioIndication.hal",
+ "IRadioResponse.hal",
+ "ISap.hal",
+ "ISapCallback.hal",
],
out: [
"android/hardware/radio/1.0/types.cpp",
"android/hardware/radio/1.0/RadioAll.cpp",
- "android/hardware/radio/1.0/RadioCallbackAll.cpp",
+ "android/hardware/radio/1.0/RadioIndicationAll.cpp",
+ "android/hardware/radio/1.0/RadioResponseAll.cpp",
+ "android/hardware/radio/1.0/SapAll.cpp",
+ "android/hardware/radio/1.0/SapCallbackAll.cpp",
],
}
@@ -23,7 +29,10 @@
srcs: [
"types.hal",
"IRadio.hal",
- "IRadioCallback.hal",
+ "IRadioIndication.hal",
+ "IRadioResponse.hal",
+ "ISap.hal",
+ "ISapCallback.hal",
],
out: [
"android/hardware/radio/1.0/types.h",
@@ -32,11 +41,26 @@
"android/hardware/radio/1.0/BnRadio.h",
"android/hardware/radio/1.0/BpRadio.h",
"android/hardware/radio/1.0/BsRadio.h",
- "android/hardware/radio/1.0/IRadioCallback.h",
- "android/hardware/radio/1.0/IHwRadioCallback.h",
- "android/hardware/radio/1.0/BnRadioCallback.h",
- "android/hardware/radio/1.0/BpRadioCallback.h",
- "android/hardware/radio/1.0/BsRadioCallback.h",
+ "android/hardware/radio/1.0/IRadioIndication.h",
+ "android/hardware/radio/1.0/IHwRadioIndication.h",
+ "android/hardware/radio/1.0/BnRadioIndication.h",
+ "android/hardware/radio/1.0/BpRadioIndication.h",
+ "android/hardware/radio/1.0/BsRadioIndication.h",
+ "android/hardware/radio/1.0/IRadioResponse.h",
+ "android/hardware/radio/1.0/IHwRadioResponse.h",
+ "android/hardware/radio/1.0/BnRadioResponse.h",
+ "android/hardware/radio/1.0/BpRadioResponse.h",
+ "android/hardware/radio/1.0/BsRadioResponse.h",
+ "android/hardware/radio/1.0/ISap.h",
+ "android/hardware/radio/1.0/IHwSap.h",
+ "android/hardware/radio/1.0/BnSap.h",
+ "android/hardware/radio/1.0/BpSap.h",
+ "android/hardware/radio/1.0/BsSap.h",
+ "android/hardware/radio/1.0/ISapCallback.h",
+ "android/hardware/radio/1.0/IHwSapCallback.h",
+ "android/hardware/radio/1.0/BnSapCallback.h",
+ "android/hardware/radio/1.0/BpSapCallback.h",
+ "android/hardware/radio/1.0/BsSapCallback.h",
],
}
@@ -51,9 +75,9 @@
"libutils",
"libcutils",
],
-export_shared_lib_headers: [
- "libhidl",
- "libhwbinder",
- "libutils",
+ export_shared_lib_headers: [
+ "libhidl",
+ "libhwbinder",
+ "libutils",
],
}
diff --git a/radio/1.0/Android.mk b/radio/1.0/Android.mk
index b8365bf..dd3744b 100644
--- a/radio/1.0/Android.mk
+++ b/radio/1.0/Android.mk
@@ -13,9 +13,9 @@
HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
#
-# Build types.hal (RadioAppState)
+# Build types.hal (AppState)
#
-GEN := $(intermediates)/android/hardware/radio/1.0/RadioAppState.java
+GEN := $(intermediates)/android/hardware/radio/1.0/AppState.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -23,16 +23,16 @@
$(GEN): PRIVATE_CUSTOM_TOOL = \
$(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-Ljava -randroid.hardware:hardware/interfaces \
- android.hardware.radio@1.0::types.RadioAppState
+ android.hardware.radio@1.0::types.AppState
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (RadioAppStatus)
+# Build types.hal (AppStatus)
#
-GEN := $(intermediates)/android/hardware/radio/1.0/RadioAppStatus.java
+GEN := $(intermediates)/android/hardware/radio/1.0/AppStatus.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -40,16 +40,16 @@
$(GEN): PRIVATE_CUSTOM_TOOL = \
$(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-Ljava -randroid.hardware:hardware/interfaces \
- android.hardware.radio@1.0::types.RadioAppStatus
+ android.hardware.radio@1.0::types.AppStatus
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (RadioAppType)
+# Build types.hal (AppType)
#
-GEN := $(intermediates)/android/hardware/radio/1.0/RadioAppType.java
+GEN := $(intermediates)/android/hardware/radio/1.0/AppType.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -57,16 +57,16 @@
$(GEN): PRIVATE_CUSTOM_TOOL = \
$(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-Ljava -randroid.hardware:hardware/interfaces \
- android.hardware.radio@1.0::types.RadioAppType
+ android.hardware.radio@1.0::types.AppType
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (RadioCardState)
+# Build types.hal (Call)
#
-GEN := $(intermediates)/android/hardware/radio/1.0/RadioCardState.java
+GEN := $(intermediates)/android/hardware/radio/1.0/Call.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -74,16 +74,16 @@
$(GEN): PRIVATE_CUSTOM_TOOL = \
$(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-Ljava -randroid.hardware:hardware/interfaces \
- android.hardware.radio@1.0::types.RadioCardState
+ android.hardware.radio@1.0::types.Call
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (RadioCardStatus)
+# Build types.hal (CallForwardInfo)
#
-GEN := $(intermediates)/android/hardware/radio/1.0/RadioCardStatus.java
+GEN := $(intermediates)/android/hardware/radio/1.0/CallForwardInfo.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -91,7 +91,398 @@
$(GEN): PRIVATE_CUSTOM_TOOL = \
$(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-Ljava -randroid.hardware:hardware/interfaces \
- android.hardware.radio@1.0::types.RadioCardStatus
+ android.hardware.radio@1.0::types.CallForwardInfo
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (CallForwardInfoStatus)
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/CallForwardInfoStatus.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.radio@1.0::types.CallForwardInfoStatus
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (CallPresentation)
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/CallPresentation.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.radio@1.0::types.CallPresentation
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (CallState)
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/CallState.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.radio@1.0::types.CallState
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (CardState)
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/CardState.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.radio@1.0::types.CardState
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (CardStatus)
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/CardStatus.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.radio@1.0::types.CardStatus
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (CdmaSignalStrength)
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/CdmaSignalStrength.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.radio@1.0::types.CdmaSignalStrength
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (ClipStatus)
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/ClipStatus.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.radio@1.0::types.ClipStatus
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (Clir)
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/Clir.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.radio@1.0::types.Clir
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (DataCallFailCause)
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/DataCallFailCause.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.radio@1.0::types.DataCallFailCause
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (DataProfile)
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/DataProfile.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.radio@1.0::types.DataProfile
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (DataRegStateResult)
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/DataRegStateResult.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.radio@1.0::types.DataRegStateResult
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (Dial)
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/Dial.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.radio@1.0::types.Dial
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (EvdoSignalStrength)
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/EvdoSignalStrength.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.radio@1.0::types.EvdoSignalStrength
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (GwSignalStrength)
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/GwSignalStrength.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.radio@1.0::types.GwSignalStrength
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (IccIo)
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/IccIo.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.radio@1.0::types.IccIo
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (IccIoResult)
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/IccIoResult.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.radio@1.0::types.IccIoResult
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (LastCallFailCause)
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/LastCallFailCause.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.radio@1.0::types.LastCallFailCause
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (LteSignalStrength)
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/LteSignalStrength.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.radio@1.0::types.LteSignalStrength
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (OperatorInfo)
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/OperatorInfo.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.radio@1.0::types.OperatorInfo
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (OperatorStatus)
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/OperatorStatus.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.radio@1.0::types.OperatorStatus
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (PersoSubstate)
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/PersoSubstate.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.radio@1.0::types.PersoSubstate
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (PinState)
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/PinState.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.radio@1.0::types.PinState
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (RadioBandMode)
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/RadioBandMode.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.radio@1.0::types.RadioBandMode
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
@@ -132,9 +523,9 @@
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (RadioPersoSubstate)
+# Build types.hal (RadioError)
#
-GEN := $(intermediates)/android/hardware/radio/1.0/RadioPersoSubstate.java
+GEN := $(intermediates)/android/hardware/radio/1.0/RadioError.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -142,16 +533,16 @@
$(GEN): PRIVATE_CUSTOM_TOOL = \
$(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-Ljava -randroid.hardware:hardware/interfaces \
- android.hardware.radio@1.0::types.RadioPersoSubstate
+ android.hardware.radio@1.0::types.RadioError
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (RadioPinState)
+# Build types.hal (RadioResponseInfo)
#
-GEN := $(intermediates)/android/hardware/radio/1.0/RadioPinState.java
+GEN := $(intermediates)/android/hardware/radio/1.0/RadioResponseInfo.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -159,16 +550,16 @@
$(GEN): PRIVATE_CUSTOM_TOOL = \
$(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-Ljava -randroid.hardware:hardware/interfaces \
- android.hardware.radio@1.0::types.RadioPinState
+ android.hardware.radio@1.0::types.RadioResponseInfo
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (RadioRestrictedState)
+# Build types.hal (RadioResponseType)
#
-GEN := $(intermediates)/android/hardware/radio/1.0/RadioRestrictedState.java
+GEN := $(intermediates)/android/hardware/radio/1.0/RadioResponseType.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -176,7 +567,7 @@
$(GEN): PRIVATE_CUSTOM_TOOL = \
$(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-Ljava -randroid.hardware:hardware/interfaces \
- android.hardware.radio@1.0::types.RadioRestrictedState
+ android.hardware.radio@1.0::types.RadioResponseType
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
@@ -200,14 +591,358 @@
LOCAL_GENERATED_SOURCES += $(GEN)
#
+# Build types.hal (RadioTechnology)
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/RadioTechnology.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.radio@1.0::types.RadioTechnology
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (RegState)
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/RegState.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.radio@1.0::types.RegState
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (RestrictedState)
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/RestrictedState.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.radio@1.0::types.RestrictedState
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (SapApduType)
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/SapApduType.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.radio@1.0::types.SapApduType
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (SapConnectRsp)
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/SapConnectRsp.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.radio@1.0::types.SapConnectRsp
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (SapDisconnectType)
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/SapDisconnectType.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.radio@1.0::types.SapDisconnectType
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (SapResultCode)
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/SapResultCode.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.radio@1.0::types.SapResultCode
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (SapStatus)
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/SapStatus.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.radio@1.0::types.SapStatus
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (SapTransferProtocol)
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/SapTransferProtocol.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.radio@1.0::types.SapTransferProtocol
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (SendSmsResult)
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/SendSmsResult.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.radio@1.0::types.SendSmsResult
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (SetupDataCallResult)
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/SetupDataCallResult.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.radio@1.0::types.SetupDataCallResult
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (SignalStrength)
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/SignalStrength.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.radio@1.0::types.SignalStrength
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (SmsAcknowledgeFailCause)
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/SmsAcknowledgeFailCause.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.radio@1.0::types.SmsAcknowledgeFailCause
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (SmsWriteArgs)
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/SmsWriteArgs.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.radio@1.0::types.SmsWriteArgs
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (SmsWriteArgsStatus)
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/SmsWriteArgsStatus.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.radio@1.0::types.SmsWriteArgsStatus
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (TdScdmaSignalStrength)
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/TdScdmaSignalStrength.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.radio@1.0::types.TdScdmaSignalStrength
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (UusDcs)
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/UusDcs.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.radio@1.0::types.UusDcs
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (UusInfo)
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/UusInfo.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.radio@1.0::types.UusInfo
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (UusType)
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/UusType.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.radio@1.0::types.UusType
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (VoiceRegStateResult)
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/VoiceRegStateResult.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.radio@1.0::types.VoiceRegStateResult
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
# Build IRadio.hal
#
GEN := $(intermediates)/android/hardware/radio/1.0/IRadio.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IRadio.hal
-$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/IRadioCallback.hal
-$(GEN): $(LOCAL_PATH)/IRadioCallback.hal
+$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/IRadioIndication.hal
+$(GEN): $(LOCAL_PATH)/IRadioIndication.hal
+$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/IRadioResponse.hal
+$(GEN): $(LOCAL_PATH)/IRadioResponse.hal
+$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/types.hal
+$(GEN): $(LOCAL_PATH)/types.hal
$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
$(GEN): PRIVATE_CUSTOM_TOOL = \
$(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
@@ -219,21 +954,80 @@
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build IRadioCallback.hal
+# Build IRadioIndication.hal
#
-GEN := $(intermediates)/android/hardware/radio/1.0/IRadioCallback.java
+GEN := $(intermediates)/android/hardware/radio/1.0/IRadioIndication.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IRadioCallback.hal
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IRadioIndication.hal
$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/types.hal
$(GEN): $(LOCAL_PATH)/types.hal
$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
$(GEN): PRIVATE_CUSTOM_TOOL = \
$(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-Ljava -randroid.hardware:hardware/interfaces \
- android.hardware.radio@1.0::IRadioCallback
+ android.hardware.radio@1.0::IRadioIndication
-$(GEN): $(LOCAL_PATH)/IRadioCallback.hal
+$(GEN): $(LOCAL_PATH)/IRadioIndication.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build IRadioResponse.hal
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/IRadioResponse.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IRadioResponse.hal
+$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/types.hal
+$(GEN): $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.radio@1.0::IRadioResponse
+
+$(GEN): $(LOCAL_PATH)/IRadioResponse.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build ISap.hal
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/ISap.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/ISap.hal
+$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/ISapCallback.hal
+$(GEN): $(LOCAL_PATH)/ISapCallback.hal
+$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/types.hal
+$(GEN): $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.radio@1.0::ISap
+
+$(GEN): $(LOCAL_PATH)/ISap.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build ISapCallback.hal
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/ISapCallback.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/ISapCallback.hal
+$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/types.hal
+$(GEN): $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.radio@1.0::ISapCallback
+
+$(GEN): $(LOCAL_PATH)/ISapCallback.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
include $(BUILD_JAVA_LIBRARY)
@@ -250,9 +1044,9 @@
HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
#
-# Build types.hal (RadioAppState)
+# Build types.hal (AppState)
#
-GEN := $(intermediates)/android/hardware/radio/1.0/RadioAppState.java
+GEN := $(intermediates)/android/hardware/radio/1.0/AppState.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -260,16 +1054,16 @@
$(GEN): PRIVATE_CUSTOM_TOOL = \
$(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-Ljava -randroid.hardware:hardware/interfaces \
- android.hardware.radio@1.0::types.RadioAppState
+ android.hardware.radio@1.0::types.AppState
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (RadioAppStatus)
+# Build types.hal (AppStatus)
#
-GEN := $(intermediates)/android/hardware/radio/1.0/RadioAppStatus.java
+GEN := $(intermediates)/android/hardware/radio/1.0/AppStatus.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -277,16 +1071,16 @@
$(GEN): PRIVATE_CUSTOM_TOOL = \
$(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-Ljava -randroid.hardware:hardware/interfaces \
- android.hardware.radio@1.0::types.RadioAppStatus
+ android.hardware.radio@1.0::types.AppStatus
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (RadioAppType)
+# Build types.hal (AppType)
#
-GEN := $(intermediates)/android/hardware/radio/1.0/RadioAppType.java
+GEN := $(intermediates)/android/hardware/radio/1.0/AppType.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -294,16 +1088,16 @@
$(GEN): PRIVATE_CUSTOM_TOOL = \
$(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-Ljava -randroid.hardware:hardware/interfaces \
- android.hardware.radio@1.0::types.RadioAppType
+ android.hardware.radio@1.0::types.AppType
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (RadioCardState)
+# Build types.hal (Call)
#
-GEN := $(intermediates)/android/hardware/radio/1.0/RadioCardState.java
+GEN := $(intermediates)/android/hardware/radio/1.0/Call.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -311,16 +1105,16 @@
$(GEN): PRIVATE_CUSTOM_TOOL = \
$(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-Ljava -randroid.hardware:hardware/interfaces \
- android.hardware.radio@1.0::types.RadioCardState
+ android.hardware.radio@1.0::types.Call
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (RadioCardStatus)
+# Build types.hal (CallForwardInfo)
#
-GEN := $(intermediates)/android/hardware/radio/1.0/RadioCardStatus.java
+GEN := $(intermediates)/android/hardware/radio/1.0/CallForwardInfo.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -328,7 +1122,398 @@
$(GEN): PRIVATE_CUSTOM_TOOL = \
$(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-Ljava -randroid.hardware:hardware/interfaces \
- android.hardware.radio@1.0::types.RadioCardStatus
+ android.hardware.radio@1.0::types.CallForwardInfo
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (CallForwardInfoStatus)
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/CallForwardInfoStatus.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.radio@1.0::types.CallForwardInfoStatus
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (CallPresentation)
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/CallPresentation.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.radio@1.0::types.CallPresentation
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (CallState)
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/CallState.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.radio@1.0::types.CallState
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (CardState)
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/CardState.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.radio@1.0::types.CardState
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (CardStatus)
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/CardStatus.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.radio@1.0::types.CardStatus
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (CdmaSignalStrength)
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/CdmaSignalStrength.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.radio@1.0::types.CdmaSignalStrength
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (ClipStatus)
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/ClipStatus.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.radio@1.0::types.ClipStatus
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (Clir)
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/Clir.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.radio@1.0::types.Clir
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (DataCallFailCause)
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/DataCallFailCause.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.radio@1.0::types.DataCallFailCause
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (DataProfile)
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/DataProfile.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.radio@1.0::types.DataProfile
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (DataRegStateResult)
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/DataRegStateResult.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.radio@1.0::types.DataRegStateResult
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (Dial)
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/Dial.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.radio@1.0::types.Dial
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (EvdoSignalStrength)
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/EvdoSignalStrength.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.radio@1.0::types.EvdoSignalStrength
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (GwSignalStrength)
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/GwSignalStrength.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.radio@1.0::types.GwSignalStrength
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (IccIo)
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/IccIo.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.radio@1.0::types.IccIo
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (IccIoResult)
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/IccIoResult.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.radio@1.0::types.IccIoResult
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (LastCallFailCause)
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/LastCallFailCause.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.radio@1.0::types.LastCallFailCause
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (LteSignalStrength)
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/LteSignalStrength.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.radio@1.0::types.LteSignalStrength
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (OperatorInfo)
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/OperatorInfo.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.radio@1.0::types.OperatorInfo
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (OperatorStatus)
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/OperatorStatus.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.radio@1.0::types.OperatorStatus
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (PersoSubstate)
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/PersoSubstate.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.radio@1.0::types.PersoSubstate
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (PinState)
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/PinState.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.radio@1.0::types.PinState
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (RadioBandMode)
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/RadioBandMode.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.radio@1.0::types.RadioBandMode
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
@@ -369,9 +1554,9 @@
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (RadioPersoSubstate)
+# Build types.hal (RadioError)
#
-GEN := $(intermediates)/android/hardware/radio/1.0/RadioPersoSubstate.java
+GEN := $(intermediates)/android/hardware/radio/1.0/RadioError.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -379,16 +1564,16 @@
$(GEN): PRIVATE_CUSTOM_TOOL = \
$(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-Ljava -randroid.hardware:hardware/interfaces \
- android.hardware.radio@1.0::types.RadioPersoSubstate
+ android.hardware.radio@1.0::types.RadioError
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (RadioPinState)
+# Build types.hal (RadioResponseInfo)
#
-GEN := $(intermediates)/android/hardware/radio/1.0/RadioPinState.java
+GEN := $(intermediates)/android/hardware/radio/1.0/RadioResponseInfo.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -396,16 +1581,16 @@
$(GEN): PRIVATE_CUSTOM_TOOL = \
$(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-Ljava -randroid.hardware:hardware/interfaces \
- android.hardware.radio@1.0::types.RadioPinState
+ android.hardware.radio@1.0::types.RadioResponseInfo
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (RadioRestrictedState)
+# Build types.hal (RadioResponseType)
#
-GEN := $(intermediates)/android/hardware/radio/1.0/RadioRestrictedState.java
+GEN := $(intermediates)/android/hardware/radio/1.0/RadioResponseType.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -413,7 +1598,7 @@
$(GEN): PRIVATE_CUSTOM_TOOL = \
$(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-Ljava -randroid.hardware:hardware/interfaces \
- android.hardware.radio@1.0::types.RadioRestrictedState
+ android.hardware.radio@1.0::types.RadioResponseType
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
@@ -437,14 +1622,358 @@
LOCAL_GENERATED_SOURCES += $(GEN)
#
+# Build types.hal (RadioTechnology)
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/RadioTechnology.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.radio@1.0::types.RadioTechnology
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (RegState)
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/RegState.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.radio@1.0::types.RegState
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (RestrictedState)
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/RestrictedState.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.radio@1.0::types.RestrictedState
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (SapApduType)
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/SapApduType.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.radio@1.0::types.SapApduType
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (SapConnectRsp)
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/SapConnectRsp.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.radio@1.0::types.SapConnectRsp
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (SapDisconnectType)
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/SapDisconnectType.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.radio@1.0::types.SapDisconnectType
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (SapResultCode)
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/SapResultCode.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.radio@1.0::types.SapResultCode
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (SapStatus)
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/SapStatus.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.radio@1.0::types.SapStatus
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (SapTransferProtocol)
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/SapTransferProtocol.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.radio@1.0::types.SapTransferProtocol
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (SendSmsResult)
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/SendSmsResult.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.radio@1.0::types.SendSmsResult
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (SetupDataCallResult)
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/SetupDataCallResult.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.radio@1.0::types.SetupDataCallResult
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (SignalStrength)
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/SignalStrength.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.radio@1.0::types.SignalStrength
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (SmsAcknowledgeFailCause)
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/SmsAcknowledgeFailCause.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.radio@1.0::types.SmsAcknowledgeFailCause
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (SmsWriteArgs)
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/SmsWriteArgs.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.radio@1.0::types.SmsWriteArgs
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (SmsWriteArgsStatus)
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/SmsWriteArgsStatus.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.radio@1.0::types.SmsWriteArgsStatus
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (TdScdmaSignalStrength)
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/TdScdmaSignalStrength.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.radio@1.0::types.TdScdmaSignalStrength
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (UusDcs)
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/UusDcs.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.radio@1.0::types.UusDcs
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (UusInfo)
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/UusInfo.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.radio@1.0::types.UusInfo
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (UusType)
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/UusType.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.radio@1.0::types.UusType
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (VoiceRegStateResult)
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/VoiceRegStateResult.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.radio@1.0::types.VoiceRegStateResult
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
# Build IRadio.hal
#
GEN := $(intermediates)/android/hardware/radio/1.0/IRadio.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IRadio.hal
-$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/IRadioCallback.hal
-$(GEN): $(LOCAL_PATH)/IRadioCallback.hal
+$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/IRadioIndication.hal
+$(GEN): $(LOCAL_PATH)/IRadioIndication.hal
+$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/IRadioResponse.hal
+$(GEN): $(LOCAL_PATH)/IRadioResponse.hal
+$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/types.hal
+$(GEN): $(LOCAL_PATH)/types.hal
$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
$(GEN): PRIVATE_CUSTOM_TOOL = \
$(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
@@ -456,21 +1985,80 @@
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build IRadioCallback.hal
+# Build IRadioIndication.hal
#
-GEN := $(intermediates)/android/hardware/radio/1.0/IRadioCallback.java
+GEN := $(intermediates)/android/hardware/radio/1.0/IRadioIndication.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IRadioCallback.hal
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IRadioIndication.hal
$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/types.hal
$(GEN): $(LOCAL_PATH)/types.hal
$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
$(GEN): PRIVATE_CUSTOM_TOOL = \
$(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-Ljava -randroid.hardware:hardware/interfaces \
- android.hardware.radio@1.0::IRadioCallback
+ android.hardware.radio@1.0::IRadioIndication
-$(GEN): $(LOCAL_PATH)/IRadioCallback.hal
+$(GEN): $(LOCAL_PATH)/IRadioIndication.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build IRadioResponse.hal
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/IRadioResponse.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IRadioResponse.hal
+$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/types.hal
+$(GEN): $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.radio@1.0::IRadioResponse
+
+$(GEN): $(LOCAL_PATH)/IRadioResponse.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build ISap.hal
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/ISap.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/ISap.hal
+$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/ISapCallback.hal
+$(GEN): $(LOCAL_PATH)/ISapCallback.hal
+$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/types.hal
+$(GEN): $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.radio@1.0::ISap
+
+$(GEN): $(LOCAL_PATH)/ISap.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build ISapCallback.hal
+#
+GEN := $(intermediates)/android/hardware/radio/1.0/ISapCallback.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/ISapCallback.hal
+$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/types.hal
+$(GEN): $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.radio@1.0::ISapCallback
+
+$(GEN): $(LOCAL_PATH)/ISapCallback.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
include $(BUILD_STATIC_JAVA_LIBRARY)
diff --git a/radio/1.0/IRadio.hal b/radio/1.0/IRadio.hal
index 7725e63..38c36e8 100644
--- a/radio/1.0/IRadio.hal
+++ b/radio/1.0/IRadio.hal
@@ -16,27 +16,901 @@
package android.hardware.radio@1.0;
-import IRadioCallback;
+import IRadioResponse;
+import IRadioIndication;
+/*
+ * This interface is used by telephony & telecom to talk to cellular radio.
+ * All the functions have minimum two parameters:
+ * slotId: which corresponds to sim slot id.
+ * serial: which corresponds to serial no. of request. Serial numbers must only be memorized for the
+ * duration of a method call. If clients provide colliding serials (including passing the same
+ * serial to different methods), multiple responses (one for each method call) must still be served.
+ */
interface IRadio {
- /**
- * Set callback that has response functions for requests
+ /*
+ * Set response functions for radio requests & radio indications.
*
* @param slotId SIM slot id for which the function is called; needed for multi-sim
- * @param radioCallback Object containing response callbacks
+ * @param radioResponse Object containing response functions
+ * @param radioIndication Object containing radio indications
*/
- setCallback(int32_t slotId, IRadioCallback radioCallback);
+ setResponseFunctions(int32_t slotId, IRadioResponse radioResponse,
+ IRadioIndication radioIndication);
- /**
+ /*
* Requests status of the ICC card
*
- * Response callback is IRadioCallback.responseGetSimStatus()
+ * @param slotId SIM slot id for which the function is called; needed for multi-sim
+ * @param serial Serial number of request.
*
- * Valid errors:
- * Must never fail for a valid slot id
+ * Response function is IRadioResponse.getIccCardStatusResponse()
+ *
+ */
+ oneway getIccCardStatus(int32_t slotId, int32_t serial);
+
+ /*
+ * Supplies ICC PIN. Only called if CardStatus has AppState.PIN state
*
* @param slotId SIM slot id for which the function is called; needed for multi-sim
- * @param serial Serial number of request
+ * @param serial Serial number of request.
+ * @param pin PIN value
+ * @param aid AID value, See ETSI 102.221 8.1 and 101.220 4, empty string if no value.
+ *
+ * Response function is IRadioResponse.supplyIccPinForAppResponse()
+ *
*/
- oneway requestGetSimStatus(int32_t slotId, int32_t serial);
-};
+ oneway supplyIccPinForApp(int32_t slotId, int32_t serial, string pin, string aid);
+
+ /*
+ * Supplies ICC PUK and new PIN.
+ *
+ * @param slotId SIM slot id for which the function is called; needed for multi-sim
+ * @param serial Serial number of request.
+ * @param puk PUK value
+ * @param pin New PIN value
+ * @param aid AID value, See ETSI 102.221 8.1 and 101.220 4, empty string if no value.
+ *
+ * Response function is IRadioResponse.supplyIccPukForAppResponse()
+ *
+ */
+ oneway supplyIccPukForApp(int32_t slotId, int32_t serial, string puk, string pin, string aid);
+
+ /*
+ * Supplies ICC PIN2. Only called following operation where SIM_PIN2 was
+ * returned as a a failure from a previous operation.
+ *
+ * @param slotId SIM slot id for which the function is called; needed for multi-sim
+ * @param serial Serial number of request.
+ * @param pin2 PIN2 value
+ * @param aid AID value, See ETSI 102.221 8.1 and 101.220 4, empty string if no value.
+ *
+ * Response function is IRadioResponse.supplyIccPin2ForAppResponse()
+ *
+ */
+ oneway supplyIccPin2ForApp(int32_t slotId, int32_t serial, string pin2, string aid);
+
+ /*
+ * Supplies ICC PUK2 and new PIN2.
+ *
+ * @param slotId SIM slot id for which the function is called; needed for multi-sim
+ * @param serial Serial number of request.
+ * @param puk2 PUK2 value
+ * @param pin2 New PIN2 value
+ * @param aid AID value, See ETSI 102.221 8.1 and 101.220 4, empty string if no value.
+ *
+ * Response function is IRadioResponse.supplyIccPuk2ForAppResponse()
+ *
+ */
+ oneway supplyIccPuk2ForApp(int32_t slotId, int32_t serial, string puk2, string pin2,
+ string aid);
+
+ /*
+ * Supplies old ICC PIN and new PIN.
+ *
+ * @param slotId SIM slot id for which the function is called; needed for multi-sim
+ * @param serial Serial number of request.
+ * @param oldPin Old pin value
+ * @param newPin New pin value
+ * @param aid AID value, See ETSI 102.221 8.1 and 101.220 4, empty string if no value.
+ *
+ * Response function is IRadioResponse.changeIccPinForAppResponse()
+ *
+ */
+ oneway changeIccPinForApp(int32_t slotId, int32_t serial, string oldPin, string newPin,
+ string aid);
+
+ /*
+ * Supplies old ICC PIN2 and new PIN2.
+ *
+ * @param slotId SIM slot id for which the function is called; needed for multi-sim
+ * @param serial Serial number of request.
+ * @param oldPin2 Old pin2 value
+ * @param newPin2 New pin2 value
+ * @param aid AID value, See ETSI 102.221 8.1 and 101.220 4, empty string if no value.
+ *
+ * Response function is IRadioResponse.changeIccPin2ForAppResponse()
+ *
+ */
+ oneway changeIccPin2ForApp(int32_t slotId, int32_t serial, string oldPin2, string newPin2,
+ string aid);
+
+ /*
+ * Requests that network personalization be deactivated
+ *
+ * @param slotId SIM slot id for which the function is called; needed for multi-sim
+ * @param serial Serial number of request.
+ * @param netPin Network depersonlization code
+ *
+ * Response function is IRadioResponse.supplyNetworkDepersonalizationResponse()
+ *
+ */
+ oneway supplyNetworkDepersonalization(int32_t slotId, int32_t serial, string netPin);
+
+ /*
+ * Requests current call list
+ *
+ * @param slotId SIM slot id for which the function is called; needed for multi-sim
+ * @param serial Serial number of request.
+ *
+ * Response function is IRadioResponse.getCurrentCallsResponse()
+ *
+ */
+ oneway getCurrentCalls(int32_t slotId, int32_t serial);
+
+ /*
+ * Initiate voice call.
+ * This method is never used for supplementary service codes
+ *
+ * @param slotId SIM slot id for which the function is called; needed for multi-sim
+ * @param serial Serial number of request.
+ * @param dialInfo Dial struct
+ *
+ * Response function is IRadioResponse.dialResponse()
+ *
+ */
+ oneway dial(int32_t slotId, int32_t serial, Dial dialInfo);
+
+ /*
+ * Get the SIM IMSI
+ * Only valid when radio state is "RADIO_STATE_ON"
+ *
+ * @param slotId SIM slot id for which the function is called; needed for multi-sim
+ * @param serial Serial number of request.
+ * @param aid AID value, See ETSI 102.221 8.1 and 101.220 4, empty string if no value.
+ *
+ * Response function is IRadioResponse.getImsiForAppResponse()
+ *
+ */
+ oneway getImsiForApp(int32_t slotId, int32_t serial, string aid);
+
+ /*
+ * Hang up a specific line (like AT+CHLD=1x)
+ * After this HANGUP request returns, Radio must show the connection is NOT
+ * active anymore in next requestGetCurrentCalls query.
+ *
+ * @param slotId SIM slot id for which the function is called; needed for multi-sim
+ * @param serial Serial number of request.
+ * @param gsmIndex Connection index (value of 'x' in CHLD above)
+ *
+ * Response function is IRadioResponse.hangupResponse()
+ *
+ */
+ oneway hangup(int32_t slotId, int32_t serial, int32_t gsmIndex);
+
+ /*
+ * Hang up waiting or held (like AT+CHLD=0)
+ * After this HANGUP request returns, Radio must show the connection is NOT
+ * active anymore in next getCurrentCalls() query.
+ *
+ * @param slotId SIM slot id for which the function is called; needed for multi-sim
+ * @param serial Serial number of request.
+ *
+ * Response function is IRadioResponse.hangupWaitingOrBackgroundResponse()
+ *
+ */
+ oneway hangupWaitingOrBackground(int32_t slotId, int32_t serial);
+
+ /*
+ * Hang up waiting or held (like AT+CHLD=1)
+ * After this HANGUP request returns, Radio must show the connection is NOT
+ * active anymore in next getCurrentCalls query.
+ *
+ * @param slotId SIM slot id for which the function is called; needed for multi-sim
+ * @param serial Serial number of request.
+ *
+ * Response function is IRadioResponse.hangupForegroundResumeBackgroundResponse()
+ *
+ */
+ oneway hangupForegroundResumeBackground(int32_t slotId, int32_t serial);
+
+ /*
+ * Switch waiting or holding call and active call (like AT+CHLD=2)
+ * State transitions must be as follows:
+ *
+ * Call transitions must happen as shown below.
+ *
+ * BEFORE AFTER
+ * Call 1 Call 2 Call 1 Call 2
+ * ACTIVE HOLDING HOLDING ACTIVE
+ * ACTIVE WAITING HOLDING ACTIVE
+ * HOLDING WAITING HOLDING ACTIVE
+ * ACTIVE IDLE HOLDING IDLE
+ * IDLE IDLE IDLE IDLE
+ *
+ * @param slotId SIM slot id for which the function is called; needed for multi-sim
+ * @param serial Serial number of request.
+ *
+ * Response function is IRadioResponse.switchWaitingOrHoldingAndActiveResponse()
+ *
+ */
+ oneway switchWaitingOrHoldingAndActive(int32_t slotId, int32_t serial);
+
+ /*
+ * Conference holding and active (like AT+CHLD=3)
+ *
+ * @param slotId SIM slot id for which the function is called; needed for multi-sim
+ * @param serial Serial number of request.
+ *
+ * Response function is IRadioResponse.conferenceResponse()
+ *
+ */
+ oneway conference(int32_t slotId, int32_t serial);
+
+ /*
+ * Send UDUB (user determined user busy) to ringing or
+ * waiting call answer)
+ *
+ * @param slotId SIM slot id for which the function is called; needed for multi-sim
+ * @param serial Serial number of request.
+ *
+ * Response function is IRadioResponse.rejectCallResponse()
+ *
+ */
+ oneway rejectCall(int32_t slotId, int32_t serial);
+
+ /*
+ * Requests the failure cause code for the most recently terminated call.
+ *
+ * @param slotId SIM slot id for which the function is called; needed for multi-sim
+ * @param serial Serial number of request.
+ *
+ * Response function is IRadioResponse.getLastCallFailCauseResponse()
+ *
+ */
+ oneway getLastCallFailCause(int32_t slotId, int32_t serial);
+
+ /*
+ * Requests current signal strength and associated information.
+ * Must succeed if radio is on.
+ *
+ * @param slotId SIM slot id for which the function is called; needed for multi-sim
+ * @param serial Serial number of request.
+ *
+ * Response function is IRadioResponse.getSignalStrengthResponse()
+ */
+ oneway getSignalStrength(int32_t slotId, int32_t serial);
+
+ /*
+ * Request current voice registration state
+ *
+ * @param slotId SIM slot id for which the function is called; needed for multi-sim
+ * @param serial Serial number of request.
+ *
+ * Response function is IRadioResponse.getVoiceRegistrationStateResponse()
+ */
+ oneway getVoiceRegistrationState(int32_t slotId, int32_t serial);
+
+ /*
+ * Request current data registration state
+ *
+ * @param slotId SIM slot id for which the function is called; needed for multi-sim
+ * @param serial Serial number of request.
+ *
+ * Response function is IRadioResponse.getDataRegistrationStateResponse()
+ */
+ oneway getDataRegistrationState(int32_t slotId, int32_t serial);
+
+ /*
+ * Request current operator ONS or EONS
+ *
+ * @param slotId SIM slot id for which the function is called; needed for multi-sim
+ * @param serial Serial number of request.
+ *
+ * Response function is IRadioResponse.getOperatorResponse()
+ */
+ oneway getOperator(int32_t slotId, int32_t serial);
+
+ /*
+ * Toggle radio on and off (for "airplane" mode)
+ * If the radio is turned off/on the radio modem subsystem
+ * is expected return to an initialized state. For instance,
+ * any voice and data calls must be terminated and all associated
+ * lists emptied.
+ *
+ * @param slotId SIM slot id for which the function is called; needed for multi-sim
+ * @param serial Serial number of request.
+ * @param on To turn on radio -> on = true, to turn off radio -> on = false.
+ *
+ * Response function is IRadioResponse.setRadioPowerResponse()
+ */
+ oneway setRadioPower(int32_t slotId, int32_t serial, bool on);
+
+ /*
+ * Send a DTMF tone
+ *
+ * If the implementation is currently playing a tone requested via
+ * startDtmf(), that tone must be cancelled and the new tone
+ * must be played instead
+ *
+ * @param slotId SIM slot id for which the function is called; needed for multi-sim
+ * @param serial Serial number of request.
+ * @param s string with single char having one of 12 values: 0-9, *, #
+ *
+ * Response function is IRadioResponse.sendDtmfResponse()
+ */
+ oneway sendDtmf(int32_t slotId, int32_t serial, string s);
+
+ /*
+ * Send an SMS message
+ *
+ * @param slotId SIM slot id for which the function is called; needed for multi-sim
+ * @param serial Serial number of request.
+ * @param smscPDU is SMSC address in GSM BCD format prefixed by a length byte
+ * (as expected by TS 27.005) or empty string for default SMSC
+ * @param pdu is SMS in PDU format as an ASCII hex string less the SMSC address
+ * TP-Layer-Length is be "strlen(pdu)/2"
+ *
+ * Response function is IRadioResponse.sendSmsResponse()
+ *
+ * Based on the return error, caller decides to resend if sending sms
+ * fails. RadioError:SMS_SEND_FAIL_RETRY means retry (i.e. error cause is 332)
+ * and RadioError:GENERIC_FAILURE means no retry (i.e. error cause is 500)
+ */
+ oneway sendSms(int32_t slotId, int32_t serial, string smscPDU, string pdu);
+
+ /*
+ * Send an SMS message. Identical to sendSms,
+ * except that more messages are expected to be sent soon. If possible,
+ * keep SMS relay protocol link open (eg TS 27.005 AT+CMMS command)
+ *
+ * @param slotId SIM slot id for which the function is called; needed for multi-sim
+ * @param serial Serial number of request.
+ * @param smscPDU is SMSC address in GSM BCD format prefixed by a length byte
+ * (as expected by TS 27.005) or empty string for default SMSC
+ * @param pdu is SMS in PDU format as an ASCII hex string less the SMSC address
+ * TP-Layer-Length is be "strlen(pdu)/2"
+ *
+ * Response function is IRadioResponse.sendSMSExpectMoreResponse()
+ *
+ * Based on the return error, caller decides to resend if sending sms
+ * fails. RadioError:SMS_SEND_FAIL_RETRY means retry (i.e. error cause is 332)
+ * and RadioError:GENERIC_FAILURE means no retry (i.e. error cause is 500)
+ */
+ oneway sendSMSExpectMore(int32_t slotId, int32_t serial, string smscPDU, string pdu);
+
+ /*
+ * Setup a packet data connection. If DataCallResponse.status
+ * return DataCallFailCause:NONE it is added to the list of data calls and a
+ * unsolDataCallListChanged() is sent. The call remains in the
+ * list until deactivateDataCall() is issued or the
+ * radio is powered off/on. This list is returned by getDataCallList()
+ * and dataCallListChanged().
+ *
+ * The RIL is expected to:
+ * - Create one data call context.
+ * - Create and configure a dedicated interface for the context
+ * - The interface must be point to point.
+ * - The interface is configured with one or more addresses and
+ * is capable of sending and receiving packets. The prefix length
+ * of the addresses must be /32 for IPv4 and /128 for IPv6.
+ * - Must NOT change the linux routing table.
+ * - Support up to getDataRegistrationState response[5]
+ * number of simultaneous data call contexts.
+ *
+ * @param slotId SIM slot id for which the function is called; needed for multi-sim
+ * @param serial Serial number of request.
+ * @param radioTechnology Radio technology to use: 0-CDMA, 1-GSM/UMTS, 2...
+ * for values above 2 this is RadioTechnology + 2.
+ * @param profile is a RadioDataProfile (support is optional)
+ * @param apn is the APN to connect to if radio technology is GSM/UMTS. This APN must
+ * override the one in the profile. empty string indicates no APN overrride.
+ * @param user is the username for APN, or empty string
+ * @param password is the password for APN, or empty string
+ * @param authType is the PAP / CHAP auth type. Values:
+ * 0 => PAP and CHAP is never performed.
+ * 1 => PAP may be performed; CHAP is never performed.
+ * 2 => CHAP may be performed; PAP is never performed.
+ * 3 => PAP / CHAP may be performed - baseband dependent.
+ * @param protocol is the connection type to request must be one of the
+ * PDP_type values in TS 27.007 section 10.1.1.
+ * For example, "IP", "IPV6", "IPV4V6", or "PPP".
+ *
+ * Response function is IRadioResponse.setupDataCallResponse()
+ */
+ oneway setupDataCall(int32_t slotId, int32_t serial, int32_t radioTechnology,
+ int32_t profile, string apn, string user, string password, int32_t authType,
+ string protocol);
+
+ /*
+ * Request ICC I/O operation.
+ * This is similar to the TS 27.007 "restricted SIM" operation
+ * where it assumes all of the EF selection must be done by the
+ * callee
+ *
+ * Arguments and responses that are unused for certain
+ * values of "command" must be ignored or set to empty string
+ *
+ * @param slotId SIM slot id for which the function is called; needed for multi-sim
+ * @param serial Serial number of request.
+ * @param iccIo IccIo
+ *
+ * Please note that IccIo has a "PIN2" field which may be empty string,
+ * or may specify a PIN2 for operations that require a PIN2 (eg
+ * updating FDN records)
+ *
+ * Response function is IRadioResponse.iccIOForAppResponse()
+ */
+ oneway iccIOForApp(int32_t slotId, int32_t serial, IccIo iccIo);
+
+ /*
+ * Send a USSD message.
+ *
+ * If a USSD session already exists, the message must be sent in the
+ * context of that session. Otherwise, a new session must be created.
+ *
+ * The network reply must be reported via unsolOnUssd
+ *
+ * Only one USSD session must exist at a time, and the session is assumed
+ * to exist until:
+ * a) The android system invokes cancelUssd()
+ * b) The implementation sends a unsolOnUssd() with a type code
+ * of "0" (USSD-Notify/no further action) or "2" (session terminated)
+ *
+ * @param slotId SIM slot id for which the function is called; needed for multi-sim
+ * @param serial Serial number of request.
+ * @param ussd string containing the USSD request in UTF-8 format
+ *
+ * Response function is IRadioResponse.sendUssdResponse()
+ *
+ * See also requestCancelUssd, unsolOnUssd
+ */
+ oneway sendUssd(int32_t slotId, int32_t serial, string ussd);
+
+ /*
+ * Cancel the current USSD session if one exists.
+ *
+ * @param slotId SIM slot id for which the function is called; needed for multi-sim
+ * @param serial Serial number of request.
+ *
+ * Response function is IRadioResponse.cancelPendingUssdResponse()
+ */
+ oneway cancelPendingUssd(int32_t slotId, int32_t serial);
+
+ /*
+ * Gets current CLIR status
+ *
+ * @param slotId SIM slot id for which the function is called; needed for multi-sim
+ * @param serial Serial number of request.
+ *
+ * Response function is IRadioResponse.getClirResponse()
+ */
+ oneway getClir(int32_t slotId, int32_t serial);
+
+ /*
+ * Set current CLIR status
+ *
+ * @param slotId SIM slot id for which the function is called; needed for multi-sim
+ * @param serial Serial number of request.
+ * @param status "n" parameter from TS 27.007 7.7
+ *
+ * Response function is IRadioResponse.setClirResponse()
+ */
+ oneway setClir(int32_t slotId, int32_t serial, int32_t status);
+
+ /*
+ * Request call forward status.
+ *
+ * @param slotId SIM slot id for which the function is called; needed for multi-sim
+ * @param serial Serial number of request.
+ * @param callInfo CallForwardInfo
+ *
+ * Response function is IRadioResponse.getCallForwardStatusResponse()
+ */
+ oneway getCallForwardStatus(int32_t slotId, int32_t serial,
+ CallForwardInfo callInfo);
+
+ /*
+ * Configure call forward rule
+ *
+ * @param slotId SIM slot id for which the function is called; needed for multi-sim
+ * @param serial Serial number of request.
+ * @param callInfo CallForwardInfo
+ *
+ * Response function is IRadioResponse.setCallForwardResponse()
+ */
+ oneway setCallForward(int32_t slotId, int32_t serial, CallForwardInfo callInfo);
+
+ /*
+ * Query current call waiting state
+ *
+ * @param slotId SIM slot id for which the function is called; needed for multi-sim
+ * @param serial Serial number of request.
+ * @param serviceClass Service class is the TS 27.007 service class to query
+ *
+ * Response function is IRadioResponse.getCallWaitingResponse()
+ */
+ oneway getCallWaiting(int32_t slotId, int32_t serial, int32_t serviceClass);
+
+ /*
+ * Configure current call waiting state
+ *
+ * @param slotId SIM slot id for which the function is called; needed for multi-sim
+ * @param serial Serial number of request.
+ * @param enable is false for "disabled" and true for "enabled"
+ * @param serviceClass is the TS 27.007 service class bit vector of services to modify
+ *
+ * Response function is IRadioResponse.setCallWaitingResponse()
+ */
+ oneway setCallWaiting(int32_t slotId, int32_t serial, bool enable,
+ int32_t serviceClass);
+
+ /*
+ * Acknowledge successful or failed receipt of SMS previously indicated
+ * via unsolResponseNewSms
+ *
+ * @param slotId SIM slot id for which the function is called; needed for multi-sim
+ * @param serial Serial number of request.
+ * @param success is true on successful receipt
+ * (basically, AT+CNMA=1 from TS 27.005 is 0 on failed receipt
+ * (basically, AT+CNMA=2 from TS 27.005)
+ * @param cause: if success is false, this contains the failure cause as defined
+ * in TS 23.040, 9.2.3.22.
+ *
+ * Response function is IRadioResponse.acknowledgeLastIncomingGsmSmsResponse()
+ */
+ oneway acknowledgeLastIncomingGsmSms(int32_t slotId, int32_t serial, bool success,
+ SmsAcknowledgeFailCause cause);
+
+ /*
+ * Answer incoming call
+ * Must not be called for WAITING calls.
+ * switchWaitingOrHoldingAndActive() must be used in this case
+ * instead
+ *
+ * @param slotId SIM slot id for which the function is called; needed for multi-sim
+ * @param serial Serial number of request.
+ *
+ * Response function is IRadioResponse.acceptCallResponse()
+ */
+ oneway acceptCall(int32_t slotId, int32_t serial);
+
+ /*
+ * Deactivate packet data connection and remove from the
+ * data call list if RadioError:NONE is returned. Any other return
+ * values must also try to remove the call from the list. An
+ * unsolDataCallListChanged must be
+ * issued because of an deactivateDataCall.
+ *
+ * @param slotId SIM slot id for which the function is called; needed for multi-sim
+ * @param serial Serial number of request.
+ * @param cid Indicates CID
+ * @param reasonRadioShutDown Indicates Disconnect Reason
+ * false => No specific reason specified
+ * true => Radio shutdown requested
+ *
+ * Response function is IRadioResponse.deactivateDataCallResponse()
+ */
+ oneway deactivateDataCall(int32_t slotId, int32_t serial, int32_t cid,
+ bool reasonRadioShutDown);
+
+ /*
+ * Query the status of a facility lock state
+ *
+ * @param slotId SIM slot id for which the function is called; needed for multi-sim
+ * @param serial Serial number of request.
+ * @param facility is the facility string code from TS 27.007 7.4
+ * (eg "AO" for BAOC, "SC" for SIM lock)
+ * @param password is the password, or "" if not required
+ * @param serviceClass is the TS 27.007 service class bit vector of services to query
+ * @param appId is AID value, See ETSI 102.221 8.1 and 101.220 4, empty string if no value.
+ * This is only applicable in the case of Fixed Dialing Numbers (FDN) requests.
+ *
+ * Response function is IRadioResponse.getFacilityLockForAppResponse()
+ */
+ oneway getFacilityLockForApp(int32_t slotId, int32_t serial, string facility,
+ string password, int32_t serviceClass, string appId);
+
+ /*
+ * Enable/disable one facility lock
+ *
+ * @param slotId SIM slot id for which the function is called; needed for multi-sim
+ * @param serial Serial number of request.
+ * @param facility is the facility string code from TS 27.007 7.4 (eg "AO" for BAOC)
+ * @param lockState false for "unlock" and true for "lock"
+ * @param password is the password
+ * @param serviceClass is string representation of decimal TS 27.007
+ * service class bit vector. Eg, the string
+ * "1" means "set this facility for voice services"
+ * @param appId is AID value, See ETSI 102.221 8.1 and 101.220 4, empty string if no value.
+ * This is only applicable in the case of Fixed Dialing Numbers (FDN) requests.
+ *
+ * Response function is IRadioResponse.setFacilityLockForAppResponse()
+ */
+ oneway setFacilityLockForApp(int32_t slotId, int32_t serial, string facility, bool lockState,
+ string password, int32_t serviceClass, string appId);
+
+ /*
+ * Change call barring facility password
+ *
+ * @param slotId SIM slot id for which the function is called; needed for multi-sim
+ * @param serial Serial number of request.
+ * @param facility facility string code from TS 27.007 7.4 (eg "AO" for BAOC)
+ * @param oldPassword old password
+ * @param newPassword new password
+ *
+ * Response function is IRadioResponse.setBarringPasswordResponse()
+ */
+ oneway setBarringPassword(int32_t slotId, int32_t serial, string facility,
+ string oldPassword, string newPassword);
+
+ /*
+ * Query current network selection mode
+ *
+ * @param slotId SIM slot id for which the function is called; needed for multi-sim
+ * @param serial Serial number of request.
+ *
+ * Response function is IRadioResponse.getNetworkSelectionModeResponse()
+ */
+ oneway getNetworkSelectionMode(int32_t slotId, int32_t serial);
+
+ /*
+ * Specify that the network must be selected automatically.
+ * This request must not respond until the new operator is selected and registered.
+ *
+ * @param slotId SIM slot id for which the function is called; needed for multi-sim
+ * @param serial Serial number of request.
+ *
+ * Response function is IRadioResponse.setNetworkSelectionModeAutomaticResponse()
+ */
+ oneway setNetworkSelectionModeAutomatic(int32_t slotId, int32_t serial);
+
+ /*
+ * Manually select a specified network.
+ * This request must not respond until the new operator is selected and registered.
+ *
+ * @param slotId SIM slot id for which the function is called; needed for multi-sim
+ * @param serial Serial number of request.
+ * @param operatorNumeric string specifying MCCMNC of network to select (eg "310170")
+ *
+ * Response function is IRadioResponse.setNetworkSelectionModeManualResponse()
+ */
+ oneway setNetworkSelectionModeManual(int32_t slotId, int32_t serial, string operatorNumeric);
+
+ /*
+ * Scans for available networks
+ * This request must not respond until the new operator is selected and registered.
+ *
+ * @param slotId SIM slot id for which the function is called; needed for multi-sim
+ * @param serial Serial number of request.
+ *
+ * Response function is IRadioResponse.getAvailableNetworksResponse()
+ */
+ oneway getAvailableNetworks(int32_t slotId, int32_t serial);
+
+ /*
+ * Start playing a DTMF tone. Continue playing DTMF tone until
+ * stopDtmf is received.
+ * If a startDtmf() is received while a tone is currently playing,
+ * it must cancel the previous tone and play the new one.
+ *
+ * @param slotId SIM slot id for which the function is called; needed for multi-sim
+ * @param serial Serial number of request.
+ * @param s string having a single character with one of 12 values: 0-9,*,#
+ *
+ * Response function is IRadioResponse.startDtmfResponse()
+ */
+ oneway startDtmf(int32_t slotId, int32_t serial, string s);
+
+ /*
+ * Stop playing a currently playing DTMF tone.
+ *
+ * @param slotId SIM slot id for which the function is called; needed for multi-sim
+ * @param serial Serial number of request.
+ *
+ * Response function is IRadioResponse.stopDtmfResponse()
+ */
+ oneway stopDtmf(int32_t slotId, int32_t serial);
+
+ /*
+ * Return string value indicating baseband version, eg response from AT+CGMR
+ *
+ * @param slotId SIM slot id for which the function is called; needed for multi-sim
+ * @param serial Serial number of request.
+ *
+ * Response function is IRadioResponse.getBasebandVersionResponse()
+ */
+ oneway getBasebandVersion(int32_t slotId, int32_t serial);
+
+ /*
+ * Separate a party from a multiparty call placing the multiparty call
+ * (less the specified party) on hold and leaving the specified party
+ * as the only other member of the current (active) call
+ *
+ * Like AT+CHLD=2x
+ *
+ * See TS 22.084 1.3.8.2 (iii)
+ * TS 22.030 6.5.5 "Entering "2X followed by send"
+ * TS 27.007 "AT+CHLD=2x"
+ *
+ * @param slotId SIM slot id for which the function is called; needed for multi-sim
+ * @param serial Serial number of request.
+ * @param gsmIndex contains Connection index (value of 'x' in CHLD above)
+ *
+ * Response function is IRadioResponse.separateConnectionResponse()
+ */
+ oneway separateConnection(int32_t slotId, int32_t serial, int32_t gsmIndex);
+
+ /*
+ * Turn on or off uplink (microphone) mute.
+ * Must only be sent while voice call is active.
+ * Must always be reset to "disable mute" when a new voice call is initiated
+ *
+ * @param slotId SIM slot id for which the function is called; needed for multi-sim
+ * @param serial Serial number of request.
+ * @param enable true for "enable mute" and false for "disable mute"
+ *
+ * Response function is IRadioResponse.setMuteResponse()
+ */
+ oneway setMute(int32_t slotId, int32_t serial, bool enable);
+
+ /*
+ * Queries the current state of the uplink mute setting
+ *
+ * @param slotId SIM slot id for which the function is called; needed for multi-sim
+ * @param serial Serial number of request.
+ *
+ * Response function is IRadioResponse.getMuteResponse()
+ */
+ oneway getMute(int32_t slotId, int32_t serial);
+
+ /*
+ * Queries the status of the CLIP supplementary service
+ * (for MMI code "*#30#")
+ *
+ * @param slotId SIM slot id for which the function is called; needed for multi-sim
+ * @param serial Serial number of request.
+ *
+ * Response function is IRadioResponse.getClipResponse()
+ */
+ oneway getClip(int32_t slotId, int32_t serial);
+
+ /*
+ * Returns the data call list. An entry is added when a
+ * setupDataCall() is issued and removed on a
+ * deactivateDataCall(). The list is emptied when
+ * setRadioPower() off/on is issued.
+ *
+ * @param slotId SIM slot id for which the function is called; needed for multi-sim
+ * @param serial Serial number of request.
+ *
+ * Response function is IRadioResponse.getDataCallListResponse()
+ */
+ oneway getDataCallList(int32_t slotId, int32_t serial);
+
+ /*
+ * This request is reserved for OEM-specific uses. It passes raw byte arrays back and forth.
+ *
+ * @param slotId SIM slot id for which the function is called; needed for multi-sim
+ * @param serial Serial number of request.
+ * @param data data passed as raw bytes to oem
+ *
+ * Response function is IRadioResponse.sendOemRilRequestRawResponse()
+ */
+ oneway sendOemRilRequestRaw(int32_t slotId, int32_t serial, vec<uint8_t> data);
+
+ /*
+ * This request is reserved for OEM-specific uses. It passes strings back and forth.
+ *
+ * @param slotId SIM slot id for which the function is called; needed for multi-sim
+ * @param serial Serial number of request.
+ * @param data data passed as strings to oem
+ *
+ * Response function is IRadioResponse.sendOemRilRequestStringsResponse()
+ */
+ oneway sendOemRilRequestStrings(int32_t slotId, int32_t serial, vec<string> data);
+
+ /*
+ * Indicates the current state of the screen. When the screen is off, the
+ * Radio must notify the baseband to suppress certain notifications (eg,
+ * signal strength and changes in LAC/CID or BID/SID/NID/latitude/longitude)
+ * in an effort to conserve power. These notifications must resume when the
+ * screen is on.
+ *
+ * @param slotId SIM slot id for which the function is called; needed for multi-sim
+ * @param serial Serial number of request.
+ * @param enable true = screen on, false = screen off.
+ *
+ * Response function is IRadioResponse.sendScreenStateResponse()
+ */
+ oneway sendScreenState(int32_t slotId, int32_t serial, bool enable);
+
+ /*
+ * Enables/disables supplementary service related notifications from the network.
+ * Notifications are reported via unsolSuppSvcNotification().
+ *
+ * @param slotId SIM slot id for which the function is called; needed for multi-sim
+ * @param serial Serial number of request.
+ * @param enable true = notifications enabled, false = notifications disabled.
+ *
+ * Response function is IRadioResponse.setSuppServiceNotificationsResponse()
+ */
+ oneway setSuppServiceNotifications(int32_t slotId, int32_t serial, bool enable);
+
+ /*
+ * Stores a SMS message to SIM memory.
+ *
+ * @param slotId SIM slot id for which the function is called; needed for multi-sim
+ * @param serial Serial number of request.
+ * @param smsWriteArgs SmsWriteArgs defined in types.hal
+ *
+ * Response function is IRadioResponse.writeSmsToSimResponse()
+ */
+ oneway writeSmsToSim(int32_t slotId, int32_t serial, SmsWriteArgs smsWriteArgs);
+
+ /*
+ * Deletes a SMS message from SIM memory.
+ *
+ * @param slotId SIM slot id for which the function is called; needed for multi-sim
+ * @param serial Serial number of request.
+ * @param index Record index of the message to delete.
+ *
+ * Response function is IRadioResponse.deleteSmsOnSimResponse()
+ */
+ oneway deleteSmsOnSim(int32_t slotId, int32_t serial, int32_t index);
+
+ /*
+ * Assign a specified band for RF configuration.
+ *
+ * @param slotId SIM slot id for which the function is called; needed for multi-sim
+ * @param serial Serial number of request.
+ * @param mode RadioBandMode defined in types.hal
+ *
+ * Response function is IRadioResponse.setBandModeResponse()
+ */
+ oneway setBandMode(int32_t slotId, int32_t serial, RadioBandMode mode);
+
+ /*
+ * Get the list of band modes supported by RF.
+ *
+ * @param slotId SIM slot id for which the function is called; needed for multi-sim
+ * @param serial Serial number of request.
+ *
+ * Response function is IRadioResponse.getAvailableBandModesResponse()
+ */
+ oneway getAvailableBandModes(int32_t slotId, int32_t serial);
+
+ /*
+ * Requests to send a SAT/USAT envelope command to SIM.
+ * The SAT/USAT envelope command refers to 3GPP TS 11.14 and 3GPP TS 31.111
+ *
+ * @param slotId SIM slot id for which the function is called; needed for multi-sim
+ * @param serial Serial number of request.
+ * @param command SAT/USAT command in hexadecimal format string starting with command tag
+ *
+ * Response function is IRadioResponse.sendEnvelopeResponse()
+ */
+ oneway sendEnvelope(int32_t slotId, int32_t serial, string command);
+
+ /*
+ * Requests to send a terminal response to SIM for a received proactive command
+ *
+ * @param slotId SIM slot id for which the function is called; needed for multi-sim
+ * @param serial Serial number of request.
+ * @param commandResponse SAT/USAT response in hexadecimal format string starting with
+ * first byte of response data
+ *
+ * Response function is IRadioResponse.sendTerminalResponseResponseToSim()
+ */
+ oneway sendTerminalResponseToSim(int32_t slotId, int32_t serial, string commandResponse);
+};
\ No newline at end of file
diff --git a/radio/1.0/IRadioCallback.hal b/radio/1.0/IRadioIndication.hal
similarity index 66%
rename from radio/1.0/IRadioCallback.hal
rename to radio/1.0/IRadioIndication.hal
index c27d168..8f28e3f 100644
--- a/radio/1.0/IRadioCallback.hal
+++ b/radio/1.0/IRadioIndication.hal
@@ -16,20 +16,14 @@
package android.hardware.radio@1.0;
-interface IRadioCallback {
- /**
- * Response callback for IRadio.requestGetSimStatus()
- *
- * @param serial Serial number of request
- * @param cardStatus ICC card status
- */
- responseGetSimStatus(int32_t serial, RadioCardStatus cardStatus);
-
- // ONLY UNSOLICITED CALLBACKS BELOW
- /**
+/*
+ * Interface declaring unsolicited radio indications.
+ */
+interface IRadioIndication {
+ /*
* Called when radio state changes.
*
* @param radioState Current radio state
*/
- oneway unsolRadioStateChanged(RadioState radioState);
-};
+ oneway radioStateChanged(RadioState radioState);
+};
\ No newline at end of file
diff --git a/radio/1.0/IRadioResponse.hal b/radio/1.0/IRadioResponse.hal
new file mode 100644
index 0000000..9efd028
--- /dev/null
+++ b/radio/1.0/IRadioResponse.hal
@@ -0,0 +1,1061 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.radio@1.0;
+
+/*
+ * Interface declaring response functions to solicited radio requests.
+ * Response functions defined in this interface are as per following convention:
+ * <xyz>Response is response to IRadio.<xyz>
+ */
+interface IRadioResponse {
+ /*
+ * @param info Response info struct containing response type, serial no. & error
+ * @param cardStatus ICC card status as defined by CardStatus in types.hal
+ *
+ * Valid errors returned:
+ * RadioError:NONE
+ * RadioError:INVALID_ARGUMENTS
+ */
+ oneway iccCardStatusResponse(RadioResponseInfo info, CardStatus cardStatus);
+
+ /*
+ * @param info Response info struct containing response type, serial no. & error
+ * @param remainingRetries Number of retries remaining, must be equal to -1 if unknown.
+ *
+ * Valid errors returned:
+ * RadioError:NONE
+ * RadioError:INVALID_ARGUMENTS
+ * RadioError:RADIO_NOT_AVAILABLE (radio resetting)
+ * RadioError:GENERIC_FAILURE
+ * RadioError:PASSWORD_INCORRECT
+ */
+ oneway supplyIccPinForAppResponse(RadioResponseInfo info, int32_t remainingRetries);
+
+ /*
+ * @param info Response info struct containing response type, serial no. & error
+ * @param remainingRetries Number of retries remaining, must be equal to -1 if unknown.
+ *
+ * Valid errors returned:
+ * RadioError:NONE
+ * RadioError:INVALID_ARGUMENTS
+ * RadioError:RADIO_NOT_AVAILABLE (radio resetting)
+ * RadioError:GENERIC_FAILURE
+ * RadioError:PASSWORD_INCORRECT (PUK is invalid)
+ */
+ oneway supplyIccPukForAppResponse(RadioResponseInfo info, int32_t remainingRetries);
+
+ /*
+ * @param info Response info struct containing response type, serial no. & error
+ * @param remainingRetries Number of retries remaining, must be equal to -1 if unknown.
+ *
+ * Valid errors returned:
+ * RadioError:NONE
+ * RadioError:INVALID_ARGUMENTS
+ * RadioError:RADIO_NOT_AVAILABLE (radio resetting)
+ * RadioError:GENERIC_FAILURE
+ * RadioError:PASSWORD_INCORRECT
+ */
+ oneway supplyIccPin2ForAppResponse(RadioResponseInfo info, int32_t remainingRetries);
+
+ /*
+ * @param info Response info struct containing response type, serial no. & error
+ * @param remainingRetries Number of retries remaining, must be equal to -1 if unknown.
+ * Valid errors returned:
+ * RadioError:NONE
+ * RadioError:INVALID_ARGUMENTS
+ * RadioError:RADIO_NOT_AVAILABLE (radio resetting)
+ * RadioError:GENERIC_FAILURE
+ * RadioError:PASSWORD_INCORRECT (PUK is invalid)
+ */
+ oneway supplyIccPuk2ForAppResponse(RadioResponseInfo info, int32_t remainingRetries);
+
+ /*
+ * @param info Response info struct containing response type, serial no. & error
+ * @param remainingRetries Number of retries remaining, must be equal to -1 if unknown.
+ *
+ * Valid errors returned:
+ * RadioError:NONE
+ * RadioError:INVALID_ARGUMENTS
+ * RadioError:RADIO_NOT_AVAILABLE (radio resetting)
+ * RadioError:GENERIC_FAILURE
+ * RadioError:PASSWORD_INCORRECT
+ */
+ oneway changeIccPinForAppResponse(RadioResponseInfo info, int32_t remainingRetries);
+
+ /*
+ * @param info Response info struct containing response type, serial no. & error
+ * @param remainingRetries Number of retries remaining, must be equal to -1 if unknown.
+ *
+ * Valid errors returned:
+ * RadioError:NONE
+ * RadioError:INVALID_ARGUMENTS
+ * RadioError:RADIO_NOT_AVAILABLE (radio resetting)
+ * RadioError:GENERIC_FAILURE
+ * RadioError:PASSWORD_INCORRECT (old PIN2 is invalid)
+ */
+ oneway changeIccPin2ForAppResponse(RadioResponseInfo info, int32_t remainingRetries);
+
+ /*
+ * @param info Response info struct containing response type, serial no. & error
+ * @param remainingRetries Number of retries remaining, must be equal to -1 if unknown.
+ *
+ * Valid errors returned:
+ * RadioError:NONE
+ * RadioError:INVALID_ARGUMENTS
+ * RadioError:RADIO_NOT_AVAILABLE (radio resetting)
+ * RadioError:GENERIC_FAILURE
+ * RadioError:PASSWORD_INCORRECT (code is invalid)
+ */
+ oneway supplyNetworkDepersonalizationResponse(RadioResponseInfo info, int32_t remainingRetries);
+
+ /*
+ * @param info Response info struct containing response type, serial no. & error
+ * @param calls Current call list
+ *
+ * Valid errors returned:
+ * RadioError:NONE
+ * RadioError:INVALID_ARGUMENTS
+ * RadioError:RADIO_NOT_AVAILABLE (radio resetting)
+ * RadioError:GENERIC_FAILURE (request will be made again in a few hundred msec)
+ * RadioError:NO_MEMORY
+ */
+ oneway getCurrentCallsResponse(RadioResponseInfo info, vec<Call> calls);
+
+ /*
+ * @param info Response info struct containing response type, serial no. & error
+ *
+ * Valid errors returned:
+ * RadioError:NONE
+ * RadioError:RADIO_NOT_AVAILABLE (radio resetting)
+ * RadioError:GENERIC_FAILURE
+ * RadioError:DIAL_MODIFIED_TO_USSD
+ * RadioError:DIAL_MODIFIED_TO_SS
+ * RadioError:DIAL_MODIFIED_TO_DIAL
+ * RadioError:INVALID_ARGUMENTS
+ * RadioError:NO_MEMORY
+ * RadioError:INVALID_STATE
+ * RadioError:NO_RESOURCES
+ * RadioError:INTERNAL_ERR
+ * RadioError:FDN_CHECK_FAILURE
+ * RadioError:MODEM_ERR
+ * RadioError:NO_SUBSCRIPTION
+ * RadioError:NO_NETWORK_FOUND
+ * RadioError:INVALID_CALL_ID
+ * RadioError:DEVICE_IN_USE
+ * RadioError:MODE_NOT_SUPPORTED
+ * RadioError:ABORTED
+ */
+ oneway dialResponse(RadioResponseInfo info);
+
+ /*
+ * @param info Response info struct containing response type, serial no. & error
+ * @param imsi String containing the IMSI
+ *
+ * Valid errors returned:
+ * RadioError:NONE
+ * RadioError:INVALID_ARGUMENTS
+ * RadioError:RADIO_NOT_AVAILABLE (radio resetting)
+ * RadioError:GENERIC_FAILURE
+ */
+ oneway getIMSIForAppResponse(RadioResponseInfo info, string imsi);
+
+ /*
+ * @param info Response info struct containing response type, serial no. & error
+ *
+ * Valid errors returned:
+ * RadioError:NONE
+ * RadioError:RADIO_NOT_AVAILABLE (radio resetting)
+ * RadioError:INVALID_ARGUMENTS
+ * RadioError:NO_MEMORY
+ * RadioError:INVALID_STATE
+ * RadioError:MODEM_ERR
+ * RadioError:INTERNAL_ERR
+ * RadioError:INVALID_CALL_ID
+ * RadioError:GENERIC_FAILURE
+ */
+ oneway hangupConnectionResponse(RadioResponseInfo info);
+
+ /*
+ * @param info Response info struct containing response type, serial no. & error
+ *
+ * Valid errors returned:
+ * RadioError:NONE
+ * RadioError:RADIO_NOT_AVAILABLE (radio resetting)
+ * RadioError:INVALID_STATE
+ * RadioError:NO_MEMORY
+ * RadioError:MODEM_ERR
+ * RadioError:INTERNAL_ERR
+ * RadioError:INVALID_CALL_ID
+ * RadioError:NO_RESOURCES
+ * RadioError:OPERATION_NOT_ALLOWED
+ * RadioError:INVALID_ARGUMENTS
+ * RadioError:GENERIC_FAILURE
+ */
+ oneway hangupWaitingOrBackgroundResponse(RadioResponseInfo info);
+
+ /*
+ * @param info Response info struct containing response type, serial no. & error
+ *
+ * Valid errors returned:
+ * RadioError:NONE
+ * RadioError:RADIO_NOT_AVAILABLE (radio resetting)
+ * RadioError:INVALID_STATE
+ * RadioError:NO_MEMORY
+ * RadioError:MODEM_ERR
+ * RadioError:INTERNAL_ERR
+ * RadioError:INVALID_CALL_ID
+ * RadioError:NO_RESOURCES
+ * RadioError:OPERATION_NOT_ALLOWED
+ * RadioError:INVALID_ARGUMENTS
+ * RadioError:GENERIC_FAILURE
+ */
+ oneway hangupForegroundResumeBackgroundResponse(RadioResponseInfo info);
+
+ /*
+ * @param info Response info struct containing response type, serial no. & error
+ *
+ * Valid errors returned:
+ * RadioError:NONE
+ * RadioError:RADIO_NOT_AVAILABLE (radio resetting)
+ * RadioError:INVALID_STATE
+ * RadioError:NO_MEMORY
+ * RadioError:MODEM_ERR
+ * RadioError:INTERNAL_ERR
+ * RadioError:INVALID_STATE
+ * RadioError:INVALID_CALL_ID
+ * RadioError:OPERATION_NOT_ALLOWED
+ * RadioError:INVALID_ARGUMENTS
+ * RadioError:GENERIC_FAILURE
+ */
+ oneway switchWaitingOrHoldingAndActiveResponse(RadioResponseInfo info);
+
+ /*
+ * @param info Response info struct containing response type, serial no. & error
+ *
+ * Valid errors returned:
+ * RadioError:NONE
+ * RadioError:RADIO_NOT_AVAILABLE (radio resetting)
+ * RadioError:NO_MEMORY
+ * RadioError:MODEM_ERR
+ * RadioError:INTERNAL_ERR
+ * RadioError:INVALID_STATE
+ * RadioError:INVALID_CALL_ID
+ * RadioError:OPERATION_NOT_ALLOWED
+ * RadioError:INVALID_ARGUMENTS
+ * RadioError:GENERIC_FAILURE
+ */
+ oneway conferenceResponse(RadioResponseInfo info);
+
+ /*
+ * @param info Response info struct containing response type, serial no. & error
+ *
+ * Valid errors returned:
+ * RadioError:NONE
+ * RadioError:RADIO_NOT_AVAILABLE (radio resetting)
+ * RadioError:INVALID_STATE
+ * RadioError:NO_RESOURCES
+ * RadioError:NO_MEMORY
+ * RadioError:MODEM_ERR
+ * RadioError:INTERNAL_ERR
+ * RadioError:INVALID_CALL_ID
+ * RadioError:OPERATION_NOT_ALLOWED
+ * RadioError:INVALID_ARGUMENTS
+ * RadioError:GENERIC_FAILURE
+ */
+ oneway rejectCallResponse(RadioResponseInfo info);
+
+ /*
+ * @param info Response info struct containing response type, serial no. & error
+ * @param failCause failCause is LastCallFailCause. GSM failure reasons are
+ * mapped to cause codes defined in TS 24.008 Annex H where possible. CDMA
+ * failure reasons are derived from the possible call failure scenarios
+ * described in the "CDMA IS-2000 Release A (C.S0005-A v6.0)" standard.
+ *
+ * The implementation must return LastCallFailCause:ERROR_UNSPECIFIED for blocked
+ * MO calls by restricted state (See unsolRestrictedStateChanged)
+ *
+ * If the implementation does not have access to the exact cause codes,
+ * then it must return one of the values listed in LastCallFailCause,
+ * as the UI layer needs to distinguish these cases for tone generation or
+ * error notification.
+ *
+ * Valid errors returned:
+ * RadioError:NONE
+ * RadioError:INVALID_ARGUMENTS
+ * RadioError:RADIO_NOT_AVAILABLE
+ * RadioError:NO_MEMORY
+ * RadioError:GENERIC_FAILURE
+ */
+ oneway getLastCallFailCauseResponse(RadioResponseInfo info, LastCallFailCause failCause);
+
+ /*
+ * @param info Response info struct containing response type, serial no. & error
+ * @param sigStrength Current signal strength
+ *
+ * Valid errors returned:
+ * RadioError:NONE
+ * RadioError:INVALID_ARGUMENTS
+ * RadioError:RADIO_NOT_AVAILABLE
+ */
+ oneway getSignalStrengthResponse(RadioResponseInfo info, SignalStrength sigStrength);
+
+ /*
+ * @param info Response info struct containing response type, serial no. & error
+ * @param voiceRegResponse Current Voice registration response as defined by VoiceRegStateResult
+ * in types.hal
+ *
+ * Valid errors returned:
+ * RadioError:NONE
+ * RadioError:INVALID_ARGUMENTS
+ * RadioError:RADIO_NOT_AVAILABLE
+ * RadioError:GENERIC_FAILURE
+ */
+ oneway getVoiceRegistrationStateResponse(RadioResponseInfo info,
+ VoiceRegStateResult voiceRegResponse);
+
+ /*
+ * @param info Response info struct containing response type, serial no. & error
+ * @param dataRegResponse Current Data registration response as defined by DataRegStateResult in
+ * types.hal
+ *
+ * Valid errors returned:
+ * RadioError:NONE
+ * RadioError:INVALID_ARGUMENTS
+ * RadioError:RADIO_NOT_AVAILABLE
+ * RadioError:GENERIC_FAILURE
+ */
+ oneway getDataRegistrationStateResponse(RadioResponseInfo info,
+ DataRegStateResult dataRegResponse);
+
+ /*
+ * @param info Response info struct containing response type, serial no. & error
+ * @param longName is long alpha ONS or EONS or empty string if unregistered
+ * @param shortName is short alpha ONS or EONS or empty string if unregistered
+ * @param numeric is 5 or 6 digit numeric code (MCC + MNC) or empty string if unregistered
+ *
+ * Valid errors returned:
+ * RadioError:NONE
+ * RadioError:INVALID_ARGUMENTS
+ * RadioError:RADIO_NOT_AVAILABLE
+ * RadioError:GENERIC_FAILURE
+ */
+ oneway getOperatorResponse(RadioResponseInfo info, string longName, string shortName,
+ string numeric);
+
+ /*
+ * @param info Response info struct containing response type, serial no. & error
+ *
+ * Valid errors returned:
+ * RadioError:NONE
+ * RadioError:INVALID_ARGUMENTS
+ * RadioError:RADIO_NOT_AVAILABLE
+ * RadioError:GENERIC_FAILURE
+ * RadioError:OPERATION_NOT_ALLOWED
+ */
+ oneway setRadioPowerResponse(RadioResponseInfo info);
+
+ /*
+ * @param info Response info struct containing response type, serial no. & error
+ *
+ * Valid errors returned:
+ * RadioError:NONE
+ * RadioError:RADIO_NOT_AVAILABLE
+ * RadioError:INVALID_ARGUMENTS
+ * RadioError:NO_RESOURCES
+ * RadioError:NO_MEMORY
+ * RadioError:MODEM_ERR
+ * RadioError:INVALID_CALL_ID
+ * RadioError:GENERIC_FAILURE
+ */
+ oneway sendDtmfResponse(RadioResponseInfo info);
+
+ /*
+ * @param info Response info struct containing response type, serial no. & error
+ * @param sms Response to sms sent as defined by SendSmsResult in types.hal
+ *
+ * Valid errors returned:
+ * RadioError:NONE
+ * RadioError:RADIO_NOT_AVAILABLE
+ * RadioError:SMS_SEND_FAIL_RETRY
+ * RadioError:NETWORK_REJECT
+ * RadioError:INVALID_STATE
+ * RadioError:INVALID_ARGUMENTS
+ * RadioError:NO_MEMORY
+ * RadioError:REQUEST_RATE_LIMITED
+ * RadioError:INVALID_SMS_FORMAT
+ * RadioError:SYSTEM_ERR
+ * RadioError:ENCODING_ERR
+ * RadioError:INVALID_SMSC_ADDRESS
+ * RadioError:MODEM_ERR
+ * RadioError:NETWORK_ERR
+ * RadioError:MODE_NOT_SUPPORTED
+ * RadioError:GENERIC_FAILURE
+ */
+ oneway sendSmsResponse(RadioResponseInfo info, SendSmsResult sms);
+
+ /*
+ * @param info Response info struct containing response type, serial no. & error
+ * @param sms Response to sms sent as defined by SendSmsResult in types.hal
+ *
+ * Valid errors returned:
+ * RadioError:NONE
+ * RadioError:RADIO_NOT_AVAILABLE
+ * RadioError:SMS_SEND_FAIL_RETRY
+ * RadioError:NETWORK_REJECT
+ * RadioError:INVALID_STATE
+ * RadioError:INVALID_ARGUMENTS
+ * RadioError:NO_MEMORY
+ * RadioError:REQUEST_RATE_LIMITED
+ * RadioError:INVALID_SMS_FORMAT
+ * RadioError:SYSTEM_ERR
+ * RadioError:FDN_CHECK_FAILURE
+ * RadioError:ENCODING_ERR
+ * RadioError:INVALID_SMSC_ADDRESS
+ * RadioError:MODEM_ERR
+ * RadioError:NETWORK_ERR
+ * RadioError:MODE_NOT_SUPPORTED
+ * RadioError:GENERIC_FAILURE
+ */
+ oneway sendSMSExpectMoreResponse(RadioResponseInfo info, SendSmsResult sms);
+
+ /*
+ * @param info Response info struct containing response type, serial no. & error
+ * @param dcResponse SetupDataCallResult defined in types.hal
+ *
+ * Valid errors returned:
+ * RadioError:NONE must be returned on both success and failure of setup with the
+ * DataCallResponse.status containing the actual status
+ * For all other errors the DataCallResponse is ignored.
+ * RadioError:INVALID_ARGUMENTS
+ * RadioError:RADIO_NOT_AVAILABLE
+ * RadioError:OP_NOT_ALLOWED_BEFORE_REG_TO_NW
+ * RadioError:OP_NOT_ALLOWED_DURING_VOICE_CALL
+ * RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:GENERIC_FAILURE
+ */
+ oneway setupDataCallResponse(RadioResponseInfo info, SetupDataCallResult dcResponse);
+
+ /*
+ * @param info Response info struct containing response type, serial no. & error
+ * @param iccIo ICC io operation response as defined by IccIoResult in types.hal
+ *
+ * Valid errors returned:
+ * RadioError:NONE
+ * RadioError:INVALID_ARGUMENTS
+ * RadioError:RADIO_NOT_AVAILABLE
+ * RadioError:SIM_PIN2
+ * RadioError:SIM_PUK2
+ * RadioError:GENERIC_FAILURE
+ */
+ oneway iccIOForApp(RadioResponseInfo info, IccIoResult iccIo);
+
+ /*
+ * @param info Response info struct containing response type, serial no. & error
+ *
+ * Valid errors returned:
+ * RadioError:NONE
+ * RadioError:RADIO_NOT_AVAILABLE
+ * RadioError:FDN_CHECK_FAILURE
+ * RadioError:USSD_MODIFIED_TO_DIAL
+ * RadioError:USSD_MODIFIED_TO_SS
+ * RadioError:USSD_MODIFIED_TO_USSD
+ * RadioError:SIM_BUSY
+ * RadioError:OPERATION_NOT_ALLOWED
+ * RadioError:INVALID_ARGUMENTS
+ * RadioError:NO_MEMORY
+ * RadioError:MODEM_ERR
+ * RadioError:INTERNAL_ERR
+ * RadioError:ABORTED
+ * RadioError:SYSTEM_ERR
+ * RadioError:INVALID_STATE
+ * RadioError:GENERIC_FAILURE
+ */
+ oneway sendUssdResponse(RadioResponseInfo info);
+
+ /*
+ * @param info Response info struct containing response type, serial no. & error
+ *
+ * Valid errors returned:
+ * RadioError:NONE
+ * RadioError:INVALID_ARGUMENTS
+ * RadioError:RADIO_NOT_AVAILABLE
+ * RadioError:SIM_BUSY
+ * RadioError:OPERATION_NOT_ALLOWED
+ * RadioError:MODEM_ERR
+ * RadioError:INTERNAL_ERR
+ * RadioError:NO_MEMORY
+ * RadioError:INVALID_STATE
+ * RadioError:GENERIC_FAILURE
+ */
+ oneway cancelPendingUssdResponse(RadioResponseInfo info);
+
+ /*
+ * @param info Response info struct containing response type, serial no. & error
+ * @param n is "n" parameter from TS 27.007 7.7
+ * @param m is "m" parameter from TS 27.007 7.7
+ *
+ * Valid errors returned:
+ * RadioError:NONE
+ * RadioError:INVALID_ARGUMENTS
+ * RadioError:RADIO_NOT_AVAILABLE
+ * RadioError:SS_MODIFIED_TO_DIAL
+ * RadioError:SS_MODIFIED_TO_USSD
+ * RadioError:SS_MODIFIED_TO_SS
+ * RadioError:NO_MEMORY
+ * RadioError:MODEM_ERR
+ * RadioError:INTERNAL_ERR
+ * RadioError:FDN_CHECK_FAILURE
+ * RadioError:SYSTEM_ERR
+ * RadioError:GENERIC_FAILURE
+ */
+ oneway getClirResponse(RadioResponseInfo info, int32_t n, int32_t m);
+
+ /*
+ * @param info Response info struct containing response type, serial no. & error
+ *
+ * Valid errors returned:
+ * RadioError:NONE
+ * RadioError:INVALID_ARGUMENTS
+ * RadioError:RADIO_NOT_AVAILABLE
+ * RadioError:SS_MODIFIED_TO_DIAL
+ * RadioError:SS_MODIFIED_TO_USSD
+ * RadioError:SS_MODIFIED_TO_SS
+ * RadioError:INVALID_ARGUMENTS
+ * RadioError:SYSTEM_ERR
+ * RadioError:GENERIC_FAILURE
+ */
+ oneway setClirResponse(RadioResponseInfo info);
+
+ /*
+ * @param info Response info struct containing response type, serial no. & error
+ * @param callForwardInfos points to a vector of CallForwardInfo, one for
+ * each distinct registered phone number.
+ *
+ * For example, if data is forwarded to +18005551212 and voice is forwarded
+ * to +18005559999, then two separate CallForwardInfo's must be returned
+ *
+ * If, however, both data and voice are forwarded to +18005551212, then
+ * a single CallForwardInfo must be returned with the service class
+ * set to "data + voice = 3")
+ *
+ * Valid errors returned:
+ * RadioError:NONE
+ * RadioError:RADIO_NOT_AVAILABLE
+ * RadioError:SS_MODIFIED_TO_DIAL
+ * RadioError:SS_MODIFIED_TO_USSD
+ * RadioError:SS_MODIFIED_TO_SS
+ * RadioError:INVALID_ARGUMENTS
+ * RadioError:NO_MEMORY
+ * RadioError:SYSTEM_ERR
+ * RadioError:MODEM_ERR
+ * RadioError:INTERNAL_ERR
+ * RadioError:FDN_CHECK_FAILURE
+ * RadioError:GENERIC_FAILURE
+ */
+ oneway getCallForwardStatusResponse(RadioResponseInfo info,
+ vec<CallForwardInfo> callForwardInfos);
+
+ /*
+ * @param info Response info struct containing response type, serial no. & error
+ *
+ * Valid errors returned:
+ * RadioError:NONE
+ * RadioError:RADIO_NOT_AVAILABLE
+ * RadioError:SS_MODIFIED_TO_DIAL
+ * RadioError:SS_MODIFIED_TO_USSD
+ * RadioError:SS_MODIFIED_TO_SS
+ * RadioError:INVALID_ARGUMENTS
+ * RadioError:NO_MEMORY
+ * RadioError:SYSTEM_ERR
+ * RadioError:MODEM_ERR
+ * RadioError:INTERNAL_ERR
+ * RadioError:INVALID_STATE
+ * RadioError:FDN_CHECK_FAILURE
+ * RadioError:GENERIC_FAILURE
+ */
+ oneway setCallForwardResponse(RadioResponseInfo info);
+
+ /*
+ * @param info Response info struct containing response type, serial no. & error
+ * @param enable If current call waiting state is disabled, enable = false else true
+ * @param serviceClass If enable, then callWaitingResp[1]
+ * must follow, with the TS 27.007 service class bit vector of services
+ * for which call waiting is enabled.
+ * For example, if callWaitingResp[0] is 1 and
+ * callWaitingResp[1] is 3, then call waiting is enabled for data
+ * and voice and disabled for everything else.
+ *
+ * Valid errors returned:
+ * RadioError:NONE
+ * RadioError:RADIO_NOT_AVAILABLE
+ * RadioError:SS_MODIFIED_TO_DIAL
+ * RadioError:SS_MODIFIED_TO_USSD
+ * RadioError:SS_MODIFIED_TO_SS
+ * RadioError:INVALID_ARGUMENTS
+ * RadioError:NO_MEMORY
+ * RadioError:MODEM_ERR
+ * RadioError:INTERNAL_ERR
+ * RadioError:FDN_CHECK_FAILURE
+ * RadioError:GENERIC_FAILURE
+ */
+ oneway getCallWaitingResponse(RadioResponseInfo info, bool enable, int32_t serviceClass);
+
+ /*
+ * @param info Response info struct containing response type, serial no. & error
+ *
+ * Valid errors returned:
+ * RadioError:NONE
+ * RadioError:RADIO_NOT_AVAILABLE
+ * RadioError:SS_MODIFIED_TO_DIAL
+ * RadioError:SS_MODIFIED_TO_USSD
+ * RadioError:SS_MODIFIED_TO_SS
+ * RadioError:INVALID_ARGUMENTS
+ * RadioError:NO_MEMORY
+ * RadioError:MODEM_ERR
+ * RadioError:INTERNAL_ERR
+ * RadioError:INVALID_STATE
+ * RadioError:FDN_CHECK_FAILURE
+ * RadioError:GENERIC_FAILURE
+ */
+ oneway setCallWaitingResponse(RadioResponseInfo info);
+
+ /*
+ * @param info Response info struct containing response type, serial no. & error
+ *
+ * Valid errors returned:
+ * RadioError:NONE
+ * RadioError:INVALID_ARGUMENTS
+ * RadioError:RADIO_NOT_AVAILABLE
+ * RadioError:GENERIC_FAILURE
+ */
+ oneway acknowledgeLastIncomingGsmSmsResponse(RadioResponseInfo info);
+
+ /*
+ * @param info Response info struct containing response type, serial no. & error
+ *
+ * Valid errors returned:
+ * RadioError:NONE
+ * RadioError:INVALID_ARGUMENTS
+ * RadioError:RADIO_NOT_AVAILABLE
+ * RadioError:INVALID_STATE
+ * RadioError:NO_MEMORY
+ * RadioError:SYSTEM_ERR
+ * RadioError:MODEM_ERR
+ * RadioError:INTERNAL_ERR
+ * RadioError:INVALID_CALL_ID
+ * RadioError:GENERIC_FAILURE
+ */
+ oneway acceptCallResponse(RadioResponseInfo info);
+
+ /*
+ * @param info Response info struct containing response type, serial no. & error
+ *
+ * Valid errors returned:
+ * RadioError:NONE
+ * RadioError:INVALID_ARGUMENTS
+ * RadioError:RADIO_NOT_AVAILABLE
+ * RadioError:GENERIC_FAILURE
+ */
+ oneway deactivateDataCallResponse(RadioResponseInfo info);
+
+ /*
+ * @param info Response info struct containing response type, serial no. & error
+ * @param response 0 is the TS 27.007 service class bit vector of
+ * services for which the specified barring facility
+ * is active. "0" means "disabled for all"
+ *
+ * Valid errors returned:
+ * RadioError:NONE
+ * RadioError:RADIO_NOT_AVAILABLE
+ * RadioError:SS_MODIFIED_TO_DIAL
+ * RadioError:SS_MODIFIED_TO_USSD
+ * RadioError:SS_MODIFIED_TO_SS
+ * RadioError:INVALID_ARGUMENTS
+ * RadioError:NO_MEMORY
+ * RadioError:MODEM_ERR
+ * RadioError:INTERNAL_ERR
+ * RadioError:SYSTEM_ERR
+ * RadioError:FDN_CHECK_FAILURE
+ * RadioError:GENERIC_FAILURE
+ */
+ oneway getFacilityLockForAppResponse(RadioResponseInfo info, int32_t response);
+
+ /*
+ * @param info Response info struct containing response type, serial no. & error
+ * @param retry 0 is the number of retries remaining, or -1 if unknown
+ *
+ * Valid errors returned:
+ * RadioError:NONE
+ * RadioError:RADIO_NOT_AVAILABLE
+ * RadioError:SS_MODIFIED_TO_DIAL
+ * RadioError:SS_MODIFIED_TO_USSD
+ * RadioError:SS_MODIFIED_TO_SS
+ * RadioError:INVALID_ARGUMENTS
+ * RadioError:NO_MEMORY
+ * RadioError:MODEM_ERR
+ * RadioError:INTERNAL_ERR
+ * RadioError:INVALID_STATE
+ * RadioError:FDN_CHECK_FAILURE
+ * RadioError:GENERIC_FAILURE
+ */
+ oneway setFacilityLockForAppResponse(RadioResponseInfo info, int32_t retry);
+
+ /*
+ * @param info Response info struct containing response type, serial no. & error
+ *
+ * Valid errors returned:
+ * RadioError:NONE
+ * RadioError:RADIO_NOT_AVAILABLE
+ * RadioError:SS_MODIFIED_TO_DIAL
+ * RadioError:SS_MODIFIED_TO_USSD
+ * RadioError:SS_MODIFIED_TO_SS
+ * RadioError:INVALID_ARGUMENTS
+ * RadioError:NO_MEMORY
+ * RadioError:MODEM_ERR
+ * RadioError:INTERNAL_ERR
+ * RadioError:SYSTEM_ERR
+ * RadioError:FDN_CHECK_FAILURE
+ * RadioError:GENERIC_FAILURE
+ */
+ oneway setBarringPasswordResponse(RadioResponseInfo info);
+
+ /*
+ * @param info Response info struct containing response type, serial no. & error
+ * @param selection false for automatic selection, true for manual selection
+ *
+ * Valid errors returned:
+ * RadioError:NONE
+ * RadioError:INVALID_ARGUMENTS
+ * RadioError:RADIO_NOT_AVAILABLE
+ * RadioError:GENERIC_FAILURE
+ */
+ oneway getNetworkSelectionModeResponse(RadioResponseInfo info, bool manual);
+
+ /*
+ * @param info Response info struct containing response type, serial no. & error
+ *
+ * Valid errors returned:
+ * RadioError:NONE
+ * RadioError:INVALID_ARGUMENTS
+ * RadioError:RADIO_NOT_AVAILABLE
+ * RadioError:ILLEGAL_SIM_OR_ME
+ * RadioError:OPERATION_NOT_ALLOWED
+ * RadioError:GENERIC_FAILURE
+ *
+ * Returns RadioError:ILLEGAL_SIM_OR_ME when the failure is permanent and
+ * no retries needed, such as illegal SIM or ME.
+ * Returns RadioError:GENERIC_FAILURE for all other causes that might be fixed by retries.
+ */
+ oneway setNetworkSelectionModeAutomaticResponse(RadioResponseInfo info);
+
+ /*
+ * @param info Response info struct containing response type, serial no. & error
+ *
+ * Valid errors returned:
+ * RadioError:NONE
+ * RadioError:INVALID_ARGUMENTS
+ * RadioError:RADIO_NOT_AVAILABLE
+ * RadioError:ILLEGAL_SIM_OR_ME
+ * RadioError:OPERATION_NOT_ALLOWED
+ * RadioError:GENERIC_FAILURE
+ *
+ * Returns RadioError:ILLEGAL_SIM_OR_ME when the failure is permanent and
+ * no retries needed, such as illegal SIM or ME.
+ * Returns RadioError:GENERIC_FAILURE for all other causes that might be fixed by retries.
+ */
+ oneway setNetworkSelectionModeManualResponse(RadioResponseInfo info);
+
+ /*
+ * @param info Response info struct containing response type, serial no. & error
+ * @param networkInfos List of network operator information as OperatorInfos defined in
+ * types.hal
+ *
+ * Valid errors returned:
+ * RadioError:NONE
+ * RadioError:INVALID_ARGUMENTS
+ * RadioError:RADIO_NOT_AVAILABLE
+ * RadioError:OPERATION_NOT_ALLOWED
+ * RadioError:GENERIC_FAILURE
+ */
+ oneway getAvailableNetworksResponse(RadioResponseInfo info,
+ vec<OperatorInfo> networkInfos);
+
+ /*
+ * @param info Response info struct containing response type, serial no. & error
+ *
+ * Valid errors returned:
+ * RadioError:NONE
+ * RadioError:RADIO_NOT_AVAILABLE
+ * RadioError:INVALID_ARGUMENTS
+ * RadioError:NO_RESOURCES
+ * RadioError:NO_MEMORY
+ * RadioError:SYSTEM_ERR
+ * RadioError:MODEM_ERR
+ * RadioError:INTERNAL_ERR
+ * RadioError:INVALID_CALL_ID
+ * RadioError:GENERIC_FAILURE
+ */
+ oneway startDtmfResponse(RadioResponseInfo info);
+
+ /*
+ * @param info Response info struct containing response type, serial no. & error
+ *
+ * Valid errors returned:
+ * RadioError:NONE
+ * RadioError:RADIO_NOT_AVAILABLE
+ * RadioError:INVALID_ARGUMENTS
+ * RadioError:NO_RESOURCES
+ * RadioError:NO_MEMORY
+ * RadioError:INVALID_ARGUMENTS
+ * RadioError:SYSTEM_ERR
+ * RadioError:MODEM_ERR
+ * RadioError:INTERNAL_ERR
+ * RadioError:INVALID_CALL_ID
+ * RadioError:GENERIC_FAILURE
+ */
+ oneway stopDtmfResponse(RadioResponseInfo info);
+
+ /*
+ * @param info Response info struct containing response type, serial no. & error
+ * @param version string containing version string for log reporting
+ *
+ * Valid errors returned:
+ * RadioError:NONE
+ * RadioError:RADIO_NOT_AVAILABLE
+ * RadioError:INVALID_ARGUMENTS
+ * RadioError:EMPTY_RECORD
+ * RadioError:GENERIC_FAILURE
+ */
+ oneway getBasebandVersionResponse(RadioResponseInfo info, string version);
+
+ /*
+ * @param info Response info struct containing response type, serial no. & error
+ *
+ * Valid errors returned:
+ * RadioError:NONE
+ * RadioError:RADIO_NOT_AVAILABLE
+ * RadioError:INVALID_ARGUMENTS
+ * RadioError:INVALID_STATE
+ * RadioError:NO_RESOURCES
+ * RadioError:NO_MEMORY
+ * RadioError:MODEM_ERR
+ * RadioError:SYSTEM_ERR
+ * RadioError:INTERNAL_ERR
+ * RadioError:INVALID_CALL_ID
+ * RadioError:OPERATION_NOT_ALLOWED
+ * RadioError:GENERIC_FAILURE
+ */
+ oneway separateConnectionResponse(RadioResponseInfo info);
+
+ /*
+ * @param info Response info struct containing response type, serial no. & error
+ *
+ * Valid errors returned:
+ * RadioError:NONE
+ * RadioError:RADIO_NOT_AVAILABLE
+ * RadioError:INVALID_ARGUMENTS
+ * RadioError:NO_MEMORY
+ * RadioError:REQUEST_RATE_LIMITED
+ * RadioError:GENERIC_FAILURE
+ */
+ oneway setMuteResponse(RadioResponseInfo info);
+
+ /*
+ * @param info Response info struct containing response type, serial no. & error
+ * @param enable true for "mute enabled" & false for "mute disabled"
+ *
+ * Valid errors returned:
+ * RadioError:NONE
+ * RadioError:RADIO_NOT_AVAILABLE
+ * RadioError:INVALID_ARGUMENTS
+ * RadioError:SS_MODIFIED_TO_DIAL
+ * RadioError:SS_MODIFIED_TO_USSD
+ * RadioError:SS_MODIFIED_TO_SS
+ * RadioError:NO_MEMORY
+ * RadioError:REQUEST_RATE_LIMITED
+ * RadioError:GENERIC_FAILURE
+ */
+ oneway getMuteResponse(RadioResponseInfo info, bool enable);
+
+ /*
+ * @param info Response info struct containing response type, serial no. & error
+ * @param status indicates CLIP status
+ *
+ * Valid errors returned:
+ * RadioError:NONE
+ * RadioError:RADIO_NOT_AVAILABLE
+ * RadioError:INVALID_ARGUMENTS
+ * RadioError:NO_MEMORY
+ * RadioError:SYSTEM_ERR
+ * RadioError:MODEM_ERR
+ * RadioError:INTERNAL_ERR
+ * RadioError:FDN_CHECK_FAILURE
+ * RadioError:GENERIC_FAILURE
+ */
+ oneway getClipResponse(RadioResponseInfo info, ClipStatus status);
+
+ /*
+ * @param info Response info struct containing response type, serial no. & error
+ * @param dcResponse List of DataCallResult as defined in types.hal
+ *
+ * Valid errors returned:
+ * RadioError:NONE
+ * RadioError:RADIO_NOT_AVAILABLE
+ * RadioError:INVALID_ARGUMENTS
+ * RadioError:GENERIC_FAILURE
+ */
+ oneway getDataCallListResponse(RadioResponseInfo info, vec<SetupDataCallResult> dcResponse);
+
+ /*
+ * @param info Response info struct containing response type, serial no. & error
+ * @param data data returned by oem
+ *
+ * Valid errors returned:
+ * RadioError:NONE
+ * RadioError:RADIO_NOT_AVAILABLE
+ * RadioError:INVALID_ARGUMENTS
+ * RadioError:OEM_ERROR_X
+ */
+ oneway sendOemRilRequestRawResponse(RadioResponseInfo info, vec<uint8_t> data);
+
+ /*
+ * @param info Response info struct containing response type, serial no. & error
+ * @param data data returned by oem
+ *
+ * Valid errors returned:
+ * RadioError:NONE
+ * RadioError:RADIO_NOT_AVAILABLE
+ * RadioError:INVALID_ARGUMENTS
+ * RadioError:OEM_ERROR_X
+ */
+ oneway sendOemRilRequestStringsResponse(RadioResponseInfo info, vec<string> data);
+
+ /*
+ * @param info Response info struct containing response type, serial no. & error
+ *
+ * Valid errors returned:
+ * RadioError:NONE
+ * RadioError:RADIO_NOT_AVAILABLE
+ * RadioError:INVALID_ARGUMENTS
+ * RadioError:GENERIC_FAILURE
+ */
+ oneway sendScreenStateResponse(RadioResponseInfo info);
+
+ /*
+ * @param info Response info struct containing response type, serial no. & error
+ *
+ * Valid errors returned:
+ * RadioError:NONE
+ * RadioError:RADIO_NOT_AVAILABLE
+ * RadioError:INVALID_ARGUMENTS
+ * RadioError:SIM_BUSY
+ * RadioError:NO_MEMORY
+ * RadioError:SYSTEM_ERR
+ * RadioError:MODEM_ERR
+ * RadioError:INTERNAL_ERR
+ * RadioError:GENERIC_FAILURE
+ */
+ oneway setSuppServiceNotificationsResponse(RadioResponseInfo info);
+
+ /*
+ * @param info Response info struct containing response type, serial no. & error
+ * @param index record index where the message is stored
+ *
+ * Valid errors returned:
+ * RadioError:NONE
+ * RadioError:SIM_FULL
+ * RadioError:INVALID_ARGUMENTS
+ * RadioError:INVALID_SMS_FORMAT
+ * RadioError:INTERNAL_ERR
+ * RadioError:MODEM_ERR
+ * RadioError:ENCODING_ERR
+ * RadioError:NO_MEMORY
+ * RadioError:NO_RESOURCES
+ * RadioError:INVALID_MODEM_STATE
+ * RadioError:MODE_NOT_SUPPORTED
+ * RadioError:INVALID_SMSC_ADDRESS
+ * RadioError:GENERIC_FAILURE
+ */
+ oneway writeSmsToSimResponse(RadioResponseInfo info, int32_t index);
+
+ /*
+ * @param info Response info struct containing response type, serial no. & error
+ *
+ * Valid errors returned:
+ * RadioError:NONE
+ * RadioError:SIM_FULL
+ * RadioError:INVALID_ARGUMENTS
+ * RadioError:NO_MEMORY
+ * RadioError:REQUEST_RATE_LIMITED
+ * RadioError:SYSTEM_ERR
+ * RadioError:MODEM_ERR
+ * RadioError:NO_SUCH_ENTRY
+ * RadioError:GENERIC_FAILURE
+ */
+ oneway deleteSmsOnSimResponse(RadioResponseInfo info);
+
+ /*
+ * @param info Response info struct containing response type, serial no. & error
+ *
+ * Valid errors returned:
+ * RadioError:NONE
+ * RadioError:RADIO_NOT_AVAILABLE
+ * RadioError:INVALID_ARGUMENTS
+ * RadioError:OPERATION_NOT_ALLOWED
+ * RadioError:GENERIC_FAILURE
+ */
+ oneway setBandModeResponse(RadioResponseInfo info);
+
+ /*
+ * @param info Response info struct containing response type, serial no. & error
+ * @param bandModes List of RadioBandMode listing supported modes
+ *
+ * Valid errors returned:
+ * RadioError:NONE
+ * RadioError:RADIO_NOT_AVAILABLE
+ * RadioError:INVALID_ARGUMENTS
+ * RadioError:GENERIC_FAILURE
+ */
+ oneway getAvailableBandModesResponse(RadioResponseInfo info, vec<RadioBandMode> bandModes);
+
+ /*
+ * @param info Response info struct containing response type, serial no. & error
+ * @param commandResponse SAT/USAT response in hexadecimal format
+ * string starting with first byte of response
+ *
+ * Valid errors returned:
+ * RadioError:NONE
+ * RadioError:RADIO_NOT_AVAILABLE
+ * RadioError:INVALID_ARGUMENTS
+ * RadioError:SIM_BUSY
+ * RadioError:OPERATION_NOT_ALLOWED
+ * RadioError:GENERIC_FAILURE
+ */
+ oneway sendEnvelopeResponse(RadioResponseInfo info, string commandResponse);
+
+ /*
+ * @param info Response info struct containing response type, serial no. & error
+ *
+ * Valid errors returned:
+ * RadioError:NONE
+ * RadioError:RADIO_NOT_AVAILABLE
+ * RadioError:INVALID_ARGUMENTS
+ * RadioError:OPERATION_NOT_ALLOWED
+ * RadioError:GENERIC_FAILURE
+ */
+ oneway sendTerminalResponseToSimResponse(RadioResponseInfo info);
+};
diff --git a/radio/1.0/ISap.hal b/radio/1.0/ISap.hal
new file mode 100644
index 0000000..0351130
--- /dev/null
+++ b/radio/1.0/ISap.hal
@@ -0,0 +1,89 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.radio@1.0;
+
+import ISapCallback;
+
+interface ISap {
+ /**
+ * Set callback that has response and unsolicited indication functions
+ *
+ * @param sapCallback Object containing response and unosolicited indication callbacks
+ */
+ setCallback(ISapCallback sapCallback);
+
+ /**
+ * CONNECT_REQ from SAP 1.1 spec 5.1.1
+ *
+ * @param token Id to match req-resp. Resp must include same token.
+ * @param maxMsgSize MaxMsgSize to be used for SIM Access Profile connection
+ */
+ oneway connectReq(int32_t token, int32_t maxMsgSize);
+
+ /**
+ * DISCONNECT_REQ from SAP 1.1 spec 5.1.3
+ *
+ * @param token Id to match req-resp. Resp must include same token.
+ */
+ oneway disconnectReq(int32_t token);
+
+ /**
+ * TRANSFER_APDU_REQ from SAP 1.1 spec 5.1.6
+ *
+ * @param token Id to match req-resp. Resp must include same token.
+ * @param type APDU command type
+ * @param command CommandAPDU/CommandAPDU7816 parameter depending on type
+ */
+ oneway apduReq(int32_t token, SapApduType type, vec<uint8_t> command);
+
+ /**
+ * TRANSFER_ATR_REQ from SAP 1.1 spec 5.1.8
+ *
+ * @param token Id to match req-resp. Resp must include same token.
+ */
+ oneway transferAtrReq(int32_t token);
+
+ /**
+ * POWER_SIM_OFF_REQ and POWER_SIM_ON_REQ from SAP 1.1 spec 5.1.10 + 5.1.12
+ *
+ * @param token Id to match req-resp. Resp must include same token.
+ * @param state true for on, false for off
+ */
+ oneway powerReq(int32_t token, bool state);
+
+ /**
+ * RESET_SIM_REQ from SAP 1.1 spec 5.1.14
+ *
+ * @param token Id to match req-resp. Resp must include same token.
+ */
+ oneway resetSimReq(int32_t token);
+
+ /**
+ * TRANSFER_CARD_READER_STATUS_REQ from SAP 1.1 spec 5.1.17
+ *
+ * @param token Id to match req-resp. Resp must include same token.
+ */
+ oneway transferCardReaderStatusReq(int32_t token);
+
+ /**
+ * SET_TRANSPORT_PROTOCOL_REQ from SAP 1.1 spec 5.1.20
+ *
+ * @param token Id to match req-resp. Resp must include same token.
+ * @param transferProtocol Transport Protocol
+ */
+ oneway setTransferProtocolReq(int32_t token, SapTransferProtocol transferProtocol);
+};
\ No newline at end of file
diff --git a/radio/1.0/ISapCallback.hal b/radio/1.0/ISapCallback.hal
new file mode 100644
index 0000000..5129648
--- /dev/null
+++ b/radio/1.0/ISapCallback.hal
@@ -0,0 +1,151 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.radio@1.0;
+
+interface ISapCallback {
+ /**
+ * CONNECT_RESP from SAP 1.1 spec 5.1.2
+ *
+ * @param token Id to match req-resp. Value must match the one in req.
+ * @param sapConnectRsp Connection Status
+ * @param maxMsgSize MaxMsgSize supported by server if request cannot be fulfilled.
+ * Valid only if connectResponse is SapConnectResponse:MSG_SIZE_TOO_LARGE.
+ */
+ oneway connectResponse(int32_t token, SapConnectRsp sapConnectRsp, int32_t maxMsgSize);
+
+ /**
+ * DISCONNECT_RESP from SAP 1.1 spec 5.1.4
+ *
+ * @param token Id to match req-resp. Value must match the one in req.
+ */
+ oneway disconnectResponse(int32_t token);
+
+ /**
+ * DISCONNECT_IND from SAP 1.1 spec 5.1.5
+ *
+ * @param token Id to match req-resp. Value must match the one in req.
+ * @param disconnectType Disconnect Type to indicate if shutdown is graceful or immediate
+ */
+ oneway disconnectIndication(int32_t token, SapDisconnectType disconnectType);
+
+ /**
+ * TRANSFER_APDU_RESP from SAP 1.1 spec 5.1.7
+ *
+ * @param token Id to match req-resp. Value must match the one in req.
+ * @param type APDU command type
+ * @param resultCode ResultCode to indicate if command was processed correctly
+ * Possible values:
+ * SapResultCode:SUCCESS,
+ * SapResultCode:GENERIC_FAILURE,
+ * SapResultCode:CARD_NOT_ACCESSSIBLE,
+ * SapResultCode:CARD_ALREADY_POWERED_OFF,
+ * SapResultCode:CARD_REMOVED
+ * @param apduRsp APDU Response. Valid only if command was processed correctly and no error
+ * occurred.
+ */
+ oneway apduResponse(int32_t token,
+ SapApduType type,
+ SapResultCode resultCode,
+ vec<uint8_t> apduRsp);
+
+ /**
+ * TRANSFER_ATR_RESP from SAP 1.1 spec 5.1.9
+ *
+ * @param token Id to match req-resp. Value must match the one in req.
+ * @param resultCode ResultCode to indicate if command was processed correctly
+ * Possible values:
+ * SapResultCode:SUCCESS,
+ * SapResultCode:GENERIC_FAILURE,
+ * SapResultCode:CARD_ALREADY_POWERED_OFF,
+ * SapResultCode:CARD_REMOVED,
+ * SapResultCode:DATA_NOT_AVAILABLE
+ * @param atr Answer to Reset from the subscription module. Included only if no error occurred,
+ * otherwise empty.
+ */
+ oneway transferAtrResponse(int32_t token, SapResultCode resultCode, vec<uint8_t> atr);
+
+ /**
+ * POWER_SIM_OFF_RESP and POWER_SIM_ON_RESP from SAP 1.1 spec 5.1.11 + 5.1.13
+ *
+ * @param token Id to match req-resp. Value must match the one in req.
+ * @param resultCode ResultCode to indicate if command was processed correctly
+ * Possible values:
+ * SapResultCode:SUCCESS,
+ * SapResultCode:GENERIC_FAILURE,
+ * SapResultCode:CARD_NOT_ACCESSSIBLE, (possible only for power on req)
+ * SapResultCode:CARD_ALREADY_POWERED_OFF, (possible only for power off req)
+ * SapResultCode:CARD_REMOVED,
+ * SapResultCode:CARD_ALREADY_POWERED_ON (possible only for power on req)
+ */
+ oneway powerResponse(int32_t token, SapResultCode resultCode);
+
+ /**
+ * RESET_SIM_RESP from SAP 1.1 spec 5.1.15
+ *
+ * @param token Id to match req-resp. Value must match the one in req.
+ * @param resultCode ResultCode to indicate if command was processed correctly
+ * Possible values:
+ * SapResultCode:SUCCESS,
+ * SapResultCode:GENERIC_FAILURE,
+ * SapResultCode:CARD_NOT_ACCESSSIBLE,
+ * SapResultCode:CARD_ALREADY_POWERED_OFF,
+ * SapResultCode:CARD_REMOVED
+ */
+ oneway resetSimResponse(int32_t token, SapResultCode resultCode);
+
+ /**
+ * STATUS_IND from SAP 1.1 spec 5.1.16
+ *
+ * @param token Id to match req-resp. Value must match the one in req.
+ * @param status Parameter to indicate reason for the status change.
+ */
+ oneway statusIndication(int32_t token, SapStatus status);
+
+ /**
+ * TRANSFER_CARD_READER_STATUS_REQ from SAP 1.1 spec 5.1.18
+ *
+ * @param token Id to match req-resp. Value must match the one in req.
+ * @param resultCode ResultCode to indicate if command was processed correctly
+ * Possible values:
+ * SapResultCode:SUCCESS,
+ * SapResultCode:GENERIC_FAILURE
+ * SapResultCode:CARD_ALREADY_POWERED_ON
+ * @param cardReaderStatus Card Reader Status coded as described in 3GPP TS 11.14 Section 12.33
+ * and TS 31.111 Section 8.33
+ */
+ oneway transferCardReaderStatusResponse(int32_t token,
+ SapResultCode resultCode,
+ int32_t cardReaderStatus);
+
+ /**
+ * ERROR_RESP from SAP 1.1 spec 5.1.19
+ *
+ * @param token Id to match req-resp. Value must match the one in req.
+ */
+ oneway errorResponse(int32_t token);
+
+ /**
+ * SET_TRANSPORT_PROTOCOL_RESP from SAP 1.1 spec 5.1.21
+ *
+ * @param token Id to match req-resp. Value must match the one in req.
+ * @param resultCode ResultCode to indicate if command was processed correctly
+ * Possible values:
+ * SapResultCode:SUCCESS
+ * SapResultCode:NOT_SUPPORTED
+ */
+ oneway transferProtocolResponse(int32_t token, SapResultCode resultCode);
+};
\ No newline at end of file
diff --git a/radio/1.0/types.hal b/radio/1.0/types.hal
index e5bbe15..1ecc5a9 100644
--- a/radio/1.0/types.hal
+++ b/radio/1.0/types.hal
@@ -54,7 +54,111 @@
IP_ADDRESS_SIZE = 4,
};
-enum RadioRestrictedState : int32_t {
+enum RadioError : int32_t {
+ NONE = 0, // Success
+ RADIO_NOT_AVAILABLE = 1, // If radio did not start or is resetting
+ GENERIC_FAILURE = 2,
+ PASSWORD_INCORRECT = 3, // for PIN/PIN2 methods only
+ SIM_PIN2 = 4, // Operation requires SIM PIN2 to be entered
+ SIM_PUK2 = 5, // Operation requires SIM PIN2 to be entered
+ REQUEST_NOT_SUPPORTED = 6,
+ CANCELLED = 7,
+ OP_NOT_ALLOWED_DURING_VOICE_CALL = 8, // data ops are not allowed during voice
+ // call on a Class C GPRS device
+ OP_NOT_ALLOWED_BEFORE_REG_TO_NW = 9, // data ops are not allowed before device
+ // registers in network
+ SMS_SEND_FAIL_RETRY = 10, // fail to send sms and need retry
+ SIM_ABSENT = 11, // fail to set the location where CDMA subscription
+ // shall be retrieved because of SIM or RUIM
+ // card absent
+ SUBSCRIPTION_NOT_AVAILABLE = 12, // fail to find CDMA subscription from specified
+ // location
+ MODE_NOT_SUPPORTED = 13, // HW does not support preferred network type
+ FDN_CHECK_FAILURE = 14, // command failed because recipient is not on FDN list
+ ILLEGAL_SIM_OR_ME = 15, // network selection failed due to illegal SIM or ME
+ MISSING_RESOURCE = 16, // no logical channel available
+ NO_SUCH_ELEMENT = 17, // application not found on SIM
+ DIAL_MODIFIED_TO_USSD = 18, // DIAL request modified to USSD
+ DIAL_MODIFIED_TO_SS = 19, // DIAL request modified to SS
+ DIAL_MODIFIED_TO_DIAL = 20, // DIAL request modified to DIAL with different data
+ USSD_MODIFIED_TO_DIAL = 21, // USSD request modified to DIAL
+ USSD_MODIFIED_TO_SS = 22, // USSD request modified to SS
+ USSD_MODIFIED_TO_USSD = 23, // USSD request modified to different USSD request
+ SS_MODIFIED_TO_DIAL = 24, // SS request modified to DIAL
+ SS_MODIFIED_TO_USSD = 25, // SS request modified to USSD
+ SUBSCRIPTION_NOT_SUPPORTED = 26, // Subscription not supported by RIL
+ SS_MODIFIED_TO_SS = 27, // SS request modified to different SS request
+ LCE_NOT_SUPPORTED = 36, // LCE service not supported(36 in RILConstants.java)
+ NO_MEMORY = 37, // Not sufficient memory to process the request
+ INTERNAL_ERR = 38, // Hit unexpected vendor internal error scenario
+ SYSTEM_ERR = 39, // Hit platform or system error
+ MODEM_ERR = 40, // Hit unexpected modem error
+ INVALID_STATE = 41, // Unexpected request for the current state
+ NO_RESOURCES = 42, // Not sufficient resource to process the request
+ SIM_ERR = 43, // Received error from SIM card
+ INVALID_ARGUMENTS = 44, // Received invalid arguments in request
+ INVALID_SIM_STATE = 45, // Cannot process the request in current SIM state
+ INVALID_MODEM_STATE = 46, // Cannot process the request in current Modem state
+ INVALID_CALL_ID = 47, // Received invalid call id in request
+ NO_SMS_TO_ACK = 48, // ACK received when there is no SMS to ack
+ NETWORK_ERR = 49, // Received error from network
+ REQUEST_RATE_LIMITED = 50, // Operation denied due to overly-frequent requests
+ SIM_BUSY = 51, // SIM is busy
+ SIM_FULL = 52, // The target EF is full
+ NETWORK_REJECT = 53, // Request is rejected by network
+ OPERATION_NOT_ALLOWED = 54, // Not allowed the request now
+ EMPTY_RECORD = 55, // The request record is empty
+ INVALID_SMS_FORMAT = 56, // Invalid sms format
+ ENCODING_ERR = 57, // Message not encoded properly
+ INVALID_SMSC_ADDRESS = 58, // SMSC address specified is invalid
+ NO_SUCH_ENTRY = 59, // No such entry present to perform the request
+ NETWORK_NOT_READY = 60, // Network is not ready to perform the request
+ NOT_PROVISIONED = 61, // Device doesnot have this value provisioned
+ NO_SUBSCRIPTION = 62, // Device doesnot have subscription
+ NO_NETWORK_FOUND = 63, // Network cannot be found
+ DEVICE_IN_USE = 64, // Operation cannot be performed because the device
+ // is currently in use
+ RIL_E_ABORTED = 65, // Operation aborted
+
+ // TODO(May be moved to vendor HAL extension)
+ // OEM specific error codes. To be used by OEM when they don't want to reveal
+ // specific error codes which would be replaced by Generic failure.
+ OEM_ERROR_1 = 501,
+ OEM_ERROR_2 = 502,
+ OEM_ERROR_3 = 503,
+ OEM_ERROR_4 = 504,
+ OEM_ERROR_5 = 505,
+ OEM_ERROR_6 = 506,
+ OEM_ERROR_7 = 507,
+ OEM_ERROR_8 = 508,
+ OEM_ERROR_9 = 509,
+ OEM_ERROR_10 = 510,
+ OEM_ERROR_11 = 511,
+ OEM_ERROR_12 = 512,
+ OEM_ERROR_13 = 513,
+ OEM_ERROR_14 = 514,
+ OEM_ERROR_15 = 515,
+ OEM_ERROR_16 = 516,
+ OEM_ERROR_17 = 517,
+ OEM_ERROR_18 = 518,
+ OEM_ERROR_19 = 519,
+ OEM_ERROR_20 = 520,
+ OEM_ERROR_21 = 521,
+ OEM_ERROR_22 = 522,
+ OEM_ERROR_23 = 523,
+ OEM_ERROR_24 = 524,
+ OEM_ERROR_25 = 525,
+};
+
+enum RadioResponseType : int32_t {
+ RESPONSE_SOLICITED,
+ RESPONSE_UNSOLICITED,
+ RESPONSE_SOLICITED_ACK,
+ RESPONSE_SOLICITED_ACK_EXP,
+ RESPONSE_UNSOLICITED_ACK_EXP,
+};
+
+enum RestrictedState : int32_t {
NONE = 0x00,
CS_EMERGENCY = 0x01,
CS_NORMAL = 0x02,
@@ -62,130 +166,814 @@
PS_ALL = 0x10,
};
-enum RadioCardState : int32_t {
- ABSENT = 0,
- PRESENT = 1,
- ERROR = 2,
- /* card is present but not usable due to carrier restrictions.*/
- RESTRICTED = 3,
+enum CardState : int32_t {
+ ABSENT,
+ PRESENT,
+ ERROR,
+ RESTRICTED, // card is present but not usable due to carrier
+ // restrictions
};
-enum RadioPinState : int32_t {
- UNKNOWN = 0,
- ENABLED_NOT_VERIFIED = 1,
- ENABLED_VERIFIED = 2,
- DISABLED = 3,
- ENABLED_BLOCKED = 4,
- ENABLED_PERM_BLOCKED = 5,
+enum PinState : int32_t {
+ UNKNOWN,
+ ENABLED_NOT_VERIFIED,
+ ENABLED_VERIFIED,
+ DISABLED,
+ ENABLED_BLOCKED,
+ ENABLED_PERM_BLOCKED,
};
-enum RadioAppType : int32_t {
- UNKNOWN = 0,
- SIM = 1,
- USIM = 2,
- RUIM = 3,
- CSIM = 4,
- ISIM = 5,
+enum AppType : int32_t {
+ UNKNOWN,
+ SIM,
+ USIM,
+ RUIM,
+ CSIM,
+ ISIM,
};
-enum RadioAppState : int32_t {
- UNKNOWN = 0,
- DETECTED = 1,
- PIN = 2,
- /* If PIN1 or UPin is required */
- PUK = 3,
- /* If PUK1 or Puk for UPin is required */
- SUBSCRIPTION_PERSO = 4,
- /* perso_substate should be look at when app_state is assigned to this value */
- READY = 5,
+enum AppState : int32_t {
+ UNKNOWN,
+ DETECTED,
+ PIN, // If PIN1 or UPin is required
+ PUK, // If PUK1 or Puk for UPin is required
+ SUBSCRIPTION_PERSO, // perso_substate must be look at when app_state is
+ // assigned to this value
+ READY,
};
-enum RadioPersoSubstate : int32_t {
- UNKNOWN = 0,
- /* initial state */
- IN_PROGRESS = 1,
- /* in between each lock transition */
- READY = 2,
- /* when either SIM or RUIM Perso is finished since each app can only have 1 active perso
- involved */
- SIM_NETWORK = 3,
- SIM_NETWORK_SUBSET = 4,
- SIM_CORPORATE = 5,
- SIM_SERVICE_PROVIDER = 6,
- SIM_SIM = 7,
- SIM_NETWORK_PUK = 8,
- /* The corresponding perso lock is blocked */
- SIM_NETWORK_SUBSET_PUK = 9,
- SIM_CORPORATE_PUK = 10,
- SIM_SERVICE_PROVIDER_PUK = 11,
- SIM_SIM_PUK = 12,
- RUIM_NETWORK1 = 13,
- RUIM_NETWORK2 = 14,
- RUIM_HRPD = 15,
- RUIM_CORPORATE = 16,
- RUIM_SERVICE_PROVIDER = 17,
- RUIM_RUIM = 18,
- RUIM_NETWORK1_PUK = 19,
- /* The corresponding perso lock is blocked */
- RUIM_NETWORK2_PUK = 20,
- RUIM_HRPD_PUK = 21,
- RUIM_CORPORATE_PUK = 22,
- RUIM_SERVICE_PROVIDER_PUK = 23,
- RUIM_RUIM_PUK = 24,
+enum PersoSubstate : int32_t {
+ UNKNOWN, // initial state
+ IN_PROGRESS, // in between each lock transition
+ READY, // when either SIM or RUIM Perso is finished since each
+ // app must only have 1 active perso involved
+ SIM_NETWORK,
+ SIM_NETWORK_SUBSET,
+ SIM_CORPORATE,
+ SIM_SERVICE_PROVIDER,
+ SIM_SIM,
+ SIM_NETWORK_PUK, // The corresponding perso lock is blocked
+ SIM_NETWORK_SUBSET_PUK,
+ SIM_CORPORATE_PUK,
+ SIM_SERVICE_PROVIDER_PUK,
+ SIM_SIM_PUK,
+ RUIM_NETWORK1,
+ RUIM_NETWORK2,
+ RUIM_HRPD,
+ RUIM_CORPORATE,
+ RUIM_SERVICE_PROVIDER,
+ RUIM_RUIM,
+ RUIM_NETWORK1_PUK, // The corresponding perso lock is blocked
+ RUIM_NETWORK2_PUK,
+ RUIM_HRPD_PUK,
+ RUIM_CORPORATE_PUK,
+ RUIM_SERVICE_PROVIDER_PUK,
+ RUIM_RUIM_PUK,
};
-enum RadioState : int32_t {
- OFF = 0,
- /* Radio explictly powered off (eg CFUN=0) */
- UNAVAILABLE = 1,
- /* States 2-9 below are deprecated. Just leaving them here for backward compatibility. */
- SIM_NOT_READY = 2,
- /* Radio is on, but the SIM interface is not ready */
- SIM_LOCKED_OR_ABSENT = 3,
- /* SIM PIN locked, PUK required, network
- personalization locked, or SIM absent */
- SIM_READY = 4,
- /* Radio is on and SIM interface is available */
- RUIM_NOT_READY = 5,
- /* Radio is on, but the RUIM interface is not ready */
- RUIM_READY = 6,
- /* Radio is on and the RUIM interface is available */
- RUIM_LOCKED_OR_ABSENT = 7,
- /* RUIM PIN locked, PUK required, network
- personalization locked, or RUIM absent */
- NV_NOT_READY = 8,
- /* Radio is on, but the NV interface is not available */
- NV_READY = 9,
- /* Radio is on */
- ON = 10,
+enum RadioState : int32_t {
+ OFF, // Radio explictly powered off (eg CFUN=0)
+ UNAVAILABLE, // Radio unavailable (eg, resetting or not booted)
};
-struct RadioAppStatus {
- RadioAppType appType;
- RadioAppState appState;
- RadioPersoSubstate persoSubstate;
- /* applicable only if app_state == SUBSCRIPTION_PERSO */
- string aidPtr;
- /* null terminated string, e.g., from 0xA0, 0x00 -> 0x41, 0x30, 0x30, 0x30 */
+enum SapConnectRsp : int32_t {
+ SUCCESS,
+ CONNECT_FAILURE,
+ MSG_SIZE_TOO_LARGE,
+ MSG_SIZE_TOO_SMALL,
+ CONNECT_OK_CALL_ONGOING
+};
+
+enum SapDisconnectType : int32_t {
+ GRACEFUL,
+ IMMEDIATE
+};
+
+enum SapApduType : int32_t {
+ APDU,
+ APDU7816
+};
+
+enum SapResultCode : int32_t {
+ SUCCESS,
+ GENERIC_FAILURE,
+ CARD_NOT_ACCESSSIBLE,
+ CARD_ALREADY_POWERED_OFF,
+ CARD_REMOVED,
+ CARD_ALREADY_POWERED_ON,
+ DATA_NOT_AVAILABLE,
+ NOT_SUPPORTED
+};
+
+enum SapStatus : int32_t {
+ UNKNOWN_ERROR,
+ CARD_RESET,
+ CARD_NOT_ACCESSIBLE,
+ CARD_REMOVED,
+ CARD_INSERTED,
+ RECOVERED
+};
+
+enum SapTransferProtocol : int32_t {
+ T0,
+ T1
+};
+
+enum CallState : int32_t {
+ ACTIVE,
+ HOLDING,
+ DIALING, // MO call only
+ ALERTING, // MO call only
+ INCOMING, // MT call only
+ WAITING, // MT call only
+};
+
+/*
+ * User-to-User signaling Info activation types derived from 3GPP 23.087 v8.0
+ */
+enum UusType : int32_t {
+ TYPE1_IMPLICIT,
+ TYPE1_REQUIRED,
+ TYPE1_NOT_REQUIRED,
+ TYPE2_REQUIRED,
+ TYPE2_NOT_REQUIRED,
+ TYPE3_REQUIRED,
+ TYPE3_NOT_REQUIRED,
+};
+
+/*
+ * User-to-User Signaling Information data coding schemes. Possible values for
+ * Octet 3 (Protocol Discriminator field) in the UUIE. The values have been
+ * specified in section 10.5.4.25 of 3GPP TS 24.008
+ */
+enum UusDcs : int32_t {
+ USP, // User specified protocol
+ OSIHLP, // OSI higher layer protocol
+ X244, // X.244
+ RMCF, // Reserved for system mangement convergence function
+ IA5C, // IA5 characters
+};
+
+enum CallPresentation : int32_t {
+ ALLOWED,
+ RESTRICTED,
+ UNKNOWN,
+ PAYPHONE,
+};
+
+enum Clir : int32_t {
+ DEFAULT, // "use subscription default value"
+ INVOCATION, // restrict CLI presentation
+ SUPPRESSION, // allow CLI presentation
+};
+
+enum LastCallFailCause : int32_t {
+ UNOBTAINABLE_NUMBER = 1,
+ NO_ROUTE_TO_DESTINATION = 3,
+ CHANNEL_UNACCEPTABLE = 6,
+ OPERATOR_DETERMINED_BARRING = 8,
+ NORMAL = 16,
+ BUSY = 17,
+ NO_USER_RESPONDING = 18,
+ NO_ANSWER_FROM_USER = 19,
+ CALL_REJECTED = 21,
+ NUMBER_CHANGED = 22,
+ PREEMPTION = 25,
+ DESTINATION_OUT_OF_ORDER = 27,
+ INVALID_NUMBER_FORMAT = 28,
+ FACILITY_REJECTED = 29,
+ RESP_TO_STATUS_ENQUIRY = 30,
+ NORMAL_UNSPECIFIED = 31,
+ CONGESTION = 34,
+ NETWORK_OUT_OF_ORDER = 38,
+ TEMPORARY_FAILURE = 41,
+ SWITCHING_EQUIPMENT_CONGESTION = 42,
+ ACCESS_INFORMATION_DISCARDED = 43,
+ REQUESTED_CIRCUIT_OR_CHANNEL_NOT_AVAILABLE = 44,
+ RESOURCES_UNAVAILABLE_OR_UNSPECIFIED = 47,
+ QOS_UNAVAILABLE = 49,
+ REQUESTED_FACILITY_NOT_SUBSCRIBED = 50,
+ INCOMING_CALLS_BARRED_WITHIN_CUG = 55,
+ BEARER_CAPABILITY_NOT_AUTHORIZED = 57,
+ BEARER_CAPABILITY_UNAVAILABLE = 58,
+ SERVICE_OPTION_NOT_AVAILABLE = 63,
+ BEARER_SERVICE_NOT_IMPLEMENTED = 65,
+ ACM_LIMIT_EXCEEDED = 68,
+ REQUESTED_FACILITY_NOT_IMPLEMENTED = 69,
+ ONLY_DIGITAL_INFORMATION_BEARER_AVAILABLE = 70,
+ SERVICE_OR_OPTION_NOT_IMPLEMENTED = 79,
+ INVALID_TRANSACTION_IDENTIFIER = 81,
+ USER_NOT_MEMBER_OF_CUG = 87,
+ INCOMPATIBLE_DESTINATION = 88,
+ INVALID_TRANSIT_NW_SELECTION = 91,
+ SEMANTICALLY_INCORRECT_MESSAGE = 95,
+ INVALID_MANDATORY_INFORMATION = 96,
+ MESSAGE_TYPE_NON_IMPLEMENTED = 97,
+ MESSAGE_TYPE_NOT_COMPATIBLE_WITH_PROTOCOL_STATE = 98,
+ INFORMATION_ELEMENT_NON_EXISTENT = 99,
+ CONDITIONAL_IE_ERROR = 100,
+ MESSAGE_NOT_COMPATIBLE_WITH_PROTOCOL_STATE = 101,
+ RECOVERY_ON_TIMER_EXPIRED = 102,
+ PROTOCOL_ERROR_UNSPECIFIED = 111,
+ INTERWORKING_UNSPECIFIED = 127,
+ CALL_BARRED = 240,
+ FDN_BLOCKED = 241,
+ IMSI_UNKNOWN_IN_VLR = 242,
+ IMEI_NOT_ACCEPTED = 243,
+ DIAL_MODIFIED_TO_USSD = 244, // STK Call Control
+ DIAL_MODIFIED_TO_SS = 245,
+ DIAL_MODIFIED_TO_DIAL = 246,
+ CDMA_LOCKED_UNTIL_POWER_CYCLE = 1000,
+ CDMA_DROP = 1001,
+ CDMA_INTERCEPT = 1002,
+ CDMA_REORDER = 1003,
+ CDMA_SO_REJECT = 1004,
+ CDMA_RETRY_ORDER = 1005,
+ CDMA_ACCESS_FAILURE = 1006,
+ CDMA_PREEMPTED = 1007,
+ CDMA_NOT_EMERGENCY = 1008, // For non-emergency number dialed during emergency
+ // callback mode
+ CDMA_ACCESS_BLOCKED = 1009, // This error will be deprecated soon,
+ // vendor code must make sure to map error
+ // code to specific error
+ ERROR_UNSPECIFIED = 0xffff,
+};
+
+enum DataCallFailCause : int32_t {
+ NONE = 0, // an integer cause code defined in TS 24.008
+ // section 6.1.3.1.3 or TS 24.301 Release 8+ Annex B.
+ // If the implementation does not have access to the exact
+ // cause codes, then it must return one of the
+ // following values, as the UI layer needs to distinguish
+ // these cases for error notification and potential
+ // retries.
+ OPERATOR_BARRED = 0x08, // no retry
+ NAS_SIGNALLING = 0x0E, // PDP_FAIL_LLC_SNDCP = 0x19,
+ INSUFFICIENT_RESOURCES = 0x1A,
+ MISSING_UKNOWN_APN = 0x1B, // no retry
+ UNKNOWN_PDP_ADDRESS_TYPE = 0x1C, // no retry
+ USER_AUTHENTICATION = 0x1D, // no retry
+ ACTIVATION_REJECT_GGSN = 0x1E, // no retry
+ ACTIVATION_REJECT_UNSPECIFIED = 0x1F,
+ SERVICE_OPTION_NOT_SUPPORTED = 0x20, // no retry
+ SERVICE_OPTION_NOT_SUBSCRIBED = 0x21, // no retry
+ SERVICE_OPTION_OUT_OF_ORDER = 0x22,
+ NSAPI_IN_USE = 0x23, // no retry
+ REGULAR_DEACTIVATION = 0x24, // possibly restart radio,
+ // based on framework config
+ QOS_NOT_ACCEPTED = 0x25,
+ NETWORK_FAILURE = 0x26,
+ UMTS_REACTIVATION_REQ = 0x27,
+ FEATURE_NOT_SUPP = 0x28,
+ TFT_SEMANTIC_ERROR = 0x29,
+ TFT_SYTAX_ERROR = 0x2A,
+ UNKNOWN_PDP_CONTEXT = 0x2B,
+ FILTER_SEMANTIC_ERROR = 0x2C,
+ FILTER_SYTAX_ERROR = 0x2D,
+ PDP_WITHOUT_ACTIVE_TFT = 0x2E,
+ ONLY_IPV4_ALLOWED = 0x32, // no retry
+ ONLY_IPV6_ALLOWED = 0x33, // no retry
+ ONLY_SINGLE_BEARER_ALLOWED = 0x34,
+ ESM_INFO_NOT_RECEIVED = 0x35,
+ PDN_CONN_DOES_NOT_EXIST = 0x36,
+ MULTI_CONN_TO_SAME_PDN_NOT_ALLOWED = 0x37,
+ MAX_ACTIVE_PDP_CONTEXT_REACHED = 0x41,
+ UNSUPPORTED_APN_IN_CURRENT_PLMN = 0x42,
+ INVALID_TRANSACTION_ID = 0x51,
+ MESSAGE_INCORRECT_SEMANTIC = 0x5F,
+ INVALID_MANDATORY_INFO = 0x60,
+ MESSAGE_TYPE_UNSUPPORTED = 0x61,
+ MSG_TYPE_NONCOMPATIBLE_STATE = 0x62,
+ UNKNOWN_INFO_ELEMENT = 0x63,
+ CONDITIONAL_IE_ERROR = 0x64,
+ MSG_AND_PROTOCOL_STATE_UNCOMPATIBLE = 0x65,
+ PROTOCOL_ERRORS = 0x6F, // no retry
+ APN_TYPE_CONFLICT = 0x70,
+ INVALID_PCSCF_ADDR = 0x71,
+ INTERNAL_CALL_PREEMPT_BY_HIGH_PRIO_APN = 0x72,
+ EMM_ACCESS_BARRED = 0x73,
+ EMERGENCY_IFACE_ONLY = 0x74,
+ IFACE_MISMATCH = 0x75,
+ COMPANION_IFACE_IN_USE = 0x76,
+ IP_ADDRESS_MISMATCH = 0x77,
+ IFACE_AND_POL_FAMILY_MISMATCH = 0x78,
+ EMM_ACCESS_BARRED_INFINITE_RETRY = 0x79,
+ AUTH_FAILURE_ON_EMERGENCY_CALL = 0x7A,
+ OEM_DCFAILCAUSE_1 = 0x1001,
+
+ // OEM specific error codes. To be used by OEMs when they don't want to
+ // reveal error code which would be replaced by PDP_FAIL_ERROR_UNSPECIFIED
+ // TODO(May be moved to vendor HAL extension)
+ OEM_DCFAILCAUSE_2 = 0x1002,
+ OEM_DCFAILCAUSE_3 = 0x1003,
+ OEM_DCFAILCAUSE_4 = 0x1004,
+ OEM_DCFAILCAUSE_5 = 0x1005,
+ OEM_DCFAILCAUSE_6 = 0x1006,
+ OEM_DCFAILCAUSE_7 = 0x1007,
+ OEM_DCFAILCAUSE_8 = 0x1008,
+ OEM_DCFAILCAUSE_9 = 0x1009,
+ OEM_DCFAILCAUSE_10 = 0x100A,
+ OEM_DCFAILCAUSE_11 = 0x100B,
+ OEM_DCFAILCAUSE_12 = 0x100C,
+ OEM_DCFAILCAUSE_13 = 0x100D,
+ OEM_DCFAILCAUSE_14 = 0x100E,
+ OEM_DCFAILCAUSE_15 = 0x100F,
+
+ // Not mentioned in the specification
+ VOICE_REGISTRATION_FAIL = -1,
+ DATA_REGISTRATION_FAIL = -2,
+
+ // reasons for data call drop - network/modem disconnect
+ SIGNAL_LOST = -3,
+ PREF_RADIO_TECH_CHANGED = -4, // preferred technology has changed, must retry
+ // with parameters appropriate for new technology
+ RADIO_POWER_OFF = -5, // data call was disconnected because radio was resetting,
+ // powered off - no retry
+ TETHERED_CALL_ACTIVE = -6, // data call was disconnected by modem because tethered
+ // mode was up on same APN/data profile - no retry until
+ // tethered call is off
+ ERROR_UNSPECIFIED = 0xffff,
+};
+
+/*
+ * Please note that registration state UNKNOWN is
+ * treated as "out of service" in the Android telephony.
+ * Registration state REG_DENIED must be returned if Location Update
+ * Reject (with cause 17 - Network Failure) is received
+ * repeatedly from the network, to facilitate
+ * "managed roaming"
+ */
+enum RegState : int32_t {
+ NOT_REG_MT_NOT_SEARCHING_OP, // Not registered, MT is not currently searching
+ // a new operator to register
+ REG_HOME, // Registered, home network
+ NOT_REG_MT_SEARCHING_OP, // Not registered, but MT is currently searching
+ // a new operator to register
+ REG_DENIED, // Registration denied
+ UNKNOWN, // Unknown
+ REG_ROAMING, // Registered, roaming
+ NOT_REG_MT_NOT_SEARCHING_OP_EM, // Same as NOT_REG_MT_NOT_SEARCHING_OP but indicates that
+ // emergency calls are enabled.
+ NOT_REG_MT_SEARCHING_OP_EM, // Same as NOT_REG_MT_SEARCHING_OP but indicates that
+ // emergency calls are enabled.
+ REG_DENIED_EM, // Same as REG_DENIED but indicates that
+ // emergency calls are enabled.
+ UNKNOWN_EM // Same as UNKNOWN but indicates that
+ // emergency calls are enabled.
+};
+
+enum RadioTechnology : int32_t {
+ UNKNOWN,
+ GPRS,
+ EDGE,
+ UMTS,
+ IS95A,
+ IS95B,
+ ONE_X_RTT,
+ EVDO_0,
+ EVDO_A,
+ HSDPA,
+ HSUPA,
+ HSPA,
+ EVDO_B,
+ EHRPD,
+ LTE,
+ HSPAP, // HSPA+
+ GSM, // Only supports voice
+ TD_SCDMA,
+ IWLAN,
+ LTE_CA,
+};
+
+enum DataProfile : int32_t {
+ DEFAULT = 0,
+ TETHERED = 1,
+ IMS = 2,
+ FOTA = 3,
+ CBS = 4,
+ OEM_BASE = 1000, // Start of OEM-specific profiles
+ INVALID = 0xFFFFFFFF,
+};
+
+enum SmsAcknowledgeFailCause : int32_t {
+ MEMORY_CAPAPCITY_EXCEEDED = 0xD3,
+ UNSPECIFIED_ERROR = 0XFF,
+};
+
+enum CallForwardInfoStatus : int32_t {
+ ACTIVE,
+ INACTIVE,
+ DISABLE,
+ ENABLE,
+ INTERROGATE,
+ REGISTRATION,
+ ERASURE,
+};
+
+enum ClipStatus : int32_t {
+ CLIP_PROVISIONED, // CLIP provisioned
+ CLIP_UNPROVISIONED, // CLIP not provisioned
+ UNKOWN, // unknown, e.g. no network etc
+};
+
+enum SmsWriteArgsStatus : int32_t {
+ REC_UNREAD,
+ REC_READ,
+ STO_UNSENT,
+ STO_SENT,
+};
+
+enum RadioBandMode : int32_t {
+ BAND_MODE_UNSPECIFIED, // "unspecified" (selected by baseband automatically)
+ BAND_MODE_EURO, // "EURO band" (GSM-900 / DCS-1800 / WCDMA-IMT-2000)
+ BAND_MODE_USA, // "US band"
+ // (GSM-850 / PCS-1900 / WCDMA-850 / WCDMA-PCS-1900)
+ BAND_MODE_JPN, // "JPN band" (WCDMA-800 / WCDMA-IMT-2000)
+ BAND_MODE_AUS, // "AUS band"
+ // (GSM-900 / DCS-1800 / WCDMA-850 / WCDMA-IMT-2000)
+ BAND_MODE_AUS_2, // "AUS band 2" (GSM-900 / DCS-1800 / WCDMA-850)
+ BAND_MODE_CELL_800, // "Cellular" (800-MHz Band)
+ BAND_MODE_PCS, // "PCS" (1900-MHz Band)
+ BAND_MODE_JTACS, // "Band Class 3" (JTACS Band)
+ BAND_MODE_KOREA_PCS, // "Band Class 4" (Korean PCS Band)
+ BAND_MODE_5_450M, // "Band Class 5" (450-MHz Band)
+ BAND_MODE_IMT2000, // "Band Class 6" (2-GMHz IMT2000 Band)
+ BAND_MODE_7_700M_2, // "Band Class 7" (Upper 700-MHz Band)
+ BAND_MODE_8_1800M, // "Band Class 8" (1800-MHz Band)
+ BAND_MODE_9_900M, // "Band Class 9" (900-MHz Band)
+ BAND_MODE_10_800M_2, // "Band Class 10" (Secondary 800-MHz Band)
+ BAND_MODE_EURO_PAMR_400M, // "Band Class 11" (400-MHz European PAMR Band)
+ BAND_MODE_AWS, // "Band Class 15" (AWS Band)
+ BAND_MODE_USA_2500M, // "Band Class 16" (US 2.5-GHz Band)
+};
+
+enum OperatorStatus : int32_t {
+ UNKNOWN,
+ AVAILABLE,
+ CURRENT,
+ FORBIDDEN,
+};
+
+struct RadioResponseInfo {
+ RadioResponseType type; // Response type
+ int32_t serial; // Serial number of the request
+ RadioError error; // Response error
+};
+
+struct AppStatus {
+ AppType appType;
+ AppState appState;
+ PersoSubstate persoSubstate; // applicable only if app_state == SUBSCRIPTION_PERSO
+ string aidPtr; // e.g., from 0xA0, 0x00 -> 0x41,
+ // 0x30, 0x30, 0x30
string appLabelPtr;
- /* null terminated string */
- int32_t pin1Replaced;
- /* applicable to USIM, CSIM & ISIM */
- RadioPinState pin1;
- RadioPinState pin2;
+ int32_t pin1Replaced; // applicable to USIM, CSIM & ISIM
+ PinState pin1;
+ PinState pin2;
};
-struct RadioCardStatus {
- RadioCardState cardState;
- RadioPinState universalPinState;
- /* applicable to USIM and CSIM */
- int32_t gsmUmtsSubscriptionAppIndex;
- /* value < RADIO_CARD_MAX_APPS, -1 if none */
- int32_t cdmaSubscriptionAppIndex;
- /* value < RADIO_CARD_MAX_APPS, -1 if none */
- int32_t imsSubscriptionAppIndex;
- /* value < RADIO_CARD_MAX_APPS, -1 if none */
- int32_t numApplications;
- /* value <= RADIO_CARD_MAX_APPS */
- RadioAppStatus[RadioConst:RADIO_CARD_MAX_APPS] applications;
+struct CardStatus {
+ CardState cardState;
+ PinState universalPinState; // applicable to USIM and CSIM
+ int32_t gsmUmtsSubscriptionAppIndex; // value < RADIO_CARD_MAX_APPS, -1 if none
+ int32_t cdmaSubscriptionAppIndex; // value < RADIO_CARD_MAX_APPS, -1 if none
+ int32_t imsSubscriptionAppIndex; // value < RADIO_CARD_MAX_APPS, -1 if none
+ int32_t numApplications; // value <= RADIO_CARD_MAX_APPS
+ AppStatus[RadioConst:RADIO_CARD_MAX_APPS] applications;
+};
+
+/*
+ * User-to-User Signaling Information defined in 3GPP 23.087 v8.0
+ * This data is passed in RADIO_ExtensionRecord and rec contains this
+ * structure when type is RADIO_UUS_INFO_EXT_REC
+ */
+struct UusInfo {
+ UusType uusType; // UUS Type
+ UusDcs uusDcs; // UUS Data Coding Scheme
+ int32_t uusLength; // Length of UUS Data
+ string uusData; // UUS data
+};
+
+struct Call {
+ CallState state;
+ int32_t index; // Connection Index for use with, eg, AT+CHLD
+ int32_t toa; // type of address, eg 145 = intl
+ bool isMpty; // true if is mpty call
+ bool isMT; // true if call is mobile terminated
+ uint8_t als; // ALS line indicator if available (0 = line 1)
+ bool isVoice; // true if this is is a voice call
+ bool isVoicePrivacy; // true if CDMA voice privacy mode is active
+ string number; // Remote party number
+ CallPresentation numberPresentation;
+ string name; // Remote party name
+ CallPresentation namePresentation;
+ vec<UusInfo> uusInfo; // Vector of User-User Signaling Information
+};
+
+struct Dial {
+ string address;
+ Clir clir;
+ vec<UusInfo> uusInfo; // Vector of User-User Signaling Information
+};
+
+struct GwSignalStrength {
+ uint32_t signalStrength; // Valid values are (0-31, 99) as defined in
+ // TS 27.007 8.5
+ uint32_t bitErrorRate; // bit error rate (0-7, 99) as defined in TS 27.007 8.5
+};
+
+struct CdmaSignalStrength {
+ uint32_t dbm; // This value is the actual RSSI
+ // value multiplied by -1. Example: If the
+ // actual RSSI is -75, then this response value will
+ // be 75.
+ uint32_t ecio; // This value is the actual
+ // Ec/Io multiplied by -10. Example: If the
+ // actual Ec/Io is -12.5 dB, then this response value
+ // will be 125.
+};
+
+struct EvdoSignalStrength {
+ uint32_t dbm; // This value is the actual
+ // RSSI value multiplied by -1.
+ // Example: If the actual RSSI is -75,
+ // then this response value will be 75.
+ uint32_t ecio; // This value is the actual
+ // Ec/Io multiplied by -10. Example: If the
+ // actual Ec/Io is -12.5 dB, then this response value
+ // will be 125.
+ uint32_t signalNoiseRatio; // Valid values are 0-8. 8 is the highest signal to
+ // noise ratio.
+};
+
+struct LteSignalStrength {
+ uint32_t signalStrength; // Valid values are (0-31, 99) as defined in
+ // TS 27.007 8.5
+ uint32_t rsrp; // The current Reference Signal Receive Power in dBm
+ // multipled by -1.
+ // Range: 44 to 140 dBm
+ // INT_MAX: 0x7FFFFFFF denotes invalid value.
+ // Reference: 3GPP TS 36.133 9.1.4
+ uint32_t rsrq; // The current Reference Signal Receive Quality in dB
+ // multiplied by -1.
+ // Range: 20 to 3 dB.
+ // INT_MAX: 0x7FFFFFFF denotes invalid value.
+ // Reference: 3GPP TS 36.133 9.1.7
+ int32_t rssnr; // The current reference signal signal-to-noise ratio in
+ // 0.1 dB units.
+ // Range: -200 to +300 (-200 = -20.0 dB, +300 = 30dB).
+ // INT_MAX : 0x7FFFFFFF denotes invalid value.
+ // Reference: 3GPP TS 36.101 8.1.1
+ uint32_t cqi; // The current Channel Quality Indicator.
+ // Range: 0 to 15.
+ // INT_MAX : 0x7FFFFFFF denotes invalid value.
+ // Reference: 3GPP TS 36.101 9.2, 9.3, A.4
+ uint32_t timingAdvance; // timing advance in micro seconds for a one way trip
+ // from cell to device.
+ // Approximate distance is calculated using
+ // 300m/us * timingAdvance.
+ // Range: 0 to 0x7FFFFFFE
+ // INT_MAX : 0x7FFFFFFF denotes invalid value.
+ // Reference: 3GPP 36.321 section 6.1.3.5
+ // also: http://www.cellular-planningoptimization.com/2010/02/timing-advance-with-calculation.html
+};
+
+struct TdScdmaSignalStrength {
+ uint32_t rscp; // The Received Signal Code Power in dBm multipled by -1.
+ // Range : 25 to 120
+ // INT_MAX: 0x7FFFFFFF denotes invalid value.
+ // Reference: 3GPP TS 25.123, section 9.1.1.1
+};
+
+struct SignalStrength {
+ GwSignalStrength gw;
+ CdmaSignalStrength cdma;
+ EvdoSignalStrength evdo;
+ LteSignalStrength lte;
+ TdScdmaSignalStrength tdScdma;
+};
+
+struct SendSmsResult {
+ int32_t messageRef; // TP-Message-Reference for GSM, and BearerData MessageId
+ // for CDMA (See 3GPP2 C.S0015-B, v2.0, table 4.5-1)
+ string ackPDU; // or empty string if n/a
+ int32_t errorCode; // See 3GPP 27.005, 3.2.5 for GSM/UMTS,
+ // 3GPP2 N.S0005 (IS-41C) Table 171 for CDMA,
+ // -1 if unknown or not applicable
+};
+
+struct SetupDataCallResult {
+ int32_t status; // A RadioDataCallFailCause, 0 which is
+ // RadioDataCallFailCause:NONE if no error
+ int32_t suggestedRetryTime; // If status != 0, this fields indicates the suggested
+ // retry back-off timer value RIL wants to override the
+ // one pre-configured in FW.
+ // The unit is miliseconds.
+ // The value < 0 means no value is suggested.
+ // The value 0 means retry must be done ASAP.
+ // The value of INT_MAX(0x7fffffff) means no retry.
+ int32_t cid; // Context ID, uniquely identifies this call
+ int32_t active; // 0=inactive, 1=active/physical link down,
+ // 2=active/physical link up */
+ string type; // One of the PDP_type values in TS 27.007 section 10.1.1.
+ // For example, "IP", "IPV6", "IPV4V6", or "PPP". If
+ // status is
+ // RadioDataCallFailCause:ONLY_SINGLE_BEARER_ALLOWED this
+ // is the type supported such as "IP" or "IPV6"
+ string ifname; // The network interface name
+ string addresses; // A space-delimited list of addresses with optional "/"
+ // prefix length, e.g., "192.0.1.3" or
+ // "192.0.1.11/16 2001:db8::1/64".
+ // Typically 1 IPv4 or 1 IPv6 or
+ // one of each. If the prefix length is absent the
+ // addresses are assumed to be point to point with IPv4
+ // having a prefix length of 32 and IPv6 128.
+ string dnses; // A space-delimited list of DNS server addresses,
+ // e.g., "192.0.1.3" or "192.0.1.11 2001:db8::1".
+ // Empty if no dns server addresses returned.
+ string gateways; // A space-delimited list of default gateway addresses,
+ // e.g., "192.0.1.3" or "192.0.1.11 2001:db8::1".
+ // When empty, the addresses represent
+ // point to point connections.
+ string pcscf; // the Proxy Call State Control Function address
+ // via PCO(Protocol Configuration Option) for IMS client.
+ int32_t mtu; // MTU received from network
+ // Value <= 0 means network has either not sent a
+ // value or sent an invalid value
+};
+
+struct IccIo {
+ int32_t command; // one of the commands listed for TS 27.007 +CRSM
+ int32_t fileid; // EF id
+ string path; // "pathid" from TS 27.007 +CRSM command.
+ // Path is in hex asciii format eg "7f205f70"
+ // Path must always be provided.
+ int32_t p1; // Values of p1, p2 & p3 defined as per 3GPP TS 51.011
+ int32_t p2;
+ int32_t p3;
+ string data; // information to be written to the SIM
+ string pin2;
+ string aidPtr; // AID value, See ETSI 102.221 8.1 and 101.220 4, empty
+ // string if no value.
+};
+
+struct IccIoResult {
+ int32_t sw1;
+ int32_t sw2;
+ string simResponse; // In hex string format ([a-fA-F0-9]*), except for
+ // SIM_AUTHENTICATION response for which it is in
+ // Base64 format, see 3GPP TS 31.102 7.1.2
+};
+
+struct VoiceRegStateResult {
+ RegState regState;
+ int32_t lac; // LAC if registered on a GSM/WCDMA system or
+ // -1 if not.Valid LAC are 0x0000 - 0xffff
+ int32_t cid; // CID. if registered on a * GSM/WCDMA or -1 if not
+ // Valid CID are 0x00000000 - 0xffffffff
+ // In GSM, CID is Cell ID (see TS 27.007) in 16 bits
+ // In UMTS, CID is UMTS Cell Identity (see TS 25.331)
+ // in 28 bits
+ int32_t rat; // indicates the available voice radio technology,
+ // valid values as defined by RIL_RadioTechnology.
+ int32_t baseStationId; // Base Station ID. if registered on a CDMA
+ // system or -1 if not. Base Station ID in decimal format
+ int32_t baseStationLatitude; // Base Station latitude. if registered on a
+ // CDMA system or -1 if not. Base Station latitude is a
+ // decimal number as specified in 3GPP2 C.S0005-A v6.0.
+ // It is represented in units of 0.25 seconds and ranges
+ // from -1296000 to 1296000, both values inclusive
+ // (corresponding to a range of -90 to +90 degrees).
+ int32_t baseStationLongitude; // Base Station longitude. if registered on a
+ // CDMA system or -1 if not. Base Station
+ // longitude is a decimal number as specified in
+ // 3GPP2 C.S0005-A v6.0. It is represented in
+ // units of 0.25 seconds and ranges from -2592000
+ // to 2592000, both values inclusive (corresponding
+ // to a range of -180 to +180 degrees).
+ bool cssSupported; // concurrent services support indicator. if
+ // registered on a CDMA system.
+ // false - Concurrent services not supported,
+ // true - Concurrent services supported
+ int32_t systemId; // System ID. if registered on a CDMA system or
+ // -1 if not. Valid System ID are 0 - 32767
+ int32_t networkId; // Network ID. if registered on a CDMA system or
+ // -1 if not. Valid System ID are 0 - 65535
+ int32_t roamingIndicator; // TSB-58 Roaming Indicator if registered
+ // on a CDMA or EVDO system or -1 if not.
+ // Valid values are 0-255.
+ int32_t systemIsInPrl; // indicates whether the current system is in the
+ // PRL if registered on a CDMA or EVDO system or -1 if
+ // not. 0=not in the PRL, 1=in the PRL
+ int32_t defaultRoamingIndicator; // default Roaming Indicator from the PRL,
+ // if registered on a CDMA or EVDO system or -1 if not.
+ // Valid values are 0-255.
+ int32_t reasonForDenial; // reasonForDenial if registration state is 3
+ // (Registration denied) this is an enumerated reason why
+ // registration was denied. See 3GPP TS 24.008,
+ // 10.5.3.6 and Annex G.
+ // 0 - General
+ // 1 - Authentication Failure
+ // 2 - IMSI unknown in HLR
+ // 3 - Illegal MS
+ // 4 - Illegal ME
+ // 5 - PLMN not allowed
+ // 6 - Location area not allowed
+ // 7 - Roaming not allowed
+ // 8 - No Suitable Cells in this Location Area
+ // 9 - Network failure
+ // 10 - Persistent location update reject
+ // 11 - PLMN not allowed
+ // 12 - Location area not allowed
+ // 13 - Roaming not allowed in this Location Area
+ // 15 - No Suitable Cells in this Location Area
+ // 17 - Network Failure
+ // 20 - MAC Failure
+ // 21 - Sync Failure
+ // 22 - Congestion
+ // 23 - GSM Authentication unacceptable
+ // 25 - Not Authorized for this CSG
+ // 32 - Service option not supported
+ // 33 - Requested service option not subscribed
+ // 34 - Service option temporarily out of order
+ // 38 - Call cannot be identified
+ // 48-63 - Retry upon entry into a new cell
+ // 95 - Semantically incorrect message
+ // 96 - Invalid mandatory information
+ // 97 - Message type non-existent or not implemented
+ // 98 - Message type not compatible with protocol state
+ // 99 - Information element non-existent or not implemented
+ // 100 - Conditional IE error
+ // 101 - Message not compatible with protocol state
+ // 111 - Protocol error, unspecified
+ int32_t psc; // Primary Scrambling Code of the current
+ // cell as described in TS 25.331, in hexadecimal
+ // format, or -1 if unknown or not registered
+ // to a UMTS network.
+};
+
+struct DataRegStateResult {
+ RegState regState; // Valid reg states are NOT_REG_MT_NOT_SEARCHING_OP,
+ // REG_HOME, NOT_REG_MT_SEARCHING_OP, REG_DENIED,
+ // UNKNOWN, REG_ROAMING defined in RegState
+ int32_t lac; // LAC if registered or -1 if not
+ // valid LAC are 0x0000 - 0xffff
+ int32_t cid; // CID if registered or -1 if not
+ // valid CID are 0x00000000 - 0x0fffffff
+ int32_t rat; // indicates the available data radio technology,
+ // valid values as defined by RIL_RadioTechnology.
+ int32_t reasonDataDenied; // if registration state is 3 (Registration
+ // denied) this is an enumerated reason why
+ // registration was denied. See 3GPP TS 24.008,
+ // Annex G.6 "Additonal cause codes for GMM".
+ // 7 == GPRS services not allowed
+ // 8 == GPRS services and non-GPRS services not allowed
+ // 9 == MS identity cannot be derived by the network
+ // 10 == Implicitly detached
+ // 14 == GPRS services not allowed in this PLMN
+ // 16 == MSC temporarily not reachable
+ // 40 == No PDP context activated
+ int32_t maxDataCalls; // The maximum number of simultaneous Data Calls that
+ // must be established using requestSetupDataCall().
+ // The values below are optional LTE location information in decimal.
+ // If a value is unknown that value must be -1.
+ int32_t tac; // a 16-bit Tracking Area Code.
+ int32_t phyCid; // a 0-503 Physical Cell Identifier.
+ int32_t eci; // a 28-bit E-UTRAN Cell Identifier.
+ int32_t csgid; // a 27-bit Closed Subscriber Group Identity.
+ int32_t tadv; // a 6-bit timing advance value.
+};
+
+// See also com.android.internal.telephony.gsm.CallForwardInfo
+struct CallForwardInfo {
+ CallForwardInfoStatus status; // For queryCallForwardStatus()
+ // status must be ACTIVE, INACTIVE
+ // For setCallForward():
+ // status must be
+ // DISABLE, ENABLE, INTERROGATE, REGISTRATION, ERASURE
+ int32_t reason; // from TS 27.007 7.11 "reason"
+ int32_t serviceClass; // From 27.007 +CCFC/+CLCK "class"
+ // See table for Android mapping from
+ // MMI service code
+ // 0 means user doesnt input class
+ int32_t toa; // "type" from TS 27.007 7.11
+ string number; // "number" from TS 27.007 7.11.
+ int32_t timeSeconds;
+};
+
+// Response struct used in responseQueryAvailableNetworks
+struct OperatorInfo {
+ string alphaLong; // long alpha ONS or EONS
+ string alphaShort; // short alpha ONS or EONS
+ string operatorNumeric; // 5 or 6 digit numeric code (MCC + MNC)
+ OperatorStatus status;
+};
+
+struct SmsWriteArgs {
+ SmsWriteArgsStatus status; // Status of message. See TS 27.005 3.1
+ string pdu; // PDU of message to write, as an ASCII hex string less
+ // the SMSC address, the TP-layer length is strlen(pdu)/2.
+ string smsc; // SMSC address in GSM BCD format prefixed by a length
+ // byte (as expected by TS 27.005) or NULL for default
+ // SMSC
};
\ No newline at end of file
diff --git a/sensors/1.0/Android.bp b/sensors/1.0/Android.bp
index 5b1fd05..13e9bee 100644
--- a/sensors/1.0/Android.bp
+++ b/sensors/1.0/Android.bp
@@ -43,9 +43,9 @@
"libutils",
"libcutils",
],
-export_shared_lib_headers: [
- "libhidl",
- "libhwbinder",
- "libutils",
+ export_shared_lib_headers: [
+ "libhidl",
+ "libhwbinder",
+ "libutils",
],
}
diff --git a/soundtrigger/2.0/Android.bp b/soundtrigger/2.0/Android.bp
index a7a42a0..cda8c22 100644
--- a/soundtrigger/2.0/Android.bp
+++ b/soundtrigger/2.0/Android.bp
@@ -52,9 +52,9 @@
"libcutils",
"android.hardware.audio.common@2.0",
],
-export_shared_lib_headers: [
- "libhidl",
- "libhwbinder",
- "libutils",
+ export_shared_lib_headers: [
+ "libhidl",
+ "libhwbinder",
+ "libutils",
],
}
diff --git a/tests/Android.bp b/tests/Android.bp
index e9b0148..030576d 100644
--- a/tests/Android.bp
+++ b/tests/Android.bp
@@ -7,6 +7,8 @@
"foo/1.0",
"foo/1.0/default",
"foo/1.0/default/lib",
+ "inheritance/1.0",
+ "inheritance/1.0/default",
"libhwbinder/1.0",
"libhwbinder/1.0/default",
"msgq/1.0",
diff --git a/tests/bar/1.0/Android.bp b/tests/bar/1.0/Android.bp
index 06db6d0..4af053c 100644
--- a/tests/bar/1.0/Android.bp
+++ b/tests/bar/1.0/Android.bp
@@ -48,9 +48,9 @@
"libcutils",
"android.hardware.tests.foo@1.0",
],
-export_shared_lib_headers: [
- "libhidl",
- "libhwbinder",
- "libutils",
+ export_shared_lib_headers: [
+ "libhidl",
+ "libhwbinder",
+ "libutils",
],
}
diff --git a/tests/bar/1.0/IBar.hal b/tests/bar/1.0/IBar.hal
index b57d9a0..82c6fc1 100644
--- a/tests/bar/1.0/IBar.hal
+++ b/tests/bar/1.0/IBar.hal
@@ -17,6 +17,7 @@
package android.hardware.tests.bar@1.0;
import android.hardware.tests.foo@1.0::IFoo;
+import android.hardware.tests.foo@1.0::Abc;
import android.hardware.tests.foo@1.0::Unrelated;
interface IBar extends android.hardware.tests.foo@1.0::IFoo {
@@ -29,4 +30,5 @@
};
thisIsNew();
+ expectNullHandle(handle h, Abc xyz) generates (bool hIsNull, bool xyzHasNull);
};
diff --git a/tests/bar/1.0/default/Android.bp b/tests/bar/1.0/default/Android.bp
index 0d47001..c2c2309 100644
--- a/tests/bar/1.0/default/Android.bp
+++ b/tests/bar/1.0/default/Android.bp
@@ -10,6 +10,7 @@
shared_libs: [
"libbase",
+ "libcutils",
"libhidl",
"libhwbinder",
"liblog",
diff --git a/tests/bar/1.0/default/Bar.cpp b/tests/bar/1.0/default/Bar.cpp
index 34ec087..4ff9e6b 100644
--- a/tests/bar/1.0/default/Bar.cpp
+++ b/tests/bar/1.0/default/Bar.cpp
@@ -130,6 +130,22 @@
return Void();
}
+Return<void> Bar::createMyHandle(createMyHandle_cb _hidl_cb) {
+ return mFoo->createMyHandle(_hidl_cb);
+}
+
+Return<void> Bar::createHandles(uint32_t size, createHandles_cb _hidl_cb) {
+ return mFoo->createHandles(size, _hidl_cb);
+}
+
+Return<void> Bar::closeHandles() {
+ return mFoo->closeHandles();
+}
+
+Return<void> Bar::echoNullInterface(const sp<IFooCallback> &cb, echoNullInterface_cb _hidl_cb) {
+ return mFoo->echoNullInterface(cb, _hidl_cb);
+}
+
// Methods from ::android::hardware::tests::bar::V1_0::IBar follow.
Return<void> Bar::thisIsNew() {
ALOGI("SERVER(Bar) thisIsNew");
@@ -137,6 +153,12 @@
return Void();
}
+Return<void> Bar::expectNullHandle(const native_handle_t* h, const Abc& xyz, expectNullHandle_cb _hidl_cb) {
+ ALOGI("SERVER(Bar) h = %p, xyz.z = %p", h, xyz.z);
+ _hidl_cb(h == nullptr, xyz.z == nullptr);
+ return Void();
+}
+
IBar* HIDL_FETCH_IBar(const char* /* name */) {
return new Bar();
}
diff --git a/tests/bar/1.0/default/Bar.h b/tests/bar/1.0/default/Bar.h
index d2c2635..4e22b61 100644
--- a/tests/bar/1.0/default/Bar.h
+++ b/tests/bar/1.0/default/Bar.h
@@ -48,6 +48,9 @@
virtual Return<void> transpose2(const hidl_array<hidl_string, 5 /* 5 */, 3 /* 3 */>& in, transpose2_cb _hidl_cb) override;
virtual Return<void> sendVec(const hidl_vec<uint8_t>& data, sendVec_cb _hidl_cb) override;
virtual Return<void> sendVecVec(sendVecVec_cb _hidl_cb) override;
+ virtual Return<void> createMyHandle(createMyHandle_cb _hidl_cb) override;
+ virtual Return<void> createHandles(uint32_t size, createHandles_cb _hidl_cb) override;
+ virtual Return<void> closeHandles() override;
Return<void> haveAVectorOfInterfaces(
const hidl_vec<sp<ISimple> > &in,
@@ -57,8 +60,11 @@
const hidl_vec<sp<android::hardware::IBinder> > &in,
haveAVectorOfGenericInterfaces_cb _hidl_cb) override;
+ Return<void> echoNullInterface(const sp<IFooCallback> &cb, echoNullInterface_cb _hidl_cb) override;
+
// Methods from ::android::hardware::tests::bar::V1_0::IBar follow.
Return<void> thisIsNew() override;
+ Return<void> expectNullHandle(const native_handle_t* h, const Abc& xyz, expectNullHandle_cb _hidl_cb) override;
private:
sp<IFoo> mFoo;
diff --git a/tests/baz/1.0/Android.bp b/tests/baz/1.0/Android.bp
index 64a8803..18a554d 100644
--- a/tests/baz/1.0/Android.bp
+++ b/tests/baz/1.0/Android.bp
@@ -59,9 +59,9 @@
"libutils",
"libcutils",
],
-export_shared_lib_headers: [
- "libhidl",
- "libhwbinder",
- "libutils",
+ export_shared_lib_headers: [
+ "libhidl",
+ "libhwbinder",
+ "libutils",
],
}
diff --git a/tests/expression/1.0/Android.bp b/tests/expression/1.0/Android.bp
index 2ad94fa..2061283 100644
--- a/tests/expression/1.0/Android.bp
+++ b/tests/expression/1.0/Android.bp
@@ -47,9 +47,9 @@
"libutils",
"libcutils",
],
-export_shared_lib_headers: [
- "libhidl",
- "libhwbinder",
- "libutils",
+ export_shared_lib_headers: [
+ "libhidl",
+ "libhwbinder",
+ "libutils",
],
}
diff --git a/tests/foo/1.0/Android.bp b/tests/foo/1.0/Android.bp
index 96133ac..7a556ed 100644
--- a/tests/foo/1.0/Android.bp
+++ b/tests/foo/1.0/Android.bp
@@ -75,9 +75,9 @@
"libutils",
"libcutils",
],
-export_shared_lib_headers: [
- "libhidl",
- "libhwbinder",
- "libutils",
+ export_shared_lib_headers: [
+ "libhidl",
+ "libhwbinder",
+ "libutils",
],
}
diff --git a/tests/foo/1.0/IFoo.hal b/tests/foo/1.0/IFoo.hal
index 2afaec1..ea69e1e 100644
--- a/tests/foo/1.0/IFoo.hal
+++ b/tests/foo/1.0/IFoo.hal
@@ -80,6 +80,11 @@
FloatArray myFloatArray;
};
+ struct MyHandle {
+ handle h;
+ int32_t guard;
+ };
+
doThis(float param);
doThatAndReturnSomething(int64_t param) generates (int32_t result);
doQuiteABit(int32_t a, int64_t b, float c, double d) generates (double something);
@@ -112,4 +117,10 @@
haveAVectorOfGenericInterfaces(vec<interface> in)
generates (vec<interface> out);
+
+ echoNullInterface(IFooCallback cb) generates (bool receivedNull, IFooCallback cb);
+
+ createMyHandle() generates (MyHandle h);
+ createHandles(uint32_t size) generates (vec<handle> handles);
+ closeHandles();
};
diff --git a/tests/foo/1.0/default/Android.bp b/tests/foo/1.0/default/Android.bp
index 185e5ea..f2ee521 100644
--- a/tests/foo/1.0/default/Android.bp
+++ b/tests/foo/1.0/default/Android.bp
@@ -10,6 +10,7 @@
shared_libs: [
"libbase",
+ "libcutils",
"libhidl",
"libfootest",
"libhwbinder",
diff --git a/tests/foo/1.0/default/Foo.cpp b/tests/foo/1.0/default/Foo.cpp
index f855f21..f7cc7c0 100644
--- a/tests/foo/1.0/default/Foo.cpp
+++ b/tests/foo/1.0/default/Foo.cpp
@@ -291,6 +291,45 @@
const hidl_vec<sp<android::hardware::IBinder> > &in,
haveAVectorOfGenericInterfaces_cb _hidl_cb) {
_hidl_cb(in);
+ return Void();
+}
+
+Return<void> Foo::createMyHandle(createMyHandle_cb _hidl_cb) {
+ native_handle_t* nh = native_handle_create(0, 10);
+ int data[] = {2,3,5,7,11,13,17,19,21,23};
+ CHECK(sizeof(data) == 10 * sizeof(int));
+ memcpy(nh->data, data, sizeof(data));
+ mHandles.push_back(nh);
+
+ MyHandle h;
+ h.guard = 666;
+ h.h = nh;
+ _hidl_cb(h);
+ return Void();
+}
+
+Return<void> Foo::createHandles(uint32_t size, createHandles_cb _hidl_cb) {
+ hidl_vec<const native_handle_t*> handles;
+ handles.resize(size);
+ for(uint32_t i = 0; i < size; ++i) {
+ createMyHandle([&](const MyHandle& h) {
+ handles[i] = h.h;
+ });
+ }
+ _hidl_cb(handles);
+ return Void();
+}
+
+Return<void> Foo::closeHandles() {
+ for(native_handle_t* h : mHandles) {
+ native_handle_delete(h);
+ }
+ mHandles.clear();
+ return Void();
+}
+
+Return<void> Foo::echoNullInterface(const sp<IFooCallback> &cb, echoNullInterface_cb _hidl_cb) {
+ _hidl_cb(cb == nullptr, cb);
return Void();
}
diff --git a/tests/foo/1.0/default/Foo.h b/tests/foo/1.0/default/Foo.h
index b3785d2..703c210 100644
--- a/tests/foo/1.0/default/Foo.h
+++ b/tests/foo/1.0/default/Foo.h
@@ -5,6 +5,7 @@
#include <hidl/Status.h>
#include <hidl/MQDescriptor.h>
+#include <vector>
namespace android {
namespace hardware {
namespace tests {
@@ -44,6 +45,9 @@
virtual Return<void> transpose2(const hidl_array<hidl_string, 5 /* 5 */, 3 /* 3 */>& in, transpose2_cb _hidl_cb) override;
virtual Return<void> sendVec(const hidl_vec<uint8_t>& data, sendVec_cb _hidl_cb) override;
virtual Return<void> sendVecVec(sendVecVec_cb _hidl_cb) override;
+ virtual Return<void> createMyHandle(createMyHandle_cb _hidl_cb) override;
+ virtual Return<void> createHandles(uint32_t size, createHandles_cb _hidl_cb) override;
+ virtual Return<void> closeHandles() override;
Return<void> haveAVectorOfInterfaces(
const hidl_vec<sp<ISimple> > &in,
@@ -52,6 +56,10 @@
Return<void> haveAVectorOfGenericInterfaces(
const hidl_vec<sp<android::hardware::IBinder> > &in,
haveAVectorOfGenericInterfaces_cb _hidl_cb) override;
+
+ Return<void> echoNullInterface(const sp<IFooCallback> &cb, echoNullInterface_cb _hidl_cb) override;
+private:
+ std::vector<::native_handle_t *> mHandles;
};
extern "C" IFoo* HIDL_FETCH_IFoo(const char* name);
diff --git a/tests/inheritance/1.0/Android.bp b/tests/inheritance/1.0/Android.bp
new file mode 100644
index 0000000..92d6fe7
--- /dev/null
+++ b/tests/inheritance/1.0/Android.bp
@@ -0,0 +1,71 @@
+// This file is autogenerated by hidl-gen. Do not edit manually.
+
+genrule {
+ name: "android.hardware.tests.inheritance@1.0_genc++",
+ tool: "hidl-gen",
+ cmd: "$tool -o $genDir -Lc++ -randroid.hardware:hardware/interfaces android.hardware.tests.inheritance@1.0",
+ srcs: [
+ "IChild.hal",
+ "IFetcher.hal",
+ "IGrandparent.hal",
+ "IParent.hal",
+ ],
+ out: [
+ "android/hardware/tests/inheritance/1.0/ChildAll.cpp",
+ "android/hardware/tests/inheritance/1.0/FetcherAll.cpp",
+ "android/hardware/tests/inheritance/1.0/GrandparentAll.cpp",
+ "android/hardware/tests/inheritance/1.0/ParentAll.cpp",
+ ],
+}
+
+genrule {
+ name: "android.hardware.tests.inheritance@1.0_genc++_headers",
+ tool: "hidl-gen",
+ cmd: "$tool -o $genDir -Lc++ -randroid.hardware:hardware/interfaces android.hardware.tests.inheritance@1.0",
+ srcs: [
+ "IChild.hal",
+ "IFetcher.hal",
+ "IGrandparent.hal",
+ "IParent.hal",
+ ],
+ out: [
+ "android/hardware/tests/inheritance/1.0/IChild.h",
+ "android/hardware/tests/inheritance/1.0/IHwChild.h",
+ "android/hardware/tests/inheritance/1.0/BnChild.h",
+ "android/hardware/tests/inheritance/1.0/BpChild.h",
+ "android/hardware/tests/inheritance/1.0/BsChild.h",
+ "android/hardware/tests/inheritance/1.0/IFetcher.h",
+ "android/hardware/tests/inheritance/1.0/IHwFetcher.h",
+ "android/hardware/tests/inheritance/1.0/BnFetcher.h",
+ "android/hardware/tests/inheritance/1.0/BpFetcher.h",
+ "android/hardware/tests/inheritance/1.0/BsFetcher.h",
+ "android/hardware/tests/inheritance/1.0/IGrandparent.h",
+ "android/hardware/tests/inheritance/1.0/IHwGrandparent.h",
+ "android/hardware/tests/inheritance/1.0/BnGrandparent.h",
+ "android/hardware/tests/inheritance/1.0/BpGrandparent.h",
+ "android/hardware/tests/inheritance/1.0/BsGrandparent.h",
+ "android/hardware/tests/inheritance/1.0/IParent.h",
+ "android/hardware/tests/inheritance/1.0/IHwParent.h",
+ "android/hardware/tests/inheritance/1.0/BnParent.h",
+ "android/hardware/tests/inheritance/1.0/BpParent.h",
+ "android/hardware/tests/inheritance/1.0/BsParent.h",
+ ],
+}
+
+cc_library_shared {
+ name: "android.hardware.tests.inheritance@1.0",
+ generated_sources: ["android.hardware.tests.inheritance@1.0_genc++"],
+ generated_headers: ["android.hardware.tests.inheritance@1.0_genc++_headers"],
+ export_generated_headers: ["android.hardware.tests.inheritance@1.0_genc++_headers"],
+ shared_libs: [
+ "libhidl",
+ "libhwbinder",
+ "libutils",
+ "libcutils",
+ ],
+ export_shared_lib_headers: [
+ "libhidl",
+ "libhwbinder",
+ "libutils",
+ ],
+}
diff --git a/tests/inheritance/1.0/Android.mk b/tests/inheritance/1.0/Android.mk
new file mode 100644
index 0000000..34da056
--- /dev/null
+++ b/tests/inheritance/1.0/Android.mk
@@ -0,0 +1,186 @@
+# This file is autogenerated by hidl-gen. Do not edit manually.
+
+LOCAL_PATH := $(call my-dir)
+
+################################################################################
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := android.hardware.tests.inheritance@1.0-java
+LOCAL_MODULE_CLASS := JAVA_LIBRARIES
+
+intermediates := $(local-generated-sources-dir)
+
+HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
+
+#
+# Build IChild.hal
+#
+GEN := $(intermediates)/android/hardware/tests/inheritance/1.0/IChild.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IChild.hal
+$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/IParent.hal
+$(GEN): $(LOCAL_PATH)/IParent.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.tests.inheritance@1.0::IChild
+
+$(GEN): $(LOCAL_PATH)/IChild.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build IFetcher.hal
+#
+GEN := $(intermediates)/android/hardware/tests/inheritance/1.0/IFetcher.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IFetcher.hal
+$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/IChild.hal
+$(GEN): $(LOCAL_PATH)/IChild.hal
+$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/IGrandparent.hal
+$(GEN): $(LOCAL_PATH)/IGrandparent.hal
+$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/IParent.hal
+$(GEN): $(LOCAL_PATH)/IParent.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.tests.inheritance@1.0::IFetcher
+
+$(GEN): $(LOCAL_PATH)/IFetcher.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build IGrandparent.hal
+#
+GEN := $(intermediates)/android/hardware/tests/inheritance/1.0/IGrandparent.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IGrandparent.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.tests.inheritance@1.0::IGrandparent
+
+$(GEN): $(LOCAL_PATH)/IGrandparent.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build IParent.hal
+#
+GEN := $(intermediates)/android/hardware/tests/inheritance/1.0/IParent.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IParent.hal
+$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/IGrandparent.hal
+$(GEN): $(LOCAL_PATH)/IGrandparent.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.tests.inheritance@1.0::IParent
+
+$(GEN): $(LOCAL_PATH)/IParent.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+include $(BUILD_JAVA_LIBRARY)
+
+
+################################################################################
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := android.hardware.tests.inheritance@1.0-java-static
+LOCAL_MODULE_CLASS := JAVA_LIBRARIES
+
+intermediates := $(local-generated-sources-dir)
+
+HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
+
+#
+# Build IChild.hal
+#
+GEN := $(intermediates)/android/hardware/tests/inheritance/1.0/IChild.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IChild.hal
+$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/IParent.hal
+$(GEN): $(LOCAL_PATH)/IParent.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.tests.inheritance@1.0::IChild
+
+$(GEN): $(LOCAL_PATH)/IChild.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build IFetcher.hal
+#
+GEN := $(intermediates)/android/hardware/tests/inheritance/1.0/IFetcher.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IFetcher.hal
+$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/IChild.hal
+$(GEN): $(LOCAL_PATH)/IChild.hal
+$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/IGrandparent.hal
+$(GEN): $(LOCAL_PATH)/IGrandparent.hal
+$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/IParent.hal
+$(GEN): $(LOCAL_PATH)/IParent.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.tests.inheritance@1.0::IFetcher
+
+$(GEN): $(LOCAL_PATH)/IFetcher.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build IGrandparent.hal
+#
+GEN := $(intermediates)/android/hardware/tests/inheritance/1.0/IGrandparent.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IGrandparent.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.tests.inheritance@1.0::IGrandparent
+
+$(GEN): $(LOCAL_PATH)/IGrandparent.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build IParent.hal
+#
+GEN := $(intermediates)/android/hardware/tests/inheritance/1.0/IParent.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IParent.hal
+$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/IGrandparent.hal
+$(GEN): $(LOCAL_PATH)/IGrandparent.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.tests.inheritance@1.0::IParent
+
+$(GEN): $(LOCAL_PATH)/IParent.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+include $(BUILD_STATIC_JAVA_LIBRARY)
+
+
+
+include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/tests/inheritance/1.0/IChild.hal b/tests/inheritance/1.0/IChild.hal
new file mode 100644
index 0000000..160b12e
--- /dev/null
+++ b/tests/inheritance/1.0/IChild.hal
@@ -0,0 +1,22 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.tests.inheritance@1.0;
+import IParent;
+
+interface IChild extends IParent {
+ doChild();
+};
diff --git a/tests/inheritance/1.0/IFetcher.hal b/tests/inheritance/1.0/IFetcher.hal
new file mode 100644
index 0000000..3df63df
--- /dev/null
+++ b/tests/inheritance/1.0/IFetcher.hal
@@ -0,0 +1,28 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.tests.inheritance@1.0;
+
+import IGrandparent;
+import IParent;
+import IChild;
+
+interface IFetcher {
+
+ getGrandparent(bool sendRemote) generates (IGrandparent parent);
+ getParent(bool sendRemote) generates (IParent parent);
+ getChild(bool sendRemote) generates (IChild child);
+};
diff --git a/tests/inheritance/1.0/IGrandparent.hal b/tests/inheritance/1.0/IGrandparent.hal
new file mode 100644
index 0000000..59339c6
--- /dev/null
+++ b/tests/inheritance/1.0/IGrandparent.hal
@@ -0,0 +1,21 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.tests.inheritance@1.0;
+
+interface IGrandparent {
+ doGrandparent();
+};
diff --git a/tests/inheritance/1.0/IParent.hal b/tests/inheritance/1.0/IParent.hal
new file mode 100644
index 0000000..2abb2e3
--- /dev/null
+++ b/tests/inheritance/1.0/IParent.hal
@@ -0,0 +1,23 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.tests.inheritance@1.0;
+
+import IGrandparent;
+
+interface IParent extends IGrandparent {
+ doParent();
+};
diff --git a/tests/inheritance/1.0/default/Android.bp b/tests/inheritance/1.0/default/Android.bp
new file mode 100644
index 0000000..d97bd83
--- /dev/null
+++ b/tests/inheritance/1.0/default/Android.bp
@@ -0,0 +1,21 @@
+
+
+cc_library_shared {
+ name: "android.hardware.tests.inheritance@1.0-impl",
+ relative_install_path: "hw",
+ srcs: [
+ "Fetcher.cpp",
+ "Parent.cpp",
+ "Child.cpp",
+ ],
+
+ shared_libs: [
+ "libbase",
+ "libhidl",
+ "libhwbinder",
+ "liblog",
+ "libutils",
+ "android.hardware.tests.inheritance@1.0",
+ ],
+
+}
diff --git a/tests/inheritance/1.0/default/Child.cpp b/tests/inheritance/1.0/default/Child.cpp
new file mode 100644
index 0000000..66720b3
--- /dev/null
+++ b/tests/inheritance/1.0/default/Child.cpp
@@ -0,0 +1,42 @@
+#define LOG_TAG "hidl_test"
+#include <android-base/logging.h>
+
+#include "Child.h"
+
+namespace android {
+namespace hardware {
+namespace tests {
+namespace inheritance {
+namespace V1_0 {
+namespace implementation {
+
+// Methods from ::android::hardware::tests::inheritance::V1_0::IGrandparent follow.
+Return<void> Child::doGrandparent() {
+ ALOGI("SERVER(Bar) Child::doGrandparent");
+ return Void();
+}
+
+// Methods from ::android::hardware::tests::inheritance::V1_0::IParent follow.
+Return<void> Child::doParent() {
+ ALOGI("SERVER(Bar) Child::doParent");
+ return Void();
+}
+
+
+// Methods from ::android::hardware::tests::inheritance::V1_0::IChild follow.
+Return<void> Child::doChild() {
+ ALOGI("SERVER(Bar) Child::doChild");
+ return Void();
+}
+
+
+IChild* HIDL_FETCH_IChild(const char* /* name */) {
+ return new Child();
+}
+
+} // namespace implementation
+} // namespace V1_0
+} // namespace inheritance
+} // namespace tests
+} // namespace hardware
+} // namespace android
diff --git a/tests/inheritance/1.0/default/Child.h b/tests/inheritance/1.0/default/Child.h
new file mode 100644
index 0000000..0d34e83
--- /dev/null
+++ b/tests/inheritance/1.0/default/Child.h
@@ -0,0 +1,44 @@
+#ifndef HIDL_GENERATED_android_hardware_tests_inheritance_V1_0_Child_H_
+#define HIDL_GENERATED_android_hardware_tests_inheritance_V1_0_Child_H_
+
+#include <android/hardware/tests/inheritance/1.0/IChild.h>
+#include <hidl/Status.h>
+
+#include <hidl/MQDescriptor.h>
+namespace android {
+namespace hardware {
+namespace tests {
+namespace inheritance {
+namespace V1_0 {
+namespace implementation {
+
+using ::android::hardware::tests::inheritance::V1_0::IParent;
+using ::android::hardware::tests::inheritance::V1_0::IChild;
+using ::android::hardware::Return;
+using ::android::hardware::Void;
+using ::android::hardware::hidl_vec;
+using ::android::hardware::hidl_string;
+using ::android::sp;
+
+struct Child : public IChild {
+ // Methods from ::android::hardware::tests::inheritance::V1_0::IGrandparent follow.
+ Return<void> doGrandparent() override;
+
+ // Methods from ::android::hardware::tests::inheritance::V1_0::IParent follow.
+ Return<void> doParent() override;
+
+ // Methods from ::android::hardware::tests::inheritance::V1_0::IChild follow.
+ Return<void> doChild() override;
+
+};
+
+extern "C" IChild* HIDL_FETCH_IChild(const char* name);
+
+} // namespace implementation
+} // namespace V1_0
+} // namespace inheritance
+} // namespace tests
+} // namespace hardware
+} // namespace android
+
+#endif // HIDL_GENERATED_android_hardware_tests_inheritance_V1_0_Child_H_
diff --git a/tests/inheritance/1.0/default/Fetcher.cpp b/tests/inheritance/1.0/default/Fetcher.cpp
new file mode 100644
index 0000000..28dffaa
--- /dev/null
+++ b/tests/inheritance/1.0/default/Fetcher.cpp
@@ -0,0 +1,58 @@
+
+#define LOG_TAG "hidl_test"
+
+#include "Fetcher.h"
+#include <android-base/logging.h>
+#include <inttypes.h>
+
+namespace android {
+namespace hardware {
+namespace tests {
+namespace inheritance {
+namespace V1_0 {
+namespace implementation {
+
+Fetcher::Fetcher() {
+ mPrecious = IChild::getService("local child", true);
+ CHECK(!mPrecious->isRemote());
+}
+
+template <typename CB>
+Return<void> selectService(bool sendRemote, CB &_hidl_cb, sp<IChild> &local) {
+ sp<IChild> toSend;
+ if (sendRemote) {
+ toSend = IChild::getService("child");
+ if (!toSend->isRemote()) {
+ return Status::fromExceptionCode(Status::EX_ILLEGAL_STATE);
+ }
+ } else {
+ toSend = local;
+ }
+ ALOGI("SERVER(Fetcher) selectService returning %p", toSend.get());
+ _hidl_cb(toSend);
+ return Void();
+}
+
+// Methods from ::android::hardware::tests::inheritance::V1_0::IFetcher follow.
+Return<void> Fetcher::getGrandparent(bool sendRemote, getGrandparent_cb _hidl_cb) {
+ return selectService(sendRemote, _hidl_cb, mPrecious);
+}
+
+Return<void> Fetcher::getParent(bool sendRemote, getParent_cb _hidl_cb) {
+ return selectService(sendRemote, _hidl_cb, mPrecious);
+}
+
+Return<void> Fetcher::getChild(bool sendRemote, getChild_cb _hidl_cb) {
+ return selectService(sendRemote, _hidl_cb, mPrecious);
+}
+
+IFetcher* HIDL_FETCH_IFetcher(const char* /* name */) {
+ return new Fetcher();
+}
+
+} // namespace implementation
+} // namespace V1_0
+} // namespace inheritance
+} // namespace tests
+} // namespace hardware
+} // namespace android
diff --git a/tests/inheritance/1.0/default/Fetcher.h b/tests/inheritance/1.0/default/Fetcher.h
new file mode 100644
index 0000000..d389853
--- /dev/null
+++ b/tests/inheritance/1.0/default/Fetcher.h
@@ -0,0 +1,45 @@
+#ifndef HIDL_GENERATED_android_hardware_tests_inheritance_V1_0_Fetcher_H_
+#define HIDL_GENERATED_android_hardware_tests_inheritance_V1_0_Fetcher_H_
+
+#include "Child.h"
+#include <android/hardware/tests/inheritance/1.0/IFetcher.h>
+#include <hidl/Status.h>
+
+#include <hidl/MQDescriptor.h>
+namespace android {
+namespace hardware {
+namespace tests {
+namespace inheritance {
+namespace V1_0 {
+namespace implementation {
+
+using ::android::hardware::tests::inheritance::V1_0::IFetcher;
+using ::android::hardware::Return;
+using ::android::hardware::Void;
+using ::android::hardware::hidl_vec;
+using ::android::hardware::hidl_string;
+using ::android::sp;
+
+struct Fetcher : public IFetcher {
+
+ Fetcher();
+
+ // Methods from ::android::hardware::tests::inheritance::V1_0::IFetcher follow.
+ Return<void> getGrandparent(bool sendRemote, getGrandparent_cb _hidl_cb) override;
+ Return<void> getParent(bool sendRemote, getParent_cb _hidl_cb) override;
+ Return<void> getChild(bool sendRemote, getChild_cb _hidl_cb) override;
+
+private:
+ sp<IChild> mPrecious;
+};
+
+extern "C" IFetcher* HIDL_FETCH_IFetcher(const char* name);
+
+} // namespace implementation
+} // namespace V1_0
+} // namespace inheritance
+} // namespace tests
+} // namespace hardware
+} // namespace android
+
+#endif // HIDL_GENERATED_android_hardware_tests_inheritance_V1_0_Fetcher_H_
diff --git a/tests/inheritance/1.0/default/Grandparent.cpp b/tests/inheritance/1.0/default/Grandparent.cpp
new file mode 100644
index 0000000..c53dc87
--- /dev/null
+++ b/tests/inheritance/1.0/default/Grandparent.cpp
@@ -0,0 +1,29 @@
+#define LOG_TAG "hidl_test"
+#include <android-base/logging.h>
+
+#include "Grandparent.h"
+
+namespace android {
+namespace hardware {
+namespace tests {
+namespace inheritance {
+namespace V1_0 {
+namespace implementation {
+
+// Methods from ::android::hardware::tests::inheritance::V1_0::IGrandparent follow.
+Return<void> Grandparent::doGrandparent() {
+ ALOGI("SERVER(Bar) Grandparent::doGrandparent");
+ return Void();
+}
+
+
+IGrandparent* HIDL_FETCH_IGrandparent(const char* /* name */) {
+ return new Grandparent();
+}
+
+} // namespace implementation
+} // namespace V1_0
+} // namespace inheritance
+} // namespace tests
+} // namespace hardware
+} // namespace android
diff --git a/tests/inheritance/1.0/default/Grandparent.h b/tests/inheritance/1.0/default/Grandparent.h
new file mode 100644
index 0000000..e1113bf
--- /dev/null
+++ b/tests/inheritance/1.0/default/Grandparent.h
@@ -0,0 +1,37 @@
+#ifndef HIDL_GENERATED_android_hardware_tests_inheritance_V1_0_Grandparent_H_
+#define HIDL_GENERATED_android_hardware_tests_inheritance_V1_0_Grandparent_H_
+
+#include <android/hardware/tests/inheritance/1.0/IGrandparent.h>
+#include <hidl/Status.h>
+
+#include <hidl/MQDescriptor.h>
+namespace android {
+namespace hardware {
+namespace tests {
+namespace inheritance {
+namespace V1_0 {
+namespace implementation {
+
+using ::android::hardware::tests::inheritance::V1_0::IGrandparent;
+using ::android::hardware::Return;
+using ::android::hardware::Void;
+using ::android::hardware::hidl_vec;
+using ::android::hardware::hidl_string;
+using ::android::sp;
+
+struct Grandparent : public IGrandparent {
+ // Methods from ::android::hardware::tests::inheritance::V1_0::IGrandparent follow.
+ Return<void> doGrandparent() override;
+
+};
+
+extern "C" IGrandparent* HIDL_FETCH_IGrandparent(const char* name);
+
+} // namespace implementation
+} // namespace V1_0
+} // namespace inheritance
+} // namespace tests
+} // namespace hardware
+} // namespace android
+
+#endif // HIDL_GENERATED_android_hardware_tests_inheritance_V1_0_Grandparent_H_
diff --git a/tests/inheritance/1.0/default/Parent.cpp b/tests/inheritance/1.0/default/Parent.cpp
new file mode 100644
index 0000000..bdd20c9
--- /dev/null
+++ b/tests/inheritance/1.0/default/Parent.cpp
@@ -0,0 +1,35 @@
+#define LOG_TAG "hidl_test"
+#include <android-base/logging.h>
+
+#include "Parent.h"
+
+namespace android {
+namespace hardware {
+namespace tests {
+namespace inheritance {
+namespace V1_0 {
+namespace implementation {
+
+// Methods from ::android::hardware::tests::inheritance::V1_0::IGrandparent follow.
+Return<void> Parent::doGrandparent() {
+ ALOGI("SERVER(Bar) Parent::doGrandparent");
+ return Void();
+}
+
+// Methods from ::android::hardware::tests::inheritance::V1_0::IParent follow.
+Return<void> Parent::doParent() {
+ ALOGI("SERVER(Bar) Parent::doParent");
+ return Void();
+}
+
+
+IParent* HIDL_FETCH_IParent(const char* /* name */) {
+ return new Parent();
+}
+
+} // namespace implementation
+} // namespace V1_0
+} // namespace inheritance
+} // namespace tests
+} // namespace hardware
+} // namespace android
diff --git a/tests/inheritance/1.0/default/Parent.h b/tests/inheritance/1.0/default/Parent.h
new file mode 100644
index 0000000..2e07fdc
--- /dev/null
+++ b/tests/inheritance/1.0/default/Parent.h
@@ -0,0 +1,40 @@
+#ifndef HIDL_GENERATED_android_hardware_tests_inheritance_V1_0_Parent_H_
+#define HIDL_GENERATED_android_hardware_tests_inheritance_V1_0_Parent_H_
+
+#include <android/hardware/tests/inheritance/1.0/IParent.h>
+#include <hidl/Status.h>
+
+#include <hidl/MQDescriptor.h>
+namespace android {
+namespace hardware {
+namespace tests {
+namespace inheritance {
+namespace V1_0 {
+namespace implementation {
+
+using ::android::hardware::tests::inheritance::V1_0::IParent;
+using ::android::hardware::Return;
+using ::android::hardware::Void;
+using ::android::hardware::hidl_vec;
+using ::android::hardware::hidl_string;
+using ::android::sp;
+
+struct Parent : public IParent {
+ // Methods from ::android::hardware::tests::inheritance::V1_0::IGrandparent follow.
+ Return<void> doGrandparent() override;
+
+ // Methods from ::android::hardware::tests::inheritance::V1_0::IParent follow.
+ Return<void> doParent() override;
+
+};
+
+extern "C" IParent* HIDL_FETCH_IParent(const char* name);
+
+} // namespace implementation
+} // namespace V1_0
+} // namespace inheritance
+} // namespace tests
+} // namespace hardware
+} // namespace android
+
+#endif // HIDL_GENERATED_android_hardware_tests_inheritance_V1_0_Parent_H_
diff --git a/tests/libhwbinder/1.0/Android.bp b/tests/libhwbinder/1.0/Android.bp
index 52a8186..aad24a6 100644
--- a/tests/libhwbinder/1.0/Android.bp
+++ b/tests/libhwbinder/1.0/Android.bp
@@ -39,9 +39,9 @@
"libutils",
"libcutils",
],
-export_shared_lib_headers: [
- "libhidl",
- "libhwbinder",
- "libutils",
+ export_shared_lib_headers: [
+ "libhidl",
+ "libhwbinder",
+ "libutils",
],
}
diff --git a/tests/msgq/1.0/Android.bp b/tests/msgq/1.0/Android.bp
index 58ee3d4..2eb36c0 100644
--- a/tests/msgq/1.0/Android.bp
+++ b/tests/msgq/1.0/Android.bp
@@ -39,9 +39,9 @@
"libutils",
"libcutils",
],
-export_shared_lib_headers: [
- "libhidl",
- "libhwbinder",
- "libutils",
+ export_shared_lib_headers: [
+ "libhidl",
+ "libhwbinder",
+ "libutils",
],
}
diff --git a/tests/pointer/1.0/Android.bp b/tests/pointer/1.0/Android.bp
index 2601a5b..2b1e8b2 100644
--- a/tests/pointer/1.0/Android.bp
+++ b/tests/pointer/1.0/Android.bp
@@ -47,9 +47,9 @@
"libutils",
"libcutils",
],
-export_shared_lib_headers: [
- "libhidl",
- "libhwbinder",
- "libutils",
+ export_shared_lib_headers: [
+ "libhidl",
+ "libhwbinder",
+ "libutils",
],
}
diff --git a/thermal/1.0/Android.bp b/thermal/1.0/Android.bp
index ae64dde..76a38a0 100644
--- a/thermal/1.0/Android.bp
+++ b/thermal/1.0/Android.bp
@@ -43,9 +43,9 @@
"libutils",
"libcutils",
],
-export_shared_lib_headers: [
- "libhidl",
- "libhwbinder",
- "libutils",
+ export_shared_lib_headers: [
+ "libhidl",
+ "libhwbinder",
+ "libutils",
],
}
diff --git a/tv/Android.bp b/tv/Android.bp
index 095839f..5ad82f4 100644
--- a/tv/Android.bp
+++ b/tv/Android.bp
@@ -1,4 +1,5 @@
// This is an autogenerated file, do not edit.
subdirs = [
+ "cec/1.0",
"input/1.0",
]
diff --git a/tv/cec/1.0/Android.bp b/tv/cec/1.0/Android.bp
new file mode 100644
index 0000000..4fd1b7e
--- /dev/null
+++ b/tv/cec/1.0/Android.bp
@@ -0,0 +1,59 @@
+// This file is autogenerated by hidl-gen. Do not edit manually.
+
+genrule {
+ name: "android.hardware.tv.cec@1.0_genc++",
+ tool: "hidl-gen",
+ cmd: "$tool -o $genDir -Lc++ -randroid.hardware:hardware/interfaces android.hardware.tv.cec@1.0",
+ srcs: [
+ "types.hal",
+ "IHdmiCec.hal",
+ "IHdmiCecCallback.hal",
+ ],
+ out: [
+ "android/hardware/tv/cec/1.0/types.cpp",
+ "android/hardware/tv/cec/1.0/HdmiCecAll.cpp",
+ "android/hardware/tv/cec/1.0/HdmiCecCallbackAll.cpp",
+ ],
+}
+
+genrule {
+ name: "android.hardware.tv.cec@1.0_genc++_headers",
+ tool: "hidl-gen",
+ cmd: "$tool -o $genDir -Lc++ -randroid.hardware:hardware/interfaces android.hardware.tv.cec@1.0",
+ srcs: [
+ "types.hal",
+ "IHdmiCec.hal",
+ "IHdmiCecCallback.hal",
+ ],
+ out: [
+ "android/hardware/tv/cec/1.0/types.h",
+ "android/hardware/tv/cec/1.0/IHdmiCec.h",
+ "android/hardware/tv/cec/1.0/IHwHdmiCec.h",
+ "android/hardware/tv/cec/1.0/BnHdmiCec.h",
+ "android/hardware/tv/cec/1.0/BpHdmiCec.h",
+ "android/hardware/tv/cec/1.0/BsHdmiCec.h",
+ "android/hardware/tv/cec/1.0/IHdmiCecCallback.h",
+ "android/hardware/tv/cec/1.0/IHwHdmiCecCallback.h",
+ "android/hardware/tv/cec/1.0/BnHdmiCecCallback.h",
+ "android/hardware/tv/cec/1.0/BpHdmiCecCallback.h",
+ "android/hardware/tv/cec/1.0/BsHdmiCecCallback.h",
+ ],
+}
+
+cc_library_shared {
+ name: "android.hardware.tv.cec@1.0",
+ generated_sources: ["android.hardware.tv.cec@1.0_genc++"],
+ generated_headers: ["android.hardware.tv.cec@1.0_genc++_headers"],
+ export_generated_headers: ["android.hardware.tv.cec@1.0_genc++_headers"],
+ shared_libs: [
+ "libhidl",
+ "libhwbinder",
+ "libutils",
+ "libcutils",
+ ],
+export_shared_lib_headers: [
+ "libhidl",
+ "libhwbinder",
+ "libutils",
+ ],
+}
diff --git a/tv/cec/1.0/Android.mk b/tv/cec/1.0/Android.mk
new file mode 100644
index 0000000..8cc9c47
--- /dev/null
+++ b/tv/cec/1.0/Android.mk
@@ -0,0 +1,484 @@
+# This file is autogenerated by hidl-gen. Do not edit manually.
+
+LOCAL_PATH := $(call my-dir)
+
+################################################################################
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := android.hardware.tv.cec@1.0-java
+LOCAL_MODULE_CLASS := JAVA_LIBRARIES
+
+intermediates := $(local-generated-sources-dir)
+
+HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
+
+#
+# Build types.hal (AbortReason)
+#
+GEN := $(intermediates)/android/hardware/tv/cec/1.0/AbortReason.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.tv.cec@1.0::types.AbortReason
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (CecDeviceType)
+#
+GEN := $(intermediates)/android/hardware/tv/cec/1.0/CecDeviceType.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.tv.cec@1.0::types.CecDeviceType
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (CecLogicalAddress)
+#
+GEN := $(intermediates)/android/hardware/tv/cec/1.0/CecLogicalAddress.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.tv.cec@1.0::types.CecLogicalAddress
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (CecMessage)
+#
+GEN := $(intermediates)/android/hardware/tv/cec/1.0/CecMessage.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.tv.cec@1.0::types.CecMessage
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (CecMessageType)
+#
+GEN := $(intermediates)/android/hardware/tv/cec/1.0/CecMessageType.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.tv.cec@1.0::types.CecMessageType
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (HdmiPortInfo)
+#
+GEN := $(intermediates)/android/hardware/tv/cec/1.0/HdmiPortInfo.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.tv.cec@1.0::types.HdmiPortInfo
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (HdmiPortType)
+#
+GEN := $(intermediates)/android/hardware/tv/cec/1.0/HdmiPortType.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.tv.cec@1.0::types.HdmiPortType
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (HotplugEvent)
+#
+GEN := $(intermediates)/android/hardware/tv/cec/1.0/HotplugEvent.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.tv.cec@1.0::types.HotplugEvent
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (OptionKey)
+#
+GEN := $(intermediates)/android/hardware/tv/cec/1.0/OptionKey.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.tv.cec@1.0::types.OptionKey
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (Result)
+#
+GEN := $(intermediates)/android/hardware/tv/cec/1.0/Result.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.tv.cec@1.0::types.Result
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (SendMessageResult)
+#
+GEN := $(intermediates)/android/hardware/tv/cec/1.0/SendMessageResult.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.tv.cec@1.0::types.SendMessageResult
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build IHdmiCec.hal
+#
+GEN := $(intermediates)/android/hardware/tv/cec/1.0/IHdmiCec.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IHdmiCec.hal
+$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/IHdmiCecCallback.hal
+$(GEN): $(LOCAL_PATH)/IHdmiCecCallback.hal
+$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/types.hal
+$(GEN): $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.tv.cec@1.0::IHdmiCec
+
+$(GEN): $(LOCAL_PATH)/IHdmiCec.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build IHdmiCecCallback.hal
+#
+GEN := $(intermediates)/android/hardware/tv/cec/1.0/IHdmiCecCallback.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IHdmiCecCallback.hal
+$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/types.hal
+$(GEN): $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.tv.cec@1.0::IHdmiCecCallback
+
+$(GEN): $(LOCAL_PATH)/IHdmiCecCallback.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+include $(BUILD_JAVA_LIBRARY)
+
+
+################################################################################
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := android.hardware.tv.cec@1.0-java-static
+LOCAL_MODULE_CLASS := JAVA_LIBRARIES
+
+intermediates := $(local-generated-sources-dir)
+
+HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
+
+#
+# Build types.hal (AbortReason)
+#
+GEN := $(intermediates)/android/hardware/tv/cec/1.0/AbortReason.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.tv.cec@1.0::types.AbortReason
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (CecDeviceType)
+#
+GEN := $(intermediates)/android/hardware/tv/cec/1.0/CecDeviceType.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.tv.cec@1.0::types.CecDeviceType
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (CecLogicalAddress)
+#
+GEN := $(intermediates)/android/hardware/tv/cec/1.0/CecLogicalAddress.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.tv.cec@1.0::types.CecLogicalAddress
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (CecMessage)
+#
+GEN := $(intermediates)/android/hardware/tv/cec/1.0/CecMessage.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.tv.cec@1.0::types.CecMessage
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (CecMessageType)
+#
+GEN := $(intermediates)/android/hardware/tv/cec/1.0/CecMessageType.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.tv.cec@1.0::types.CecMessageType
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (HdmiPortInfo)
+#
+GEN := $(intermediates)/android/hardware/tv/cec/1.0/HdmiPortInfo.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.tv.cec@1.0::types.HdmiPortInfo
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (HdmiPortType)
+#
+GEN := $(intermediates)/android/hardware/tv/cec/1.0/HdmiPortType.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.tv.cec@1.0::types.HdmiPortType
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (HotplugEvent)
+#
+GEN := $(intermediates)/android/hardware/tv/cec/1.0/HotplugEvent.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.tv.cec@1.0::types.HotplugEvent
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (OptionKey)
+#
+GEN := $(intermediates)/android/hardware/tv/cec/1.0/OptionKey.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.tv.cec@1.0::types.OptionKey
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (Result)
+#
+GEN := $(intermediates)/android/hardware/tv/cec/1.0/Result.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.tv.cec@1.0::types.Result
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (SendMessageResult)
+#
+GEN := $(intermediates)/android/hardware/tv/cec/1.0/SendMessageResult.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.tv.cec@1.0::types.SendMessageResult
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build IHdmiCec.hal
+#
+GEN := $(intermediates)/android/hardware/tv/cec/1.0/IHdmiCec.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IHdmiCec.hal
+$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/IHdmiCecCallback.hal
+$(GEN): $(LOCAL_PATH)/IHdmiCecCallback.hal
+$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/types.hal
+$(GEN): $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.tv.cec@1.0::IHdmiCec
+
+$(GEN): $(LOCAL_PATH)/IHdmiCec.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build IHdmiCecCallback.hal
+#
+GEN := $(intermediates)/android/hardware/tv/cec/1.0/IHdmiCecCallback.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IHdmiCecCallback.hal
+$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/types.hal
+$(GEN): $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.tv.cec@1.0::IHdmiCecCallback
+
+$(GEN): $(LOCAL_PATH)/IHdmiCecCallback.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+include $(BUILD_STATIC_JAVA_LIBRARY)
+
+
+
+include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/tv/cec/1.0/IHdmiCec.hal b/tv/cec/1.0/IHdmiCec.hal
new file mode 100644
index 0000000..e8db265
--- /dev/null
+++ b/tv/cec/1.0/IHdmiCec.hal
@@ -0,0 +1,166 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.tv.cec@1.0;
+
+import IHdmiCecCallback;
+
+/*
+ * HDMI-CEC HAL interface definition.
+ */
+interface IHdmiCec {
+ /*
+ * Passes the logical address that must be used in this system.
+ *
+ * HAL must use it to configure the hardware so that the CEC commands
+ * addressed the given logical address can be filtered in. This method must
+ * be able to be called as many times as necessary in order to support
+ * multiple logical devices.
+ *
+ * @param addr Logical address that must be used in this system. It must be
+ * in the range of valid logical addresses for the call to succeed.
+ * @return result Result status of the operation. SUCCESS if successful,
+ * FAILURE_INVALID_ARGS if the given logical address is invalid,
+ * FAILURE_BUSY if device or resource is busy
+ */
+ @callflow(next={"*"})
+ addLogicalAddress(CecLogicalAddress addr) generates (Result result);
+
+ /*
+ * Clears all the logical addresses.
+ *
+ * It is used when the system doesn't need to process CEC command any more,
+ * hence to tell HAL to stop receiving commands from the CEC bus, and change
+ * the state back to the beginning.
+ */
+ @callflow(next="addLogicalAddress")
+ @exit
+ clearLogicalAddress();
+
+ /*
+ * Gets the CEC physical address.
+ *
+ * The physical address depends on the topology of the network formed by
+ * connected HDMI devices. It is therefore likely to change if the cable is
+ * plugged off and on again. It is advised to call getPhysicalAddress to get
+ * the updated address when hot plug event takes place.
+ *
+ * @return result Result status of the operation. SUCCESS if successful,
+ * FAILURE_INVALID_STATE if HAL cannot retrieve the physical
+ * address.
+ * @return addr Physical address of this device.
+ */
+ @callflow(next="*")
+ getPhysicalAddress() generates (Result result, uint16_t addr);
+
+ /*
+ * Transmits HDMI-CEC message to other HDMI device.
+ *
+ * The method must be designed to return in a certain amount of time and not
+ * hanging forever which may happen if CEC signal line is pulled low for
+ * some reason.
+ *
+ * It must try retransmission at least once as specified in the section '7.1
+ * Frame Re-transmissions' of the CEC Spec 1.4b.
+ *
+ * @param message CEC message to be sent to other HDMI device.
+ * @return result Result status of the operation. SUCCESS if successful,
+ * NACK if the sent message is not acknowledged,
+ * BUSY if the CEC bus is busy.
+ */
+ @callflow(next="*")
+ sendMessage(CecMessage message) generates (SendMessageResult result);
+
+ /*
+ * Sets a callback that HDMI-CEC HAL must later use for incoming CEC
+ * messages or internal HDMI events.
+ *
+ * @param callback Callback object to pass hdmi events to the system. The
+ * previously registered callback must be replaced with this one.
+ */
+ @callflow(next={"addLogicalAddress"})
+ @entry
+ setCallback(IHdmiCecCallback callback);
+
+ /*
+ * Returns the CEC version supported by underlying hardware.
+ *
+ * @return version the CEC version supported by underlying hardware.
+ */
+ @callflow(next={"*"})
+ getCecVersion() generates (int32_t version);
+
+ /*
+ * Gets the identifier of the vendor.
+ *
+ * @return vendorId Identifier of the vendor that is the 24-bit unique
+ * company ID obtained from the IEEE Registration Authority
+ * Committee (RAC). The upper 8 bits must be 0.
+ */
+ @callflow(next={"*"})
+ getVendorId() generates (uint32_t vendorId);
+
+ /*
+ * Gets the hdmi port information of underlying hardware.
+ *
+ * @return infos The list of HDMI port information
+ */
+ @callflow(next={"*"})
+ getPortInfo() generates (vec<HdmiPortInfo> infos);
+
+ /*
+ * Sets flags controlling the way HDMI-CEC service works down to HAL
+ * implementation. Those flags must be used in case the feature needs update
+ * in HAL itself, firmware or microcontroller.
+ *
+ * @param key The key of the option to be updated with a new value.
+ * @param value Value to be set.
+ */
+ @callflow(next="*")
+ setOption(OptionKey key, bool value);
+
+ /*
+ * Passes the updated language information of Android system. Contains
+ * three-letter code as defined in ISO/FDIS 639-2. Must be used for HAL to
+ * respond to <Get Menu Language> while in standby mode.
+ *
+ * @param language Three-letter code defined in ISO/FDIS 639-2. Must be
+ * lowercase letters. (e.g., eng for English)
+ */
+ @callflow(next="*")
+ setLanguage(string language);
+
+ /*
+ * Configures ARC circuit in the hardware logic to start or stop the
+ * feature.
+ *
+ * @param portId Port id to be configured.
+ * @param enable Flag must be either true to start the feature or false to
+ * stop it.
+ */
+ @callflow(next="*")
+ enableAudioReturnChannel(int32_t portId, bool enable);
+
+ /*
+ * Gets the connection status of the specified port.
+ *
+ * @param portId Port id to be inspected for the connection status.
+ * @return status True if a device is connected, otherwise false. The HAL
+ * must watch for +5V power signal to determine the status.
+ */
+ @callflow(next="*")
+ isConnected(int32_t portId) generates (bool status);
+};
diff --git a/tv/cec/1.0/IHdmiCecCallback.hal b/tv/cec/1.0/IHdmiCecCallback.hal
new file mode 100644
index 0000000..4a9d28f
--- /dev/null
+++ b/tv/cec/1.0/IHdmiCecCallback.hal
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.tv.cec@1.0;
+
+interface IHdmiCecCallback {
+ /*
+ * The callback function that must be called by HAL implementation to notify
+ * the system of new CEC message arrival.
+ */
+ oneway onCecMessage(CecMessage message);
+
+ /*
+ * The callback function that must be called by HAL implementation to notify
+ * the system of new hotplug event.
+ */
+ oneway onHotplugEvent(HotplugEvent event);
+};
diff --git a/tv/cec/1.0/default/Android.mk b/tv/cec/1.0/default/Android.mk
new file mode 100644
index 0000000..3971f6c
--- /dev/null
+++ b/tv/cec/1.0/default/Android.mk
@@ -0,0 +1,42 @@
+LOCAL_PATH := $(call my-dir)
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := android.hardware.tv.cec@1.0-impl
+LOCAL_MODULE_RELATIVE_PATH := hw
+LOCAL_SRC_FILES := \
+ HdmiCec.cpp
+
+LOCAL_SHARED_LIBRARIES := \
+ libhidl \
+ libhwbinder \
+ liblog \
+ libbase \
+ libutils \
+ libhardware \
+ android.hardware.tv.cec@1.0 \
+
+include $(BUILD_SHARED_LIBRARY)
+
+
+include $(CLEAR_VARS)
+LOCAL_MODULE_RELATIVE_PATH := hw
+LOCAL_MODULE := android.hardware.tv.cec@1.0-service
+LOCAL_INIT_RC := android.hardware.tv.cec@1.0-service.rc
+LOCAL_SRC_FILES := \
+ service.cpp \
+
+LOCAL_SHARED_LIBRARIES := \
+ liblog \
+ libcutils \
+ libdl \
+ libbase \
+ libutils \
+ libhardware_legacy \
+ libhardware \
+
+LOCAL_SHARED_LIBRARIES += \
+ libhwbinder \
+ libhidl \
+ android.hardware.tv.cec@1.0 \
+
+include $(BUILD_EXECUTABLE)
diff --git a/tv/cec/1.0/default/HdmiCec.cpp b/tv/cec/1.0/default/HdmiCec.cpp
new file mode 100644
index 0000000..c4bae41
--- /dev/null
+++ b/tv/cec/1.0/default/HdmiCec.cpp
@@ -0,0 +1,415 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#define LOG_TAG "android.hardware.tv.cec@1.0-impl"
+#include <android-base/logging.h>
+
+#include <hardware/hardware.h>
+#include <hardware/hdmi_cec.h>
+#include "HdmiCec.h"
+
+namespace android {
+namespace hardware {
+namespace tv {
+namespace cec {
+namespace V1_0 {
+namespace implementation {
+
+static_assert(CEC_DEVICE_INACTIVE == static_cast<int>(CecDeviceType::INACTIVE),
+ "CecDeviceType::INACTIVE must match legacy value.");
+static_assert(CEC_DEVICE_TV == static_cast<int>(CecDeviceType::TV),
+ "CecDeviceType::TV must match legacy value.");
+static_assert(CEC_DEVICE_RECORDER == static_cast<int>(CecDeviceType::RECORDER),
+ "CecDeviceType::RECORDER must match legacy value.");
+static_assert(CEC_DEVICE_TUNER == static_cast<int>(CecDeviceType::TUNER),
+ "CecDeviceType::TUNER must match legacy value.");
+static_assert(CEC_DEVICE_PLAYBACK == static_cast<int>(CecDeviceType::PLAYBACK),
+ "CecDeviceType::PLAYBACK must match legacy value.");
+static_assert(CEC_DEVICE_AUDIO_SYSTEM == static_cast<int>(CecDeviceType::AUDIO_SYSTEM),
+ "CecDeviceType::AUDIO_SYSTEM must match legacy value.");
+static_assert(CEC_DEVICE_MAX == static_cast<int>(CecDeviceType::MAX),
+ "CecDeviceType::MAX must match legacy value.");
+
+static_assert(CEC_ADDR_TV == static_cast<int>(CecLogicalAddress::TV),
+ "CecLogicalAddress::TV must match legacy value.");
+static_assert(CEC_ADDR_RECORDER_1 == static_cast<int>(CecLogicalAddress::RECORDER_1),
+ "CecLogicalAddress::RECORDER_1 must match legacy value.");
+static_assert(CEC_ADDR_RECORDER_2 == static_cast<int>(CecLogicalAddress::RECORDER_2),
+ "CecLogicalAddress::RECORDER_2 must match legacy value.");
+static_assert(CEC_ADDR_TUNER_1 == static_cast<int>(CecLogicalAddress::TUNER_1),
+ "CecLogicalAddress::TUNER_1 must match legacy value.");
+static_assert(CEC_ADDR_PLAYBACK_1 == static_cast<int>(CecLogicalAddress::PLAYBACK_1),
+ "CecLogicalAddress::PLAYBACK_1 must match legacy value.");
+static_assert(CEC_ADDR_AUDIO_SYSTEM == static_cast<int>(CecLogicalAddress::AUDIO_SYSTEM),
+ "CecLogicalAddress::AUDIO_SYSTEM must match legacy value.");
+static_assert(CEC_ADDR_TUNER_2 == static_cast<int>(CecLogicalAddress::TUNER_2),
+ "CecLogicalAddress::TUNER_2 must match legacy value.");
+static_assert(CEC_ADDR_TUNER_3 == static_cast<int>(CecLogicalAddress::TUNER_3),
+ "CecLogicalAddress::TUNER_3 must match legacy value.");
+static_assert(CEC_ADDR_PLAYBACK_2 == static_cast<int>(CecLogicalAddress::PLAYBACK_2),
+ "CecLogicalAddress::PLAYBACK_2 must match legacy value.");
+static_assert(CEC_ADDR_RECORDER_3 == static_cast<int>(CecLogicalAddress::RECORDER_3),
+ "CecLogicalAddress::RECORDER_3 must match legacy value.");
+static_assert(CEC_ADDR_TUNER_4 == static_cast<int>(CecLogicalAddress::TUNER_4),
+ "CecLogicalAddress::TUNER_4 must match legacy value.");
+static_assert(CEC_ADDR_PLAYBACK_3 == static_cast<int>(CecLogicalAddress::PLAYBACK_3),
+ "CecLogicalAddress::PLAYBACK_3 must match legacy value.");
+static_assert(CEC_ADDR_FREE_USE == static_cast<int>(CecLogicalAddress::FREE_USE),
+ "CecLogicalAddress::FREE_USE must match legacy value.");
+static_assert(CEC_ADDR_UNREGISTERED == static_cast<int>(CecLogicalAddress::UNREGISTERED),
+ "CecLogicalAddress::UNREGISTERED must match legacy value.");
+static_assert(CEC_ADDR_BROADCAST == static_cast<int>(CecLogicalAddress::BROADCAST),
+ "CecLogicalAddress::BROADCAST must match legacy value.");
+
+static_assert(CEC_MESSAGE_FEATURE_ABORT == static_cast<int>(CecMessageType::FEATURE_ABORT),
+ "CecMessageType::FEATURE_ABORT must match legacy value.");
+static_assert(CEC_MESSAGE_IMAGE_VIEW_ON == static_cast<int>(CecMessageType::IMAGE_VIEW_ON),
+ "CecMessageType::IMAGE_VIEW_ON must match legacy value.");
+static_assert(CEC_MESSAGE_TUNER_STEP_INCREMENT == static_cast<int>(
+ CecMessageType::TUNER_STEP_INCREMENT),
+ "CecMessageType::TUNER_STEP_INCREMENT must match legacy value.");
+static_assert(CEC_MESSAGE_TUNER_STEP_DECREMENT == static_cast<int>(
+ CecMessageType::TUNER_STEP_DECREMENT),
+ "CecMessageType::TUNER_STEP_DECREMENT must match legacy value.");
+static_assert(CEC_MESSAGE_TUNER_DEVICE_STATUS == static_cast<int>(
+ CecMessageType::TUNER_DEVICE_STATUS),
+ "CecMessageType::TUNER_DEVICE_STATUS must match legacy value.");
+static_assert(CEC_MESSAGE_GIVE_TUNER_DEVICE_STATUS == static_cast<int>(
+ CecMessageType::GIVE_TUNER_DEVICE_STATUS),
+ "CecMessageType::GIVE_TUNER_DEVICE_STATUS must match legacy value.");
+static_assert(CEC_MESSAGE_RECORD_ON == static_cast<int>(CecMessageType::RECORD_ON),
+ "CecMessageType::RECORD_ON must match legacy value.");
+static_assert(CEC_MESSAGE_RECORD_STATUS == static_cast<int>(CecMessageType::RECORD_STATUS),
+ "CecMessageType::RECORD_STATUS must match legacy value.");
+static_assert(CEC_MESSAGE_RECORD_OFF == static_cast<int>(CecMessageType::RECORD_OFF),
+ "CecMessageType::RECORD_OFF must match legacy value.");
+static_assert(CEC_MESSAGE_TEXT_VIEW_ON == static_cast<int>(CecMessageType::TEXT_VIEW_ON),
+ "CecMessageType::TEXT_VIEW_ON must match legacy value.");
+static_assert(CEC_MESSAGE_RECORD_TV_SCREEN == static_cast<int>(CecMessageType::RECORD_TV_SCREEN),
+ "CecMessageType::RECORD_TV_SCREEN must match legacy value.");
+static_assert(CEC_MESSAGE_GIVE_DECK_STATUS == static_cast<int>(CecMessageType::GIVE_DECK_STATUS),
+ "CecMessageType::GIVE_DECK_STATUS must match legacy value.");
+static_assert(CEC_MESSAGE_STANDBY == static_cast<int>(CecMessageType::STANDBY),
+ "CecMessageType::STANDBY must match legacy value.");
+static_assert(CEC_MESSAGE_PLAY == static_cast<int>(CecMessageType::PLAY),
+ "CecMessageType::PLAY must match legacy value.");
+static_assert(CEC_MESSAGE_DECK_CONTROL == static_cast<int>(CecMessageType::DECK_CONTROL),
+ "CecMessageType::DECK_CONTROL must match legacy value.");
+static_assert(CEC_MESSAGE_TIMER_CLEARED_STATUS == static_cast<int>(
+ CecMessageType::TIMER_CLEARED_STATUS),
+ "CecMessageType::TIMER_CLEARED_STATUS must match legacy value.");
+static_assert(CEC_MESSAGE_USER_CONTROL_PRESSED == static_cast<int>(
+ CecMessageType::USER_CONTROL_PRESSED),
+ "CecMessageType::USER_CONTROL_PRESSED must match legacy value.");
+static_assert(CEC_MESSAGE_USER_CONTROL_RELEASED == static_cast<int>(
+ CecMessageType::USER_CONTROL_RELEASED),
+ "CecMessageType::USER_CONTROL_RELEASED must match legacy value.");
+static_assert(CEC_MESSAGE_GIVE_OSD_NAME == static_cast<int>(CecMessageType::GIVE_OSD_NAME),
+ "CecMessageType::GIVE_OSD_NAME must match legacy value.");
+static_assert(CEC_MESSAGE_SET_OSD_NAME == static_cast<int>(CecMessageType::SET_OSD_NAME),
+ "CecMessageType::SET_OSD_NAME must match legacy value.");
+static_assert(CEC_MESSAGE_SYSTEM_AUDIO_MODE_REQUEST == static_cast<int>(
+ CecMessageType::SYSTEM_AUDIO_MODE_REQUEST),
+ "CecMessageType::SYSTEM_AUDIO_MODE_REQUEST must match legacy value.");
+static_assert(CEC_MESSAGE_GIVE_AUDIO_STATUS == static_cast<int>(CecMessageType::GIVE_AUDIO_STATUS),
+ "CecMessageType::GIVE_AUDIO_STATUS must match legacy value.");
+static_assert(CEC_MESSAGE_SET_SYSTEM_AUDIO_MODE == static_cast<int>(
+ CecMessageType::SET_SYSTEM_AUDIO_MODE),
+ "CecMessageType::SET_SYSTEM_AUDIO_MODE must match legacy value.");
+static_assert(CEC_MESSAGE_REPORT_AUDIO_STATUS == static_cast<int>(
+ CecMessageType::REPORT_AUDIO_STATUS),
+ "CecMessageType::REPORT_AUDIO_STATUS must match legacy value.");
+static_assert(CEC_MESSAGE_GIVE_SYSTEM_AUDIO_MODE_STATUS == static_cast<int>(
+ CecMessageType::GIVE_SYSTEM_AUDIO_MODE_STATUS),
+ "CecMessageType::GIVE_SYSTEM_AUDIO_MODE_STATUS must match legacy value.");
+static_assert(CEC_MESSAGE_SYSTEM_AUDIO_MODE_STATUS == static_cast<int>(
+ CecMessageType::SYSTEM_AUDIO_MODE_STATUS),
+ "CecMessageType::SYSTEM_AUDIO_MODE_STATUS must match legacy value.");
+static_assert(CEC_MESSAGE_ROUTING_CHANGE == static_cast<int>(CecMessageType::ROUTING_CHANGE),
+ "CecMessageType::ROUTING_CHANGE must match legacy value.");
+static_assert(CEC_MESSAGE_ROUTING_INFORMATION == static_cast<int>(
+ CecMessageType::ROUTING_INFORMATION),
+ "CecMessageType::ROUTING_INFORMATION must match legacy value.");
+static_assert(CEC_MESSAGE_ACTIVE_SOURCE == static_cast<int>(CecMessageType::ACTIVE_SOURCE),
+ "CecMessageType::ACTIVE_SOURCE must match legacy value.");
+static_assert(CEC_MESSAGE_GIVE_PHYSICAL_ADDRESS == static_cast<int>(
+ CecMessageType::GIVE_PHYSICAL_ADDRESS),
+ "CecMessageType::GIVE_PHYSICAL_ADDRESS must match legacy value.");
+static_assert(CEC_MESSAGE_REPORT_PHYSICAL_ADDRESS == static_cast<int>(
+ CecMessageType::REPORT_PHYSICAL_ADDRESS),
+ "CecMessageType::REPORT_PHYSICAL_ADDRESS must match legacy value.");
+static_assert(CEC_MESSAGE_REQUEST_ACTIVE_SOURCE == static_cast<int>(
+ CecMessageType::REQUEST_ACTIVE_SOURCE),
+ "CecMessageType::REQUEST_ACTIVE_SOURCE must match legacy value.");
+static_assert(CEC_MESSAGE_SET_STREAM_PATH == static_cast<int>(CecMessageType::SET_STREAM_PATH),
+ "CecMessageType::SET_STREAM_PATH must match legacy value.");
+static_assert(CEC_MESSAGE_DEVICE_VENDOR_ID == static_cast<int>(CecMessageType::DEVICE_VENDOR_ID),
+ "CecMessageType::DEVICE_VENDOR_ID must match legacy value.");
+static_assert(CEC_MESSAGE_VENDOR_COMMAND == static_cast<int>(CecMessageType::VENDOR_COMMAND),
+ "CecMessageType::VENDOR_COMMAND must match legacy value.");
+static_assert(CEC_MESSAGE_VENDOR_REMOTE_BUTTON_DOWN == static_cast<int>(
+ CecMessageType::VENDOR_REMOTE_BUTTON_DOWN),
+ "CecMessageType::VENDOR_REMOTE_BUTTON_DOWN must match legacy value.");
+static_assert(CEC_MESSAGE_VENDOR_REMOTE_BUTTON_UP == static_cast<int>(
+ CecMessageType::VENDOR_REMOTE_BUTTON_UP),
+ "CecMessageType::VENDOR_REMOTE_BUTTON_UP must match legacy value.");
+static_assert(CEC_MESSAGE_GIVE_DEVICE_VENDOR_ID == static_cast<int>(
+ CecMessageType::GIVE_DEVICE_VENDOR_ID),
+ "CecMessageType::GIVE_DEVICE_VENDOR_ID must match legacy value.");
+static_assert(CEC_MESSAGE_MENU_REQUEST == static_cast<int>(CecMessageType::MENU_REQUEST),
+ "CecMessageType::MENU_REQUEST must match legacy value.");
+static_assert(CEC_MESSAGE_MENU_STATUS == static_cast<int>(CecMessageType::MENU_STATUS),
+ "CecMessageType::MENU_STATUS must match legacy value.");
+static_assert(CEC_MESSAGE_GIVE_DEVICE_POWER_STATUS == static_cast<int>(
+ CecMessageType::GIVE_DEVICE_POWER_STATUS),
+ "CecMessageType::GIVE_DEVICE_POWER_STATUS must match legacy value.");
+static_assert(CEC_MESSAGE_REPORT_POWER_STATUS == static_cast<int>(
+ CecMessageType::REPORT_POWER_STATUS),
+ "CecMessageType::REPORT_POWER_STATUS must match legacy value.");
+static_assert(CEC_MESSAGE_GET_MENU_LANGUAGE == static_cast<int>(CecMessageType::GET_MENU_LANGUAGE),
+ "CecMessageType::GET_MENU_LANGUAGE must match legacy value.");
+static_assert(CEC_MESSAGE_SELECT_ANALOG_SERVICE == static_cast<int>(
+ CecMessageType::SELECT_ANALOG_SERVICE),
+ "CecMessageType::SELECT_ANALOG_SERVICE must match legacy value.");
+static_assert(CEC_MESSAGE_SELECT_DIGITAL_SERVICE == static_cast<int>(
+ CecMessageType::SELECT_DIGITAL_SERVICE),
+ "CecMessageType::SELECT_DIGITAL_SERVICE must match legacy value.");
+static_assert(CEC_MESSAGE_SET_DIGITAL_TIMER == static_cast<int>(CecMessageType::SET_DIGITAL_TIMER),
+ "CecMessageType::SET_DIGITAL_TIMER must match legacy value.");
+static_assert(CEC_MESSAGE_CLEAR_DIGITAL_TIMER == static_cast<int>(
+ CecMessageType::CLEAR_DIGITAL_TIMER),
+ "CecMessageType::CLEAR_DIGITAL_TIMER must match legacy value.");
+static_assert(CEC_MESSAGE_SET_AUDIO_RATE == static_cast<int>(CecMessageType::SET_AUDIO_RATE),
+ "CecMessageType::SET_AUDIO_RATE must match legacy value.");
+static_assert(CEC_MESSAGE_INACTIVE_SOURCE == static_cast<int>(CecMessageType::INACTIVE_SOURCE),
+ "CecMessageType::INACTIVE_SOURCE must match legacy value.");
+static_assert(CEC_MESSAGE_CEC_VERSION == static_cast<int>(CecMessageType::CEC_VERSION),
+ "CecMessageType::CEC_VERSION must match legacy value.");
+static_assert(CEC_MESSAGE_GET_CEC_VERSION == static_cast<int>(CecMessageType::GET_CEC_VERSION),
+ "CecMessageType::GET_CEC_VERSION must match legacy value.");
+static_assert(CEC_MESSAGE_VENDOR_COMMAND_WITH_ID == static_cast<int>(
+ CecMessageType::VENDOR_COMMAND_WITH_ID),
+ "CecMessageType::VENDOR_COMMAND_WITH_ID must match legacy value.");
+static_assert(CEC_MESSAGE_CLEAR_EXTERNAL_TIMER == static_cast<int>(
+ CecMessageType::CLEAR_EXTERNAL_TIMER),
+ "CecMessageType::CLEAR_EXTERNAL_TIMER must match legacy value.");
+static_assert(CEC_MESSAGE_SET_EXTERNAL_TIMER == static_cast<int>(
+ CecMessageType::SET_EXTERNAL_TIMER),
+ "CecMessageType::SET_EXTERNAL_TIMER must match legacy value.");
+static_assert(CEC_MESSAGE_INITIATE_ARC == static_cast<int>(CecMessageType::INITIATE_ARC),
+ "CecMessageType::INITIATE_ARC must match legacy value.");
+static_assert(CEC_MESSAGE_REPORT_ARC_INITIATED == static_cast<int>(
+ CecMessageType::REPORT_ARC_INITIATED),
+ "CecMessageType::REPORT_ARC_INITIATED must match legacy value.");
+static_assert(CEC_MESSAGE_REPORT_ARC_TERMINATED == static_cast<int>(
+ CecMessageType::REPORT_ARC_TERMINATED),
+ "CecMessageType::REPORT_ARC_TERMINATED must match legacy value.");
+static_assert(CEC_MESSAGE_REQUEST_ARC_INITIATION == static_cast<int>(
+ CecMessageType::REQUEST_ARC_INITIATION),
+ "CecMessageType::REQUEST_ARC_INITIATION must match legacy value.");
+static_assert(CEC_MESSAGE_REQUEST_ARC_TERMINATION == static_cast<int>(
+ CecMessageType::REQUEST_ARC_TERMINATION),
+ "CecMessageType::REQUEST_ARC_TERMINATION must match legacy value.");
+static_assert(CEC_MESSAGE_TERMINATE_ARC == static_cast<int>(CecMessageType::TERMINATE_ARC),
+ "CecMessageType::TERMINATE_ARC must match legacy value.");
+static_assert(CEC_MESSAGE_ABORT == static_cast<int>(CecMessageType::ABORT),
+ "CecMessageType::ABORT must match legacy value.");
+
+static_assert(ABORT_UNRECOGNIZED_MODE == static_cast<int>(AbortReason::UNRECOGNIZED_MODE),
+ "AbortReason::UNRECOGNIZED_MODE must match legacy value.");
+static_assert(ABORT_NOT_IN_CORRECT_MODE == static_cast<int>(AbortReason::NOT_IN_CORRECT_MODE),
+ "AbortReason::NOT_IN_CORRECT_MODE must match legacy value.");
+static_assert(ABORT_CANNOT_PROVIDE_SOURCE == static_cast<int>(AbortReason::CANNOT_PROVIDE_SOURCE),
+ "AbortReason::CANNOT_PROVIDE_SOURCE must match legacy value.");
+static_assert(ABORT_INVALID_OPERAND == static_cast<int>(AbortReason::INVALID_OPERAND),
+ "AbortReason::INVALID_OPERAND must match legacy value.");
+static_assert(ABORT_REFUSED == static_cast<int>(AbortReason::REFUSED),
+ "AbortReason::REFUSED must match legacy value.");
+static_assert(ABORT_UNABLE_TO_DETERMINE == static_cast<int>(AbortReason::UNABLE_TO_DETERMINE),
+ "AbortReason::UNABLE_TO_DETERMINE must match legacy value.");
+
+static_assert(HDMI_RESULT_SUCCESS == static_cast<int>(SendMessageResult::SUCCESS),
+ "SendMessageResult::SUCCESS must match legacy value.");
+static_assert(HDMI_RESULT_NACK == static_cast<int>(SendMessageResult::NACK),
+ "SendMessageResult::NACK must match legacy value.");
+static_assert(HDMI_RESULT_BUSY == static_cast<int>(SendMessageResult::BUSY),
+ "SendMessageResult::BUSY must match legacy value.");
+static_assert(HDMI_RESULT_FAIL == static_cast<int>(SendMessageResult::FAIL),
+ "SendMessageResult::FAIL must match legacy value.");
+
+static_assert(HDMI_INPUT == static_cast<int>(HdmiPortType::INPUT),
+ "HdmiPortType::INPUT must match legacy value.");
+static_assert(HDMI_OUTPUT == static_cast<int>(HdmiPortType::OUTPUT),
+ "HdmiPortType::OUTPUT must match legacy value.");
+
+static_assert(HDMI_OPTION_WAKEUP == static_cast<int>(OptionKey::WAKEUP),
+ "OptionKey::WAKEUP must match legacy value.");
+static_assert(HDMI_OPTION_ENABLE_CEC == static_cast<int>(OptionKey::ENABLE_CEC),
+ "OptionKey::ENABLE_CEC must match legacy value.");
+static_assert(HDMI_OPTION_SYSTEM_CEC_CONTROL == static_cast<int>(OptionKey::SYSTEM_CEC_CONTROL),
+ "OptionKey::SYSTEM_CEC_CONTROL must match legacy value.");
+
+sp<IHdmiCecCallback> HdmiCec::mCallback = nullptr;
+
+HdmiCec::HdmiCec(hdmi_cec_device_t* device) : mDevice(device) {
+}
+
+// Methods from ::android::hardware::tv::cec::V1_0::IHdmiCec follow.
+Return<Result> HdmiCec::addLogicalAddress(CecLogicalAddress addr) {
+ int ret = mDevice->add_logical_address(mDevice, static_cast<cec_logical_address_t>(addr));
+ switch (ret) {
+ case 0:
+ return Result::SUCCESS;
+ case -EINVAL:
+ return Result::FAILURE_INVALID_ARGS;
+ case -ENOTSUP:
+ return Result::FAILURE_NOT_SUPPORTED;
+ case -EBUSY:
+ return Result::FAILURE_BUSY;
+ default:
+ return Result::FAILURE_UNKNOWN;
+ }
+}
+
+Return<void> HdmiCec::clearLogicalAddress() {
+ mDevice->clear_logical_address(mDevice);
+ return Void();
+}
+
+Return<void> HdmiCec::getPhysicalAddress(getPhysicalAddress_cb _hidl_cb) {
+ uint16_t addr;
+ int ret = mDevice->get_physical_address(mDevice, &addr);
+ switch (ret) {
+ case 0:
+ _hidl_cb(Result::SUCCESS, addr);
+ break;
+ case -EBADF:
+ _hidl_cb(Result::FAILURE_INVALID_STATE, addr);
+ break;
+ default:
+ _hidl_cb(Result::FAILURE_UNKNOWN, addr);
+ break;
+ }
+ return Void();
+}
+
+Return<SendMessageResult> HdmiCec::sendMessage(const CecMessage& message) {
+ cec_message_t legacyMessage {
+ .initiator = static_cast<cec_logical_address_t>(message.initiator),
+ .destination = static_cast<cec_logical_address_t>(message.destination),
+ .length = message.body.size(),
+ };
+ for (size_t i = 0; i < message.body.size(); ++i) {
+ legacyMessage.body[i] = static_cast<unsigned char>(message.body[i]);
+ }
+ return static_cast<SendMessageResult>(mDevice->send_message(mDevice, &legacyMessage));
+}
+
+Return<void> HdmiCec::setCallback(const sp<IHdmiCecCallback>& callback) {
+ mCallback = callback;
+ mDevice->register_event_callback(mDevice, eventCallback, nullptr);
+ return Void();
+}
+
+Return<int32_t> HdmiCec::getCecVersion() {
+ int version;
+ mDevice->get_version(mDevice, &version);
+ return static_cast<int32_t>(version);
+}
+
+Return<uint32_t> HdmiCec::getVendorId() {
+ uint32_t vendor_id;
+ mDevice->get_vendor_id(mDevice, &vendor_id);
+ return vendor_id;
+}
+
+Return<void> HdmiCec::getPortInfo(getPortInfo_cb _hidl_cb) {
+ struct hdmi_port_info* legacyPorts;
+ int numPorts;
+ hidl_vec<HdmiPortInfo> portInfos;
+ mDevice->get_port_info(mDevice, &legacyPorts, &numPorts);
+ portInfos.resize(numPorts);
+ for (int i = 0; i < numPorts; ++i) {
+ portInfos[i] = {
+ .type = static_cast<HdmiPortType>(legacyPorts[i].type),
+ .portId = static_cast<uint32_t>(legacyPorts[i].port_id),
+ .cecSupported = legacyPorts[i].cec_supported != 0,
+ .arcSupported = legacyPorts[i].arc_supported != 0,
+ .physicalAddress = legacyPorts[i].physical_address
+ };
+ }
+ _hidl_cb(portInfos);
+ return Void();
+}
+
+Return<void> HdmiCec::setOption(OptionKey key, bool value) {
+ mDevice->set_option(mDevice, static_cast<int>(key), value ? 1 : 0);
+ return Void();
+}
+
+Return<void> HdmiCec::setLanguage(const hidl_string& language) {
+ if (language.size() != 3) {
+ LOG(ERROR) << "Wrong language code: expected 3 letters, but it was " << language.size()
+ << ".";
+ return Void();
+ }
+ const char *languageStr = language.c_str();
+ int convertedLanguage = ((languageStr[0] & 0xFF) << 16)
+ | ((languageStr[1] & 0xFF) << 8)
+ | (languageStr[2] & 0xFF);
+ mDevice->set_option(mDevice, HDMI_OPTION_SET_LANG, convertedLanguage);
+ return Void();
+}
+
+Return<void> HdmiCec::enableAudioReturnChannel(int32_t portId, bool enable) {
+ mDevice->set_audio_return_channel(mDevice, portId, enable ? 1 : 0);
+ return Void();
+}
+
+Return<bool> HdmiCec::isConnected(int32_t portId) {
+ return mDevice->is_connected(mDevice, portId) > 0;
+}
+
+
+IHdmiCec* HIDL_FETCH_IHdmiCec(const char* hal) {
+ hdmi_cec_device_t* hdmi_cec_device;
+ int ret = 0;
+ const hw_module_t* hw_module = nullptr;
+
+ ret = hw_get_module (hal, &hw_module);
+ if (ret == 0) {
+ ret = hdmi_cec_open (hw_module, &hdmi_cec_device);
+ if (ret != 0) {
+ LOG(ERROR) << "hdmi_cec_open " << hal << " failed: " << ret;
+ }
+ } else {
+ LOG(ERROR) << "hw_get_module " << hal << " failed: " << ret;
+ }
+
+ if (ret == 0) {
+ return new HdmiCec(hdmi_cec_device);
+ } else {
+ LOG(ERROR) << "Passthrough failed to load legacy HAL.";
+ return nullptr;
+ }
+}
+
+} // namespace implementation
+} // namespace V1_0
+} // namespace cec
+} // namespace tv
+} // namespace hardware
+} // namespace android
diff --git a/tv/cec/1.0/default/HdmiCec.h b/tv/cec/1.0/default/HdmiCec.h
new file mode 100644
index 0000000..3e80cb1
--- /dev/null
+++ b/tv/cec/1.0/default/HdmiCec.h
@@ -0,0 +1,102 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef HIDL_GENERATED_android_hardware_tv_cec_V1_0_HdmiCec_H_
+#define HIDL_GENERATED_android_hardware_tv_cec_V1_0_HdmiCec_H_
+
+#include <algorithm>
+
+#include <android/hardware/tv/cec/1.0/IHdmiCec.h>
+#include <hidl/Status.h>
+#include <hardware/hardware.h>
+#include <hardware/hdmi_cec.h>
+
+#include <hidl/MQDescriptor.h>
+namespace android {
+namespace hardware {
+namespace tv {
+namespace cec {
+namespace V1_0 {
+namespace implementation {
+
+using ::android::hardware::tv::cec::V1_0::CecLogicalAddress;
+using ::android::hardware::tv::cec::V1_0::CecMessage;
+using ::android::hardware::tv::cec::V1_0::HdmiPortInfo;
+using ::android::hardware::tv::cec::V1_0::IHdmiCec;
+using ::android::hardware::tv::cec::V1_0::IHdmiCecCallback;
+using ::android::hardware::tv::cec::V1_0::OptionKey;
+using ::android::hardware::tv::cec::V1_0::Result;
+using ::android::hardware::tv::cec::V1_0::SendMessageResult;
+using ::android::hardware::Return;
+using ::android::hardware::Void;
+using ::android::hardware::hidl_vec;
+using ::android::hardware::hidl_string;
+using ::android::sp;
+
+struct HdmiCec : public IHdmiCec {
+ HdmiCec(hdmi_cec_device_t* device);
+ // Methods from ::android::hardware::tv::cec::V1_0::IHdmiCec follow.
+ Return<Result> addLogicalAddress(CecLogicalAddress addr) override;
+ Return<void> clearLogicalAddress() override;
+ Return<void> getPhysicalAddress(getPhysicalAddress_cb _hidl_cb) override;
+ Return<SendMessageResult> sendMessage(const CecMessage& message) override;
+ Return<void> setCallback(const sp<IHdmiCecCallback>& callback) override;
+ Return<int32_t> getCecVersion() override;
+ Return<uint32_t> getVendorId() override;
+ Return<void> getPortInfo(getPortInfo_cb _hidl_cb) override;
+ Return<void> setOption(OptionKey key, bool value) override;
+ Return<void> setLanguage(const hidl_string& language) override;
+ Return<void> enableAudioReturnChannel(int32_t portId, bool enable) override;
+ Return<bool> isConnected(int32_t portId) override;
+
+ static void eventCallback(const hdmi_event_t* event, void* arg) {
+ if (mCallback != nullptr && event != nullptr) {
+ if (event->type == HDMI_EVENT_CEC_MESSAGE) {
+ size_t length = std::min(event->cec.length, static_cast<size_t>(15));
+ CecMessage cecMessage {
+ .initiator = static_cast<CecLogicalAddress>(event->cec.initiator),
+ .destination = static_cast<CecLogicalAddress>(event->cec.destination),
+ };
+ cecMessage.body.resize(length);
+ for (size_t i = 0; i < length; ++i) {
+ cecMessage.body[i] = static_cast<uint8_t>(event->cec.body[i]);
+ }
+ mCallback->onCecMessage(cecMessage);
+ } else if (event->type == HDMI_EVENT_HOT_PLUG) {
+ HotplugEvent hotplugEvent {
+ .connected = event->hotplug.connected > 0,
+ .portId = static_cast<uint32_t>(event->hotplug.port_id)
+ };
+ mCallback->onHotplugEvent(hotplugEvent);
+ }
+ }
+ }
+
+private:
+ static sp<IHdmiCecCallback> mCallback;
+ const hdmi_cec_device_t* mDevice;
+};
+
+extern "C" IHdmiCec* HIDL_FETCH_IHdmiCec(const char* name);
+
+} // namespace implementation
+} // namespace V1_0
+} // namespace cec
+} // namespace tv
+} // namespace hardware
+} // namespace android
+
+#endif // HIDL_GENERATED_android_hardware_tv_cec_V1_0_HdmiCec_H_
diff --git a/tv/cec/1.0/default/android.hardware.tv.cec@1.0-service.rc b/tv/cec/1.0/default/android.hardware.tv.cec@1.0-service.rc
new file mode 100644
index 0000000..1af32cb
--- /dev/null
+++ b/tv/cec/1.0/default/android.hardware.tv.cec@1.0-service.rc
@@ -0,0 +1,4 @@
+service cec-hal-1-0 /system/bin/hw/android.hardware.tv.cec@1.0-service
+ class hal
+ user system
+ group system
diff --git a/tv/cec/1.0/default/service.cpp b/tv/cec/1.0/default/service.cpp
new file mode 100644
index 0000000..3c11e24
--- /dev/null
+++ b/tv/cec/1.0/default/service.cpp
@@ -0,0 +1,27 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#define LOG_TAG "android.hardware.tv.cec@1.0-service"
+
+#include <android/hardware/tv/cec/1.0/IHdmiCec.h>
+#include <hidl/LegacySupport.h>
+
+using android::hardware::tv::cec::V1_0::IHdmiCec;
+using android::hardware::defaultPassthroughServiceImplementation;
+
+int main() {
+ return defaultPassthroughServiceImplementation<IHdmiCec>("tv.cec");
+}
diff --git a/tv/cec/1.0/types.hal b/tv/cec/1.0/types.hal
new file mode 100644
index 0000000..421fe9c
--- /dev/null
+++ b/tv/cec/1.0/types.hal
@@ -0,0 +1,218 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.tv.cec@1.0;
+
+enum CecDeviceType : int32_t {
+ INACTIVE = -1,
+ TV = 0,
+ RECORDER = 1,
+ TUNER = 3,
+ PLAYBACK = 4,
+ AUDIO_SYSTEM = 5,
+ MAX = AUDIO_SYSTEM,
+};
+
+enum CecLogicalAddress : int32_t {
+ TV = 0,
+ RECORDER_1 = 1,
+ RECORDER_2 = 2,
+ TUNER_1 = 3,
+ PLAYBACK_1 = 4,
+ AUDIO_SYSTEM = 5,
+ TUNER_2 = 6,
+ TUNER_3 = 7,
+ PLAYBACK_2 = 8,
+ RECORDER_3 = 9,
+ TUNER_4 = 10,
+ PLAYBACK_3 = 11,
+ FREE_USE = 14,
+ UNREGISTERED = 15, // as Initiator address
+ BROADCAST = 15, // as Destination address
+};
+
+/*
+ * HDMI CEC message types. The assigned values represent opcode used in CEC
+ * frame as specified in CEC Table 8-26 of the CEC Spec 1.4b.
+ */
+enum CecMessageType : int32_t {
+ FEATURE_ABORT = 0x00,
+ IMAGE_VIEW_ON = 0x04,
+ TUNER_STEP_INCREMENT = 0x05,
+ TUNER_STEP_DECREMENT = 0x06,
+ TUNER_DEVICE_STATUS = 0x07,
+ GIVE_TUNER_DEVICE_STATUS = 0x08,
+ RECORD_ON = 0x09,
+ RECORD_STATUS = 0x0A,
+ RECORD_OFF = 0x0B,
+ TEXT_VIEW_ON = 0x0D,
+ RECORD_TV_SCREEN = 0x0F,
+ GIVE_DECK_STATUS = 0x1A,
+ DECK_STATUS = 0x1B,
+ SET_MENU_LANGUAGE = 0x32,
+ CLEAR_ANALOG_TIMER = 0x33,
+ SET_ANALOG_TIMER = 0x34,
+ TIMER_STATUS = 0x35,
+ STANDBY = 0x36,
+ PLAY = 0x41,
+ DECK_CONTROL = 0x42,
+ TIMER_CLEARED_STATUS = 0x43,
+ USER_CONTROL_PRESSED = 0x44,
+ USER_CONTROL_RELEASED = 0x45,
+ GIVE_OSD_NAME = 0x46,
+ SET_OSD_NAME = 0x47,
+ SET_OSD_STRING = 0x64,
+ SET_TIMER_PROGRAM_TITLE = 0x67,
+ SYSTEM_AUDIO_MODE_REQUEST = 0x70,
+ GIVE_AUDIO_STATUS = 0x71,
+ SET_SYSTEM_AUDIO_MODE = 0x72,
+ REPORT_AUDIO_STATUS = 0x7A,
+ GIVE_SYSTEM_AUDIO_MODE_STATUS = 0x7D,
+ SYSTEM_AUDIO_MODE_STATUS = 0x7E,
+ ROUTING_CHANGE = 0x80,
+ ROUTING_INFORMATION = 0x81,
+ ACTIVE_SOURCE = 0x82,
+ GIVE_PHYSICAL_ADDRESS = 0x83,
+ REPORT_PHYSICAL_ADDRESS = 0x84,
+ REQUEST_ACTIVE_SOURCE = 0x85,
+ SET_STREAM_PATH = 0x86,
+ DEVICE_VENDOR_ID = 0x87,
+ VENDOR_COMMAND = 0x89,
+ VENDOR_REMOTE_BUTTON_DOWN = 0x8A,
+ VENDOR_REMOTE_BUTTON_UP = 0x8B,
+ GIVE_DEVICE_VENDOR_ID = 0x8C,
+ MENU_REQUEST = 0x8D,
+ MENU_STATUS = 0x8E,
+ GIVE_DEVICE_POWER_STATUS = 0x8F,
+ REPORT_POWER_STATUS = 0x90,
+ GET_MENU_LANGUAGE = 0x91,
+ SELECT_ANALOG_SERVICE = 0x92,
+ SELECT_DIGITAL_SERVICE = 0x93,
+ SET_DIGITAL_TIMER = 0x97,
+ CLEAR_DIGITAL_TIMER = 0x99,
+ SET_AUDIO_RATE = 0x9A,
+ INACTIVE_SOURCE = 0x9D,
+ CEC_VERSION = 0x9E,
+ GET_CEC_VERSION = 0x9F,
+ VENDOR_COMMAND_WITH_ID = 0xA0,
+ CLEAR_EXTERNAL_TIMER = 0xA1,
+ SET_EXTERNAL_TIMER = 0xA2,
+ INITIATE_ARC = 0xC0,
+ REPORT_ARC_INITIATED = 0xC1,
+ REPORT_ARC_TERMINATED = 0xC2,
+ REQUEST_ARC_INITIATION = 0xC3,
+ REQUEST_ARC_TERMINATION = 0xC4,
+ TERMINATE_ARC = 0xC5,
+ ABORT = 0xFF,
+};
+
+/*
+ * Operand description [Abort Reason]
+ */
+enum AbortReason : int32_t {
+ UNRECOGNIZED_MODE = 0,
+ NOT_IN_CORRECT_MODE = 1,
+ CANNOT_PROVIDE_SOURCE = 2,
+ INVALID_OPERAND = 3,
+ REFUSED = 4,
+ UNABLE_TO_DETERMINE = 5,
+};
+
+enum Result : int32_t {
+ SUCCESS = 0,
+ FAILURE_UNKNOWN = 1,
+ FAILURE_INVALID_ARGS = 2,
+ FAILURE_INVALID_STATE = 3,
+ FAILURE_NOT_SUPPORTED = 4,
+ FAILURE_BUSY = 5,
+};
+
+/*
+ * error code used for send_message.
+ */
+enum SendMessageResult : int32_t {
+ SUCCESS = 0,
+ NACK = 1, // not acknowledged
+ BUSY = 2, // bus is busy
+ FAIL = 3,
+};
+
+/*
+ * HDMI port type.
+ */
+enum HdmiPortType : int32_t {
+ INPUT = 0,
+ OUTPUT = 1,
+};
+
+/*
+ * Options used for IHdmiCec.setOption()
+ */
+enum OptionKey : int32_t {
+ /* When set to false, HAL does not wake up the system upon receiving <Image
+ * View On> or <Text View On>. Used when user changes the TV settings to
+ * disable the auto TV on functionality.
+ * True by default.
+ */
+ WAKEUP = 1,
+
+ /* When set to false, all the CEC commands are discarded. Used when user
+ * changes the TV settings to disable CEC functionality.
+ * True by default.
+ */
+ ENABLE_CEC = 2,
+
+ /* Setting this flag to false means Android system must stop handling CEC
+ * service and yield the control over to the microprocessor that is powered
+ * on through the standby mode. When set to true, the system must gain the
+ * control over, hence telling the microprocessor to stop handling the CEC
+ * commands. For example, this may be called when system goes in and out of
+ * standby mode to notify the microprocessor that it should start/stop
+ * handling CEC commands on behalf of the system.
+ * False by default.
+ */
+ SYSTEM_CEC_CONTROL = 3,
+
+ /* Option 4 not used */
+};
+
+struct CecMessage {
+ /* logical address of sender */
+ CecLogicalAddress initiator;
+
+ /* logical address of receiver */
+ CecLogicalAddress destination;
+
+ /* The maximum size of body is 15 as specified in the section 6 of the CEC
+ * Spec 1.4b. Overflowed data must be ignored. */
+ vec<uint8_t> body;
+};
+
+struct HotplugEvent {
+ bool connected;
+ uint32_t portId;
+};
+
+/*
+ * HDMI port descriptor
+ */
+struct HdmiPortInfo {
+ HdmiPortType type;
+ uint32_t portId; // Should start from 1 which corresponds to HDMI "port 1".
+ bool cecSupported;
+ bool arcSupported;
+ uint16_t physicalAddress;
+};
diff --git a/tv/input/1.0/Android.bp b/tv/input/1.0/Android.bp
index 895aa73..fa736b0 100644
--- a/tv/input/1.0/Android.bp
+++ b/tv/input/1.0/Android.bp
@@ -52,9 +52,9 @@
"libcutils",
"android.hardware.audio.common@2.0",
],
-export_shared_lib_headers: [
- "libhidl",
- "libhwbinder",
- "libutils",
+ export_shared_lib_headers: [
+ "libhidl",
+ "libhwbinder",
+ "libutils",
],
}
diff --git a/vehicle/2.0/Android.bp b/vehicle/2.0/Android.bp
index 981103c..27ac213 100644
--- a/vehicle/2.0/Android.bp
+++ b/vehicle/2.0/Android.bp
@@ -51,9 +51,9 @@
"libutils",
"libcutils",
],
-export_shared_lib_headers: [
- "libhidl",
- "libhwbinder",
- "libutils",
+ export_shared_lib_headers: [
+ "libhidl",
+ "libhwbinder",
+ "libutils",
],
}
diff --git a/vehicle/2.0/IVehicle.hal b/vehicle/2.0/IVehicle.hal
index 0885539..4c02447 100644
--- a/vehicle/2.0/IVehicle.hal
+++ b/vehicle/2.0/IVehicle.hal
@@ -64,11 +64,11 @@
* Clients must be able to subscribe to multiple properties at a time
* depending on data provided in options argument.
*
- * @param listener This client must be called on aproperiate event.
+ * @param listener This client must be called on appropriate event.
* @param options List of options to subscribe. SubscribeOption contains
- * information such as propery Id, area Id, sample rate, etc.
+ * information such as property Id, area Id, sample rate, etc.
*/
- subscribe(IVehicleCallback listener, vec<SubscribeOptions> options)
+ subscribe(IVehicleCallback callback, vec<SubscribeOptions> options)
generates (StatusCode status);
/**
@@ -77,7 +77,8 @@
* If this client wasn't subscribed to the given property, this method
* must return StatusCode::INVALID_ARGUMENT.
*/
- unsubscribe(VehicleProperty propId) generates (StatusCode status);
+ unsubscribe(IVehicleCallback callback, VehicleProperty propId)
+ generates (StatusCode status);
/**
* Print out debugging state for the vehicle hal.
@@ -91,7 +92,7 @@
* primitives used (such as mutex locks or semaphores) must be acquired
* with a timeout.
*
- * TODO(pavelm): we cannot use handle here due to Java compatability, it's
+ * TODO(pavelm): we cannot use handle here due to Java compatibility, it's
* better to pass file descriptor and write debug data directly in vehicle HAL
* rather than passing back a string.
*/
diff --git a/vehicle/2.0/IVehicleCallback.hal b/vehicle/2.0/IVehicleCallback.hal
index 1e9034f..5c1042b 100644
--- a/vehicle/2.0/IVehicleCallback.hal
+++ b/vehicle/2.0/IVehicleCallback.hal
@@ -29,7 +29,7 @@
*
* @param values that has been updated.
*/
- onPropertyEvent(vec<VehiclePropValue> propValues);
+ oneway onPropertyEvent(vec<VehiclePropValue> propValues);
/*
* This method gets called if the client was susbscribed to a property using
@@ -40,7 +40,7 @@
*
* @param value Value that was set by a client.
*/
- onPropertySet(VehiclePropValue propValue);
+ oneway onPropertySet(VehiclePropValue propValue);
/*
* Called by HAL server when error condition has occurred.
@@ -50,7 +50,7 @@
* a generic error, this value should be VehicleProperty::INVALID.
* @param operation Represent the operation where the error has happened.
*/
- onError(StatusCode errorCode,
- VehicleProperty propId,
- VehiclePropertyOperation operation);
+ oneway onError(StatusCode errorCode,
+ VehicleProperty propId,
+ VehiclePropertyOperation operation);
};
diff --git a/vehicle/2.0/default/Android.mk b/vehicle/2.0/default/Android.mk
index a30d753..e14cb19 100644
--- a/vehicle/2.0/default/Android.mk
+++ b/vehicle/2.0/default/Android.mk
@@ -14,29 +14,92 @@
LOCAL_PATH := $(call my-dir)
+module_prefix = android.hardware.vehicle@2.0
+
+###############################################################################
+# Vehicle reference implementation lib
+###############################################################################
include $(CLEAR_VARS)
-LOCAL_MODULE := android.hardware.vehicle@2.0-impl
-# TODO(pavelm): add LOCAL_INIT_RC
-LOCAL_MODULE_RELATIVE_PATH := hw
+LOCAL_MODULE := $(module_prefix)-manager-lib
LOCAL_SRC_FILES := \
- Vehicle.cpp \
- VehicleCallback.cpp \
+ vehicle_hal_manager/SubscriptionManager.cpp \
+ vehicle_hal_manager/VehicleHalManager.cpp \
+ vehicle_hal_manager/VehicleCallback.cpp \
LOCAL_SHARED_LIBRARIES := \
+ liblog \
+ libbinder \
libhidl \
libhwbinder \
libutils \
- android.hardware.vehicle@2.0 \
+ $(module_prefix) \
-include $(BUILD_SHARED_LIBRARY)
+include $(BUILD_STATIC_LIBRARY)
-
+###############################################################################
+# Vehicle default VehicleHAL implementation
+###############################################################################
include $(CLEAR_VARS)
-LOCAL_MODULE := android.hardware.vehicle@2.0-service
+
+LOCAL_MODULE:= $(module_prefix)-default-impl-lib
+LOCAL_SRC_FILES:= \
+ impl/DefaultVehicleHal.cpp \
+
+LOCAL_SHARED_LIBRARIES := \
+ liblog \
+ libbinder \
+ libhidl \
+ libhwbinder \
+ libutils \
+ $(module_prefix) \
+
+include $(BUILD_STATIC_LIBRARY)
+
+
+###############################################################################
+# Vehicle reference implementation unit tests
+###############################################################################
+include $(CLEAR_VARS)
+
+LOCAL_MODULE:= $(module_prefix)-manager-unit-tests
+
+LOCAL_WHOLE_STATIC_LIBRARIES := $(module_prefix)-manager-lib
+
+LOCAL_SRC_FILES:= \
+ tests/VehicleObjectPool_test.cpp \
+ tests/VehiclePropConfigIndex_test.cpp \
+ tests/SubscriptionManager_test.cpp \
+ tests/VehicleHalManager_test.cpp \
+
+LOCAL_SHARED_LIBRARIES := \
+ liblog \
+ libbinder \
+ libhidl \
+ libhwbinder \
+ libutils \
+ $(module_prefix) \
+
+LOCAL_CFLAGS += -Wall -Wextra
+LOCAL_MODULE_TAGS := tests
+
+include $(BUILD_NATIVE_TEST)
+
+
+###############################################################################
+# Vehicle HAL service
+###############################################################################
+include $(CLEAR_VARS)
+LOCAL_MODULE := $(module_prefix)-service
LOCAL_MODULE_RELATIVE_PATH := hw
+# TODO(pavelm): add LOCAL_INIT_RC
+
LOCAL_SRC_FILES := \
VehicleService.cpp
+LOCAL_WHOLE_STATIC_LIBRARIES := \
+ $(module_prefix)-manager-lib \
+ $(module_prefix)-default-impl-lib \
+
LOCAL_SHARED_LIBRARIES := \
liblog \
libbinder \
diff --git a/vehicle/2.0/default/Vehicle.cpp b/vehicle/2.0/default/Vehicle.cpp
deleted file mode 100644
index a4933df..0000000
--- a/vehicle/2.0/default/Vehicle.cpp
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- * Copyright (C) 2016 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "Vehicle.h"
-#include "VehicleUtils.h"
-
-#include <utils/SystemClock.h>
-
-namespace android {
-namespace hardware {
-namespace vehicle {
-namespace V2_0 {
-namespace implementation {
-
-const VehiclePropConfig kVehicleProperties[] = {
- {
- .prop = VehicleProperty::INFO_MAKE,
- .access = VehiclePropertyAccess::READ,
- .changeMode = VehiclePropertyChangeMode::STATIC,
- .permissionModel = VehiclePermissionModel::OEM_ONLY,
- .configString = init_hidl_string("Some=configuration,options=if,you=have,any=?"),
- },
-
- {
- .prop = VehicleProperty::HVAC_FAN_SPEED,
- .access = VehiclePropertyAccess::READ_WRITE,
- .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
- .permissionModel = VehiclePermissionModel::NO_RESTRICTION,
- .supportedAreas = static_cast<int32_t>(
- VehicleAreaZone::ROW_1_LEFT | VehicleAreaZone::ROW_1_RIGHT),
- .areaConfigs = init_hidl_vec({
- VehicleAreaConfig {
- .areaId = enum_val(VehicleAreaZone::ROW_2_LEFT),
- .minInt32Value = 1,
- .maxInt32Value = 7},
- VehicleAreaConfig {
- .areaId = enum_val(VehicleAreaZone::ROW_1_RIGHT),
- .minInt32Value = 1,
- .maxInt32Value = 5,
- }
- }),
- },
-
- {
- .prop = VehicleProperty::INFO_FUEL_CAPACITY,
- .access = VehiclePropertyAccess::READ,
- .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
- .permissionModel = VehiclePermissionModel::OEM_ONLY,
- .areaConfigs = init_hidl_vec({
- VehicleAreaConfig {
- .minFloatValue = 0,
- .maxFloatValue = 1.0
- }
- })
- }
-};
-
-const char kInfoMake[] = "Android Super Car";
-
-
-Return<void> Vehicle::getAllPropConfigs(getAllPropConfigs_cb _hidl_cb) {
- hidl_vec<VehiclePropConfig> configs;
-
- configs.setToExternal(const_cast<VehiclePropConfig*>(kVehicleProperties),
- arraysize(kVehicleProperties));
-
- _hidl_cb(configs);
- return Void();
-}
-
-Return<void> Vehicle::getPropConfigs(const hidl_vec<VehicleProperty>& properties,
- getAllPropConfigs_cb _hidl_cb) {
- // TODO(pavelm): add default implementation
- hidl_vec<VehiclePropConfig> configs;
- _hidl_cb(configs);
- return Void();
-}
-
-Return<void> Vehicle::get(VehicleProperty propId, int32_t areaId, get_cb _hidl_cb) {
- VehiclePropValue v {
- .prop = propId,
- .areaId = areaId,
- .timestamp = elapsedRealtimeNano(),
- };
-
- StatusCode status = StatusCode::OK;
-
- if (propId == VehicleProperty::INFO_MAKE) {
- v.value.stringValue.setToExternal(kInfoMake, strlen(kInfoMake));
- } else if (propId == VehicleProperty::HVAC_FAN_SPEED) {
- v.value.int32Values = init_hidl_vec({42});
- } else {
- status = StatusCode::INVALID_ARG;
- }
-
- _hidl_cb(status, v);
-
- return Void();
-}
-
-Return<StatusCode> Vehicle::set(const VehiclePropValue& value) {
- // TODO(pavelm): add default implementation
- return StatusCode::OK;
-}
-
-Return<StatusCode> Vehicle::subscribe(const sp<IVehicleCallback>& listener,
- const hidl_vec<SubscribeOptions>& options) {
- // TODO(pavelm): add default implementation
- return StatusCode::OK;
-}
-
-Return<StatusCode> Vehicle::unsubscribe(VehicleProperty propId) {
- // TODO(pavelm): add default implementation
- return StatusCode::OK;
-}
-
-Return<void> Vehicle::debugDump(debugDump_cb _hidl_cb) {
- hidl_string debug;
- debug = "Put debug data here";
-
- _hidl_cb(debug);
-
- return Void();
-}
-
-IVehicle* HIDL_FETCH_IVehicle(const char* /* name */) {
- return new Vehicle();
-}
-
-} // namespace implementation
-} // namespace V2_0
-} // namespace vehicle
-} // namespace hardware
-} // namespace android
diff --git a/vehicle/2.0/default/Vehicle.h b/vehicle/2.0/default/Vehicle.h
deleted file mode 100644
index c0fe03e..0000000
--- a/vehicle/2.0/default/Vehicle.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright (C) 2016 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef HIDL_GENERATED_android_hardware_vehicle_V2_0_Vehicle_H_
-#define HIDL_GENERATED_android_hardware_vehicle_V2_0_Vehicle_H_
-
-#include <android/hardware/vehicle/2.0/IVehicle.h>
-#include <hidl/Status.h>
-
-#include <hidl/MQDescriptor.h>
-namespace android {
-namespace hardware {
-namespace vehicle {
-namespace V2_0 {
-namespace implementation {
-
-using ::android::hardware::vehicle::V2_0::IVehicle;
-using ::android::hardware::vehicle::V2_0::IVehicleCallback;
-using ::android::hardware::vehicle::V2_0::SubscribeOptions;
-using ::android::hardware::vehicle::V2_0::VehiclePropConfig;
-using ::android::hardware::vehicle::V2_0::VehiclePropValue;
-using ::android::hardware::vehicle::V2_0::VehicleProperty;
-using ::android::hardware::Return;
-using ::android::hardware::Void;
-using ::android::hardware::hidl_vec;
-using ::android::hardware::hidl_string;
-using ::android::sp;
-
-struct Vehicle : public IVehicle {
- // Methods from ::android::hardware::vehicle::V2_0::IVehicle follow.
- Return<void> getAllPropConfigs(getAllPropConfigs_cb _hidl_cb) override;
- Return<void> getPropConfigs(const hidl_vec<VehicleProperty>& properties, getPropConfigs_cb _hidl_cb) override;
- Return<void> get(VehicleProperty propId, int32_t areaId, get_cb _hidl_cb) override;
- Return<StatusCode> set(const VehiclePropValue& value) override;
- Return<StatusCode> subscribe(const sp<IVehicleCallback>& listener, const hidl_vec<SubscribeOptions>& options) override;
- Return<StatusCode> unsubscribe(VehicleProperty propId) override;
- Return<void> debugDump(debugDump_cb _hidl_cb = nullptr) override;
-};
-
-extern "C" IVehicle* HIDL_FETCH_IVehicle(const char* name);
-
-} // namespace implementation
-} // namespace V2_0
-} // namespace vehicle
-} // namespace hardware
-} // namespace android
-
-#endif // HIDL_GENERATED_android_hardware_vehicle_V2_0_Vehicle_H_
diff --git a/vehicle/2.0/default/VehicleHal.h b/vehicle/2.0/default/VehicleHal.h
new file mode 100644
index 0000000..89d8ef8
--- /dev/null
+++ b/vehicle/2.0/default/VehicleHal.h
@@ -0,0 +1,115 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef android_hardware_vehicle_V2_0_VehicleHal_H_
+#define android_hardware_vehicle_V2_0_VehicleHal_H_
+
+#include <android/hardware/vehicle/2.0/IVehicle.h>
+#include "vehicle_hal_manager/VehicleObjectPool.h"
+
+
+namespace android {
+namespace hardware {
+namespace vehicle {
+namespace V2_0 {
+
+/**
+ * This is a low-level vehicle hal interface that should be implemented by
+ * Vendor.
+ */
+class VehicleHal {
+public:
+ using VehiclePropValuePtr = recyclable_ptr<VehiclePropValue>;
+
+ using HalEventFunction = std::function<void(VehiclePropValuePtr)>;
+ using HalErrorFunction = std::function<void(
+ VehicleProperty property,
+ status_t errorCode,
+ VehiclePropertyOperation operation)>;
+
+ virtual ~VehicleHal() {}
+
+ virtual std::vector<VehiclePropConfig> listProperties() = 0;
+ virtual VehiclePropValuePtr get(VehicleProperty property,
+ int32_t areaId,
+ status_t* outStatus) = 0;
+
+ virtual status_t set(const VehiclePropValue& propValue) = 0;
+
+ /**
+ * Subscribe to HAL property events. This method might be called multiple
+ * times for the same vehicle property to update subscribed areas or sample
+ * rate.
+ *
+ * @param property to subscribe
+ * @param areas a bitwise vehicle areas or 0 for all supported areas
+ * @param sampleRate sample rate in Hz for properties that support sample
+ * rate, e.g. for properties with
+ * VehiclePropertyChangeMode::CONTINUOUS
+ */
+ virtual status_t subscribe(VehicleProperty property,
+ int32_t areas,
+ float sampleRate) = 0;
+
+ /**
+ * Unsubscribe from HAL events for given property
+ *
+ * @param property vehicle property to unsubscribe
+ */
+ virtual status_t unsubscribe(VehicleProperty property) = 0;
+
+ /**
+ * Override this method if you need to do one-time initialization.
+ */
+ virtual void onCreate() {}
+
+ void init(
+ VehiclePropValuePool* valueObjectPool,
+ const HalEventFunction& onHalEvent,
+ const HalErrorFunction& onHalError) {
+ mValuePool = valueObjectPool;
+ mOnHalEvent = onHalEvent;
+ mOnHalError = onHalError;
+
+ onCreate();
+ }
+
+ VehiclePropValuePool* getValuePool() {
+ return mValuePool;
+ }
+protected:
+ void doHalEvent(VehiclePropValuePtr v) {
+ mOnHalEvent(std::move(v));
+ }
+
+ void doHalError(VehicleProperty property,
+ status_t errorCode,
+ VehiclePropertyOperation operation) {
+ mOnHalError(property, errorCode, operation);
+ }
+
+private:
+ HalEventFunction mOnHalEvent;
+ HalErrorFunction mOnHalError;
+ VehiclePropValuePool* mValuePool;
+};
+
+} // namespace V2_0
+} // namespace vehicle
+} // namespace hardware
+} // namespace android
+
+#endif //android_hardware_vehicle_V2_0_VehicleHal_H_
diff --git a/vehicle/2.0/default/VehicleService.cpp b/vehicle/2.0/default/VehicleService.cpp
index b685977..e21dcd9 100644
--- a/vehicle/2.0/default/VehicleService.cpp
+++ b/vehicle/2.0/default/VehicleService.cpp
@@ -21,22 +21,18 @@
#include <hwbinder/IPCThreadState.h>
-#include <android/hardware/vehicle/2.0/IVehicle.h>
+#include <vehicle_hal_manager/VehicleHalManager.h>
+#include <impl/DefaultVehicleHal.h>
using namespace android;
using namespace android::hardware;
using namespace android::hardware::vehicle::V2_0;
int main(int /* argc */, char* /* argv */ []) {
- ALOGI("Service is starting");
- android::sp<IVehicle> service = IVehicle::getService("Vehicle");
- if (service.get() == NULL) {
- ALOGE("IVehicle::getService returned NULL, exiting");
- return 1;
- }
+ auto hal = std::make_unique<impl::DefaultVehicleHal>();
+ auto service = std::make_unique<VehicleHalManager>(hal.get());
- ALOGI("Registering as service");
- // will register the -impl as a binderized service in this process
+ ALOGI("Registering as service...");
service->registerAsService("Vehicle");
ALOGI("Ready");
diff --git a/vehicle/2.0/default/VehicleUtils.h b/vehicle/2.0/default/VehicleUtils.h
deleted file mode 100644
index 78e34e5..0000000
--- a/vehicle/2.0/default/VehicleUtils.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Copyright (C) 2016 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef android_hardware_vehicle_V2_0_VehicleUtils_H_
-#define android_hardware_vehicle_V2_0_VehicleUtils_H_
-
-#include <hidl/HidlSupport.h>
-#include <android/hardware/vehicle/2.0/types.h>
-
-namespace android {
-namespace hardware {
-namespace vehicle {
-namespace V2_0 {
-
-hidl_string init_hidl_string(const char *cstr) {
- hidl_string hidlString;
- hidlString = cstr;
- return hidlString;
-}
-
-template <typename T>
-hidl_vec<T> init_hidl_vec(std::initializer_list<T> values) {
- hidl_vec<T> vector;
- vector.resize(values.size());
- size_t i = 0;
- for (auto& c : values) {
- vector[i++] = c;
- }
- return vector;
-}
-
-// OR operator for class enums. The return type will be enum's underline type.
-template <typename ENUM>
-typename std::underlying_type<ENUM>::type operator |(ENUM v1, ENUM v2) {
- return static_cast<typename std::underlying_type<ENUM>::type>(v1)
- | static_cast<typename std::underlying_type<ENUM>::type>(v2);
-}
-
-// AND operator for class enums. The return type will be enum's underline type.
-template <typename ENUM>
-typename std::underlying_type<ENUM>::type operator &(ENUM v1, ENUM v2) {
- return static_cast<typename std::underlying_type<ENUM>::type>(v1)
- | static_cast<typename std::underlying_type<ENUM>::type>(v2);
-}
-
-// Returns underlying (integer) value for given enum.
-template <typename ENUM>
-typename std::underlying_type<ENUM>::type enum_val(ENUM const value)
-{
- return static_cast<typename std::underlying_type<ENUM>::type>(value);
-}
-
-VehiclePropertyType getPropType(VehicleProperty prop) {
- return static_cast<VehiclePropertyType>(
- static_cast<int32_t>(prop) & static_cast<int32_t>(VehiclePropertyType::MASK));
-}
-
-VehiclePropertyGroup getPropGroup(VehicleProperty prop) {
- return static_cast<VehiclePropertyGroup>(
- static_cast<int32_t>(prop) & static_cast<int32_t>(VehiclePropertyGroup::MASK));
-}
-
-bool checkPropType(VehicleProperty prop, VehiclePropertyType type) {
- return getPropType(prop) == type;
-}
-
-bool isSystemProperty(VehicleProperty prop) {
- return VehiclePropertyGroup::SYSTEM == getPropGroup(prop);
-}
-
-
-} // namespace V2_0
-} // namespace vehicle
-} // namespace hardware
-} // namespace android
-
-#endif android_hardware_vehicle_V2_0_VehicleUtils_H_
diff --git a/vehicle/2.0/default/impl/DefaultConfig.h b/vehicle/2.0/default/impl/DefaultConfig.h
new file mode 100644
index 0000000..6f04626
--- /dev/null
+++ b/vehicle/2.0/default/impl/DefaultConfig.h
@@ -0,0 +1,91 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef android_hardware_vehicle_V2_0_impl_DefaultConfig_H_
+#define android_hardware_vehicle_V2_0_impl_DefaultConfig_H_
+
+#include <android/hardware/vehicle/2.0/IVehicle.h>
+
+namespace android {
+namespace hardware {
+namespace vehicle {
+namespace V2_0 {
+
+namespace impl {
+
+const VehiclePropConfig kVehicleProperties[] = {
+ {
+ .prop = VehicleProperty::INFO_MAKE,
+ .access = VehiclePropertyAccess::READ,
+ .changeMode = VehiclePropertyChangeMode::STATIC,
+ .permissionModel = VehiclePermissionModel::OEM_ONLY,
+ },
+
+ {
+ .prop = VehicleProperty::HVAC_FAN_SPEED,
+ .access = VehiclePropertyAccess::READ_WRITE,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
+ .permissionModel = VehiclePermissionModel::NO_RESTRICTION,
+ .supportedAreas = static_cast<int32_t>(
+ VehicleAreaZone::ROW_1_LEFT | VehicleAreaZone::ROW_1_RIGHT),
+ .areaConfigs = init_hidl_vec({
+ VehicleAreaConfig {
+ .areaId = val(VehicleAreaZone::ROW_2_LEFT),
+ .minInt32Value = 1,
+ .maxInt32Value = 7},
+ VehicleAreaConfig {
+ .areaId = val(VehicleAreaZone::ROW_1_RIGHT),
+ .minInt32Value = 1,
+ .maxInt32Value = 5,
+ }
+ }),
+ },
+
+ {
+ .prop = VehicleProperty::INFO_FUEL_CAPACITY,
+ .access = VehiclePropertyAccess::READ,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
+ .permissionModel = VehiclePermissionModel::OEM_ONLY,
+ .areaConfigs = init_hidl_vec({
+ VehicleAreaConfig {
+ .minFloatValue = 0,
+ .maxFloatValue = 1.0
+ }
+ })
+ },
+
+ {
+ .prop = VehicleProperty::DISPLAY_BRIGHTNESS,
+ .access = VehiclePropertyAccess::READ_WRITE,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
+ .permissionModel = VehiclePermissionModel::OEM_ONLY,
+ .areaConfigs = init_hidl_vec({
+ VehicleAreaConfig {
+ .minInt32Value = 0,
+ .maxInt32Value = 10
+ }
+ })
+ }
+};
+
+} // impl
+
+} // namespace V2_0
+} // namespace vehicle
+} // namespace hardware
+} // namespace android
+
+#endif // android_hardware_vehicle_V2_0_impl_DefaultConfig_H_
diff --git a/vehicle/2.0/default/impl/DefaultVehicleHal.cpp b/vehicle/2.0/default/impl/DefaultVehicleHal.cpp
new file mode 100644
index 0000000..6ca0f9f
--- /dev/null
+++ b/vehicle/2.0/default/impl/DefaultVehicleHal.cpp
@@ -0,0 +1,110 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "DefaultVehicleHal.h"
+
+namespace android {
+namespace hardware {
+namespace vehicle {
+namespace V2_0 {
+
+namespace impl {
+
+VehicleHal::VehiclePropValuePtr DefaultVehicleHal::get(VehicleProperty property,
+ int32_t areaId,
+ status_t* outStatus) {
+ *outStatus = OK;
+
+ VehiclePropValuePtr v;
+
+ switch (property) {
+ case VehicleProperty::INFO_MAKE:
+ v = getValuePool()->obtainString("Default Car");
+ break;
+ case VehicleProperty::HVAC_FAN_SPEED:
+ int32_t value;
+ if ((*outStatus = getHvacFanSpeed(areaId, &value)) == OK) {
+ v = getValuePool()->obtainInt32(value);
+ }
+ break;
+ case VehicleProperty::INFO_FUEL_CAPACITY:
+ v = getValuePool()->obtainFloat(0.75f);
+ break;
+ case VehicleProperty::DISPLAY_BRIGHTNESS:
+ v = getValuePool()->obtainInt32(brightness);
+ break;
+ default:
+ *outStatus = BAD_VALUE;
+ }
+
+ if (*outStatus == OK && v.get() != nullptr) {
+ v->prop = property;
+ v->areaId = areaId;
+ v->timestamp = elapsedRealtimeNano();
+ }
+
+ return v;
+}
+
+status_t DefaultVehicleHal::set(const VehiclePropValue& propValue) {
+ auto property = propValue.prop;
+
+ status_t status = OK;
+
+ switch (property) {
+ case VehicleProperty::HVAC_FAN_SPEED:
+ status = setHvacFanSpeed(propValue.areaId,
+ propValue.value.int32Values[0]);
+ break;
+ case VehicleProperty::DISPLAY_BRIGHTNESS:
+ brightness = propValue.value.int32Values[0];
+ break;
+ default:
+ status = BAD_VALUE;
+ }
+
+ return status;
+}
+
+status_t DefaultVehicleHal::getHvacFanSpeed(int32_t areaId,
+ int32_t* outValue) {
+ if (areaId == val(VehicleAreaZone::ROW_1_LEFT)) {
+ *outValue = fanSpeedRow1Left;
+ } else if (areaId == val(VehicleAreaZone::ROW_2_RIGHT)) {
+ *outValue = fanSpeedRow1Right;
+ } else {
+ return BAD_VALUE;
+ }
+ return OK;
+}
+
+status_t DefaultVehicleHal::setHvacFanSpeed(int32_t areaId, int32_t value) {
+ if (areaId == val(VehicleAreaZone::ROW_1_LEFT)) {
+ fanSpeedRow1Left = value;
+ } else if (areaId == val(VehicleAreaZone::ROW_2_RIGHT)) {
+ fanSpeedRow1Right = value;
+ } else {
+ return BAD_VALUE;
+ }
+ return OK;
+}
+
+} // impl
+
+} // namespace V2_0
+} // namespace vehicle
+} // namespace hardware
+} // namespace android
diff --git a/vehicle/2.0/default/impl/DefaultVehicleHal.h b/vehicle/2.0/default/impl/DefaultVehicleHal.h
new file mode 100644
index 0000000..7d0b7cb
--- /dev/null
+++ b/vehicle/2.0/default/impl/DefaultVehicleHal.h
@@ -0,0 +1,73 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef android_hardware_vehicle_V2_0_impl_DefaultVehicleHal_H_
+#define android_hardware_vehicle_V2_0_impl_DefaultVehicleHal_H_
+
+#include <VehicleHal.h>
+#include <impl/DefaultConfig.h>
+#include <utils/SystemClock.h>
+
+namespace android {
+namespace hardware {
+namespace vehicle {
+namespace V2_0 {
+
+namespace impl {
+
+class DefaultVehicleHal : public VehicleHal {
+public:
+ std::vector<VehiclePropConfig> listProperties() override {
+ return std::vector<VehiclePropConfig>(std::begin(kVehicleProperties),
+ std::end(kVehicleProperties));
+ }
+
+ VehiclePropValuePtr get(VehicleProperty property,
+ int32_t areaId,
+ status_t* outStatus) override;
+
+ status_t set(const VehiclePropValue& propValue) override;
+
+ status_t subscribe(VehicleProperty property,
+ int32_t areas,
+ float sampleRate) {
+ // TODO(pavelm): implement
+ return OK;
+ }
+
+ status_t unsubscribe(VehicleProperty property) {
+ // TODO(pavelm): implement
+ return OK;
+ }
+
+private:
+ status_t getHvacFanSpeed(int32_t areaId, int32_t* outValue);
+ status_t setHvacFanSpeed(int32_t areaId, int32_t value);
+private:
+ int32_t fanSpeedRow1Left = 3;
+ int32_t fanSpeedRow1Right = 5;
+ int32_t brightness = 7;
+};
+
+} // impl
+
+} // namespace V2_0
+} // namespace vehicle
+} // namespace hardware
+} // namespace android
+
+
+#endif // android_hardware_vehicle_V2_0_impl_DefaultVehicleHal_H_
diff --git a/vehicle/2.0/default/tests/SubscriptionManager_test.cpp b/vehicle/2.0/default/tests/SubscriptionManager_test.cpp
new file mode 100644
index 0000000..c3db993
--- /dev/null
+++ b/vehicle/2.0/default/tests/SubscriptionManager_test.cpp
@@ -0,0 +1,203 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <unordered_map>
+#include <iostream>
+
+#include <gtest/gtest.h>
+
+#include <vehicle_hal_manager/VehiclePropConfigIndex.h>
+#include <VehicleHal.h>
+#include <vehicle_hal_manager/VehicleHalManager.h>
+#include "vehicle_hal_manager/SubscriptionManager.h"
+
+#include "VehicleHalTestUtils.h"
+
+namespace android {
+namespace hardware {
+namespace vehicle {
+namespace V2_0 {
+
+namespace {
+
+using namespace std::placeholders;
+
+class SubscriptionManagerTest : public ::testing::Test {
+public:
+ SubscriptionManager manager;
+
+ const VehicleProperty PROP1 = VehicleProperty::HVAC_FAN_SPEED;
+ const VehicleProperty PROP2 = VehicleProperty::DISPLAY_BRIGHTNESS;
+
+ sp<IVehicleCallback> cb1 = new MockedVehicleCallback();
+ sp<IVehicleCallback> cb2 = new MockedVehicleCallback();
+ sp<IVehicleCallback> cb3 = new MockedVehicleCallback();
+
+ hidl_vec<SubscribeOptions> subscrToProp1 = init_hidl_vec(
+ {
+ SubscribeOptions {
+ .propId = PROP1,
+ .vehicleAreas = val(VehicleAreaZone::ROW_1_LEFT),
+ .flags = SubscribeFlags::HAL_EVENT
+ },
+ });
+
+ hidl_vec<SubscribeOptions> subscrToProp2 = init_hidl_vec(
+ {
+ SubscribeOptions {
+ .propId = PROP2,
+ .flags = SubscribeFlags::HAL_EVENT
+ },
+ });
+
+ hidl_vec<SubscribeOptions> subscrToProp1and2 = init_hidl_vec(
+ {
+ SubscribeOptions {
+ .propId = PROP1,
+ .vehicleAreas = val(VehicleAreaZone::ROW_1_LEFT),
+ .flags = SubscribeFlags::HAL_EVENT
+ },
+ SubscribeOptions {
+ .propId = PROP2,
+ .flags = SubscribeFlags::HAL_EVENT
+ },
+ });
+
+ static std::list<sp<IVehicleCallback>> extractCallbacks(
+ const std::list<sp<HalClient>>& clients) {
+ std::list<sp<IVehicleCallback>> callbacks;
+ for (auto c : clients) {
+ callbacks.push_back(c->getCallback());
+ }
+ return callbacks;
+ }
+
+ std::list<sp<HalClient>> clientsToProp1() {
+ return manager.getSubscribedClients(PROP1,
+ val(VehicleAreaZone::ROW_1_LEFT),
+ SubscribeFlags::DEFAULT);
+ }
+
+ std::list<sp<HalClient>> clientsToProp2() {
+ return manager.getSubscribedClients(PROP2, 0,
+ SubscribeFlags::DEFAULT);
+ }
+};
+
+
+TEST_F(SubscriptionManagerTest, multipleClients) {
+ manager.addOrUpdateSubscription(cb1, subscrToProp1);
+ manager.addOrUpdateSubscription(cb2, subscrToProp1);
+
+ auto clients = manager.getSubscribedClients(
+ PROP1,
+ val(VehicleAreaZone::ROW_1_LEFT),
+ SubscribeFlags::HAL_EVENT);
+
+ ASSERT_ALL_EXISTS({cb1, cb2}, extractCallbacks(clients));
+}
+
+TEST_F(SubscriptionManagerTest, negativeCases) {
+ manager.addOrUpdateSubscription(cb1, subscrToProp1);
+
+ // Wrong zone
+ auto clients = manager.getSubscribedClients(
+ PROP1,
+ val(VehicleAreaZone::ROW_2_LEFT),
+ SubscribeFlags::HAL_EVENT);
+ ASSERT_TRUE(clients.empty());
+
+ // Wrong prop
+ clients = manager.getSubscribedClients(
+ VehicleProperty::AP_POWER_BOOTUP_REASON,
+ val(VehicleAreaZone::ROW_1_LEFT),
+ SubscribeFlags::HAL_EVENT);
+ ASSERT_TRUE(clients.empty());
+
+ // Wrong flag
+ clients = manager.getSubscribedClients(
+ PROP1,
+ val(VehicleAreaZone::ROW_1_LEFT),
+ SubscribeFlags::SET_CALL);
+ ASSERT_TRUE(clients.empty());
+}
+
+TEST_F(SubscriptionManagerTest, mulipleSubscriptions) {
+ manager.addOrUpdateSubscription(cb1, subscrToProp1);
+
+ auto clients = manager.getSubscribedClients(
+ PROP1,
+ val(VehicleAreaZone::ROW_1_LEFT),
+ SubscribeFlags::DEFAULT);
+ ASSERT_EQ((size_t) 1, clients.size());
+ ASSERT_EQ(cb1, clients.front()->getCallback());
+
+ // Same property, but different zone, to make sure we didn't unsubscribe
+ // from previous zone.
+ manager.addOrUpdateSubscription(cb1, init_hidl_vec(
+ {
+ SubscribeOptions {
+ .propId = PROP1,
+ .vehicleAreas = val(VehicleAreaZone::ROW_2),
+ .flags = SubscribeFlags::DEFAULT
+ }
+ }));
+
+ clients = manager.getSubscribedClients(PROP1,
+ val(VehicleAreaZone::ROW_1_LEFT),
+ SubscribeFlags::DEFAULT);
+ ASSERT_ALL_EXISTS({cb1}, extractCallbacks(clients));
+
+ clients = manager.getSubscribedClients(PROP1,
+ val(VehicleAreaZone::ROW_2),
+ SubscribeFlags::DEFAULT);
+ ASSERT_ALL_EXISTS({cb1}, extractCallbacks(clients));
+}
+
+TEST_F(SubscriptionManagerTest, unsubscribe) {
+ manager.addOrUpdateSubscription(cb1, subscrToProp1);
+ manager.addOrUpdateSubscription(cb2, subscrToProp2);
+ manager.addOrUpdateSubscription(cb3, subscrToProp1and2);
+
+ ASSERT_ALL_EXISTS({cb1, cb3}, extractCallbacks(clientsToProp1()));
+ ASSERT_ALL_EXISTS({cb2, cb3}, extractCallbacks(clientsToProp2()));
+
+ ASSERT_FALSE(manager.unsubscribe(cb1, PROP1));
+ ASSERT_ALL_EXISTS({cb3}, extractCallbacks(clientsToProp1()));
+
+ // Make sure nothing changed in PROP2 so far.
+ ASSERT_ALL_EXISTS({cb2, cb3}, extractCallbacks(clientsToProp2()));
+
+ // No one subscribed to PROP1, subscription for PROP2 is not affected.
+ ASSERT_TRUE(manager.unsubscribe(cb3, PROP1));
+ ASSERT_ALL_EXISTS({cb2, cb3}, extractCallbacks(clientsToProp2()));
+
+ ASSERT_FALSE(manager.unsubscribe(cb3, PROP2));
+ ASSERT_ALL_EXISTS({cb2}, extractCallbacks(clientsToProp2()));
+
+ // The last client unsubscribed from this property.
+ ASSERT_TRUE(manager.unsubscribe(cb2, PROP2));
+
+ // No one was subscribed, return false.
+ ASSERT_FALSE(manager.unsubscribe(cb1, PROP1));
+}
+
+} // namespace anonymous
+
+} // namespace V2_0
+} // namespace vehicle
+} // namespace hardware
+} // namespace android
diff --git a/vehicle/2.0/default/tests/VehicleHalManager_test.cpp b/vehicle/2.0/default/tests/VehicleHalManager_test.cpp
new file mode 100644
index 0000000..1410ddf
--- /dev/null
+++ b/vehicle/2.0/default/tests/VehicleHalManager_test.cpp
@@ -0,0 +1,208 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <unordered_map>
+#include <iostream>
+
+#include <gtest/gtest.h>
+
+#include <vehicle_hal_manager/VehiclePropConfigIndex.h>
+#include <VehicleHal.h>
+#include <vehicle_hal_manager/VehicleHalManager.h>
+#include "vehicle_hal_manager/SubscriptionManager.h"
+
+#include "VehicleHalTestUtils.h"
+
+namespace android {
+namespace hardware {
+namespace vehicle {
+namespace V2_0 {
+
+namespace {
+
+using namespace std::placeholders;
+
+class MockedVehicleHal : public VehicleHal {
+public:
+ MockedVehicleHal() {
+ mConfigs.assign(std::begin(kVehicleProperties),
+ std::end(kVehicleProperties));
+ }
+
+ std::vector<VehiclePropConfig> listProperties() override {
+ return mConfigs;
+ }
+
+ VehiclePropValuePtr get(VehicleProperty property,
+ int32_t areaId,
+ status_t* outStatus) override {
+ *outStatus = OK;
+ return getValuePool()->obtain(mValues[property]);
+ }
+
+ status_t set(const VehiclePropValue& propValue) override {
+ mValues[propValue.prop] = propValue;
+ return OK;
+ }
+
+ status_t subscribe(VehicleProperty property,
+ int32_t areas,
+ float sampleRate) override {
+ return OK;
+ }
+
+ status_t unsubscribe(VehicleProperty property) override {
+ return OK;
+ }
+
+ void sendPropEvent(recyclable_ptr<VehiclePropValue> value) {
+ doHalEvent(std::move(value));
+ }
+
+private:
+ std::vector<VehiclePropConfig> mConfigs;
+ std::unordered_map<VehicleProperty, VehiclePropValue> mValues;
+};
+
+class VehicleHalManagerTest : public ::testing::Test {
+protected:
+ void SetUp() override {
+ hal.reset(new MockedVehicleHal);
+ manager.reset(new VehicleHalManager(hal.get()));
+
+ objectPool = hal->getValuePool();
+ }
+
+ void TearDown() override {
+ manager.reset(nullptr);
+ hal.reset(nullptr);
+ }
+
+public:
+ VehiclePropValuePool* objectPool;
+ std::unique_ptr<MockedVehicleHal> hal;
+ std::unique_ptr<VehicleHalManager> manager;
+};
+
+class HalClientVectorTest : public ::testing::Test {
+public:
+ HalClientVector clients;
+};
+
+TEST_F(VehicleHalManagerTest, getPropConfigs) {
+ hidl_vec<VehicleProperty> properties = init_hidl_vec(
+ { VehicleProperty::HVAC_FAN_SPEED,VehicleProperty::INFO_MAKE} );
+ bool called = false;
+ manager->getPropConfigs(properties,
+ [&called] (const hidl_vec<VehiclePropConfig>& c) {
+ ASSERT_EQ(2u, c.size());
+ called = true;
+ });
+ ASSERT_TRUE(called); // Verify callback received.
+
+ called = false;
+ manager->getPropConfigs(init_hidl_vec({VehicleProperty::HVAC_FAN_SPEED}),
+ [&called] (const hidl_vec<VehiclePropConfig>& c) {
+ ASSERT_EQ(1u, c.size());
+ ASSERT_EQ(toString(kVehicleProperties[1]), toString(c[0]));
+ called = true;
+ });
+ ASSERT_TRUE(called); // Verify callback received.
+}
+
+TEST_F(VehicleHalManagerTest, getAllPropConfigs) {
+ bool called = false;
+ manager->getAllPropConfigs(
+ [&called] (const hidl_vec<VehiclePropConfig>& propConfigs) {
+ ASSERT_EQ(arraysize(kVehicleProperties), propConfigs.size());
+
+ for (size_t i = 0; i < propConfigs.size(); i++) {
+ ASSERT_EQ(toString(kVehicleProperties[i]),
+ toString(propConfigs[i]));
+ }
+ called = true;
+ });
+ ASSERT_TRUE(called); // Verify callback received.
+}
+
+TEST_F(VehicleHalManagerTest, subscribe) {
+ const VehicleProperty PROP = VehicleProperty::DISPLAY_BRIGHTNESS;
+
+ sp<MockedVehicleCallback> cb = new MockedVehicleCallback();
+
+ hidl_vec<SubscribeOptions> options = init_hidl_vec(
+ {
+ SubscribeOptions {
+ .propId = PROP,
+ .flags = SubscribeFlags::DEFAULT
+ },
+ });
+
+ StatusCode res = manager->subscribe(cb, options);
+ ASSERT_EQ(StatusCode::OK, res);
+
+ auto unsubscribedValue = objectPool->obtain(VehiclePropertyType::INT32);
+ unsubscribedValue->prop = VehicleProperty::HVAC_FAN_SPEED;
+
+ hal->sendPropEvent(std::move(unsubscribedValue));
+ auto& receivedEnvents = cb->getReceivedEvents();
+
+ ASSERT_TRUE(cb->waitForExpectedEvents(0)) << " Unexpected events received: "
+ << receivedEnvents.size()
+ << (receivedEnvents.size() > 0
+ ? toString(receivedEnvents.front()[0]) : "");
+
+ auto subscribedValue = objectPool->obtain(VehiclePropertyType::INT32);
+ subscribedValue->prop = PROP;
+ subscribedValue->value.int32Values[0] = 42;
+
+ cb->reset();
+ VehiclePropValue actualValue(*subscribedValue.get());
+ hal->sendPropEvent(std::move(subscribedValue));
+
+ ASSERT_TRUE(cb->waitForExpectedEvents(1)) << "Events received: "
+ << receivedEnvents.size();
+
+ ASSERT_EQ(toString(actualValue),
+ toString(cb->getReceivedEvents().front()[0]));
+}
+
+TEST_F(HalClientVectorTest, basic) {
+ sp<IVehicleCallback> callback1 = new MockedVehicleCallback();
+
+ sp<HalClient> c1 = new HalClient(callback1, 10, 20);
+ sp<HalClient> c2 = new HalClient(callback1, 10, 20);
+
+ clients.addOrUpdate(c1);
+ clients.addOrUpdate(c1);
+ clients.addOrUpdate(c2);
+ ASSERT_EQ(2u, clients.size());
+ ASSERT_FALSE(clients.isEmpty());
+ ASSERT_GE(0, clients.indexOf(c1));
+ ASSERT_GE(0, clients.remove(c1));
+ ASSERT_GE(0, clients.indexOf(c1));
+ ASSERT_GE(0, clients.remove(c1));
+ ASSERT_GE(0, clients.remove(c2));
+
+ ASSERT_TRUE(clients.isEmpty());
+}
+
+} // namespace anonymous
+
+} // namespace V2_0
+} // namespace vehicle
+} // namespace hardware
+} // namespace android
diff --git a/vehicle/2.0/default/tests/VehicleHalTestUtils.h b/vehicle/2.0/default/tests/VehicleHalTestUtils.h
new file mode 100644
index 0000000..b3b3ffa
--- /dev/null
+++ b/vehicle/2.0/default/tests/VehicleHalTestUtils.h
@@ -0,0 +1,244 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef android_hardware_vehicle_V2_0_VehicleDebugUtils_H_
+#define android_hardware_vehicle_V2_0_VehicleDebugUtils_H_
+
+#include <android/hardware/vehicle/2.0/types.h>
+#include <vehicle_hal_manager/VehicleUtils.h>
+#include <ios>
+#include <sstream>
+
+namespace android {
+namespace hardware {
+namespace vehicle {
+namespace V2_0 {
+
+const VehiclePropConfig kVehicleProperties[] = {
+ {
+ .prop = VehicleProperty::INFO_MAKE,
+ .access = VehiclePropertyAccess::READ,
+ .changeMode = VehiclePropertyChangeMode::STATIC,
+ .permissionModel = VehiclePermissionModel::OEM_ONLY,
+ .configString = "Some=config,options=if,you=have_any",
+ },
+
+ {
+ .prop = VehicleProperty::HVAC_FAN_SPEED,
+ .access = VehiclePropertyAccess::READ_WRITE,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
+ .permissionModel = VehiclePermissionModel::NO_RESTRICTION,
+ .supportedAreas = static_cast<int32_t>(
+ VehicleAreaZone::ROW_1_LEFT | VehicleAreaZone::ROW_1_RIGHT),
+ .areaConfigs = init_hidl_vec({
+ VehicleAreaConfig {
+ .areaId = val(
+ VehicleAreaZone::ROW_2_LEFT),
+ .minInt32Value = 1,
+ .maxInt32Value = 7},
+ VehicleAreaConfig {
+ .areaId = val(
+ VehicleAreaZone::ROW_1_RIGHT),
+ .minInt32Value = 1,
+ .maxInt32Value = 5,
+ }
+ }),
+ },
+
+ {
+ .prop = VehicleProperty::INFO_FUEL_CAPACITY,
+ .access = VehiclePropertyAccess::READ,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
+ .permissionModel = VehiclePermissionModel::OEM_ONLY,
+ .areaConfigs = init_hidl_vec({
+ VehicleAreaConfig {
+ .minFloatValue = 0,
+ .maxFloatValue = 1.0
+ }
+ })
+ },
+
+ {
+ .prop = VehicleProperty::DISPLAY_BRIGHTNESS,
+ .access = VehiclePropertyAccess::READ_WRITE,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
+ .permissionModel = VehiclePermissionModel::OEM_ONLY,
+ .areaConfigs = init_hidl_vec({
+ VehicleAreaConfig {
+ .minInt32Value = 0,
+ .maxInt32Value = 10
+ }
+ })
+ }
+};
+
+constexpr auto kTimeout = std::chrono::milliseconds(500);
+
+class MockedVehicleCallback : public IVehicleCallback {
+public:
+ // Methods from ::android::hardware::vehicle::V2_0::IVehicleCallback follow.
+ Return<void> onPropertyEvent(
+ const hidl_vec<VehiclePropValue>& values) override {
+ {
+ MuxGuard g(mLock);
+ mReceivedEvents.push_back(values);
+ }
+ mEventCond.notify_one();
+ return Return<void>();
+ }
+ Return<void> onPropertySet(const VehiclePropValue& value) override {
+ return Return<void>();
+ }
+ Return<void> onError(StatusCode errorCode,
+ VehicleProperty propId,
+ VehiclePropertyOperation operation) override {
+ return Return<void>();
+ }
+
+ bool waitForExpectedEvents(size_t expectedEvents) {
+ std::unique_lock<std::mutex> g(mLock);
+
+ if (expectedEvents == 0 && mReceivedEvents.size() == 0) {
+ // No events expected, let's sleep a little bit to make sure
+ // nothing will show up.
+ return mEventCond.wait_for(g, kTimeout) == std::cv_status::timeout;
+ }
+
+ while (expectedEvents != mReceivedEvents.size()) {
+ if (mEventCond.wait_for(g, kTimeout) == std::cv_status::timeout) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ void reset() {
+ mReceivedEvents.clear();
+ }
+
+ const std::vector<hidl_vec<VehiclePropValue>>& getReceivedEvents() {
+ return mReceivedEvents;
+ }
+
+private:
+ using MuxGuard = std::lock_guard<std::mutex>;
+
+ std::mutex mLock;
+ std::condition_variable mEventCond;
+ std::vector<hidl_vec<VehiclePropValue>> mReceivedEvents;
+};
+
+template<typename T>
+inline std::string hexString(T value) {
+ std::stringstream ss;
+ ss << std::showbase << std::hex << value;
+ return ss.str();
+}
+
+template <typename T, typename Collection>
+inline void assertAllExistsAnyOrder(
+ std::initializer_list<T> expected,
+ const Collection& actual,
+ const char* msg) {
+ std::set<T> expectedSet = expected;
+
+ for (auto a: actual) {
+ ASSERT_EQ(1u, expectedSet.erase(a))
+ << msg << "\nContains not unexpected value.\n";
+ }
+
+ ASSERT_EQ(0u, expectedSet.size())
+ << msg
+ << "\nDoesn't contain expected value.";
+}
+
+#define ASSERT_ALL_EXISTS(...) \
+ assertAllExistsAnyOrder(__VA_ARGS__, (std::string("Called from: ") + \
+ std::string(__FILE__) + std::string(":") + \
+ std::to_string(__LINE__)).c_str()); \
+
+template<typename T>
+inline std::string enumToHexString(T value) {
+ return hexString(val(value));
+}
+
+template <typename T>
+inline std::string toString(const hidl_vec<T>& vec) {
+ std::stringstream ss("[");
+ for (size_t i = 0; i < vec.size(); i++) {
+ if (i != 0) ss << ",";
+ ss << vec[i];
+ }
+ ss << "]";
+ return ss.str();
+}
+
+inline std::string toString(const VehiclePropValue &v) {
+ std::stringstream ss;
+ ss << "VehiclePropValue {n"
+ << " prop: " << enumToHexString(v.prop) << ",\n"
+ << " areaId: " << hexString(v.areaId) << ",\n"
+ << " timestamp: " << v.timestamp << ",\n"
+ << " value {\n"
+ << " int32Values: " << toString(v.value.int32Values) << ",\n"
+ << " floatValues: " << toString(v.value.floatValues) << ",\n"
+ << " int64Values: " << toString(v.value.int64Values) << ",\n"
+ << " bytes: " << toString(v.value.bytes) << ",\n"
+ << " string: " << v.value.stringValue.c_str() << ",\n"
+ << " }\n"
+ << "}\n";
+
+ return ss.str();
+}
+
+inline std::string toString(const VehiclePropConfig &config) {
+ std::stringstream ss;
+ ss << "VehiclePropConfig {\n"
+ << " prop: " << enumToHexString(config.prop) << ",\n"
+ << " supportedAreas: " << hexString(config.supportedAreas) << ",\n"
+ << " access: " << enumToHexString(config.access) << ",\n"
+ << " permissionModel: " << enumToHexString(config.permissionModel) << ",\n"
+ << " changeMode: " << enumToHexString(config.changeMode) << ",\n"
+ << " configFlags: " << hexString(config.configFlags) << ",\n"
+ << " minSampleRate: " << config.minSampleRate << ",\n"
+ << " maxSampleRate: " << config.maxSampleRate << ",\n"
+ << " configString: " << config.configString.c_str() << ",\n";
+
+ ss << " areaConfigs {\n";
+ for (size_t i = 0; i < config.areaConfigs.size(); i++) {
+ const auto &area = config.areaConfigs[i];
+ ss << " areaId: " << hexString(area.areaId) << ",\n"
+ << " minFloatValue: " << area.minFloatValue << ",\n"
+ << " minFloatValue: " << area.maxFloatValue << ",\n"
+ << " minInt32Value: " << area.minInt32Value << ",\n"
+ << " minInt32Value: " << area.maxInt32Value << ",\n"
+ << " minInt64Value: " << area.minInt64Value << ",\n"
+ << " minInt64Value: " << area.maxInt64Value << ",\n";
+ }
+ ss << " }\n"
+ << "}\n";
+
+ return ss.str();
+}
+
+
+} // namespace V2_0
+} // namespace vehicle
+} // namespace hardware
+} // namespace android
+
+
+#endif //VEHICLEHALDEBUGUTILS_H
diff --git a/vehicle/2.0/default/tests/VehicleObjectPool_test.cpp b/vehicle/2.0/default/tests/VehicleObjectPool_test.cpp
new file mode 100644
index 0000000..88b1be0
--- /dev/null
+++ b/vehicle/2.0/default/tests/VehicleObjectPool_test.cpp
@@ -0,0 +1,128 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <thread>
+
+#include <gtest/gtest.h>
+
+#include <vehicle_hal_manager/VehicleObjectPool.h>
+#include <utils/SystemClock.h>
+
+namespace android {
+namespace hardware {
+namespace vehicle {
+namespace V2_0 {
+
+namespace {
+
+class VehicleObjectPoolTest : public ::testing::Test {
+protected:
+ void SetUp() override {
+ stats = PoolStats::instance();
+ resetStats();
+ valuePool.reset(new VehiclePropValuePool);
+ }
+
+ void TearDown() override {
+ // At the end, all created objects should be either recycled or deleted.
+ // Some objects could be recycled multiple times, that's why it's <=
+ ASSERT_EQ(stats->Obtained, stats->Recycled);
+ ASSERT_LE(stats->Created, stats->Recycled);
+ }
+private:
+ void resetStats() {
+ stats->Obtained = 0;
+ stats->Created = 0;
+ stats->Recycled = 0;
+ }
+
+public:
+ PoolStats* stats;
+ std::unique_ptr<VehiclePropValuePool> valuePool;
+};
+
+TEST_F(VehicleObjectPoolTest, valuePoolBasicCorrectness) {
+ void* raw = valuePool->obtain(VehiclePropertyType::INT32).get();
+ // At this point, v1 should be recycled and the only object in the pool.
+ ASSERT_EQ(raw, valuePool->obtain(VehiclePropertyType::INT32).get());
+ // Obtaining value of another type - should return a new object
+ ASSERT_NE(raw, valuePool->obtain(VehiclePropertyType::FLOAT).get());
+
+ ASSERT_EQ(3u, stats->Obtained);
+ ASSERT_EQ(2u, stats->Created);
+}
+
+TEST_F(VehicleObjectPoolTest, valuePoolStrings) {
+ valuePool->obtain(VehiclePropertyType::STRING);
+ auto vs = valuePool->obtain(VehiclePropertyType::STRING);
+ vs->value.stringValue = "Hello";
+ void* raw = vs.get();
+ vs.reset(); // delete the pointer
+
+ auto vs2 = valuePool->obtain(VehiclePropertyType::STRING);
+ ASSERT_EQ(0u, vs2->value.stringValue.size());
+ ASSERT_NE(raw, valuePool->obtain(VehiclePropertyType::STRING).get());
+
+ ASSERT_EQ(0u, stats->Obtained);
+}
+
+TEST_F(VehicleObjectPoolTest, valuePoolMultithreadedBenchmark) {
+ // In this test we have T threads that concurrently in C cycles
+ // obtain and release O VehiclePropValue objects of FLOAT / INT32 types.
+
+ const auto T = 2;
+ const auto C = 500;
+ const auto O = 100;
+
+ auto poolPtr = valuePool.get();
+
+ std::vector<std::thread> threads;
+ auto start = elapsedRealtimeNano();
+ for (int i = 0; i < T; i++) {
+ threads.push_back(std::thread([&poolPtr] () {
+ for (int j = 0; j < C; j++) {
+ std::vector<recyclable_ptr<VehiclePropValue>> vec;
+ for (int k = 0; k < O; k++) {
+ vec.push_back(
+ poolPtr->obtain(k % 2 == 0
+ ? VehiclePropertyType::FLOAT
+ : VehiclePropertyType::INT32));
+ }
+ }
+ }));
+ }
+
+ for (auto& t : threads) {
+ t.join();
+ }
+ auto finish = elapsedRealtimeNano();
+
+ ASSERT_EQ(T * C * O, stats->Obtained);
+ ASSERT_EQ(T * C * O, stats->Recycled);
+ // Created less than obtained.
+ ASSERT_GE(T * O, stats->Created);
+
+ auto elapsedMs = (finish - start) / 1000000;
+ ASSERT_GE(1000, elapsedMs); // Less a second to access 100K objects.
+ // Typically it takes about 0.1s on Nexus6P.
+}
+
+} // namespace anonymous
+
+} // namespace V2_0
+} // namespace vehicle
+} // namespace hardware
+} // namespace android
diff --git a/vehicle/2.0/default/tests/VehiclePropConfigIndex_test.cpp b/vehicle/2.0/default/tests/VehiclePropConfigIndex_test.cpp
new file mode 100644
index 0000000..aae7e62
--- /dev/null
+++ b/vehicle/2.0/default/tests/VehiclePropConfigIndex_test.cpp
@@ -0,0 +1,75 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <gtest/gtest.h>
+
+#include <vehicle_hal_manager/VehiclePropConfigIndex.h>
+
+#include "VehicleHalTestUtils.h"
+
+namespace android {
+namespace hardware {
+namespace vehicle {
+namespace V2_0 {
+
+namespace {
+
+class PropConfigTest : public ::testing::Test {
+protected:
+ void SetUp() override {
+ configs.assign(std::begin(kVehicleProperties),
+ std::end(kVehicleProperties));
+ }
+
+ void TearDown() override {}
+
+public:
+ std::vector<VehiclePropConfig> configs;
+};
+
+TEST_F(PropConfigTest, hasConfig) {
+ VehiclePropConfigIndex index(configs);
+
+ ASSERT_TRUE(index.hasConfig(VehicleProperty::HVAC_FAN_SPEED));
+ ASSERT_TRUE(index.hasConfig(VehicleProperty::INFO_MAKE));
+ ASSERT_TRUE(index.hasConfig(VehicleProperty::INFO_FUEL_CAPACITY));
+
+ ASSERT_FALSE(index.hasConfig(VehicleProperty::INVALID));
+}
+
+TEST_F(PropConfigTest, getAllConfig) {
+ VehiclePropConfigIndex index(configs);
+
+ std::vector<VehiclePropConfig> actualConfigs = index.getAllConfigs();
+ ASSERT_EQ(configs.size(), actualConfigs.size());
+
+ for (size_t i = 0; i < actualConfigs.size(); i++) {
+ ASSERT_EQ(toString(configs[i]), toString(actualConfigs[i]));
+ }
+}
+
+TEST_F(PropConfigTest, getConfigs) {
+ VehiclePropConfigIndex index(configs);
+ auto actualConfig = index.getConfig(VehicleProperty::HVAC_FAN_SPEED);
+ ASSERT_EQ(toString(configs[1]), toString(actualConfig));
+}
+
+} // namespace anonymous
+
+} // namespace V2_0
+} // namespace vehicle
+} // namespace hardware
+} // namespace android
\ No newline at end of file
diff --git a/vehicle/2.0/default/vehicle_hal_manager/ConcurrentQueue.h b/vehicle/2.0/default/vehicle_hal_manager/ConcurrentQueue.h
new file mode 100644
index 0000000..a64ef46
--- /dev/null
+++ b/vehicle/2.0/default/vehicle_hal_manager/ConcurrentQueue.h
@@ -0,0 +1,160 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef android_hardware_vehicle_V2_0_ConcurrentQueue_H_
+#define android_hardware_vehicle_V2_0_ConcurrentQueue_H_
+
+#include <queue>
+#include <atomic>
+#include <thread>
+#include <condition_variable>
+#include <iostream>
+
+namespace android {
+
+template<typename T>
+class ConcurrentQueue {
+public:
+ void waitForItems() {
+ std::unique_lock<std::mutex> g(mLock);
+ while (mQueue.empty() && mIsActive) {
+ mCond.wait(g);
+ }
+ }
+
+ std::vector<T> flush() {
+ std::vector<T> items;
+
+ MuxGuard g(mLock);
+ if (mQueue.empty() || !mIsActive) {
+ return items;
+ }
+ while (!mQueue.empty()) {
+ items.push_back(std::move(mQueue.front()));
+ mQueue.pop();
+ }
+ return items;
+ }
+
+ void push(T&& item) {
+ {
+ MuxGuard g(mLock);
+ if (!mIsActive) {
+ return;
+ }
+ mQueue.push(std::move(item));
+ }
+ mCond.notify_one();
+ }
+
+ /* Deactivates the queue, thus no one can push items to it, also
+ * notifies all waiting thread.
+ */
+ void deactivate() {
+ {
+ MuxGuard g(mLock);
+ mIsActive = false;
+ }
+ mCond.notify_all(); // To unblock all waiting consumers.
+ }
+
+ ConcurrentQueue() = default;
+
+ ConcurrentQueue(const ConcurrentQueue &) = delete;
+ ConcurrentQueue &operator=(const ConcurrentQueue &) = delete;
+private:
+ using MuxGuard = std::lock_guard<std::mutex>;
+
+ bool mIsActive = true;
+ mutable std::mutex mLock;
+ std::condition_variable mCond;
+ std::queue<T> mQueue;
+};
+
+template<typename T>
+class BatchingConsumer {
+private:
+ enum class State {
+ INIT = 0,
+ RUNNING = 1,
+ STOP_REQUESTED = 2,
+ STOPPED = 3,
+ };
+
+public:
+ BatchingConsumer() : mState(State::INIT) {}
+
+ BatchingConsumer(const BatchingConsumer &) = delete;
+ BatchingConsumer &operator=(const BatchingConsumer &) = delete;
+
+ using OnBatchReceivedFunc = std::function<void(const std::vector<T>& vec)>;
+
+ void run(ConcurrentQueue<T>* queue,
+ std::chrono::nanoseconds batchInterval,
+ const OnBatchReceivedFunc& func) {
+ mQueue = queue;
+ mBatchInterval = batchInterval;
+
+ std::thread(&BatchingConsumer<T>::runInternal, this, func).detach();
+ }
+
+ void requestStop() {
+ if (mState.exchange(State::STOP_REQUESTED) != State::RUNNING) {
+ mState = State::STOPPED;
+ }
+ }
+
+ void waitStopped() {
+ std::unique_lock<std::mutex> g(mLock);
+ while (State::STOPPED != mState) {
+ mCondStopped.wait_for(g, std::chrono::seconds(1));
+ }
+ }
+
+private:
+ void runInternal(const OnBatchReceivedFunc& onBatchReceived) {
+ if (mState.exchange(State::RUNNING) == State::INIT) {
+ while (State::RUNNING == mState) {
+ mQueue->waitForItems();
+ if (State::STOP_REQUESTED == mState) break;
+
+ std::this_thread::sleep_for(mBatchInterval);
+ if (State::STOP_REQUESTED == mState) break;
+
+ std::vector<T> items = mQueue->flush();
+
+ if (items.size() > 0) {
+ onBatchReceived(items);
+ }
+ }
+ }
+
+ mState = State::STOPPED;
+ mCondStopped.notify_one();
+ }
+
+private:
+ std::mutex mLock;
+ std::condition_variable mCondStopped;
+
+ std::atomic<State> mState;
+ std::chrono::nanoseconds mBatchInterval;
+ ConcurrentQueue<T>* mQueue;
+};
+
+} // namespace android
+
+#endif //android_hardware_vehicle_V2_0_ConcurrentQueue_H_
diff --git a/vehicle/2.0/default/vehicle_hal_manager/SubscriptionManager.cpp b/vehicle/2.0/default/vehicle_hal_manager/SubscriptionManager.cpp
new file mode 100644
index 0000000..0d2180f
--- /dev/null
+++ b/vehicle/2.0/default/vehicle_hal_manager/SubscriptionManager.cpp
@@ -0,0 +1,255 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#define LOG_TAG "android.hardware.vehicle@2.0-impl"
+
+#include <cmath>
+
+#include <utils/Errors.h>
+
+#include "VehicleUtils.h"
+#include "SubscriptionManager.h"
+
+namespace android {
+namespace hardware {
+namespace vehicle {
+namespace V2_0 {
+
+bool mergeSubscribeOptions(const SubscribeOptions &oldOpts,
+ const SubscribeOptions &newOpts,
+ SubscribeOptions *outResult) {
+
+ int32_t updatedAreas = oldOpts.vehicleAreas;
+ if (updatedAreas != kAllSupportedAreas) {
+ updatedAreas = newOpts.vehicleAreas != kAllSupportedAreas
+ ? updatedAreas | newOpts.vehicleAreas
+ : kAllSupportedAreas;
+ }
+
+ float updatedRate = std::max(oldOpts.sampleRate, newOpts.sampleRate);
+ SubscribeFlags updatedFlags = oldOpts.flags | newOpts.flags;
+
+ bool updated = updatedRate > oldOpts.sampleRate
+ || updatedAreas != oldOpts.vehicleAreas
+ || updatedFlags != oldOpts.flags;
+ if (updated) {
+ *outResult = oldOpts;
+ outResult->vehicleAreas = updatedAreas;
+ outResult->sampleRate = updatedRate;
+ outResult->flags = updatedFlags;
+ }
+
+ return updated;
+}
+
+void HalClient::addOrUpdateSubscription(const SubscribeOptions &opts) {
+ auto it = mSubscriptions.find(opts.propId);
+ if (it == mSubscriptions.end()) {
+ mSubscriptions.emplace(opts.propId, opts);
+ } else {
+ const SubscribeOptions& oldOpts = it->second;
+ SubscribeOptions updatedOptions;
+ if (mergeSubscribeOptions(oldOpts, opts, &updatedOptions)) {
+ mSubscriptions.erase(it);
+ mSubscriptions.emplace(opts.propId, updatedOptions);
+ }
+ }
+}
+
+bool HalClient::isSubscribed(VehicleProperty propId, int32_t areaId, SubscribeFlags flags) {
+ auto it = mSubscriptions.find(propId);
+ if (it == mSubscriptions.end()) {
+ return false;
+ }
+ const SubscribeOptions& opts = it->second;
+ bool res = (opts.flags & flags)
+ && (opts.vehicleAreas == 0 || areaId == 0 || opts.vehicleAreas & areaId);
+ return res;
+}
+
+std::list<SubscribeOptions> SubscriptionManager::addOrUpdateSubscription(
+ const sp<IVehicleCallback> &callback,
+ const hidl_vec<SubscribeOptions> &optionList) {
+ std::list<SubscribeOptions> updatedSubscriptions;
+
+ MuxGuard g(mLock);
+
+ const sp<HalClient>& client = getOrCreateHalClientLocked(callback);
+
+ for (size_t i = 0; i < optionList.size(); i++) {
+ const SubscribeOptions& opts = optionList[i];
+ client->addOrUpdateSubscription(opts);
+
+ addClientToPropMapLocked(opts.propId, client);
+
+ if (SubscribeFlags::HAL_EVENT & opts.flags) {
+ SubscribeOptions updated;
+ if (updateHalEventSubscriptionLocked(opts, &updated)) {
+ updatedSubscriptions.push_back(updated);
+ }
+ }
+ }
+
+ return updatedSubscriptions;
+}
+
+std::list<HalClientValues> SubscriptionManager::distributeValuesToClients(
+ const std::vector<recyclable_ptr<VehiclePropValue>>& propValues,
+ SubscribeFlags flags) const {
+ std::map<sp<HalClient>, std::list<VehiclePropValue*>> clientValuesMap;
+
+ {
+ MuxGuard g(mLock);
+ for (const auto& propValue: propValues) {
+ VehiclePropValue* v = propValue.get();
+ auto clients = getSubscribedClientsLocked(
+ v->prop, v->areaId, flags);
+ for (const auto& client : clients) {
+ clientValuesMap[client].push_back(v);
+ }
+ }
+ }
+
+ std::list<HalClientValues> clientValues;
+ for (const auto& entry : clientValuesMap) {
+ clientValues.push_back(HalClientValues {
+ .client = entry.first,
+ .values = entry.second
+ });
+ }
+
+ return clientValues;
+}
+
+std::list<sp<HalClient>> SubscriptionManager::getSubscribedClients(
+ VehicleProperty propId, int32_t area, SubscribeFlags flags) const {
+ MuxGuard g(mLock);
+ return getSubscribedClientsLocked(propId, area, flags);
+}
+
+std::list<sp<HalClient>> SubscriptionManager::getSubscribedClientsLocked(
+ VehicleProperty propId, int32_t area, SubscribeFlags flags) const {
+ std::list<sp<HalClient>> subscribedClients;
+
+ sp<HalClientVector> propClients = getClientsForPropertyLocked(propId);
+ if (propClients.get() != nullptr) {
+ for (size_t i = 0; i < propClients->size(); i++) {
+ const auto& client = propClients->itemAt(i);
+ if (client->isSubscribed(propId, area, flags)) {
+ subscribedClients.push_back(client);
+ }
+ }
+ }
+
+ return subscribedClients;
+}
+
+bool SubscriptionManager::updateHalEventSubscriptionLocked(
+ const SubscribeOptions &opts, SubscribeOptions *outUpdated) {
+ bool updated = false;
+ auto it = mHalEventSubscribeOptions.find(opts.propId);
+ if (it == mHalEventSubscribeOptions.end()) {
+ *outUpdated = opts;
+ mHalEventSubscribeOptions.emplace(opts.propId, opts);
+ updated = true;
+ } else {
+ const SubscribeOptions& oldOpts = it->second;
+
+ if (mergeSubscribeOptions(oldOpts, opts, outUpdated)) {
+ mHalEventSubscribeOptions.erase(opts.propId);
+ mHalEventSubscribeOptions.emplace(opts.propId, *outUpdated);
+ updated = true;
+ }
+ }
+
+ return updated;
+}
+
+void SubscriptionManager::addClientToPropMapLocked(
+ VehicleProperty propId, const sp<HalClient> &client) {
+ auto it = mPropToClients.find(propId);
+ sp<HalClientVector> propClients;
+ if (it == mPropToClients.end()) {
+ propClients = new HalClientVector();
+ mPropToClients.insert(std::make_pair(propId, propClients));
+ } else {
+ propClients = it->second;
+ }
+ propClients->addOrUpdate(client);
+}
+
+sp<HalClientVector> SubscriptionManager::getClientsForPropertyLocked(
+ VehicleProperty propId) const {
+ auto it = mPropToClients.find(propId);
+ return it == mPropToClients.end() ? nullptr : it->second;
+}
+
+sp<HalClient> SubscriptionManager::getOrCreateHalClientLocked(
+ const sp<IVehicleCallback>& callback) {
+ auto it = mClients.find(callback);
+ if (it == mClients.end()) {
+ IPCThreadState* self = IPCThreadState::self();
+ pid_t pid = self->getCallingPid();
+ uid_t uid = self->getCallingUid();
+ sp<HalClient> client = new HalClient(callback, pid, uid);
+ mClients.emplace(callback, client);
+ return client;
+ } else {
+ return it->second;
+ }
+}
+
+bool SubscriptionManager::unsubscribe(const sp<IVehicleCallback>& callback,
+ VehicleProperty propId) {
+ MuxGuard g(mLock);
+ auto propertyClients = getClientsForPropertyLocked(propId);
+ auto clientIter = mClients.find(callback);
+ if (clientIter == mClients.end()) {
+ ALOGW("Unable to unsubscribe: no callback found, propId: 0x%x", propId);
+ } else {
+ auto client = clientIter->second;
+
+ if (propertyClients != nullptr) {
+ propertyClients->remove(client);
+
+ if (propertyClients->isEmpty()) {
+ mPropToClients.erase(propId);
+ }
+ }
+
+ bool isClientSubscribedToOtherProps = false;
+ for (const auto& propClient : mPropToClients) {
+ if (propClient.second->indexOf(client) >= 0) {
+ isClientSubscribedToOtherProps = true;
+ break;
+ }
+ }
+
+ if (!isClientSubscribedToOtherProps) {
+ mClients.erase(clientIter);
+ }
+ }
+
+ return (propertyClients == nullptr || propertyClients->isEmpty())
+ ? mHalEventSubscribeOptions.erase(propId) == 1
+ : false;
+}
+
+
+} // namespace V2_0
+} // namespace vehicle
+} // namespace hardware
+} // namespace android
diff --git a/vehicle/2.0/default/vehicle_hal_manager/SubscriptionManager.h b/vehicle/2.0/default/vehicle_hal_manager/SubscriptionManager.h
new file mode 100644
index 0000000..903bde5
--- /dev/null
+++ b/vehicle/2.0/default/vehicle_hal_manager/SubscriptionManager.h
@@ -0,0 +1,147 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef android_hardware_vehicle_V2_0_SubscriptionManager_H_
+#define android_hardware_vehicle_V2_0_SubscriptionManager_H_
+
+#include <memory>
+#include <map>
+#include <set>
+#include <list>
+
+#include <utils/Log.h>
+#include <hwbinder/IPCThreadState.h>
+
+#include <android/hardware/vehicle/2.0/IVehicle.h>
+
+#include "ConcurrentQueue.h"
+#include "VehicleObjectPool.h"
+
+namespace android {
+namespace hardware {
+namespace vehicle {
+namespace V2_0 {
+
+class HalClient : public android::RefBase {
+public:
+ HalClient(const sp<IVehicleCallback> &callback,
+ int32_t pid,
+ int32_t uid)
+ : mCallback(callback), mPid(pid), mUid(uid) {}
+
+ virtual ~HalClient() {}
+public:
+ sp<IVehicleCallback> getCallback() const {
+ return mCallback;
+ }
+
+ void addOrUpdateSubscription(const SubscribeOptions &opts);
+
+ bool isSubscribed(VehicleProperty propId,
+ int32_t areaId,
+ SubscribeFlags flags);
+
+private:
+ const sp<IVehicleCallback> mCallback;
+ const int32_t mPid;
+ const int32_t mUid;
+
+ std::map<VehicleProperty, SubscribeOptions> mSubscriptions;
+};
+
+class HalClientVector : private SortedVector<sp<HalClient>> , public RefBase {
+public:
+ virtual ~HalClientVector() {}
+
+ inline void addOrUpdate(const sp<HalClient> &client) {
+ SortedVector::add(client);
+ }
+
+ using SortedVector::remove;
+ using SortedVector::size;
+ using SortedVector::indexOf;
+ using SortedVector::itemAt;
+ using SortedVector::isEmpty;
+};
+
+struct HalClientValues {
+ sp<HalClient> client;
+ std::list<VehiclePropValue *> values;
+};
+
+class SubscriptionManager {
+public:
+ virtual ~SubscriptionManager() {}
+
+ /**
+ * Updates subscription. Returns the vector of properties subscription that
+ * needs to be updated in VehicleHAL.
+ */
+ std::list<SubscribeOptions> addOrUpdateSubscription(
+ const sp<IVehicleCallback>& callback,
+ const hidl_vec<SubscribeOptions>& optionList);
+
+ /**
+ * Returns a list of IVehicleCallback -> list of VehiclePropValue ready for
+ * dispatching to its clients.
+ */
+ std::list<HalClientValues> distributeValuesToClients(
+ const std::vector<recyclable_ptr<VehiclePropValue>>& propValues,
+ SubscribeFlags flags) const;
+
+ std::list<sp<HalClient>> getSubscribedClients(
+ VehicleProperty propId, int32_t area, SubscribeFlags flags) const;
+
+ /**
+ * Returns true the client was unsubscribed successfully and there are
+ * no more clients subscribed to given propId.
+ */
+ bool unsubscribe(const sp<IVehicleCallback>& callback,
+ VehicleProperty propId);
+private:
+ std::list<sp< HalClient>> getSubscribedClientsLocked(
+ VehicleProperty propId, int32_t area, SubscribeFlags flags) const;
+
+ bool updateHalEventSubscriptionLocked(const SubscribeOptions &opts,
+ SubscribeOptions *out);
+
+ void addClientToPropMapLocked(VehicleProperty propId,
+ const sp<HalClient> &client);
+
+ sp<HalClientVector> getClientsForPropertyLocked(
+ VehicleProperty propId) const;
+
+ sp<HalClient> getOrCreateHalClientLocked(
+ const sp<IVehicleCallback> &callback);
+
+private:
+ using MuxGuard = std::lock_guard<std::mutex>;
+
+ mutable std::mutex mLock;
+
+ std::map<sp<IVehicleCallback>, sp<HalClient>> mClients;
+ std::map<VehicleProperty, sp<HalClientVector>> mPropToClients;
+ std::map<VehicleProperty, SubscribeOptions> mHalEventSubscribeOptions;
+};
+
+
+} // namespace V2_0
+} // namespace vehicle
+} // namespace hardware
+} // namespace android
+
+
+#endif // android_hardware_vehicle_V2_0_SubscriptionManager_H_
diff --git a/vehicle/2.0/default/VehicleCallback.cpp b/vehicle/2.0/default/vehicle_hal_manager/VehicleCallback.cpp
similarity index 100%
rename from vehicle/2.0/default/VehicleCallback.cpp
rename to vehicle/2.0/default/vehicle_hal_manager/VehicleCallback.cpp
diff --git a/vehicle/2.0/default/VehicleCallback.h b/vehicle/2.0/default/vehicle_hal_manager/VehicleCallback.h
similarity index 100%
rename from vehicle/2.0/default/VehicleCallback.h
rename to vehicle/2.0/default/vehicle_hal_manager/VehicleCallback.h
diff --git a/vehicle/2.0/default/vehicle_hal_manager/VehicleHalManager.cpp b/vehicle/2.0/default/vehicle_hal_manager/VehicleHalManager.cpp
new file mode 100644
index 0000000..8638131
--- /dev/null
+++ b/vehicle/2.0/default/vehicle_hal_manager/VehicleHalManager.cpp
@@ -0,0 +1,260 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#define LOG_TAG "android.hardware.vehicle@2.0-impl"
+
+#include <cmath>
+
+#include <utils/Errors.h>
+#include <utils/Log.h>
+#include <hidl/Status.h>
+
+#include "VehicleHalManager.h"
+
+namespace android {
+namespace hardware {
+namespace vehicle {
+namespace V2_0 {
+
+using namespace std::placeholders;
+
+constexpr std::chrono::milliseconds kHalEventBatchingTimeWindow(10);
+
+/**
+ * Indicates what's the maximum size of hidl_vec<VehiclePropValue> we want
+ * to store in reusable object pool.
+ */
+constexpr auto kMaxHidlVecOfVehiclPropValuePoolSize = 20;
+
+Return<void> VehicleHalManager::getAllPropConfigs(
+ getAllPropConfigs_cb _hidl_cb) {
+ hidl_vec<VehiclePropConfig> hidlConfigs;
+ auto& halConfig = mConfigIndex->getAllConfigs();
+
+ hidlConfigs.setToExternal(
+ const_cast<VehiclePropConfig *>(halConfig.data()),
+ halConfig.size());
+
+ _hidl_cb(hidlConfigs);
+
+ return hardware::Return<void>();
+}
+
+Return<void> VehicleHalManager::getPropConfigs(
+ const hidl_vec<VehicleProperty> &properties,
+ getPropConfigs_cb _hidl_cb) {
+ Vector<VehiclePropConfig> configs;
+ for (size_t i = 0; i < properties.size(); i++) {
+ VehicleProperty prop = properties[i];
+ if (mConfigIndex->hasConfig(prop)) {
+ configs.add(mConfigIndex->getConfig(prop));
+ } else {
+ // TODO: return error
+ }
+ }
+
+ hidl_vec<VehiclePropConfig> hidlConfigs;
+ hidlConfigs.setToExternal(
+ const_cast<VehiclePropConfig*>(configs.array()),
+ configs.size());
+
+ _hidl_cb(hidlConfigs);
+
+ return hardware::Return<void>();
+}
+
+Return<void> VehicleHalManager::get(
+ VehicleProperty propId, int32_t areaId, get_cb _hidl_cb) {
+
+ return hardware::Return<void>();
+}
+
+Return<StatusCode> VehicleHalManager::set(const VehiclePropValue &value) {
+ // TODO(pavelm): check permission, etc
+ // TODO(pavelm): check SET subscription
+ // TODO(pavelm): propagate SET call to VehicleHal
+ return hardware::Return<StatusCode>(StatusCode::OK);
+}
+
+Return<StatusCode> VehicleHalManager::subscribe(
+ const sp<IVehicleCallback> &callback,
+ const hidl_vec<SubscribeOptions> &options) {
+ hidl_vec<SubscribeOptions> verifiedOptions(options);
+ for (size_t i = 0; i < verifiedOptions.size(); i++) {
+ SubscribeOptions& ops = verifiedOptions[i];
+ VehicleProperty prop = ops.propId;
+
+ if (!mConfigIndex->hasConfig(prop)) {
+ ALOGE("Failed to subscribe: config not found for property: 0x%x",
+ prop);
+ return invalidArg();
+ }
+ const VehiclePropConfig& config = mConfigIndex->getConfig(prop);
+
+ if (!isSubscribable(config)) {
+ ALOGE("Failed to subscribe: property is not subscribable: 0x%x",
+ prop);
+ return invalidArg();
+ }
+
+
+ int32_t areas = isGlobalProp(prop) ? 0 : ops.vehicleAreas;
+ if (areas != 0 && ((areas & config.supportedAreas) != areas)) {
+ ALOGE("Failed to subscribe property 0x%x. Requested areas 0x%x are "
+ "out of supported range of 0x%x", prop, ops.vehicleAreas,
+ config.supportedAreas);
+ return invalidArg();
+ }
+
+ ops.vehicleAreas = areas;
+ ops.sampleRate = checkSampleRate(config, ops.sampleRate);
+ }
+
+ std::list<SubscribeOptions> updatedOptions =
+ mSubscriptionManager.addOrUpdateSubscription(callback,
+ verifiedOptions);
+
+ for (auto opt : updatedOptions) {
+ mHal->subscribe(opt.propId, opt.vehicleAreas, opt.sampleRate);
+ }
+
+ // TODO(pavelm): call immediately onHalEvent method during subscription
+ // when appropriate
+ // TODO(pavelm): link to death callback (not implemented yet in HIDL)
+
+ return ok();
+}
+
+Return<StatusCode> VehicleHalManager::unsubscribe(
+ const sp<IVehicleCallback>& callback, VehicleProperty propId) {
+ if (mSubscriptionManager.unsubscribe(callback, propId)) {
+ mHal->unsubscribe(propId);
+ }
+ return ok();
+}
+
+Return<void> VehicleHalManager::debugDump(IVehicle::debugDump_cb _hidl_cb) {
+ _hidl_cb("");
+ return hardware::Return<void>();
+}
+
+void VehicleHalManager::init() {
+ ALOGI("VehicleHalManager::init");
+
+ mHidlVecOfVehiclePropValuePool.resize(kMaxHidlVecOfVehiclPropValuePoolSize);
+
+ mBatchingConsumer.run(&mEventQueue,
+ kHalEventBatchingTimeWindow,
+ std::bind(&VehicleHalManager::onBatchHalEvent,
+ this, _1));
+
+ mHal->init(&mValueObjectPool,
+ std::bind(&VehicleHalManager::onHalEvent, this, _1),
+ std::bind(&VehicleHalManager::onHalError, this, _1, _2, _3));
+
+ // Initialize index with vehicle configurations received from VehicleHal.
+ mConfigIndex.reset(new VehiclePropConfigIndex(mHal->listProperties()));
+}
+
+VehicleHalManager::~VehicleHalManager() {
+ mBatchingConsumer.requestStop();
+ mEventQueue.deactivate();
+ // We have to wait until consumer thread is fully stopped because it may
+ // be in a state of running callback (onBatchHalEvent).
+ mBatchingConsumer.waitStopped();
+ ALOGI("VehicleHalManager::dtor");
+}
+
+void VehicleHalManager::onHalEvent(VehiclePropValuePtr v) {
+ mEventQueue.push(std::move(v));
+}
+
+void VehicleHalManager::onHalError(VehicleProperty property, status_t errorCode,
+ VehiclePropertyOperation operation) {
+ // TODO(pavelm): find subscribed clients and propagate error
+}
+
+void VehicleHalManager::onBatchHalEvent(
+ const std::vector<VehiclePropValuePtr>& values) {
+ const auto& clientValues = mSubscriptionManager.distributeValuesToClients(
+ values, SubscribeFlags::HAL_EVENT);
+
+ for (const HalClientValues& cv : clientValues) {
+ int vecSize = cv.values.size();
+ hidl_vec<VehiclePropValue> vec;
+ if (vecSize < kMaxHidlVecOfVehiclPropValuePoolSize) {
+ vec.setToExternal(&mHidlVecOfVehiclePropValuePool[0], vecSize);
+ } else {
+ vec.resize(vecSize);
+ }
+
+ int i = 0;
+ for (VehiclePropValue* pValue : cv.values) {
+ shallowCopy(&(vec)[i++], *pValue);
+ }
+ cv.client->getCallback()->onPropertyEvent(vec);
+ }
+}
+
+bool VehicleHalManager::isSampleRateFixed(VehiclePropertyChangeMode mode) {
+ return (mode & VehiclePropertyChangeMode::ON_SET)
+ || (mode & VehiclePropertyChangeMode::ON_CHANGE);
+}
+
+float VehicleHalManager::checkSampleRate(const VehiclePropConfig &config,
+ float sampleRate) {
+ if (isSampleRateFixed(config.changeMode)) {
+ if (std::abs(sampleRate) > std::numeric_limits<float>::epsilon()) {
+ ALOGW("Sample rate is greater than zero for on change type. "
+ "Ignoring it.");
+ }
+ return 0.0;
+ } else {
+ if (sampleRate > config.maxSampleRate) {
+ ALOGW("Sample rate %f is higher than max %f. Setting sampling rate "
+ "to max.", sampleRate, config.maxSampleRate);
+ return config.maxSampleRate;
+ }
+ if (sampleRate < config.minSampleRate) {
+ ALOGW("Sample rate %f is lower than min %f. Setting sampling rate "
+ "to min.", sampleRate, config.minSampleRate);
+ return config.minSampleRate;
+ }
+ }
+ return sampleRate; // Provided sample rate was good, no changes.
+}
+
+bool VehicleHalManager::isSubscribable(const VehiclePropConfig& config) {
+ if (!(config.access & VehiclePropertyAccess::READ)) {
+ ALOGW("Cannot subscribe, property 0x%x is write only", config.prop);
+ return false;
+ }
+ if (config.changeMode == VehiclePropertyChangeMode::STATIC) {
+ ALOGW("Cannot subscribe, property 0x%x is static", config.prop);
+ return false;
+ }
+
+ //TODO: extend to support event notification for set from android
+ if (config.changeMode == VehiclePropertyChangeMode::POLL) {
+ ALOGW("Cannot subscribe, property 0x%x is poll only", config.prop);
+ return false;
+ }
+ return true;
+}
+
+} // namespace V2_0
+} // namespace vehicle
+} // namespace hardware
+} // namespace android
diff --git a/vehicle/2.0/default/vehicle_hal_manager/VehicleHalManager.h b/vehicle/2.0/default/vehicle_hal_manager/VehicleHalManager.h
new file mode 100644
index 0000000..0353a15
--- /dev/null
+++ b/vehicle/2.0/default/vehicle_hal_manager/VehicleHalManager.h
@@ -0,0 +1,117 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef android_hardware_vehicle_V2_0_VehicleHalManager_H_
+#define android_hardware_vehicle_V2_0_VehicleHalManager_H_
+
+#include <stdint.h>
+#include <inttypes.h>
+#include <sys/types.h>
+#include <memory>
+#include <map>
+#include <set>
+#include <list>
+
+#include <hwbinder/IPCThreadState.h>
+
+#include <android/hardware/vehicle/2.0/IVehicle.h>
+
+#include "VehicleHal.h"
+#include "VehiclePropConfigIndex.h"
+#include "ConcurrentQueue.h"
+#include "SubscriptionManager.h"
+#include "VehicleObjectPool.h"
+
+namespace android {
+namespace hardware {
+namespace vehicle {
+namespace V2_0 {
+
+/**
+ * This class is a thick proxy between IVehicle HIDL interface and vendor's implementation.
+ *
+ * It has some boilerplate code like batching and caching property values, checking permissions,
+ * etc. Vendors must implement VehicleHal class.
+ */
+class VehicleHalManager : public IVehicle {
+public:
+ VehicleHalManager(VehicleHal* vehicleHal)
+ : mHal(vehicleHal) {
+ init();
+ }
+
+ virtual ~VehicleHalManager();
+
+ void init();
+
+ // ---------------------------------------------------------------------------------------------
+ // Methods derived from IVehicle
+ Return<void> getAllPropConfigs(getAllPropConfigs_cb _hidl_cb) override;
+ Return<void> getPropConfigs(const hidl_vec<VehicleProperty>& properties,
+ getPropConfigs_cb _hidl_cb) override;
+ Return<void> get(VehicleProperty propId, int32_t areaId, get_cb _hidl_cb) override;
+ Return<StatusCode> set(const VehiclePropValue& value) override;
+ Return<StatusCode> subscribe(const sp<IVehicleCallback>& callback,
+ const hidl_vec<SubscribeOptions>& options) override;
+ Return<StatusCode> unsubscribe(const sp<IVehicleCallback>& callback,
+ VehicleProperty propId) override;
+ Return<void> debugDump(debugDump_cb _hidl_cb = nullptr) override;
+
+private:
+ using VehiclePropValuePtr = VehicleHal::VehiclePropValuePtr;
+
+ // ---------------------------------------------------------------------------------------------
+ // Events received from VehicleHal
+ void onHalEvent(VehiclePropValuePtr v);
+ void onHalError(VehicleProperty property,
+ status_t errorCode,
+ VehiclePropertyOperation operation);
+
+ // ---------------------------------------------------------------------------------------------
+ // This method will be called from BatchingConsumer thread
+ void onBatchHalEvent(const std::vector<VehiclePropValuePtr >& values);
+
+ static bool isSubscribable(const VehiclePropConfig& config);
+ static bool isSampleRateFixed(VehiclePropertyChangeMode mode);
+ static float checkSampleRate(const VehiclePropConfig& config,
+ float sampleRate);
+
+ static Return<StatusCode> ok() {
+ return Return<StatusCode>(StatusCode::OK);
+ }
+ static Return<StatusCode> invalidArg() {
+ return Return<StatusCode>(StatusCode::INVALID_ARG);
+ }
+
+private:
+ VehicleHal* mHal;
+ std::unique_ptr<VehiclePropConfigIndex> mConfigIndex;
+ SubscriptionManager mSubscriptionManager;
+
+ hidl_vec<VehiclePropValue> mHidlVecOfVehiclePropValuePool;
+
+ ConcurrentQueue<VehiclePropValuePtr> mEventQueue;
+ BatchingConsumer<VehiclePropValuePtr> mBatchingConsumer;
+ VehiclePropValuePool mValueObjectPool;
+};
+
+} // namespace V2_0
+} // namespace vehicle
+} // namespace hardware
+} // namespace android
+
+
+#endif // android_hardware_vehicle_V2_0_VehicleHalManager_H_
diff --git a/vehicle/2.0/default/vehicle_hal_manager/VehicleObjectPool.h b/vehicle/2.0/default/vehicle_hal_manager/VehicleObjectPool.h
new file mode 100644
index 0000000..02bfb3f
--- /dev/null
+++ b/vehicle/2.0/default/vehicle_hal_manager/VehicleObjectPool.h
@@ -0,0 +1,335 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef android_hardware_vehicle_V2_0_VehicleObjectPool_H_
+#define android_hardware_vehicle_V2_0_VehicleObjectPool_H_
+
+#include <iostream>
+#include <memory>
+#include <deque>
+#include <string>
+#include <map>
+#include <mutex>
+
+#include <android/hardware/vehicle/2.0/types.h>
+
+#include "VehicleUtils.h"
+
+namespace android {
+namespace hardware {
+namespace vehicle {
+namespace V2_0 {
+
+using android::hardware::hidl_vec;
+
+// Handy metric mostly for unit tests and debug.
+#define INC_METRIC_IF_DEBUG(val) PoolStats::instance()->val++;
+struct PoolStats {
+ std::atomic<uint32_t> Obtained {0};
+ std::atomic<uint32_t> Created {0};
+ std::atomic<uint32_t> Recycled {0};
+
+ static PoolStats* instance() {
+ static PoolStats inst;
+ return &inst;
+ }
+};
+
+/**
+ * Generic abstract object pool class. Users of this class must implement
+ * #createObject method.
+ *
+ * This class is thread-safe. Concurrent calls to #obtain(...) method from
+ * multiple threads is OK, also client can obtain an object in one thread and
+ * then move ownership to another thread.
+ *
+ */
+template<typename T>
+class ObjectPool {
+public:
+ ObjectPool() = default;
+ virtual ~ObjectPool() = default;
+
+ struct Deleter {
+ using OnDeleteFunc = std::function<void(T*)>;
+
+ Deleter(const OnDeleteFunc& f) : mOnDelete(f) {};
+
+ Deleter() = default;
+ Deleter(const Deleter&) = default;
+
+ void operator()(T* o) {
+ mOnDelete(o);
+ }
+ private:
+ OnDeleteFunc mOnDelete;
+ };
+
+ using RecyclableType = std::unique_ptr<T, Deleter>;
+
+ virtual RecyclableType obtain() {
+ std::lock_guard<std::mutex> g(mLock);
+ INC_METRIC_IF_DEBUG(Obtained)
+ if (mObjects.empty()) {
+ INC_METRIC_IF_DEBUG(Created)
+ return wrap(createObject());
+ }
+
+ auto o = wrap(mObjects.front().release());
+ mObjects.pop_front();
+
+ return o;
+ }
+
+ ObjectPool& operator =(const ObjectPool &) = delete;
+ ObjectPool(const ObjectPool &) = delete;
+
+protected:
+ virtual T* createObject() = 0;
+
+ virtual void recycle(T* o) {
+ INC_METRIC_IF_DEBUG(Recycled)
+ std::lock_guard<std::mutex> g(mLock);
+ mObjects.push_back(std::unique_ptr<T> { o } );
+ }
+
+private:
+ const Deleter& getDeleter() {
+ if (!mDeleter.get()) {
+ Deleter *d = new Deleter(std::bind(&ObjectPool::recycle,
+ this,
+ std::placeholders::_1));
+ mDeleter.reset(d);
+ }
+ return *mDeleter.get();
+ }
+
+ RecyclableType wrap(T* raw) {
+ return RecyclableType { raw, getDeleter() };
+ }
+
+private:
+ mutable std::mutex mLock;
+ std::deque<std::unique_ptr<T>> mObjects;
+ std::unique_ptr<Deleter> mDeleter;
+};
+
+/**
+ * This is std::unique_ptr<> with custom delete operation that typically moves
+ * the pointer it holds back to ObectPool.
+ */
+template <typename T>
+using recyclable_ptr = typename ObjectPool<T>::RecyclableType;
+
+/**
+ * This class provides a pool of recycable VehiclePropertyValue objects.
+ *
+ * It has only one overloaded public method - obtain(...), users must call this
+ * method when new object is needed with given VehiclePropertyType and vector
+ * size (for vector properties). This method returns a recycable smart pointer
+ * to VehiclePropertyValue, essentially this is a std::unique_ptr with custom
+ * delete function, so recycable object has only one owner and developers can
+ * safely pass it around. Once this object goes out of scope, it will be
+ * returned the the object pool.
+ *
+ * Some objects are not recycable: strings and vector data types with
+ * vector length > maxRecyclableVectorSize (provided in the constructor). These
+ * objects will be deleted immediately once the go out of scope. There's no
+ * synchornization penalty for these objects since we do not store them in the
+ * pool.
+ *
+ * This class is thread-safe. Users can obtain an object in one thread and pass
+ * it to another.
+ *
+ * Sample usage:
+ *
+ * VehiclePropValuePool pool;
+ * auto v = pool.obtain(VehiclePropertyType::INT32);
+ * v->propId = VehicleProperty::HVAC_FAN_SPEED;
+ * v->areaId = VehicleAreaZone::ROW_1_LEFT;
+ * v->timestamp = elapsedRealtimeNano();
+ * v->value->int32Values[0] = 42;
+ *
+ *
+ */
+class VehiclePropValuePool {
+public:
+ using RecyclableType = recyclable_ptr<VehiclePropValue>;
+
+ /**
+ * Creates VehiclePropValuePool
+ *
+ * @param maxRecyclableVectorSize - vector value types (e.g.
+ * VehiclePropertyType::INT32_VEC) with size equal or less to this value
+ * will be stored in the pool. If users tries to obtain value with vector
+ * size greater than maxRecyclableVectorSize user will receive appropriate
+ * object, but once it goes out of scope it will be deleted immediately, not
+ * returning back to the object pool.
+ *
+ */
+ VehiclePropValuePool(size_t maxRecyclableVectorSize = 4) :
+ mMaxRecyclableVectorSize(maxRecyclableVectorSize) { };
+
+ RecyclableType obtain(VehiclePropertyType type) {
+ return obtain(type, 1);
+ }
+
+ RecyclableType obtain(VehiclePropertyType type, size_t vecSize) {
+ return isDisposable(type, vecSize)
+ ? obtainDisposable(type, vecSize)
+ : obtainRecylable(type, vecSize);
+ }
+
+ RecyclableType obtain(const VehiclePropValue& src) {
+ VehiclePropertyType type = getPropType(src.prop);
+ size_t vecSize = getVehicleRawValueVectorSize(src.value, type);;
+ auto dest = obtain(type, vecSize);
+
+ dest->prop = src.prop;
+ dest->areaId = src.areaId;
+ dest->timestamp = src.timestamp;
+ copyVehicleRawValue(&dest->value, src.value);
+
+ return dest;
+ }
+
+ RecyclableType obtainInt32(int32_t value) {
+ auto val = obtain(VehiclePropertyType::INT32);
+ val->value.int32Values[0] = value;
+ return val;
+ }
+
+ RecyclableType obtainInt64(int64_t value) {
+ auto val = obtain(VehiclePropertyType::INT64);
+ val->value.int64Values[0] = value;
+ return val;
+ }
+
+ RecyclableType obtainFloat(float value) {
+ auto val = obtain(VehiclePropertyType::FLOAT);
+ val->value.floatValues[0] = value;
+ return val;
+ }
+
+ RecyclableType obtainString(const char* cstr) {
+ auto val = obtain(VehiclePropertyType::STRING);
+ val->value.stringValue = cstr;
+ return val;
+ }
+
+ VehiclePropValuePool(VehiclePropValuePool& ) = delete;
+ VehiclePropValuePool& operator=(VehiclePropValuePool&) = delete;
+
+private:
+ bool isDisposable(VehiclePropertyType type, size_t vecSize) const {
+ return vecSize > mMaxRecyclableVectorSize ||
+ VehiclePropertyType::STRING == type;
+ }
+
+ RecyclableType obtainDisposable(VehiclePropertyType valueType,
+ size_t vectorSize) const {
+ return RecyclableType {
+ createVehiclePropValue(valueType, vectorSize).release(),
+ mDisposableDeleter
+ };
+ }
+
+ RecyclableType obtainRecylable(VehiclePropertyType type, size_t vecSize) {
+ // VehiclePropertyType is not overlapping with vectorSize.
+ int32_t key = static_cast<int32_t>(type)
+ | static_cast<int32_t>(vecSize);
+
+ std::lock_guard<std::mutex> g(mLock);
+ auto it = mValueTypePools.find(key);
+
+ if (it == mValueTypePools.end()) {
+ auto newPool(std::make_unique<InternalPool>(type, vecSize));
+ it = mValueTypePools.emplace(key, std::move(newPool)).first;
+ }
+ return it->second->obtain();
+ }
+
+ class InternalPool: public ObjectPool<VehiclePropValue> {
+ public:
+ InternalPool(VehiclePropertyType type, size_t vectorSize)
+ : mPropType(type), mVectorSize(vectorSize) {
+ }
+
+ RecyclableType obtain() {
+ return ObjectPool<VehiclePropValue>::obtain();
+ }
+ protected:
+ VehiclePropValue* createObject() override {
+ return createVehiclePropValue(mPropType, mVectorSize).release();
+ }
+
+ void recycle(VehiclePropValue* o) override {
+ ALOGE_IF(o == nullptr, "Attempt to recycle nullptr");
+
+ if (!check(&o->value)) {
+ ALOGE("Discarding value for prop 0x%x because it contains "
+ "data that is not consistent with this pool. "
+ "Expected type: %d, vector size: %d",
+ o->prop, mPropType, mVectorSize);
+ delete o;
+ }
+ ObjectPool<VehiclePropValue>::recycle(o);
+ }
+
+ private:
+ bool check(VehiclePropValue::RawValue* v) {
+ return check(&v->int32Values,
+ (VehiclePropertyType::INT32 == mPropType
+ || VehiclePropertyType::INT32_VEC == mPropType
+ || VehiclePropertyType::BOOLEAN == mPropType))
+ && check(&v->floatValues,
+ (VehiclePropertyType::FLOAT == mPropType
+ || VehiclePropertyType::FLOAT_VEC == mPropType))
+ && check(&v->int64Values,
+ VehiclePropertyType::INT64 == mPropType)
+ && check(&v->bytes,
+ VehiclePropertyType::BYTES == mPropType)
+ && v->stringValue.size() == 0;
+ }
+
+ template <typename VecType>
+ bool check(hidl_vec<VecType>* vec, bool expected) {
+ return vec->size() == (expected ? mVectorSize : 0);
+ }
+ private:
+ VehiclePropertyType mPropType;
+ size_t mVectorSize;
+ };
+
+private:
+ const ObjectPool<VehiclePropValue>::Deleter mDisposableDeleter {
+ [] (VehiclePropValue* v) {
+ delete v;
+ }
+ };
+
+private:
+ mutable std::mutex mLock;
+ const size_t mMaxRecyclableVectorSize;
+ std::map<int32_t, std::unique_ptr<InternalPool>> mValueTypePools;
+};
+
+} // namespace V2_0
+} // namespace vehicle
+} // namespace hardware
+} // namespace android
+
+#endif // android_hardware_vehicle_V2_0_VehicleObjectPool_H_
diff --git a/vehicle/2.0/default/vehicle_hal_manager/VehiclePropConfigIndex.h b/vehicle/2.0/default/vehicle_hal_manager/VehiclePropConfigIndex.h
new file mode 100644
index 0000000..540fc33
--- /dev/null
+++ b/vehicle/2.0/default/vehicle_hal_manager/VehiclePropConfigIndex.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef android_hardware_vehicle_V2_0_VehiclePropConfigIndex_H_
+#define android_hardware_vehicle_V2_0_VehiclePropConfigIndex_H_
+
+#include <utils/KeyedVector.h>
+
+#include <android/hardware/vehicle/2.0/IVehicle.h>
+
+namespace android {
+namespace hardware {
+namespace vehicle {
+namespace V2_0 {
+
+/*
+ * This is thread-safe immutable class to hold vehicle property configuration
+ * data.
+ */
+class VehiclePropConfigIndex {
+public:
+ VehiclePropConfigIndex(
+ const std::vector<VehiclePropConfig>& properties)
+ : mConfigs(properties), mPropToConfig(mConfigs)
+ {}
+
+ bool hasConfig(VehicleProperty property) const {
+ return mPropToConfig.indexOfKey(property) >= 0;
+ }
+
+ const VehiclePropConfig& getConfig(VehicleProperty property) const {
+ return *mPropToConfig.valueFor(property);
+ }
+
+ const std::vector<VehiclePropConfig>& getAllConfigs() const {
+ return mConfigs;
+ }
+
+private:
+ typedef KeyedVector<VehicleProperty, const VehiclePropConfig*> PropConfigMap;
+ class ImmutablePropConfigMap : private PropConfigMap {
+ public:
+ ImmutablePropConfigMap(const std::vector<VehiclePropConfig>& configs) {
+ setCapacity(configs.size());
+ for (auto& config : configs) {
+ add(config.prop, &config);
+ }
+ }
+ public:
+ using PropConfigMap::valueFor;
+ using PropConfigMap::indexOfKey;
+ };
+
+private:
+ const std::vector<VehiclePropConfig> mConfigs;
+ const ImmutablePropConfigMap mPropToConfig; // mConfigs must be declared
+ // first.
+};
+
+} // namespace V2_0
+} // namespace vehicle
+} // namespace hardware
+} // namespace android
+
+#endif // android_hardware_vehicle_V2_0_VehiclePropConfigIndex_H_
diff --git a/vehicle/2.0/default/vehicle_hal_manager/VehicleUtils.h b/vehicle/2.0/default/vehicle_hal_manager/VehicleUtils.h
new file mode 100644
index 0000000..f23a235
--- /dev/null
+++ b/vehicle/2.0/default/vehicle_hal_manager/VehicleUtils.h
@@ -0,0 +1,188 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef android_hardware_vehicle_V2_0_VehicleUtils_H_
+#define android_hardware_vehicle_V2_0_VehicleUtils_H_
+
+#include <memory>
+
+#include <hidl/HidlSupport.h>
+
+#include <android/hardware/vehicle/2.0/types.h>
+
+namespace android {
+namespace hardware {
+namespace vehicle {
+namespace V2_0 {
+
+/** Represents all supported areas for a property. Can be used is */
+constexpr int32_t kAllSupportedAreas = 0;
+
+template <typename T>
+inline hidl_vec<T> init_hidl_vec(std::initializer_list<const T> values) {
+ hidl_vec<T> vector;
+ vector.resize(values.size());
+ size_t i = 0;
+ for (auto& c : values) {
+ vector[i++] = c;
+ }
+ return vector;
+}
+
+/**
+ * Logical 'and' operator for class enums. The return type will be enum's
+ * underline type
+ */
+template <typename ENUM>
+inline typename std::underlying_type<ENUM>::type operator &(ENUM v1, ENUM v2) {
+ return static_cast<typename std::underlying_type<ENUM>::type>(v1)
+ & static_cast<typename std::underlying_type<ENUM>::type>(v2);
+}
+
+/** Returns underlying (integer) value for given enum. */
+template <typename ENUM>
+inline typename std::underlying_type<ENUM>::type val(ENUM const value) {
+ return static_cast<typename std::underlying_type<ENUM>::type>(value);
+}
+
+inline VehiclePropertyType getPropType(VehicleProperty prop) {
+ return static_cast<VehiclePropertyType>(
+ static_cast<int32_t>(prop)
+ & static_cast<int32_t>(VehiclePropertyType::MASK));
+}
+
+inline VehiclePropertyGroup getPropGroup(VehicleProperty prop) {
+ return static_cast<VehiclePropertyGroup>(
+ static_cast<int32_t>(prop)
+ & static_cast<int32_t>(VehiclePropertyGroup::MASK));
+}
+
+inline VehicleArea getPropArea(VehicleProperty prop) {
+ return static_cast<VehicleArea>(
+ static_cast<int32_t>(prop) & static_cast<int32_t>(VehicleArea::MASK));
+}
+
+inline bool isGlobalProp(VehicleProperty prop) {
+ return getPropArea(prop) == VehicleArea::GLOBAL;
+}
+
+inline bool checkPropType(VehicleProperty prop, VehiclePropertyType type) {
+ return getPropType(prop) == type;
+}
+
+inline bool isSystemProperty(VehicleProperty prop) {
+ return VehiclePropertyGroup::SYSTEM == getPropGroup(prop);
+}
+
+inline std::unique_ptr<VehiclePropValue> createVehiclePropValue(
+ VehiclePropertyType type, size_t vecSize) {
+ auto val = std::unique_ptr<VehiclePropValue>(new VehiclePropValue);
+ switch (type) {
+ case VehiclePropertyType::INT32: // fall through
+ case VehiclePropertyType::INT32_VEC: // fall through
+ case VehiclePropertyType::BOOLEAN:
+ val->value.int32Values.resize(vecSize);
+ break;
+ case VehiclePropertyType::FLOAT:
+ case VehiclePropertyType::FLOAT_VEC: // fall through
+ val->value.floatValues.resize(vecSize);
+ break;
+ case VehiclePropertyType::INT64:
+ val->value.int64Values.resize(vecSize);
+ break;
+ case VehiclePropertyType::BYTES:
+ val->value.bytes.resize(vecSize);
+ break;
+ case VehiclePropertyType::STRING:
+ break; // Valid, but nothing to do.
+ default:
+ ALOGE("createVehiclePropValue: unknown type: %d", type);
+ val.reset(nullptr);
+ }
+ return val;
+}
+
+inline size_t getVehicleRawValueVectorSize(
+ const VehiclePropValue::RawValue& value, VehiclePropertyType type) {
+ switch (type) {
+ case VehiclePropertyType::INT32: // fall through
+ case VehiclePropertyType::INT32_VEC: // fall through
+ case VehiclePropertyType::BOOLEAN:
+ return value.int32Values.size();
+ case VehiclePropertyType::FLOAT: // fall through
+ case VehiclePropertyType::FLOAT_VEC:
+ return value.floatValues.size();
+ case VehiclePropertyType::INT64:
+ return value.int64Values.size();
+ case VehiclePropertyType::BYTES:
+ return value.bytes.size();
+ default:
+ return 0;
+ }
+}
+
+/** Copies vector src to dest, dest should have enough space. */
+template <typename T>
+inline void copyHidlVec(hidl_vec<T>* dest, const hidl_vec<T>& src) {
+ for (size_t i = 0; i < std::min(dest->size(), src.size()); i++) {
+ (*dest)[i] = src[i];
+ }
+}
+
+inline void copyVehicleRawValue(VehiclePropValue::RawValue* dest,
+ const VehiclePropValue::RawValue& src) {
+ copyHidlVec(&dest->int32Values, src.int32Values);
+ copyHidlVec(&dest->floatValues, src.floatValues);
+ copyHidlVec(&dest->int64Values, src.int64Values);
+ copyHidlVec(&dest->bytes, src.bytes);
+ dest->stringValue = src.stringValue;
+}
+
+template <typename T>
+inline void shallowCopyHidlVec(hidl_vec<T>* dest, const hidl_vec<T>& src) {
+ if (src.size() > 0) {
+ dest->setToExternal(const_cast<T*>(&src[0]), src.size());
+ } else if (dest->size() > 0) {
+ dest->resize(0);
+ }
+}
+
+inline void shallowCopyHidlStr(hidl_string* dest, const hidl_string& src ) {
+ if (!src.empty()) {
+ dest->setToExternal(src.c_str(), src.size());
+ } else if (dest->size() > 0) {
+ dest->setToExternal(0, 0);
+ }
+}
+
+inline void shallowCopy(VehiclePropValue* dest,
+ const VehiclePropValue& src) {
+ dest->prop = src.prop;
+ dest->areaId = src.areaId;
+ dest->timestamp = src.timestamp;
+ shallowCopyHidlVec(&dest->value.int32Values, src.value.int32Values);
+ shallowCopyHidlVec(&dest->value.int64Values, src.value.int64Values);
+ shallowCopyHidlVec(&dest->value.floatValues, src.value.floatValues);
+ shallowCopyHidlVec(&dest->value.bytes, src.value.bytes);
+ shallowCopyHidlStr(&dest->value.stringValue, src.value.stringValue);
+}
+
+} // namespace V2_0
+} // namespace vehicle
+} // namespace hardware
+} // namespace android
+
+#endif // android_hardware_vehicle_V2_0_VehicleUtils_H_
diff --git a/vibrator/1.0/Android.bp b/vibrator/1.0/Android.bp
index 270e7bf..85bbc5e 100644
--- a/vibrator/1.0/Android.bp
+++ b/vibrator/1.0/Android.bp
@@ -43,9 +43,9 @@
"libutils",
"libcutils",
],
-export_shared_lib_headers: [
- "libhidl",
- "libhwbinder",
- "libutils",
+ export_shared_lib_headers: [
+ "libhidl",
+ "libhwbinder",
+ "libutils",
],
}
diff --git a/vr/1.0/Android.bp b/vr/1.0/Android.bp
index 63a0789..eaed921 100644
--- a/vr/1.0/Android.bp
+++ b/vr/1.0/Android.bp
@@ -39,9 +39,9 @@
"libutils",
"libcutils",
],
-export_shared_lib_headers: [
- "libhidl",
- "libhwbinder",
- "libutils",
+ export_shared_lib_headers: [
+ "libhidl",
+ "libhwbinder",
+ "libutils",
],
}
diff --git a/wifi/1.0/Android.bp b/wifi/1.0/Android.bp
index 504da7b..7453fe7 100644
--- a/wifi/1.0/Android.bp
+++ b/wifi/1.0/Android.bp
@@ -115,9 +115,9 @@
"libutils",
"libcutils",
],
-export_shared_lib_headers: [
- "libhidl",
- "libhwbinder",
- "libutils",
+ export_shared_lib_headers: [
+ "libhidl",
+ "libhwbinder",
+ "libutils",
],
}
diff --git a/wifi/supplicant/1.0/Android.bp b/wifi/supplicant/1.0/Android.bp
index a60179d..d4247d2 100644
--- a/wifi/supplicant/1.0/Android.bp
+++ b/wifi/supplicant/1.0/Android.bp
@@ -9,18 +9,30 @@
"ISupplicant.hal",
"ISupplicantCallback.hal",
"ISupplicantIface.hal",
- "ISupplicantIfaceCallback.hal",
"ISupplicantNetwork.hal",
- "ISupplicantNetworkCallback.hal",
+ "ISupplicantP2pIface.hal",
+ "ISupplicantP2pIfaceCallback.hal",
+ "ISupplicantP2pNetwork.hal",
+ "ISupplicantP2pNetworkCallback.hal",
+ "ISupplicantStaIface.hal",
+ "ISupplicantStaIfaceCallback.hal",
+ "ISupplicantStaNetwork.hal",
+ "ISupplicantStaNetworkCallback.hal",
],
out: [
"android/hardware/wifi/supplicant/1.0/types.cpp",
"android/hardware/wifi/supplicant/1.0/SupplicantAll.cpp",
"android/hardware/wifi/supplicant/1.0/SupplicantCallbackAll.cpp",
"android/hardware/wifi/supplicant/1.0/SupplicantIfaceAll.cpp",
- "android/hardware/wifi/supplicant/1.0/SupplicantIfaceCallbackAll.cpp",
"android/hardware/wifi/supplicant/1.0/SupplicantNetworkAll.cpp",
- "android/hardware/wifi/supplicant/1.0/SupplicantNetworkCallbackAll.cpp",
+ "android/hardware/wifi/supplicant/1.0/SupplicantP2pIfaceAll.cpp",
+ "android/hardware/wifi/supplicant/1.0/SupplicantP2pIfaceCallbackAll.cpp",
+ "android/hardware/wifi/supplicant/1.0/SupplicantP2pNetworkAll.cpp",
+ "android/hardware/wifi/supplicant/1.0/SupplicantP2pNetworkCallbackAll.cpp",
+ "android/hardware/wifi/supplicant/1.0/SupplicantStaIfaceAll.cpp",
+ "android/hardware/wifi/supplicant/1.0/SupplicantStaIfaceCallbackAll.cpp",
+ "android/hardware/wifi/supplicant/1.0/SupplicantStaNetworkAll.cpp",
+ "android/hardware/wifi/supplicant/1.0/SupplicantStaNetworkCallbackAll.cpp",
],
}
@@ -33,9 +45,15 @@
"ISupplicant.hal",
"ISupplicantCallback.hal",
"ISupplicantIface.hal",
- "ISupplicantIfaceCallback.hal",
"ISupplicantNetwork.hal",
- "ISupplicantNetworkCallback.hal",
+ "ISupplicantP2pIface.hal",
+ "ISupplicantP2pIfaceCallback.hal",
+ "ISupplicantP2pNetwork.hal",
+ "ISupplicantP2pNetworkCallback.hal",
+ "ISupplicantStaIface.hal",
+ "ISupplicantStaIfaceCallback.hal",
+ "ISupplicantStaNetwork.hal",
+ "ISupplicantStaNetworkCallback.hal",
],
out: [
"android/hardware/wifi/supplicant/1.0/types.h",
@@ -54,21 +72,51 @@
"android/hardware/wifi/supplicant/1.0/BnSupplicantIface.h",
"android/hardware/wifi/supplicant/1.0/BpSupplicantIface.h",
"android/hardware/wifi/supplicant/1.0/BsSupplicantIface.h",
- "android/hardware/wifi/supplicant/1.0/ISupplicantIfaceCallback.h",
- "android/hardware/wifi/supplicant/1.0/IHwSupplicantIfaceCallback.h",
- "android/hardware/wifi/supplicant/1.0/BnSupplicantIfaceCallback.h",
- "android/hardware/wifi/supplicant/1.0/BpSupplicantIfaceCallback.h",
- "android/hardware/wifi/supplicant/1.0/BsSupplicantIfaceCallback.h",
"android/hardware/wifi/supplicant/1.0/ISupplicantNetwork.h",
"android/hardware/wifi/supplicant/1.0/IHwSupplicantNetwork.h",
"android/hardware/wifi/supplicant/1.0/BnSupplicantNetwork.h",
"android/hardware/wifi/supplicant/1.0/BpSupplicantNetwork.h",
"android/hardware/wifi/supplicant/1.0/BsSupplicantNetwork.h",
- "android/hardware/wifi/supplicant/1.0/ISupplicantNetworkCallback.h",
- "android/hardware/wifi/supplicant/1.0/IHwSupplicantNetworkCallback.h",
- "android/hardware/wifi/supplicant/1.0/BnSupplicantNetworkCallback.h",
- "android/hardware/wifi/supplicant/1.0/BpSupplicantNetworkCallback.h",
- "android/hardware/wifi/supplicant/1.0/BsSupplicantNetworkCallback.h",
+ "android/hardware/wifi/supplicant/1.0/ISupplicantP2pIface.h",
+ "android/hardware/wifi/supplicant/1.0/IHwSupplicantP2pIface.h",
+ "android/hardware/wifi/supplicant/1.0/BnSupplicantP2pIface.h",
+ "android/hardware/wifi/supplicant/1.0/BpSupplicantP2pIface.h",
+ "android/hardware/wifi/supplicant/1.0/BsSupplicantP2pIface.h",
+ "android/hardware/wifi/supplicant/1.0/ISupplicantP2pIfaceCallback.h",
+ "android/hardware/wifi/supplicant/1.0/IHwSupplicantP2pIfaceCallback.h",
+ "android/hardware/wifi/supplicant/1.0/BnSupplicantP2pIfaceCallback.h",
+ "android/hardware/wifi/supplicant/1.0/BpSupplicantP2pIfaceCallback.h",
+ "android/hardware/wifi/supplicant/1.0/BsSupplicantP2pIfaceCallback.h",
+ "android/hardware/wifi/supplicant/1.0/ISupplicantP2pNetwork.h",
+ "android/hardware/wifi/supplicant/1.0/IHwSupplicantP2pNetwork.h",
+ "android/hardware/wifi/supplicant/1.0/BnSupplicantP2pNetwork.h",
+ "android/hardware/wifi/supplicant/1.0/BpSupplicantP2pNetwork.h",
+ "android/hardware/wifi/supplicant/1.0/BsSupplicantP2pNetwork.h",
+ "android/hardware/wifi/supplicant/1.0/ISupplicantP2pNetworkCallback.h",
+ "android/hardware/wifi/supplicant/1.0/IHwSupplicantP2pNetworkCallback.h",
+ "android/hardware/wifi/supplicant/1.0/BnSupplicantP2pNetworkCallback.h",
+ "android/hardware/wifi/supplicant/1.0/BpSupplicantP2pNetworkCallback.h",
+ "android/hardware/wifi/supplicant/1.0/BsSupplicantP2pNetworkCallback.h",
+ "android/hardware/wifi/supplicant/1.0/ISupplicantStaIface.h",
+ "android/hardware/wifi/supplicant/1.0/IHwSupplicantStaIface.h",
+ "android/hardware/wifi/supplicant/1.0/BnSupplicantStaIface.h",
+ "android/hardware/wifi/supplicant/1.0/BpSupplicantStaIface.h",
+ "android/hardware/wifi/supplicant/1.0/BsSupplicantStaIface.h",
+ "android/hardware/wifi/supplicant/1.0/ISupplicantStaIfaceCallback.h",
+ "android/hardware/wifi/supplicant/1.0/IHwSupplicantStaIfaceCallback.h",
+ "android/hardware/wifi/supplicant/1.0/BnSupplicantStaIfaceCallback.h",
+ "android/hardware/wifi/supplicant/1.0/BpSupplicantStaIfaceCallback.h",
+ "android/hardware/wifi/supplicant/1.0/BsSupplicantStaIfaceCallback.h",
+ "android/hardware/wifi/supplicant/1.0/ISupplicantStaNetwork.h",
+ "android/hardware/wifi/supplicant/1.0/IHwSupplicantStaNetwork.h",
+ "android/hardware/wifi/supplicant/1.0/BnSupplicantStaNetwork.h",
+ "android/hardware/wifi/supplicant/1.0/BpSupplicantStaNetwork.h",
+ "android/hardware/wifi/supplicant/1.0/BsSupplicantStaNetwork.h",
+ "android/hardware/wifi/supplicant/1.0/ISupplicantStaNetworkCallback.h",
+ "android/hardware/wifi/supplicant/1.0/IHwSupplicantStaNetworkCallback.h",
+ "android/hardware/wifi/supplicant/1.0/BnSupplicantStaNetworkCallback.h",
+ "android/hardware/wifi/supplicant/1.0/BpSupplicantStaNetworkCallback.h",
+ "android/hardware/wifi/supplicant/1.0/BsSupplicantStaNetworkCallback.h",
],
}
@@ -83,9 +131,9 @@
"libutils",
"libcutils",
],
-export_shared_lib_headers: [
- "libhidl",
- "libhwbinder",
- "libutils",
+ export_shared_lib_headers: [
+ "libhidl",
+ "libhwbinder",
+ "libutils",
],
}
diff --git a/wifi/supplicant/1.0/Android.mk b/wifi/supplicant/1.0/Android.mk
index b2c39f5..1f25c10 100644
--- a/wifi/supplicant/1.0/Android.mk
+++ b/wifi/supplicant/1.0/Android.mk
@@ -13,6 +13,23 @@
HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
#
+# Build types.hal (IfaceType)
+#
+GEN := $(intermediates)/android/hardware/wifi/supplicant/1.0/IfaceType.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.wifi.supplicant@1.0::types.IfaceType
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
# Build types.hal (SupplicantStatus)
#
GEN := $(intermediates)/android/hardware/wifi/supplicant/1.0/SupplicantStatus.java
@@ -93,8 +110,6 @@
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/ISupplicantIface.hal
-$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/ISupplicantIfaceCallback.hal
-$(GEN): $(LOCAL_PATH)/ISupplicantIfaceCallback.hal
$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/ISupplicantNetwork.hal
$(GEN): $(LOCAL_PATH)/ISupplicantNetwork.hal
$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/types.hal
@@ -110,33 +125,12 @@
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build ISupplicantIfaceCallback.hal
-#
-GEN := $(intermediates)/android/hardware/wifi/supplicant/1.0/ISupplicantIfaceCallback.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/ISupplicantIfaceCallback.hal
-$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/types.hal
-$(GEN): $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
- $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
- -Ljava -randroid.hardware:hardware/interfaces \
- android.hardware.wifi.supplicant@1.0::ISupplicantIfaceCallback
-
-$(GEN): $(LOCAL_PATH)/ISupplicantIfaceCallback.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
# Build ISupplicantNetwork.hal
#
GEN := $(intermediates)/android/hardware/wifi/supplicant/1.0/ISupplicantNetwork.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/ISupplicantNetwork.hal
-$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/ISupplicantNetworkCallback.hal
-$(GEN): $(LOCAL_PATH)/ISupplicantNetworkCallback.hal
$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/types.hal
$(GEN): $(LOCAL_PATH)/types.hal
$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
@@ -150,19 +144,166 @@
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build ISupplicantNetworkCallback.hal
+# Build ISupplicantP2pIface.hal
#
-GEN := $(intermediates)/android/hardware/wifi/supplicant/1.0/ISupplicantNetworkCallback.java
+GEN := $(intermediates)/android/hardware/wifi/supplicant/1.0/ISupplicantP2pIface.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/ISupplicantNetworkCallback.hal
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/ISupplicantP2pIface.hal
+$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/ISupplicantIface.hal
+$(GEN): $(LOCAL_PATH)/ISupplicantIface.hal
+$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/ISupplicantP2pIfaceCallback.hal
+$(GEN): $(LOCAL_PATH)/ISupplicantP2pIfaceCallback.hal
+$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/types.hal
+$(GEN): $(LOCAL_PATH)/types.hal
$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
$(GEN): PRIVATE_CUSTOM_TOOL = \
$(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-Ljava -randroid.hardware:hardware/interfaces \
- android.hardware.wifi.supplicant@1.0::ISupplicantNetworkCallback
+ android.hardware.wifi.supplicant@1.0::ISupplicantP2pIface
-$(GEN): $(LOCAL_PATH)/ISupplicantNetworkCallback.hal
+$(GEN): $(LOCAL_PATH)/ISupplicantP2pIface.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build ISupplicantP2pIfaceCallback.hal
+#
+GEN := $(intermediates)/android/hardware/wifi/supplicant/1.0/ISupplicantP2pIfaceCallback.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/ISupplicantP2pIfaceCallback.hal
+$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/types.hal
+$(GEN): $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.wifi.supplicant@1.0::ISupplicantP2pIfaceCallback
+
+$(GEN): $(LOCAL_PATH)/ISupplicantP2pIfaceCallback.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build ISupplicantP2pNetwork.hal
+#
+GEN := $(intermediates)/android/hardware/wifi/supplicant/1.0/ISupplicantP2pNetwork.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/ISupplicantP2pNetwork.hal
+$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/ISupplicantNetwork.hal
+$(GEN): $(LOCAL_PATH)/ISupplicantNetwork.hal
+$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/ISupplicantP2pNetworkCallback.hal
+$(GEN): $(LOCAL_PATH)/ISupplicantP2pNetworkCallback.hal
+$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/types.hal
+$(GEN): $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.wifi.supplicant@1.0::ISupplicantP2pNetwork
+
+$(GEN): $(LOCAL_PATH)/ISupplicantP2pNetwork.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build ISupplicantP2pNetworkCallback.hal
+#
+GEN := $(intermediates)/android/hardware/wifi/supplicant/1.0/ISupplicantP2pNetworkCallback.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/ISupplicantP2pNetworkCallback.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.wifi.supplicant@1.0::ISupplicantP2pNetworkCallback
+
+$(GEN): $(LOCAL_PATH)/ISupplicantP2pNetworkCallback.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build ISupplicantStaIface.hal
+#
+GEN := $(intermediates)/android/hardware/wifi/supplicant/1.0/ISupplicantStaIface.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/ISupplicantStaIface.hal
+$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/ISupplicantIface.hal
+$(GEN): $(LOCAL_PATH)/ISupplicantIface.hal
+$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/ISupplicantStaIfaceCallback.hal
+$(GEN): $(LOCAL_PATH)/ISupplicantStaIfaceCallback.hal
+$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/types.hal
+$(GEN): $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.wifi.supplicant@1.0::ISupplicantStaIface
+
+$(GEN): $(LOCAL_PATH)/ISupplicantStaIface.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build ISupplicantStaIfaceCallback.hal
+#
+GEN := $(intermediates)/android/hardware/wifi/supplicant/1.0/ISupplicantStaIfaceCallback.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/ISupplicantStaIfaceCallback.hal
+$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/types.hal
+$(GEN): $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.wifi.supplicant@1.0::ISupplicantStaIfaceCallback
+
+$(GEN): $(LOCAL_PATH)/ISupplicantStaIfaceCallback.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build ISupplicantStaNetwork.hal
+#
+GEN := $(intermediates)/android/hardware/wifi/supplicant/1.0/ISupplicantStaNetwork.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/ISupplicantStaNetwork.hal
+$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/ISupplicantNetwork.hal
+$(GEN): $(LOCAL_PATH)/ISupplicantNetwork.hal
+$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/ISupplicantStaNetworkCallback.hal
+$(GEN): $(LOCAL_PATH)/ISupplicantStaNetworkCallback.hal
+$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/types.hal
+$(GEN): $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.wifi.supplicant@1.0::ISupplicantStaNetwork
+
+$(GEN): $(LOCAL_PATH)/ISupplicantStaNetwork.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build ISupplicantStaNetworkCallback.hal
+#
+GEN := $(intermediates)/android/hardware/wifi/supplicant/1.0/ISupplicantStaNetworkCallback.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/ISupplicantStaNetworkCallback.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.wifi.supplicant@1.0::ISupplicantStaNetworkCallback
+
+$(GEN): $(LOCAL_PATH)/ISupplicantStaNetworkCallback.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
include $(BUILD_JAVA_LIBRARY)
@@ -179,6 +320,23 @@
HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
#
+# Build types.hal (IfaceType)
+#
+GEN := $(intermediates)/android/hardware/wifi/supplicant/1.0/IfaceType.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.wifi.supplicant@1.0::types.IfaceType
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
# Build types.hal (SupplicantStatus)
#
GEN := $(intermediates)/android/hardware/wifi/supplicant/1.0/SupplicantStatus.java
@@ -259,8 +417,6 @@
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/ISupplicantIface.hal
-$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/ISupplicantIfaceCallback.hal
-$(GEN): $(LOCAL_PATH)/ISupplicantIfaceCallback.hal
$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/ISupplicantNetwork.hal
$(GEN): $(LOCAL_PATH)/ISupplicantNetwork.hal
$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/types.hal
@@ -276,33 +432,12 @@
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build ISupplicantIfaceCallback.hal
-#
-GEN := $(intermediates)/android/hardware/wifi/supplicant/1.0/ISupplicantIfaceCallback.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/ISupplicantIfaceCallback.hal
-$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/types.hal
-$(GEN): $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
- $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
- -Ljava -randroid.hardware:hardware/interfaces \
- android.hardware.wifi.supplicant@1.0::ISupplicantIfaceCallback
-
-$(GEN): $(LOCAL_PATH)/ISupplicantIfaceCallback.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
# Build ISupplicantNetwork.hal
#
GEN := $(intermediates)/android/hardware/wifi/supplicant/1.0/ISupplicantNetwork.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/ISupplicantNetwork.hal
-$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/ISupplicantNetworkCallback.hal
-$(GEN): $(LOCAL_PATH)/ISupplicantNetworkCallback.hal
$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/types.hal
$(GEN): $(LOCAL_PATH)/types.hal
$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
@@ -316,19 +451,166 @@
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build ISupplicantNetworkCallback.hal
+# Build ISupplicantP2pIface.hal
#
-GEN := $(intermediates)/android/hardware/wifi/supplicant/1.0/ISupplicantNetworkCallback.java
+GEN := $(intermediates)/android/hardware/wifi/supplicant/1.0/ISupplicantP2pIface.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/ISupplicantNetworkCallback.hal
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/ISupplicantP2pIface.hal
+$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/ISupplicantIface.hal
+$(GEN): $(LOCAL_PATH)/ISupplicantIface.hal
+$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/ISupplicantP2pIfaceCallback.hal
+$(GEN): $(LOCAL_PATH)/ISupplicantP2pIfaceCallback.hal
+$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/types.hal
+$(GEN): $(LOCAL_PATH)/types.hal
$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
$(GEN): PRIVATE_CUSTOM_TOOL = \
$(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-Ljava -randroid.hardware:hardware/interfaces \
- android.hardware.wifi.supplicant@1.0::ISupplicantNetworkCallback
+ android.hardware.wifi.supplicant@1.0::ISupplicantP2pIface
-$(GEN): $(LOCAL_PATH)/ISupplicantNetworkCallback.hal
+$(GEN): $(LOCAL_PATH)/ISupplicantP2pIface.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build ISupplicantP2pIfaceCallback.hal
+#
+GEN := $(intermediates)/android/hardware/wifi/supplicant/1.0/ISupplicantP2pIfaceCallback.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/ISupplicantP2pIfaceCallback.hal
+$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/types.hal
+$(GEN): $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.wifi.supplicant@1.0::ISupplicantP2pIfaceCallback
+
+$(GEN): $(LOCAL_PATH)/ISupplicantP2pIfaceCallback.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build ISupplicantP2pNetwork.hal
+#
+GEN := $(intermediates)/android/hardware/wifi/supplicant/1.0/ISupplicantP2pNetwork.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/ISupplicantP2pNetwork.hal
+$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/ISupplicantNetwork.hal
+$(GEN): $(LOCAL_PATH)/ISupplicantNetwork.hal
+$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/ISupplicantP2pNetworkCallback.hal
+$(GEN): $(LOCAL_PATH)/ISupplicantP2pNetworkCallback.hal
+$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/types.hal
+$(GEN): $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.wifi.supplicant@1.0::ISupplicantP2pNetwork
+
+$(GEN): $(LOCAL_PATH)/ISupplicantP2pNetwork.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build ISupplicantP2pNetworkCallback.hal
+#
+GEN := $(intermediates)/android/hardware/wifi/supplicant/1.0/ISupplicantP2pNetworkCallback.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/ISupplicantP2pNetworkCallback.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.wifi.supplicant@1.0::ISupplicantP2pNetworkCallback
+
+$(GEN): $(LOCAL_PATH)/ISupplicantP2pNetworkCallback.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build ISupplicantStaIface.hal
+#
+GEN := $(intermediates)/android/hardware/wifi/supplicant/1.0/ISupplicantStaIface.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/ISupplicantStaIface.hal
+$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/ISupplicantIface.hal
+$(GEN): $(LOCAL_PATH)/ISupplicantIface.hal
+$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/ISupplicantStaIfaceCallback.hal
+$(GEN): $(LOCAL_PATH)/ISupplicantStaIfaceCallback.hal
+$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/types.hal
+$(GEN): $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.wifi.supplicant@1.0::ISupplicantStaIface
+
+$(GEN): $(LOCAL_PATH)/ISupplicantStaIface.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build ISupplicantStaIfaceCallback.hal
+#
+GEN := $(intermediates)/android/hardware/wifi/supplicant/1.0/ISupplicantStaIfaceCallback.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/ISupplicantStaIfaceCallback.hal
+$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/types.hal
+$(GEN): $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.wifi.supplicant@1.0::ISupplicantStaIfaceCallback
+
+$(GEN): $(LOCAL_PATH)/ISupplicantStaIfaceCallback.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build ISupplicantStaNetwork.hal
+#
+GEN := $(intermediates)/android/hardware/wifi/supplicant/1.0/ISupplicantStaNetwork.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/ISupplicantStaNetwork.hal
+$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/ISupplicantNetwork.hal
+$(GEN): $(LOCAL_PATH)/ISupplicantNetwork.hal
+$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/ISupplicantStaNetworkCallback.hal
+$(GEN): $(LOCAL_PATH)/ISupplicantStaNetworkCallback.hal
+$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/types.hal
+$(GEN): $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.wifi.supplicant@1.0::ISupplicantStaNetwork
+
+$(GEN): $(LOCAL_PATH)/ISupplicantStaNetwork.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build ISupplicantStaNetworkCallback.hal
+#
+GEN := $(intermediates)/android/hardware/wifi/supplicant/1.0/ISupplicantStaNetworkCallback.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/ISupplicantStaNetworkCallback.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.wifi.supplicant@1.0::ISupplicantStaNetworkCallback
+
+$(GEN): $(LOCAL_PATH)/ISupplicantStaNetworkCallback.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
include $(BUILD_STATIC_JAVA_LIBRARY)
diff --git a/wifi/supplicant/1.0/ISupplicant.hal b/wifi/supplicant/1.0/ISupplicant.hal
index 75b0aa0..c0131c5 100644
--- a/wifi/supplicant/1.0/ISupplicant.hal
+++ b/wifi/supplicant/1.0/ISupplicant.hal
@@ -40,37 +40,26 @@
};
/**
- * Registers a wireless interface in wpa_supplicant.
- *
- * @param ifName Name of the network interface, e.g., wlan0
- * @return status Status of the operation.
- * Possible status codes:
- * |SupplicantStatusCode.SUCCESS|,
- * |SupplicantStatusCode.FAILURE_UNKNOWN|,
- * |SupplicantStatusCode.FAILURE_IFACE_EXISTS|
- * @return iface HIDL interface object representing the interface if
- * successful, null otherwise.
+ * Structure describing the type and name of an iface
+ * controlled by wpa_supplicant.
*/
- createInterface(string ifName)
- generates (SupplicantStatus status, ISupplicantIface iface);
+ struct IfaceInfo {
+ /**
+ * Type of the network interface.
+ */
+ IfaceType type;
+ /**
+ * Name of the network interface, e.g., wlan0
+ */
+ string name;
+ };
/**
- * Deregisters a wireless interface from wpa_supplicant.
+ * Gets a HIDL interface object for the interface corresponding to iface
+ * name which wpa_supplicant already controls.
*
- * @param ifName Name of the network interface, e.g., wlan0
- * @return status Status of the operation.
- * Possible status codes:
- * |SupplicantStatusCode.SUCCESS|,
- * |SupplicantStatusCode.FAILURE_UNKNOWN|,
- * |SupplicantStatusCode.FAILURE_IFACE_UNKOWN|
- */
- removeInterface(string ifName) generates (SupplicantStatus status);
-
- /**
- * Gets a HIDL interface object for the interface corresponding to ifName
- * which wpa_supplicant already controls.
- *
- * @param ifName Name of the network interface, e.g., wlan0
+ * @param ifaceInfo Combination of the iface type and name retrieved
+ * using |listInterfaces|.
* @return status Status of the operation.
* Possible status codes:
* |SupplicantStatusCode.SUCCESS|,
@@ -79,11 +68,11 @@
* @return iface HIDL interface object representing the interface if
* successful, null otherwise.
*/
- getInterface(string ifName)
+ getInterface(IfaceInfo ifaceInfo)
generates (SupplicantStatus status, ISupplicantIface iface);
/**
- * Retrieve a list of all the interface names controlled by wpa_supplicant.
+ * Retrieve a list of all the interfaces controlled by wpa_supplicant.
*
* The corresponding |ISupplicantIface| object for any interface can be
* retrieved using |getInterface| method.
@@ -92,9 +81,9 @@
* Possible status codes:
* |SupplicantStatusCode.SUCCESS|,
* |SupplicantStatusCode.FAILURE_UNKNOWN|
- * @return ifNames List of all interface names controlled by wpa_supplicant.
+ * @return ifaces List of all interfaces controlled by wpa_supplicant.
*/
- listInterfaces() generates (SupplicantStatus status, vec<string> ifNames);
+ listInterfaces() generates (SupplicantStatus status, vec<IfaceInfo> ifaces);
/**
* Register for callbacks from the wpa_supplicant service.
diff --git a/wifi/supplicant/1.0/ISupplicantIface.hal b/wifi/supplicant/1.0/ISupplicantIface.hal
index 7b4f86f..afbfd8e 100644
--- a/wifi/supplicant/1.0/ISupplicantIface.hal
+++ b/wifi/supplicant/1.0/ISupplicantIface.hal
@@ -16,7 +16,6 @@
package android.hardware.wifi.supplicant@1.0;
-import ISupplicantIfaceCallback;
import ISupplicantNetwork;
/**
@@ -36,6 +35,17 @@
getName() generates (SupplicantStatus status, string name);
/**
+ * Retrieves the type of the network interface.
+ *
+ * @return status Status of the operation.
+ * Possible status codes:
+ * |SupplicantStatusCode.SUCCESS|,
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
+ * @return type Type of the network interface, e.g., STA.
+ */
+ getType() generates (SupplicantStatus status, IfaceType type);
+
+ /**
* Add a new network to the interface.
*
* @return status Status of the operation.
@@ -100,114 +110,4 @@
*/
listNetworks()
generates (SupplicantStatus status, vec<SupplicantNetworkId> networkIds);
-
- /**
- * Register for callbacks from this interface.
- *
- * These callbacks are invoked for events that are specific to this interface.
- * Registration of multiple callback objects is supported. These objects must
- * be automatically deleted when the corresponding client process is dead or
- * if this interface is removed.
- *
- * @param callback An instance of the |ISupplicantIfaceCallback| HIDL
- * interface object.
- * @return status Status of the operation.
- * Possible status codes:
- * |SupplicantStatusCode.SUCCESS|,
- * |SupplicantStatusCode.FAILURE_UNKNOWN|,
- * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
- */
- registerCallback(ISupplicantIfaceCallback callback)
- generates (SupplicantStatus status);
-
- /**
- * Reconnect to the currently active network, even if we are already
- * connected.
- *
- * @return status Status of the operation.
- * Possible status codes:
- * |SupplicantStatusCode.SUCCESS|,
- * |SupplicantStatusCode.FAILURE_UNKNOWN|,
- * |SupplicantStatusCode.FAILURE_IFACE_INVALID|,
- * |SupplicantStatusCode.FAILURE_IFACE_DISABLED|
- */
- reassociate() generates (SupplicantStatus status);
-
- /**
- * Reconnect to the currently active network, if we are currently
- * disconnected.
- *
- * @return status Status of the operation.
- * Possible status codes:
- * |SupplicantStatusCode.SUCCESS|,
- * |SupplicantStatusCode.FAILURE_UNKNOWN|,
- * |SupplicantStatusCode.FAILURE_IFACE_INVALID|,
- * |SupplicantStatusCode.FAILURE_IFACE_DISABLED|,
- * |SupplicantStatusCode.FAILURE_IFACE_NOT_DISCONNECTED|
- */
- reconnect() generates (SupplicantStatus status);
-
- /**
- * Disconnect from the current active network.
- *
- * @return status Status of the operation.
- * Possible status codes:
- * |SupplicantStatusCode.SUCCESS|,
- * |SupplicantStatusCode.FAILURE_UNKNOWN|,
- * |SupplicantStatusCode.FAILURE_IFACE_INVALID|,
- * |SupplicantStatusCode.FAILURE_IFACE_DISABLED|
- */
- disconnect() generates (SupplicantStatus status);
-
- /**
- * Turn on/off power save mode for the interface.
- *
- * @param enable Indicate if power save is to be turned on/off.
- * @return status Status of the operation.
- * Possible status codes:
- * |SupplicantStatusCode.SUCCESS|,
- * |SupplicantStatusCode.FAILURE_UNKNOWN|,
- * |SupplicantStatusCode.FAILURE_IFACE_INVALID|,
- * |SupplicantStatusCode.FAILURE_IFACE_DISABLED|
- */
- setPowerSave(bool enable) generates (SupplicantStatus status);
-
- /**
- * Initiate TDLS discover with the provided peer mac address.
- *
- * @param macAddress MAC address of the peer.
- * @return status Status of the operation.
- * Possible status codes:
- * |SupplicantStatusCode.SUCCESS|,
- * |SupplicantStatusCode.FAILURE_UNKNOWN|,
- * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
- */
- initiateTdlsDiscover(MacAddress macAddress)
- generates (SupplicantStatus status);
-
- /**
- * Initiate TDLS setup with the provided peer mac address.
- *
- * @param macAddress MAC address of the peer.
- * @return status Status of the operation.
- * Possible status codes:
- * |SupplicantStatusCode.SUCCESS|,
- * |SupplicantStatusCode.FAILURE_UNKNOWN|,
- * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
- */
- initiateTdlsSetup(MacAddress macAddress)
- generates (SupplicantStatus status);
-
- /**
- * Initiate TDLS teardown with the provided peer mac address.
- *
- * @param macAddress MAC address of the peer.
- * @return status Status of the operation.
- * Possible status codes:
- * |SupplicantStatusCode.SUCCESS|,
- * |SupplicantStatusCode.FAILURE_UNKNOWN|,
- * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
- */
- initiateTdlsTeardown(MacAddress macAddress)
- generates (SupplicantStatus status);
};
diff --git a/wifi/supplicant/1.0/ISupplicantNetwork.hal b/wifi/supplicant/1.0/ISupplicantNetwork.hal
index fce3c5d..acc3359 100644
--- a/wifi/supplicant/1.0/ISupplicantNetwork.hal
+++ b/wifi/supplicant/1.0/ISupplicantNetwork.hal
@@ -16,8 +16,6 @@
package android.hardware.wifi.supplicant@1.0;
-import ISupplicantNetworkCallback;
-
/**
* Interface exposed by wpa_supplicant for each network configuration it
* controls.
@@ -28,100 +26,6 @@
*/
interface ISupplicantNetwork {
/**
- * Size limits for some of the params used in this interface.
- */
- enum ParamSizeLimits : uint32_t {
- /** Max length of SSID param. */
- SSID_MAX_LEN_IN_BYTES = 32,
-
- /** Min length of PSK passphrase param. */
- PSK_PASSPHRASE_MIN_LEN_IN_BYTES = 8,
-
- /** Max length of PSK passphrase param. */
- PSK_PASSPHRASE_MAX_LEN_IN_BYTES = 63,
-
- /** Max number of WEP keys param. */
- WEP_KEYS_MAX_NUM = 4,
-
- /** Length of each WEP40 keys param. */
- WEP40_KEY_LEN_IN_BYTES = 5,
- /** Length of each WEP104 keys param. */
- WEP104_KEY_LEN_IN_BYTES = 13,
- };
-
- /** Possble mask of values for KeyMgmt param. */
- enum KeyMgmtMask : uint32_t {
- WPA_EAP = 1 << 0,
- WPA_PSK = 1 << 1,
- NONE = 1 << 2,
- IEEE8021X = 1 << 3
- };
-
- /** Possble mask of values for Proto param. */
- enum ProtoMask : uint32_t {
- WPA = 1 << 0,
- RSN = 1 << 1,
- /** Unused 1 << 2 */
- OSEN = 1 << 3
- };
-
- /** Possble mask of values for AuthAlg param. */
- enum AuthAlgMask : uint32_t {
- OPEN = 1 << 0,
- SHARED = 1 << 1,
- LEAP = 1 << 2
- };
-
- /** Possble mask of values for GroupCipher param. */
- enum GroupCipherMask : uint32_t {
- WEP40 = 1 << 1,
- WEP104 = 1 << 2,
- TKIP = 1 << 3,
- CCMP = 1 << 4
- };
-
- /** Possble mask of values for PairwiseCipher param. */
- enum PairwiseCipherMask : uint32_t {
- NONE = 1 << 0,
- TKIP = 1 << 3,
- CCMP = 1 << 4
- };
-
- /** Possble values for EapMethod param. */
- enum EapMethod : uint32_t {
- PEAP = 0,
- TLS = 1,
- TTLS = 2,
- PWD = 3,
- SIM = 4,
- AKA = 5,
- AKA_PRIME = 6,
- WFA_UNAUTH_TLS = 7
- };
-
- /** Possble values for Phase2Method param. */
- enum EapPhase2Method : uint32_t {
- NONE = 0,
- PAP = 1,
- MSPAP = 2,
- MSPAPV2 = 3,
- GTC = 4
- };
-
- /** Params of |sendNetworkEapSimGsmAuthResponse| request. (Refer RFC 4186) */
- struct NetworkResponseEapSimGsmAuthParams {
- uint8_t[8] kc;
- uint8_t[4] sres;
- };
-
- /** Params of |sendNetworkEapSimUmtsAuthResponse| request. (Refer RFC 4187) */
- struct NetworkResponseEapSimUmtsAuthParams {
- vec<uint8_t> res;
- uint8_t[16] ik;
- uint8_t[16] ck;
- };
-
- /**
* Retrieves the ID allocated to this network by wpa_supplicant.
*
* This is not the |SSID| of the network, but an internal identifier for
@@ -147,593 +51,13 @@
getInterfaceName() generates (SupplicantStatus status, string name);
/**
- * Register for callbacks from this network.
- *
- * These callbacks are invoked for events that are specific to this network.
- * Registration of multiple callback objects is supported. These objects must
- * be automatically deleted when the corresponding client process is dead or
- * if this network is removed.
- *
- * @param callback An instance of the |ISupplicantNetworkCallback| HIDL
- * interface object.
- * @return status Status of the operation.
- * Possible status codes:
- * |SupplicantStatusCode.SUCCESS|,
- * |SupplicantStatusCode.FAILURE_UNKNOWN|,
- * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
- */
- registerCallback(ISupplicantNetworkCallback callback)
- generates (SupplicantStatus status);
-
- /**
- * Setters for the various network params.
- * These correspond to elements of |wpa_sssid| struct used internally by
- * wpa_supplicant to represent each network.
- */
- /**
- * Set SSID for this network.
- *
- * @param ssid value to set.
- * Max length of |ParamSizeLimits.SSID_MAX_LEN_IN_BYTES|.
- * @return status Status of the operation.
- * Possible status codes:
- * |SupplicantStatusCode.SUCCESS|,
- * |SupplicantStatusCode.FAILURE_UNKNOWN|,
- * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
- */
- setSsid(Ssid ssid) generates (SupplicantStatus status);
-
- /**
- * Set the network to only connect to an AP with provided BSSID.
- *
- * @param bssid value to set.
- * @return status Status of the operation.
- * Possible status codes:
- * |SupplicantStatusCode.SUCCESS|,
- * |SupplicantStatusCode.FAILURE_UNKNOWN|,
- * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
- */
- setBssid(Bssid bssid) generates (SupplicantStatus status);
-
- /**
- * Set whether to send probe requests for this network (hidden).
- *
- * @param enable true to set, false otherwise.
- * @return status Status of the operation.
- * Possible status codes:
- * |SupplicantStatusCode.SUCCESS|,
- * |SupplicantStatusCode.FAILURE_UNKNOWN|,
- * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
- */
- setScanSsid(bool enable) generates (SupplicantStatus status);
-
- /**
- * Set key management mask for the network.
- *
- * @param keyMgmtMask value to set.
- * Combination of |KeyMgmtMask| values.
- * @return status Status of the operation.
- * Possible status codes:
- * |SupplicantStatusCode.SUCCESS|,
- * |SupplicantStatusCode.FAILURE_UNKNOWN|,
- * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
- */
- setKeyMgmt(uint32_t keyMgmtMask) generates (SupplicantStatus status);
-
- /**
- * Set proto mask for the network.
- *
- * @param protoMask value to set.
- * Combination of |ProtoMask| values.
- * @return status Status of the operation.
- * Possible status codes:
- * |SupplicantStatusCode.SUCCESS|,
- * |SupplicantStatusCode.FAILURE_UNKNOWN|,
- * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
- */
- setProto(uint32_t protoMask) generates (SupplicantStatus status);
-
- /**
- * Set auth alg mask for the network.
- *
- * @param authAlgMask value to set.
- * Combination of |ProtoMask| values.
- * @return status Status of the operation.
- * Possible status codes:
- * |SupplicantStatusCode.SUCCESS|,
- * |SupplicantStatusCode.FAILURE_UNKNOWN|,
- * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
- */
- setAuthAlg(uint32_t authAlgMask) generates (SupplicantStatus status);
-
- /**
- * Set group cipher mask for the network.
- *
- * @param groupCipherMask value to set.
- * Combination of |ProtoMask| values.
- * @return status Status of the operation.
- * Possible status codes:
- * |SupplicantStatusCode.SUCCESS|,
- * |SupplicantStatusCode.FAILURE_UNKNOWN|,
- * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
- */
- setGroupCipher(uint32_t groupCipherMask)
- generates (SupplicantStatus status);
-
- /**
- * Set pairwise cipher mask for the network.
- *
- * @param pairwiseCipherMask value to set.
- * Combination of |ProtoMask| values.
- * @return status Status of the operation.
- * Possible status codes:
- * |SupplicantStatusCode.SUCCESS|,
- * |SupplicantStatusCode.FAILURE_UNKNOWN|,
- * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
- */
- setPairwiseCipher(uint32_t pairwiseCipherMask)
- generates (SupplicantStatus status);
-
- /**
- * Set passphrase for WPA_PSK network.
- *
- * @param psk value to set.
- * Length of value must be between
- * |ParamSizeLimits.PSK_PASSPHRASE_MIN_LEN_IN_BYTES| and
- * |ParamSizeLimits.PSK_PASSPHRASE_MAX_LEN_IN_BYTES|.
- * @return status Status of the operation.
- * Possible status codes:
- * |SupplicantStatusCode.SUCCESS|,
- * |SupplicantStatusCode.FAILURE_UNKNOWN|,
- * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
- */
- setPskPassphrase(string psk) generates (SupplicantStatus status);
-
- /**
- * Set WEP key for WEP network.
- *
- * @param keyIdx Index of wep key to set.
- * Max of |ParamSizeLimits.WEP_KEYS_MAX_NUM|.
- * @param wepKey value to set.
- * Length of each key must be either
- * |ParamSizeLimits.WEP40_KEY_LEN_IN_BYTES| or
- * |ParamSizeLimits.WEP104_KEY_LEN_IN_BYTES|.
- * @return status Status of the operation.
- * Possible status codes:
- * |SupplicantStatusCode.SUCCESS|,
- * |SupplicantStatusCode.FAILURE_UNKNOWN|,
- * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
- */
- setWepKey(uint32_t keyIdx, vec<uint8_t> wepKey)
- generates (SupplicantStatus status);
-
- /**
- * Set default Tx key index for WEP network.
- *
- * @param KeyIdx value to set.
- * Max of |ParamSizeLimits.WEP_KEYS_MAX_NUM|.
- * @return status Status of the operation.
- * Possible status codes:
- * |SupplicantStatusCode.SUCCESS|,
- * |SupplicantStatusCode.FAILURE_UNKNOWN|,
- * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
- */
- setWepTxKeyIdx(uint32_t keyIdx)
- generates (SupplicantStatus status);
-
- /**
- * Set whether RequirePmf is enabled for this network.
- *
- * @param enable true to set, false otherwise.
- * @return status Status of the operation.
- * Possible status codes:
- * |SupplicantStatusCode.SUCCESS|,
- * |SupplicantStatusCode.FAILURE_UNKNOWN|,
- * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
- */
- setRequirePmf(bool enable) generates (SupplicantStatus status);
-
- /**
- * Set EAP Method for this network.
- *
- * @param method value to be set.
- * Must be one of |EapMethod| values.
- * @return status Status of the operation.
- * Possible status codes:
- * |SupplicantStatusCode.SUCCESS|,
- * |SupplicantStatusCode.FAILURE_UNKNOWN|,
- * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
- */
- setEapMethod(EapMethod method)
- generates (SupplicantStatus status);
-
- /**
- * Set EAP Phase2 Method for this network.
- *
- * @param method value to set.
- * Must be one of |EapPhase2Method| values.
- * @return status Status of the operation.
- * Possible status codes:
- * |SupplicantStatusCode.SUCCESS|,
- * |SupplicantStatusCode.FAILURE_UNKNOWN|,
- * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
- */
- setEapPhase2Method(EapPhase2Method method)
- generates (SupplicantStatus status);
-
- /**
- * Set EAP Identity for this network.
- *
- * @param identity value to set.
- * @return status Status of the operation.
- * Possible status codes:
- * |SupplicantStatusCode.SUCCESS|,
- * |SupplicantStatusCode.FAILURE_UNKNOWN|,
- * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
- */
- setEapIdentity(vec<uint8_t> identity)
- generates (SupplicantStatus status);
-
- /**
- * Set EAP Anonymous Identity for this network.
- *
- * @param identity value to set.
- * @return status Status of the operation.
- * Possible status codes:
- * |SupplicantStatusCode.SUCCESS|,
- * |SupplicantStatusCode.FAILURE_UNKNOWN|,
- * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
- */
- setEapAnonymousIdentity(vec<uint8_t> identity)
- generates (SupplicantStatus status);
-
- /**
- * Set EAP Password for this network.
- *
- * @param password value to set.
- * @return status Status of the operation.
- * Possible status codes:
- * |SupplicantStatusCode.SUCCESS|,
- * |SupplicantStatusCode.FAILURE_UNKNOWN|,
- * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
- */
- setEapPassword(vec<uint8_t> password)
- generates (SupplicantStatus status);
-
- /**
- * Set EAP CA certificate file path for this network.
- *
- * @param path value to set.
- * @return status Status of the operation.
- * Possible status codes:
- * |SupplicantStatusCode.SUCCESS|,
- * |SupplicantStatusCode.FAILURE_UNKNOWN|,
- * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
- */
- setEapCACert(string path) generates (SupplicantStatus status);
-
- /**
- * Set EAP CA certificate directory path for this network.
- *
- * @param path value to set.
- * @return status Status of the operation.
- * Possible status codes:
- * |SupplicantStatusCode.SUCCESS|,
- * |SupplicantStatusCode.FAILURE_UNKNOWN|,
- * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
- */
- setEapCAPath(string path) generates (SupplicantStatus status);
-
- /**
- * Set EAP Client certificate file path for this network.
- *
- * @param path value to set.
- * @return status Status of the operation.
- * Possible status codes:
- * |SupplicantStatusCode.SUCCESS|,
- * |SupplicantStatusCode.FAILURE_UNKNOWN|,
- * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
- */
- setEapClientCert(string path) generates (SupplicantStatus status);
-
- /**
- * Set EAP private key file path for this network.
- *
- * @param path value to set.
- * @return status Status of the operation.
- * Possible status codes:
- * |SupplicantStatusCode.SUCCESS|,
- * |SupplicantStatusCode.FAILURE_UNKNOWN|,
- * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
- */
- setEapPrivateKey(string path) generates (SupplicantStatus status);
-
- /**
- * Set EAP subject match for this network.
- *
- * @param match value to set.
- * @return status Status of the operation.
- * Possible status codes:
- * |SupplicantStatusCode.SUCCESS|,
- * |SupplicantStatusCode.FAILURE_UNKNOWN|,
- * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
- */
- setEapSubjectMatch(string match) generates (SupplicantStatus status);
-
- /**
- * Set EAP Altsubject match for this network.
- *
- * @param match value to set.
- * @return status Status of the operation.
- * Possible status codes:
- * |SupplicantStatusCode.SUCCESS|,
- * |SupplicantStatusCode.FAILURE_UNKNOWN|,
- * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
- */
- setEapAltSubjectMatch(string match)
- generates (SupplicantStatus status);
-
- /**
- * Enable EAP Open SSL Engine for this network.
- *
- * @param enable true to set, false otherwise.
- * @return status Status of the operation.
- * Possible status codes:
- * |SupplicantStatusCode.SUCCESS|,
- * |SupplicantStatusCode.FAILURE_UNKNOWN|,
- * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
- */
- setEapEngine(bool enable) generates (SupplicantStatus status);
-
- /**
- * Set EAP Open SSL Engine ID for this network.
- *
- * @param id value to set.
- * @return status Status of the operation.
- * Possible status codes:
- * |SupplicantStatusCode.SUCCESS|,
- * |SupplicantStatusCode.FAILURE_UNKNOWN|,
- * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
- */
- setEapEngineID(string id) generates (SupplicantStatus status);
-
- /**
- * Set EAP Domain suffix match for this network.
- *
- * @param match value to set.
- * @return status Status of the operation.
- * Possible status codes:
- * |SupplicantStatusCode.SUCCESS|,
- * |SupplicantStatusCode.FAILURE_UNKNOWN|,
- * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
- */
- setEapDomainSuffixMatch(string match)
- generates (SupplicantStatus status);
-
- /**
- * Getters for the various network params.
- */
- /**
- * Get SSID for this network.
+ * Retrieves the type of the interface this network belongs to.
*
* @return status Status of the operation.
* Possible status codes:
* |SupplicantStatusCode.SUCCESS|,
- * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
- * @return ssid value set.
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
+ * @return type Type of the network interface, e.g., STA.
*/
- getSsid() generates (SupplicantStatus status, Ssid ssid);
-
- /**
- * Get the BSSID set for this network.
- *
- * @return status Status of the operation.
- * Possible status codes:
- * |SupplicantStatusCode.SUCCESS|,
- * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
- * @return bssid value set.
- */
- getBssid() generates (SupplicantStatus status, Bssid bssid);
-
- /**
- * Get whether Probe Requests are being sent for this network (hidden).
- *
- * @return status Status of the operation.
- * Possible status codes:
- * |SupplicantStatusCode.SUCCESS|,
- * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
- * @return enabled true if set, false otherwise.
- */
- getScanSsid() generates (SupplicantStatus status, bool enabled);
-
- /**
- * Get the key mgmt mask set for the network.
- *
- * @return status Status of the operation.
- * Possible status codes:
- * |SupplicantStatusCode.SUCCESS|,
- * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
- * @return keyMgmtMask Combination of |KeyMgmtMask| values.
- */
- getKeyMgmt()
- generates (SupplicantStatus status, uint32_t keyMgmtMask);
-
- /**
- * Get the proto mask set for the network.
- *
- * @return status Status of the operation.
- * Possible status codes:
- * |SupplicantStatusCode.SUCCESS|,
- * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
- * @return protoMask Combination of |ProtoMask| values.
- */
- getProto() generates (SupplicantStatus status, uint32_t protoMask);
-
- /**
- * Get the auth alg mask set for the network.
- *
- * @return status Status of the operation.
- * Possible status codes:
- * |SupplicantStatusCode.SUCCESS|,
- * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
- * @return authAlgMask Combination of |AuthAlgMask| values.
- */
- getAuthAlg()
- generates (SupplicantStatus status, uint32_t authAlgMask);
-
- /**
- * Get the group cipher mask set for the network.
- *
- * @return status Status of the operation.
- * Possible status codes:
- * |SupplicantStatusCode.SUCCESS|,
- * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
- * @return groupCipherMask Combination of |GroupCipherMask| values.
- */
- getGroupCipher()
- generates (SupplicantStatus status, uint32_t groupCipherMask);
-
- /**
- * Get the pairwise cipher mask set for the network.
- *
- * @return status Status of the operation.
- * Possible status codes:
- * |SupplicantStatusCode.SUCCESS|,
- * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
- * @return pairwiseCipherMask Combination of |PairwiseCipherMask| values.
- */
- getPairwiseCipher()
- generates (SupplicantStatus status, uint32_t pairwiseCipherMask);
-
- /**
- * Get passphrase for WPA_PSK network.
- *
- * @return status Status of the operation.
- * Possible status codes:
- * |SupplicantStatusCode.SUCCESS|,
- * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
- * @return psk value set.
- */
- getPskPassphrase() generates (SupplicantStatus status, string psk);
-
- /**
- * Get WEP key for WEP network.
- *
- * @param keyIdx Index of wep key to be fetched.
- * Max of |WEP_KEYS_MAX_NUM|.
- * @return status Status of the operation.
- * Possible status codes:
- * |SupplicantStatusCode.SUCCESS|,
- * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
- * @return wepKey value set.
- */
- getWepKey(uint32_t keyIdx)
- generates (SupplicantStatus status, vec<uint8_t> wepKey);
-
- /**
- * Get default Tx key index for WEP network.
- *
- * @return status Status of the operation.
- * Possible status codes:
- * |SupplicantStatusCode.SUCCESS|,
- * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
- * @return keyIdx value set.
- */
- getWepTxKeyIdx()
- generates (SupplicantStatus status, uint32_t keyIdx);
-
- /**
- * Get whether RequirePmf is enabled for this network.
- *
- * @return status Status of the operation.
- * Possible status codes:
- * |SupplicantStatusCode.SUCCESS|,
- * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
- * @return enabled true if set, false otherwise.
- */
- getRequirePmf() generates (SupplicantStatus status, bool enabled);
-
- /**
- * Enable the network for connection purposes.
- *
- * This must trigger a connection to the network if:
- * a) |noConnect| is false, and
- * b) This is the only network configured, and
- * c) Is visible in the current scan results.
- *
- * @param noConnect Only enable the network, dont trigger a connect.
- * @return status Status of the operation.
- * Possible status codes:
- * |SupplicantStatusCode.SUCCESS|,
- * |SupplicantStatusCode.FAILURE_UNKNOWN|,
- * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
- */
- enable(bool noConnect) generates (SupplicantStatus status);
-
- /**
- * Disable the network for connection purposes.
- *
- * This must trigger a disconnection from the network, if currently
- * connected to this one.
- *
- * @return status Status of the operation.
- * Possible status codes:
- * |SupplicantStatusCode.SUCCESS|,
- * |SupplicantStatusCode.FAILURE_UNKNOWN|,
- * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
- */
- disable() generates (SupplicantStatus status);
-
- /**
- * Initiate connection to this network.
- *
- * @return status Status of the operation.
- * Possible status codes:
- * |SupplicantStatusCode.SUCCESS|,
- * |SupplicantStatusCode.FAILURE_UNKNOWN|,
- * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
- */
- select() generates (SupplicantStatus status);
-
- /**
- * Used to send a response to the
- * |ISupplicantNetworkCallback.onNetworkEapSimGsmAuthRequest| request.
- *
- * @param params Params to be used for EAP GSM authentication.
- * @return status Status of the operation.
- * Possible status codes:
- * |SupplicantStatusCode.SUCCESS|,
- * |SupplicantStatusCode.FAILURE_UNKNOWN|,
- * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
- */
- sendNetworkEapSimGsmAuthResponse(NetworkResponseEapSimGsmAuthParams params)
- generates (SupplicantStatus status);
-
- /**
- * Used to send a response to the
- * |ISupplicantNetworkCallback.onNetworkEapSimUmtsAuthRequest| request.
- *
- * @param params Params to be used for EAP UMTS authentication.
- * @return status Status of the operation.
- * Possible status codes:
- * |SupplicantStatusCode.SUCCESS|,
- * |SupplicantStatusCode.FAILURE_UNKNOWN|,
- * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
- */
- sendNetworkEapSimUmtsAuthResponse(NetworkResponseEapSimUmtsAuthParams params)
- generates (SupplicantStatus status);
-
- /**
- * Used to send a response to the
- * |ISupplicantNetworkCallback.onNetworkEapIdentityRequest| request.
- *
- * @param identity Identity to be used for the network.
- * @return status Status of the operation.
- * Possible status codes:
- * |SupplicantStatusCode.SUCCESS|,
- * |SupplicantStatusCode.FAILURE_UNKNOWN|,
- * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
- */
- sendNetworkEapIdentityResponse(vec<uint8_t> identity)
- generates (SupplicantStatus status);
+ getType() generates (SupplicantStatus status, IfaceType type);
};
diff --git a/wifi/supplicant/1.0/ISupplicantP2pIface.hal b/wifi/supplicant/1.0/ISupplicantP2pIface.hal
new file mode 100644
index 0000000..ea0878b
--- /dev/null
+++ b/wifi/supplicant/1.0/ISupplicantP2pIface.hal
@@ -0,0 +1,45 @@
+/*
+ * Copyright 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.wifi.supplicant@1.0;
+
+import ISupplicantIface;
+import ISupplicantP2pIfaceCallback;
+
+/**
+ * Interface exposed by wpa_supplicant for each P2P mode network
+ * interface (e.g p2p0) it controls.
+ */
+interface ISupplicantP2pIface extends ISupplicantIface {
+ /**
+ * Register for callbacks from this interface.
+ *
+ * These callbacks are invoked for events that are specific to this interface.
+ * Registration of multiple callback objects is supported. These objects must
+ * be automatically deleted when the corresponding client process is dead or
+ * if this interface is removed.
+ *
+ * @param callback An instance of the |ISupplicantP2pIfaceCallback| HIDL
+ * interface object.
+ * @return status Status of the operation.
+ * Possible status codes:
+ * |SupplicantStatusCode.SUCCESS|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
+ */
+ registerCallback(ISupplicantP2pIfaceCallback callback)
+ generates (SupplicantStatus status);
+};
diff --git a/wifi/supplicant/1.0/ISupplicantP2pIfaceCallback.hal b/wifi/supplicant/1.0/ISupplicantP2pIfaceCallback.hal
new file mode 100644
index 0000000..1574e6a
--- /dev/null
+++ b/wifi/supplicant/1.0/ISupplicantP2pIfaceCallback.hal
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.wifi.supplicant@1.0;
+
+/**
+ * Callback Interface exposed by the wpa_supplicant service
+ * for each P2P mode interface (ISupplicantP2pIface).
+ *
+ * Clients need to host an instance of this HIDL interface object and
+ * pass a reference of the object to wpa_supplicant via the
+ * corresponding |ISupplicantP2pIface.registerCallback| method.
+ */
+interface ISupplicantP2pIfaceCallback {
+ /**
+ * Used to indicate that a new network has been added.
+ *
+ * @param id Network ID allocated to the corresponding network.
+ */
+ oneway onNetworkAdded(SupplicantNetworkId id);
+
+ /**
+ * Used to indicate that a network has been removed.
+ *
+ * @param id Network ID allocated to the corresponding network.
+ */
+ oneway onNetworkRemoved(SupplicantNetworkId id);
+};
diff --git a/wifi/supplicant/1.0/ISupplicantP2pNetwork.hal b/wifi/supplicant/1.0/ISupplicantP2pNetwork.hal
new file mode 100644
index 0000000..13eeae7
--- /dev/null
+++ b/wifi/supplicant/1.0/ISupplicantP2pNetwork.hal
@@ -0,0 +1,45 @@
+/*
+ * Copyright 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.wifi.supplicant@1.0;
+
+import ISupplicantNetwork;
+import ISupplicantP2pNetworkCallback;
+
+/**
+ * Interface exposed by wpa_supplicant for each P2P mode network
+ * configuration it controls.
+ */
+interface ISupplicantP2pNetwork extends ISupplicantNetwork {
+ /**
+ * Register for callbacks from this network.
+ *
+ * These callbacks are invoked for events that are specific to this network.
+ * Registration of multiple callback objects is supported. These objects must
+ * be automatically deleted when the corresponding client process is dead or
+ * if this network is removed.
+ *
+ * @param callback An instance of the |ISupplicantP2pNetworkCallback| HIDL
+ * interface object.
+ * @return status P2ptus of the operation.
+ * Possible status codes:
+ * |SupplicantP2ptusCode.SUCCESS|,
+ * |SupplicantP2ptusCode.FAILURE_UNKNOWN|,
+ * |SupplicantP2ptusCode.FAILURE_NETWORK_INVALID|
+ */
+ registerCallback(ISupplicantP2pNetworkCallback callback)
+ generates (SupplicantStatus status);
+};
diff --git a/wifi/supplicant/1.0/ISupplicantP2pNetworkCallback.hal b/wifi/supplicant/1.0/ISupplicantP2pNetworkCallback.hal
new file mode 100644
index 0000000..d171a09
--- /dev/null
+++ b/wifi/supplicant/1.0/ISupplicantP2pNetworkCallback.hal
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.wifi.supplicant@1.0;
+
+/**
+ * Callback Interface exposed by the wpa_supplicant service
+ * for each network (ISupplicantP2pNetwork).
+ *
+ * Clients need to host an instance of this HIDL interface object and
+ * pass a reference of the object to wpa_supplicant via the
+ * corresponding |ISupplicantP2pNetwork.registerCallback| method.
+ */
+interface ISupplicantP2pNetworkCallback {
+ // TODO(rpius): Add the reqd callbacks.
+};
diff --git a/wifi/supplicant/1.0/ISupplicantStaIface.hal b/wifi/supplicant/1.0/ISupplicantStaIface.hal
new file mode 100644
index 0000000..4e2c7c8
--- /dev/null
+++ b/wifi/supplicant/1.0/ISupplicantStaIface.hal
@@ -0,0 +1,136 @@
+/*
+ * Copyright 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.wifi.supplicant@1.0;
+
+import ISupplicantIface;
+import ISupplicantStaIfaceCallback;
+
+/**
+ * Interface exposed by wpa_supplicant for each station mode network
+ * interface (e.g wlan0) it controls.
+ */
+interface ISupplicantStaIface extends ISupplicantIface {
+ /**
+ * Register for callbacks from this interface.
+ *
+ * These callbacks are invoked for events that are specific to this interface.
+ * Registration of multiple callback objects is supported. These objects must
+ * be automatically deleted when the corresponding client process is dead or
+ * if this interface is removed.
+ *
+ * @param callback An instance of the |ISupplicantStaIfaceCallback| HIDL
+ * interface object.
+ * @return status Status of the operation.
+ * Possible status codes:
+ * |SupplicantStatusCode.SUCCESS|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
+ */
+ registerCallback(ISupplicantStaIfaceCallback callback)
+ generates (SupplicantStatus status);
+
+ /**
+ * Reconnect to the currently active network, even if we are already
+ * connected.
+ *
+ * @return status Status of the operation.
+ * Possible status codes:
+ * |SupplicantStatusCode.SUCCESS|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|,
+ * |SupplicantStatusCode.FAILURE_IFACE_DISABLED|
+ */
+ reassociate() generates (SupplicantStatus status);
+
+ /**
+ * Reconnect to the currently active network, if we are currently
+ * disconnected.
+ *
+ * @return status Status of the operation.
+ * Possible status codes:
+ * |SupplicantStatusCode.SUCCESS|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|,
+ * |SupplicantStatusCode.FAILURE_IFACE_DISABLED|,
+ * |SupplicantStatusCode.FAILURE_IFACE_NOT_DISCONNECTED|
+ */
+ reconnect() generates (SupplicantStatus status);
+
+ /**
+ * Disconnect from the current active network.
+ *
+ * @return status Status of the operation.
+ * Possible status codes:
+ * |SupplicantStatusCode.SUCCESS|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|,
+ * |SupplicantStatusCode.FAILURE_IFACE_DISABLED|
+ */
+ disconnect() generates (SupplicantStatus status);
+
+ /**
+ * Turn on/off power save mode for the interface.
+ *
+ * @param enable Indicate if power save is to be turned on/off.
+ * @return status Status of the operation.
+ * Possible status codes:
+ * |SupplicantStatusCode.SUCCESS|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|,
+ * |SupplicantStatusCode.FAILURE_IFACE_DISABLED|
+ */
+ setPowerSave(bool enable) generates (SupplicantStatus status);
+
+ /**
+ * Initiate TDLS discover with the provided peer mac address.
+ *
+ * @param macAddress MAC address of the peer.
+ * @return status Status of the operation.
+ * Possible status codes:
+ * |SupplicantStatusCode.SUCCESS|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
+ */
+ initiateTdlsDiscover(MacAddress macAddress)
+ generates (SupplicantStatus status);
+
+ /**
+ * Initiate TDLS setup with the provided peer mac address.
+ *
+ * @param macAddress MAC address of the peer.
+ * @return status Status of the operation.
+ * Possible status codes:
+ * |SupplicantStatusCode.SUCCESS|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
+ */
+ initiateTdlsSetup(MacAddress macAddress)
+ generates (SupplicantStatus status);
+
+ /**
+ * Initiate TDLS teardown with the provided peer mac address.
+ *
+ * @param macAddress MAC address of the peer.
+ * @return status Status of the operation.
+ * Possible status codes:
+ * |SupplicantStatusCode.SUCCESS|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
+ */
+ initiateTdlsTeardown(MacAddress macAddress)
+ generates (SupplicantStatus status);
+};
diff --git a/wifi/supplicant/1.0/ISupplicantIfaceCallback.hal b/wifi/supplicant/1.0/ISupplicantStaIfaceCallback.hal
similarity index 96%
rename from wifi/supplicant/1.0/ISupplicantIfaceCallback.hal
rename to wifi/supplicant/1.0/ISupplicantStaIfaceCallback.hal
index 8e193cd..d104814 100644
--- a/wifi/supplicant/1.0/ISupplicantIfaceCallback.hal
+++ b/wifi/supplicant/1.0/ISupplicantStaIfaceCallback.hal
@@ -18,13 +18,13 @@
/**
* Callback Interface exposed by the wpa_supplicant service
- * for each interface (ISupplicantIface).
+ * for each station mode interface (ISupplicantStaIface).
*
* Clients need to host an instance of this HIDL interface object and
* pass a reference of the object to wpa_supplicant via the
- * corresponding |ISupplicantIface.registerCallback| method.
+ * corresponding |ISupplicantStaIface.registerCallback| method.
*/
-interface ISupplicantIfaceCallback {
+interface ISupplicantStaIfaceCallback {
/** Various states of the interface reported by |onStateChanged|.*/
enum State : uint32_t {
/**
@@ -38,7 +38,7 @@
* due to rfkill. wpa_supplicant refuses any new operations that would
* use the radio until the interface has been enabled.
*/
- INTERFACE_DISABLED = 1,
+ IFACE_DISABLED = 1,
/**
* This state is entered if there are no enabled networks in the
* configuration. wpa_supplicant is not trying to associate with a new
diff --git a/wifi/supplicant/1.0/ISupplicantStaNetwork.hal b/wifi/supplicant/1.0/ISupplicantStaNetwork.hal
new file mode 100644
index 0000000..ce23932
--- /dev/null
+++ b/wifi/supplicant/1.0/ISupplicantStaNetwork.hal
@@ -0,0 +1,711 @@
+/*
+ * Copyright 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.wifi.supplicant@1.0;
+
+import ISupplicantNetwork;
+import ISupplicantStaNetworkCallback;
+
+/**
+ * Interface exposed by wpa_supplicant for each station mode network
+ * configuration it controls.
+ */
+interface ISupplicantStaNetwork extends ISupplicantNetwork {
+ /**
+ * Size limits for some of the params used in this interface.
+ */
+ enum ParamSizeLimits : uint32_t {
+ /** Max length of SSID param. */
+ SSID_MAX_LEN_IN_BYTES = 32,
+
+ /** Min length of PSK passphrase param. */
+ PSK_PASSPHRASE_MIN_LEN_IN_BYTES = 8,
+
+ /** Max length of PSK passphrase param. */
+ PSK_PASSPHRASE_MAX_LEN_IN_BYTES = 63,
+
+ /** Max number of WEP keys param. */
+ WEP_KEYS_MAX_NUM = 4,
+
+ /** Length of each WEP40 keys param. */
+ WEP40_KEY_LEN_IN_BYTES = 5,
+ /** Length of each WEP104 keys param. */
+ WEP104_KEY_LEN_IN_BYTES = 13,
+ };
+
+ /** Possble mask of values for KeyMgmt param. */
+ enum KeyMgmtMask : uint32_t {
+ WPA_EAP = 1 << 0,
+ WPA_PSK = 1 << 1,
+ NONE = 1 << 2,
+ IEEE8021X = 1 << 3
+ };
+
+ /** Possble mask of values for Proto param. */
+ enum ProtoMask : uint32_t {
+ WPA = 1 << 0,
+ RSN = 1 << 1,
+ /** Unused 1 << 2 */
+ OSEN = 1 << 3
+ };
+
+ /** Possble mask of values for AuthAlg param. */
+ enum AuthAlgMask : uint32_t {
+ OPEN = 1 << 0,
+ SHARED = 1 << 1,
+ LEAP = 1 << 2
+ };
+
+ /** Possble mask of values for GroupCipher param. */
+ enum GroupCipherMask : uint32_t {
+ WEP40 = 1 << 1,
+ WEP104 = 1 << 2,
+ TKIP = 1 << 3,
+ CCMP = 1 << 4
+ };
+
+ /** Possble mask of values for PairwiseCipher param. */
+ enum PairwiseCipherMask : uint32_t {
+ NONE = 1 << 0,
+ TKIP = 1 << 3,
+ CCMP = 1 << 4
+ };
+
+ /** Possble values for EapMethod param. */
+ enum EapMethod : uint32_t {
+ PEAP = 0,
+ TLS = 1,
+ TTLS = 2,
+ PWD = 3,
+ SIM = 4,
+ AKA = 5,
+ AKA_PRIME = 6,
+ WFA_UNAUTH_TLS = 7
+ };
+
+ /** Possble values for Phase2Method param. */
+ enum EapPhase2Method : uint32_t {
+ NONE = 0,
+ PAP = 1,
+ MSPAP = 2,
+ MSPAPV2 = 3,
+ GTC = 4
+ };
+
+ /** Params of |sendNetworkEapSimGsmAuthResponse| request. (Refer RFC 4186) */
+ struct NetworkResponseEapSimGsmAuthParams {
+ uint8_t[8] kc;
+ uint8_t[4] sres;
+ };
+
+ /** Params of |sendNetworkEapSimUmtsAuthResponse| request. (Refer RFC 4187) */
+ struct NetworkResponseEapSimUmtsAuthParams {
+ vec<uint8_t> res;
+ uint8_t[16] ik;
+ uint8_t[16] ck;
+ };
+
+ /**
+ * Register for callbacks from this network.
+ *
+ * These callbacks are invoked for events that are specific to this network.
+ * Registration of multiple callback objects is supported. These objects must
+ * be automatically deleted when the corresponding client process is dead or
+ * if this network is removed.
+ *
+ * @param callback An instance of the |ISupplicantStaNetworkCallback| HIDL
+ * interface object.
+ * @return status Status of the operation.
+ * Possible status codes:
+ * |SupplicantStatusCode.SUCCESS|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ registerCallback(ISupplicantStaNetworkCallback callback)
+ generates (SupplicantStatus status);
+
+ /**
+ * Setters for the various network params.
+ * These correspond to elements of |wpa_sssid| struct used internally by
+ * wpa_supplicant to represent each network.
+ */
+ /**
+ * Set SSID for this network.
+ *
+ * @param ssid value to set.
+ * Max length of |ParamSizeLimits.SSID_MAX_LEN_IN_BYTES|.
+ * @return status Status of the operation.
+ * Possible status codes:
+ * |SupplicantStatusCode.SUCCESS|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ setSsid(Ssid ssid) generates (SupplicantStatus status);
+
+ /**
+ * Set the network to only connect to an AP with provided BSSID.
+ *
+ * @param bssid value to set.
+ * @return status Status of the operation.
+ * Possible status codes:
+ * |SupplicantStatusCode.SUCCESS|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ setBssid(Bssid bssid) generates (SupplicantStatus status);
+
+ /**
+ * Set whether to send probe requests for this network (hidden).
+ *
+ * @param enable true to set, false otherwise.
+ * @return status Status of the operation.
+ * Possible status codes:
+ * |SupplicantStatusCode.SUCCESS|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ setScanSsid(bool enable) generates (SupplicantStatus status);
+
+ /**
+ * Set key management mask for the network.
+ *
+ * @param keyMgmtMask value to set.
+ * Combination of |KeyMgmtMask| values.
+ * @return status Status of the operation.
+ * Possible status codes:
+ * |SupplicantStatusCode.SUCCESS|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ setKeyMgmt(uint32_t keyMgmtMask) generates (SupplicantStatus status);
+
+ /**
+ * Set proto mask for the network.
+ *
+ * @param protoMask value to set.
+ * Combination of |ProtoMask| values.
+ * @return status Status of the operation.
+ * Possible status codes:
+ * |SupplicantStatusCode.SUCCESS|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ setProto(uint32_t protoMask) generates (SupplicantStatus status);
+
+ /**
+ * Set auth alg mask for the network.
+ *
+ * @param authAlgMask value to set.
+ * Combination of |ProtoMask| values.
+ * @return status Status of the operation.
+ * Possible status codes:
+ * |SupplicantStatusCode.SUCCESS|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ setAuthAlg(uint32_t authAlgMask) generates (SupplicantStatus status);
+
+ /**
+ * Set group cipher mask for the network.
+ *
+ * @param groupCipherMask value to set.
+ * Combination of |ProtoMask| values.
+ * @return status Status of the operation.
+ * Possible status codes:
+ * |SupplicantStatusCode.SUCCESS|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ setGroupCipher(uint32_t groupCipherMask)
+ generates (SupplicantStatus status);
+
+ /**
+ * Set pairwise cipher mask for the network.
+ *
+ * @param pairwiseCipherMask value to set.
+ * Combination of |ProtoMask| values.
+ * @return status Status of the operation.
+ * Possible status codes:
+ * |SupplicantStatusCode.SUCCESS|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ setPairwiseCipher(uint32_t pairwiseCipherMask)
+ generates (SupplicantStatus status);
+
+ /**
+ * Set passphrase for WPA_PSK network.
+ *
+ * @param psk value to set.
+ * Length of value must be between
+ * |ParamSizeLimits.PSK_PASSPHRASE_MIN_LEN_IN_BYTES| and
+ * |ParamSizeLimits.PSK_PASSPHRASE_MAX_LEN_IN_BYTES|.
+ * @return status Status of the operation.
+ * Possible status codes:
+ * |SupplicantStatusCode.SUCCESS|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ setPskPassphrase(string psk) generates (SupplicantStatus status);
+
+ /**
+ * Set WEP key for WEP network.
+ *
+ * @param keyIdx Index of wep key to set.
+ * Max of |ParamSizeLimits.WEP_KEYS_MAX_NUM|.
+ * @param wepKey value to set.
+ * Length of each key must be either
+ * |ParamSizeLimits.WEP40_KEY_LEN_IN_BYTES| or
+ * |ParamSizeLimits.WEP104_KEY_LEN_IN_BYTES|.
+ * @return status Status of the operation.
+ * Possible status codes:
+ * |SupplicantStatusCode.SUCCESS|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ setWepKey(uint32_t keyIdx, vec<uint8_t> wepKey)
+ generates (SupplicantStatus status);
+
+ /**
+ * Set default Tx key index for WEP network.
+ *
+ * @param KeyIdx value to set.
+ * Max of |ParamSizeLimits.WEP_KEYS_MAX_NUM|.
+ * @return status Status of the operation.
+ * Possible status codes:
+ * |SupplicantStatusCode.SUCCESS|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ setWepTxKeyIdx(uint32_t keyIdx)
+ generates (SupplicantStatus status);
+
+ /**
+ * Set whether RequirePmf is enabled for this network.
+ *
+ * @param enable true to set, false otherwise.
+ * @return status Status of the operation.
+ * Possible status codes:
+ * |SupplicantStatusCode.SUCCESS|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ setRequirePmf(bool enable) generates (SupplicantStatus status);
+
+ /**
+ * Set EAP Method for this network.
+ *
+ * @param method value to be set.
+ * Must be one of |EapMethod| values.
+ * @return status Status of the operation.
+ * Possible status codes:
+ * |SupplicantStatusCode.SUCCESS|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ setEapMethod(EapMethod method)
+ generates (SupplicantStatus status);
+
+ /**
+ * Set EAP Phase2 Method for this network.
+ *
+ * @param method value to set.
+ * Must be one of |EapPhase2Method| values.
+ * @return status Status of the operation.
+ * Possible status codes:
+ * |SupplicantStatusCode.SUCCESS|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ setEapPhase2Method(EapPhase2Method method)
+ generates (SupplicantStatus status);
+
+ /**
+ * Set EAP Identity for this network.
+ *
+ * @param identity value to set.
+ * @return status Status of the operation.
+ * Possible status codes:
+ * |SupplicantStatusCode.SUCCESS|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ setEapIdentity(vec<uint8_t> identity)
+ generates (SupplicantStatus status);
+
+ /**
+ * Set EAP Anonymous Identity for this network.
+ *
+ * @param identity value to set.
+ * @return status Status of the operation.
+ * Possible status codes:
+ * |SupplicantStatusCode.SUCCESS|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ setEapAnonymousIdentity(vec<uint8_t> identity)
+ generates (SupplicantStatus status);
+
+ /**
+ * Set EAP Password for this network.
+ *
+ * @param password value to set.
+ * @return status Status of the operation.
+ * Possible status codes:
+ * |SupplicantStatusCode.SUCCESS|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ setEapPassword(vec<uint8_t> password)
+ generates (SupplicantStatus status);
+
+ /**
+ * Set EAP CA certificate file path for this network.
+ *
+ * @param path value to set.
+ * @return status Status of the operation.
+ * Possible status codes:
+ * |SupplicantStatusCode.SUCCESS|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ setEapCACert(string path) generates (SupplicantStatus status);
+
+ /**
+ * Set EAP CA certificate directory path for this network.
+ *
+ * @param path value to set.
+ * @return status Status of the operation.
+ * Possible status codes:
+ * |SupplicantStatusCode.SUCCESS|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ setEapCAPath(string path) generates (SupplicantStatus status);
+
+ /**
+ * Set EAP Client certificate file path for this network.
+ *
+ * @param path value to set.
+ * @return status Status of the operation.
+ * Possible status codes:
+ * |SupplicantStatusCode.SUCCESS|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ setEapClientCert(string path) generates (SupplicantStatus status);
+
+ /**
+ * Set EAP private key file path for this network.
+ *
+ * @param path value to set.
+ * @return status Status of the operation.
+ * Possible status codes:
+ * |SupplicantStatusCode.SUCCESS|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ setEapPrivateKey(string path) generates (SupplicantStatus status);
+
+ /**
+ * Set EAP subject match for this network.
+ *
+ * @param match value to set.
+ * @return status Status of the operation.
+ * Possible status codes:
+ * |SupplicantStatusCode.SUCCESS|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ setEapSubjectMatch(string match) generates (SupplicantStatus status);
+
+ /**
+ * Set EAP Altsubject match for this network.
+ *
+ * @param match value to set.
+ * @return status Status of the operation.
+ * Possible status codes:
+ * |SupplicantStatusCode.SUCCESS|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ setEapAltSubjectMatch(string match)
+ generates (SupplicantStatus status);
+
+ /**
+ * Enable EAP Open SSL Engine for this network.
+ *
+ * @param enable true to set, false otherwise.
+ * @return status Status of the operation.
+ * Possible status codes:
+ * |SupplicantStatusCode.SUCCESS|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ setEapEngine(bool enable) generates (SupplicantStatus status);
+
+ /**
+ * Set EAP Open SSL Engine ID for this network.
+ *
+ * @param id value to set.
+ * @return status Status of the operation.
+ * Possible status codes:
+ * |SupplicantStatusCode.SUCCESS|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ setEapEngineID(string id) generates (SupplicantStatus status);
+
+ /**
+ * Set EAP Domain suffix match for this network.
+ *
+ * @param match value to set.
+ * @return status Status of the operation.
+ * Possible status codes:
+ * |SupplicantStatusCode.SUCCESS|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ setEapDomainSuffixMatch(string match)
+ generates (SupplicantStatus status);
+
+ /**
+ * Getters for the various network params.
+ */
+ /**
+ * Get SSID for this network.
+ *
+ * @return status Status of the operation.
+ * Possible status codes:
+ * |SupplicantStatusCode.SUCCESS|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ * @return ssid value set.
+ */
+ getSsid() generates (SupplicantStatus status, Ssid ssid);
+
+ /**
+ * Get the BSSID set for this network.
+ *
+ * @return status Status of the operation.
+ * Possible status codes:
+ * |SupplicantStatusCode.SUCCESS|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ * @return bssid value set.
+ */
+ getBssid() generates (SupplicantStatus status, Bssid bssid);
+
+ /**
+ * Get whether Probe Requests are being sent for this network (hidden).
+ *
+ * @return status Status of the operation.
+ * Possible status codes:
+ * |SupplicantStatusCode.SUCCESS|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ * @return enabled true if set, false otherwise.
+ */
+ getScanSsid() generates (SupplicantStatus status, bool enabled);
+
+ /**
+ * Get the key mgmt mask set for the network.
+ *
+ * @return status Status of the operation.
+ * Possible status codes:
+ * |SupplicantStatusCode.SUCCESS|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ * @return keyMgmtMask Combination of |KeyMgmtMask| values.
+ */
+ getKeyMgmt()
+ generates (SupplicantStatus status, uint32_t keyMgmtMask);
+
+ /**
+ * Get the proto mask set for the network.
+ *
+ * @return status Status of the operation.
+ * Possible status codes:
+ * |SupplicantStatusCode.SUCCESS|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ * @return protoMask Combination of |ProtoMask| values.
+ */
+ getProto() generates (SupplicantStatus status, uint32_t protoMask);
+
+ /**
+ * Get the auth alg mask set for the network.
+ *
+ * @return status Status of the operation.
+ * Possible status codes:
+ * |SupplicantStatusCode.SUCCESS|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ * @return authAlgMask Combination of |AuthAlgMask| values.
+ */
+ getAuthAlg()
+ generates (SupplicantStatus status, uint32_t authAlgMask);
+
+ /**
+ * Get the group cipher mask set for the network.
+ *
+ * @return status Status of the operation.
+ * Possible status codes:
+ * |SupplicantStatusCode.SUCCESS|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ * @return groupCipherMask Combination of |GroupCipherMask| values.
+ */
+ getGroupCipher()
+ generates (SupplicantStatus status, uint32_t groupCipherMask);
+
+ /**
+ * Get the pairwise cipher mask set for the network.
+ *
+ * @return status Status of the operation.
+ * Possible status codes:
+ * |SupplicantStatusCode.SUCCESS|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ * @return pairwiseCipherMask Combination of |PairwiseCipherMask| values.
+ */
+ getPairwiseCipher()
+ generates (SupplicantStatus status, uint32_t pairwiseCipherMask);
+
+ /**
+ * Get passphrase for WPA_PSK network.
+ *
+ * @return status Status of the operation.
+ * Possible status codes:
+ * |SupplicantStatusCode.SUCCESS|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ * @return psk value set.
+ */
+ getPskPassphrase() generates (SupplicantStatus status, string psk);
+
+ /**
+ * Get WEP key for WEP network.
+ *
+ * @param keyIdx Index of wep key to be fetched.
+ * Max of |WEP_KEYS_MAX_NUM|.
+ * @return status Status of the operation.
+ * Possible status codes:
+ * |SupplicantStatusCode.SUCCESS|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ * @return wepKey value set.
+ */
+ getWepKey(uint32_t keyIdx)
+ generates (SupplicantStatus status, vec<uint8_t> wepKey);
+
+ /**
+ * Get default Tx key index for WEP network.
+ *
+ * @return status Status of the operation.
+ * Possible status codes:
+ * |SupplicantStatusCode.SUCCESS|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ * @return keyIdx value set.
+ */
+ getWepTxKeyIdx()
+ generates (SupplicantStatus status, uint32_t keyIdx);
+
+ /**
+ * Get whether RequirePmf is enabled for this network.
+ *
+ * @return status Status of the operation.
+ * Possible status codes:
+ * |SupplicantStatusCode.SUCCESS|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ * @return enabled true if set, false otherwise.
+ */
+ getRequirePmf() generates (SupplicantStatus status, bool enabled);
+
+ /**
+ * Enable the network for connection purposes.
+ *
+ * This must trigger a connection to the network if:
+ * a) |noConnect| is false, and
+ * b) This is the only network configured, and
+ * c) Is visible in the current scan results.
+ *
+ * @param noConnect Only enable the network, dont trigger a connect.
+ * @return status Status of the operation.
+ * Possible status codes:
+ * |SupplicantStatusCode.SUCCESS|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ enable(bool noConnect) generates (SupplicantStatus status);
+
+ /**
+ * Disable the network for connection purposes.
+ *
+ * This must trigger a disconnection from the network, if currently
+ * connected to this one.
+ *
+ * @return status Status of the operation.
+ * Possible status codes:
+ * |SupplicantStatusCode.SUCCESS|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ disable() generates (SupplicantStatus status);
+
+ /**
+ * Initiate connection to this network.
+ *
+ * @return status Status of the operation.
+ * Possible status codes:
+ * |SupplicantStatusCode.SUCCESS|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ select() generates (SupplicantStatus status);
+
+ /**
+ * Used to send a response to the
+ * |ISupplicantNetworkCallback.onNetworkEapSimGsmAuthRequest| request.
+ *
+ * @param params Params to be used for EAP GSM authentication.
+ * @return status Status of the operation.
+ * Possible status codes:
+ * |SupplicantStatusCode.SUCCESS|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ sendNetworkEapSimGsmAuthResponse(NetworkResponseEapSimGsmAuthParams params)
+ generates (SupplicantStatus status);
+
+ /**
+ * Used to send a response to the
+ * |ISupplicantNetworkCallback.onNetworkEapSimUmtsAuthRequest| request.
+ *
+ * @param params Params to be used for EAP UMTS authentication.
+ * @return status Status of the operation.
+ * Possible status codes:
+ * |SupplicantStatusCode.SUCCESS|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ sendNetworkEapSimUmtsAuthResponse(NetworkResponseEapSimUmtsAuthParams params)
+ generates (SupplicantStatus status);
+
+ /**
+ * Used to send a response to the
+ * |ISupplicantNetworkCallback.onNetworkEapIdentityRequest| request.
+ *
+ * @param identity Identity to be used for the network.
+ * @return status Status of the operation.
+ * Possible status codes:
+ * |SupplicantStatusCode.SUCCESS|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ sendNetworkEapIdentityResponse(vec<uint8_t> identity)
+ generates (SupplicantStatus status);
+};
diff --git a/wifi/supplicant/1.0/ISupplicantNetworkCallback.hal b/wifi/supplicant/1.0/ISupplicantStaNetworkCallback.hal
similarity index 93%
rename from wifi/supplicant/1.0/ISupplicantNetworkCallback.hal
rename to wifi/supplicant/1.0/ISupplicantStaNetworkCallback.hal
index 9a5ddd5..2419dcc 100644
--- a/wifi/supplicant/1.0/ISupplicantNetworkCallback.hal
+++ b/wifi/supplicant/1.0/ISupplicantStaNetworkCallback.hal
@@ -18,13 +18,13 @@
/**
* Callback Interface exposed by the wpa_supplicant service
- * for each network (ISupplicantNetwork).
+ * for each network (ISupplicantStaNetwork).
*
* Clients need to host an instance of this HIDL interface object and
* pass a reference of the object to wpa_supplicant via the
- * corresponding |ISupplicantNetwork.registerCallback| method.
+ * corresponding |ISupplicantStaNetwork.registerCallback| method.
*/
-interface ISupplicantNetworkCallback {
+interface ISupplicantStaNetworkCallback {
/** Params of |onNetworkEapSimGsmAuthRequest| request. (Refer RFC 4186) */
typedef uint8_t[16] GsmRand;
struct NetworkRequestEapSimGsmAuthParams {
diff --git a/wifi/supplicant/1.0/types.hal b/wifi/supplicant/1.0/types.hal
index e9426a6..16a8d15 100644
--- a/wifi/supplicant/1.0/types.hal
+++ b/wifi/supplicant/1.0/types.hal
@@ -65,3 +65,11 @@
/** Supplicant network ID type. */
typedef uint32_t SupplicantNetworkId;
+
+/**
+ * List of Iface types supported.
+ */
+enum IfaceType : uint32_t {
+ STA,
+ P2P
+};