Merge commit 'bf7dcd2a' into oc-dr1-dev-plus-aosp

Change-Id: Ic64fbf4782e129e15f0edbe2db810e81b04acd82
diff --git a/OWNERS b/OWNERS
new file mode 100644
index 0000000..9fbcb47
--- /dev/null
+++ b/OWNERS
@@ -0,0 +1,5 @@
+elsk@google.com
+maco@google.com
+malchev@google.com
+smoreland@google.com
+yim@google.com  # vts tests
diff --git a/automotive/vehicle/2.0/default/tests/VehicleHalTestUtils.h b/automotive/vehicle/2.0/default/tests/VehicleHalTestUtils.h
index 28e1a5a..2a06417 100644
--- a/automotive/vehicle/2.0/default/tests/VehicleHalTestUtils.h
+++ b/automotive/vehicle/2.0/default/tests/VehicleHalTestUtils.h
@@ -222,54 +222,6 @@
     return ss.str();
 }
 
-inline std::string toString(const VehiclePropValue &v) {
-    std::stringstream ss;
-    ss << "VehiclePropValue {n"
-       << "  prop: " << hexString(v.prop) << ",\n"
-       << "  areaId: " << hexString(v.areaId) << ",\n"
-       << "  timestamp: " << v.timestamp << ",\n"
-       << "  value {\n"
-       << "    int32Values: " << vecToString(v.value.int32Values) << ",\n"
-       << "    floatValues: " << vecToString(v.value.floatValues) << ",\n"
-       << "    int64Values: " << vecToString(v.value.int64Values) << ",\n"
-       << "    bytes: " << vecToString(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: " << hexString(config.prop) << ",\n"
-       << "  supportedAreas: " << hexString(config.supportedAreas) << ",\n"
-       << "  access: " << enumToHexString(config.access) << ",\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 automotive
diff --git a/bluetooth/1.0/default/bluetooth_hci.h b/bluetooth/1.0/default/bluetooth_hci.h
index 6912405..e2797b1 100644
--- a/bluetooth/1.0/default/bluetooth_hci.h
+++ b/bluetooth/1.0/default/bluetooth_hci.h
@@ -21,6 +21,8 @@
 
 #include <hidl/MQDescriptor.h>
 
+#include <functional>
+
 namespace android {
 namespace hardware {
 namespace bluetooth {
diff --git a/bluetooth/1.0/default/hci_protocol.cc b/bluetooth/1.0/default/hci_protocol.cc
index a208da1..5d6f1d1 100644
--- a/bluetooth/1.0/default/hci_protocol.cc
+++ b/bluetooth/1.0/default/hci_protocol.cc
@@ -18,6 +18,7 @@
 
 #define LOG_TAG "android.hardware.bluetooth-hci-hci_protocol"
 #include <assert.h>
+#include <errno.h>
 #include <fcntl.h>
 #include <log/log.h>
 
diff --git a/radio/1.1/Android.mk b/radio/1.1/Android.mk
index f844d07..b83ac80 100644
--- a/radio/1.1/Android.mk
+++ b/radio/1.1/Android.mk
@@ -75,6 +75,25 @@
 LOCAL_GENERATED_SOURCES += $(GEN)
 
 #
+# Build types.hal (ImsiEncryptionInfo)
+#
+GEN := $(intermediates)/android/hardware/radio/V1_1/ImsiEncryptionInfo.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 \
+        -randroid.hidl:system/libhidl/transport \
+        android.hardware.radio@1.1::types.ImsiEncryptionInfo
+
+$(GEN): $(LOCAL_PATH)/types.hal
+	$(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
 # Build types.hal (KeepaliveRequest)
 #
 GEN := $(intermediates)/android/hardware/radio/V1_1/KeepaliveRequest.java
@@ -421,6 +440,25 @@
 LOCAL_GENERATED_SOURCES += $(GEN)
 
 #
+# Build types.hal (ImsiEncryptionInfo)
+#
+GEN := $(intermediates)/android/hardware/radio/V1_1/ImsiEncryptionInfo.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 \
+        -randroid.hidl:system/libhidl/transport \
+        android.hardware.radio@1.1::types.ImsiEncryptionInfo
+
+$(GEN): $(LOCAL_PATH)/types.hal
+	$(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
 # Build types.hal (KeepaliveRequest)
 #
 GEN := $(intermediates)/android/hardware/radio/V1_1/KeepaliveRequest.java
diff --git a/radio/1.1/IRadio.hal b/radio/1.1/IRadio.hal
index 084c156..22d27d4 100644
--- a/radio/1.1/IRadio.hal
+++ b/radio/1.1/IRadio.hal
@@ -34,23 +34,13 @@
      * switch and everytime the framework receives a new certificate.
      *
      * @param serial Serial number of request.
-     * @param carrierKey Carrier specific key to be used for encryption. It must
-     *        be opaque to the framework. This is the byte-stream representation
-     *        of the key. This is an external encoded form for the key used when
-     *        a standard representation of the key is needed outside the Java
-     *        Virtual Machine, as when transmitting the key to some other party.
-     *        The key is encoded according to a standard format
-     *        (such as X.509 SubjectPublicKeyInfo or PKCS#8), and is returned using
-     *        the getEncoded method.
-     * @param keyIdentifier This is an opaque value we're given by the carrier
-     *        and is returned to the carrier. This is used by the server to
-     *        help it locate the private key to decrypt the permanent identity.
+     * @param message ImsiEncryptionInfo as defined in types.hal.
+     *
      *
      * Response callback is
      * IRadioResponse.setCarrierInfoForImsiEncryptionResponse()
      */
-     oneway setCarrierInfoForImsiEncryption(int32_t serial, vec<uint8_t> carrierKey,
-             string keyIdentifier);
+     oneway setCarrierInfoForImsiEncryption(int32_t serial, ImsiEncryptionInfo imsiEncryptionInfo);
 
     /**
      * Set SIM card power state.
diff --git a/radio/1.1/types.hal b/radio/1.1/types.hal
index c9f4bc9..a8d836c 100644
--- a/radio/1.1/types.hal
+++ b/radio/1.1/types.hal
@@ -176,6 +176,26 @@
     vec<CellInfo> networkInfos;             // List of network information as CellInfo
 };
 
+struct ImsiEncryptionInfo {
+    string mcc;                   // MCC of the Carrier.
+    string mnc;                   // MNC of the Carrier.
+    vec<uint8_t> carrierKey;      // Carrier specific key to be used for encryption. It must
+                                  // be opaque to the framework. This is the byte-stream
+                                  // representation of the key. This is an external encoded
+                                  // form for the key used when a standard representation of
+                                  // the key is needed outside the Java Virtual Machine, as
+                                  // when transmitting the key to some other party.
+                                  // The key is encoded according to a standard format
+                                  // (such as X.509 SubjectPublicKeyInfo or PKCS#8), and is
+                                  // returned using the getEncoded method as defined on the
+                                  // java.security.Key interface.
+    string keyIdentifier;         // This is an opaque value we're given by the carrier
+                                  // and is returned to the carrier. This is used by the server to
+                                  // help it locate the private key to decrypt the permanent
+                                  // identity.
+    int64_t expirationTime;       // date-time in UTC when the key will expire.
+};
+
 struct KeepaliveRequest {
     KeepaliveType type;                     // The format of the keepalive packet
     vec<uint8_t> sourceAddress;             // source address with type = family, in network