Merge "persist ringbuffer to flash when vendor hal stops" into pi-dev
diff --git a/audio/core/4.0/vts/functional/AudioPrimaryHidlHalTest.cpp b/audio/core/4.0/vts/functional/AudioPrimaryHidlHalTest.cpp
index a568a3c..9484ddd 100644
--- a/audio/core/4.0/vts/functional/AudioPrimaryHidlHalTest.cpp
+++ b/audio/core/4.0/vts/functional/AudioPrimaryHidlHalTest.cpp
@@ -63,6 +63,7 @@
 using ::android::hardware::audio::V4_0::DeviceAddress;
 using ::android::hardware::audio::V4_0::IDevice;
 using ::android::hardware::audio::V4_0::IPrimaryDevice;
+using Rotation = ::android::hardware::audio::V4_0::IPrimaryDevice::Rotation;
 using TtyMode = ::android::hardware::audio::V4_0::IPrimaryDevice::TtyMode;
 using ::android::hardware::audio::V4_0::IDevicesFactory;
 using ::android::hardware::audio::V4_0::IStream;
@@ -95,6 +96,11 @@
 
 using namespace ::android::hardware::audio::common::test::utility;
 
+// Typical accepted results from interface methods
+static auto okOrNotSupported = {Result::OK, Result::NOT_SUPPORTED};
+static auto okOrNotSupportedOrInvalidArgs = {Result::OK, Result::NOT_SUPPORTED,
+                                             Result::INVALID_ARGUMENTS};
+
 class AudioHidlTestEnvironment : public ::Environment {
    public:
     virtual void registerTestServices() override { registerTestService<IDevicesFactory>(); }
@@ -439,11 +445,7 @@
 TEST_F(AudioPrimaryHidlTest, setScreenState) {
     doc::test("Check that the hal can receive the screen state");
     for (bool turnedOn : {false, true, true, false, false}) {
-        auto ret = device->setScreenState(turnedOn);
-        ASSERT_IS_OK(ret);
-        Result result = ret;
-        auto okOrNotSupported = {Result::OK, Result::NOT_SUPPORTED};
-        ASSERT_RESULT(okOrNotSupported, result);
+        ASSERT_RESULT(okOrNotSupported, device->setScreenState(turnedOn));
     }
 }
 
@@ -783,7 +785,7 @@
                testCapabilityGetter("getSupportedFormat", stream.get(), &getSupportedFormats,
                                     &IStream::getFormat, &IStream::setFormat))
 
-static void testGetDevice(IStream* stream, AudioDevice expectedDevice) {
+static void testGetDevices(IStream* stream, AudioDevice expectedDevice) {
     hidl_vec<DeviceAddress> devices;
     Result res;
     ASSERT_OK(stream->getDevices(returnIn(res, devices)));
@@ -798,11 +800,11 @@
         << "\n  Actual: " << ::testing::PrintToString(device);
 }
 
-TEST_IO_STREAM(GetDevice, "Check that the stream device == the one it was opened with",
+TEST_IO_STREAM(GetDevices, "Check that the stream device == the one it was opened with",
                areAudioPatchesSupported() ? doc::partialTest("Audio patches are supported")
-                                          : testGetDevice(stream.get(), address.device))
+                                          : testGetDevices(stream.get(), address.device))
 
-static void testSetDevice(IStream* stream, const DeviceAddress& address) {
+static void testSetDevices(IStream* stream, const DeviceAddress& address) {
     DeviceAddress otherAddress = address;
     otherAddress.device = (address.device & AudioDevice::BIT_IN) == 0 ? AudioDevice::OUT_SPEAKER
                                                                       : AudioDevice::IN_BUILTIN_MIC;
@@ -811,9 +813,9 @@
     ASSERT_OK(stream->setDevices({address}));  // Go back to the original value
 }
 
-TEST_IO_STREAM(SetDevice, "Check that the stream can be rerouted to SPEAKER or BUILTIN_MIC",
+TEST_IO_STREAM(SetDevices, "Check that the stream can be rerouted to SPEAKER or BUILTIN_MIC",
                areAudioPatchesSupported() ? doc::partialTest("Audio patches are supported")
-                                          : testSetDevice(stream.get(), address))
+                                          : testSetDevices(stream.get(), address))
 
 static void testGetAudioProperties(IStream* stream, AudioConfig expectedConfig) {
     uint32_t sampleRateHz;
@@ -833,10 +835,8 @@
                "Check that the stream audio properties == the ones it was opened with",
                testGetAudioProperties(stream.get(), audioConfig))
 
-static auto invalidArgsOrNotSupportedOrOK = {Result::INVALID_ARGUMENTS, Result::NOT_SUPPORTED,
-                                             Result::OK};
 TEST_IO_STREAM(SetHwAvSync, "Try to set hardware sync to an invalid value",
-               ASSERT_RESULT(invalidArgsOrNotSupportedOrOK, stream->setHwAvSync(666)))
+               ASSERT_RESULT(okOrNotSupportedOrInvalidArgs, stream->setHwAvSync(666)))
 
 static void checkGetHwAVSync(IDevice* device) {
     Result res;
@@ -882,7 +882,7 @@
                // error code when a key is not supported.
                // To allow implementation to just wrapped the legacy one, consider OK as a
                // valid result for setting a non existing parameter.
-               ASSERT_RESULT(invalidArgsOrNotSupportedOrOK,
+               ASSERT_RESULT(okOrNotSupportedOrInvalidArgs,
                              stream->setParameters({}, {{"non existing key", "0"}})))
 
 TEST_IO_STREAM(DebugDump, "Check that a stream can dump its state without error",
@@ -1147,7 +1147,6 @@
     auto res = stream->setCallback(new MockOutCallbacks);
     stream->clearCallback();  // try to restore the no callback state, ignore
                               // any error
-    auto okOrNotSupported = {Result::OK, Result::NOT_SUPPORTED};
     EXPECT_RESULT(okOrNotSupported, res);
     return res.isOk() ? res == Result::OK : false;
 }
@@ -1257,6 +1256,11 @@
     ASSERT_PRED2([](auto c, auto m) { return c - m < 1e+6; }, currentTime, mesureTime);
 }
 
+TEST_P(OutputStreamTest, SelectPresentation) {
+    doc::test("Verify that presentation selection does not crash");
+    ASSERT_RESULT(okOrNotSupported, stream->selectPresentation(0, 0));
+}
+
 //////////////////////////////////////////////////////////////////////////////
 /////////////////////////////// PrimaryDevice ////////////////////////////////
 //////////////////////////////////////////////////////////////////////////////
@@ -1283,6 +1287,42 @@
     }
 }
 
+TEST_F(AudioPrimaryHidlTest, setBtHfpSampleRate) {
+    doc::test(
+        "Make sure setBtHfpSampleRate either succeeds or "
+        "indicates that it is not supported at all, or that the provided value is invalid");
+    for (auto samplingRate : {8000, 16000, 22050, 24000}) {
+        ASSERT_RESULT(okOrNotSupportedOrInvalidArgs, device->setBtHfpSampleRate(samplingRate));
+    }
+}
+
+TEST_F(AudioPrimaryHidlTest, setBtHfpVolume) {
+    doc::test(
+        "Make sure setBtHfpVolume is either not supported or "
+        "only succeed if volume is in [0,1]");
+    auto ret = device->setBtHfpVolume(0.0);
+    if (ret == Result::NOT_SUPPORTED) {
+        doc::partialTest("setBtHfpVolume is not supported");
+        return;
+    }
+    testUnitaryGain([](float volume) { return device->setBtHfpVolume(volume); });
+}
+
+TEST_F(AudioPrimaryHidlTest, setBtScoHeadsetDebugName) {
+    doc::test(
+        "Make sure setBtScoHeadsetDebugName either succeeds or "
+        "indicates that it is not supported");
+    ASSERT_RESULT(okOrNotSupported, device->setBtScoHeadsetDebugName("test"));
+}
+
+TEST_F(AudioPrimaryHidlTest, updateRotation) {
+    doc::test("Check that the hal can receive the current rotation");
+    for (Rotation rotation : {Rotation::DEG_0, Rotation::DEG_90, Rotation::DEG_180,
+                              Rotation::DEG_270, Rotation::DEG_0}) {
+        ASSERT_RESULT(okOrNotSupported, device->updateRotation(rotation));
+    }
+}
+
 TEST_F(BoolAccessorPrimaryHidlTest, BtScoNrecEnabled) {
     doc::test("Query and set the BT SCO NR&EC state");
     testOptionalAccessors("BtScoNrecEnabled", {true, false, true},
@@ -1297,6 +1337,12 @@
                           &IPrimaryDevice::getBtScoWidebandEnabled);
 }
 
+TEST_F(BoolAccessorPrimaryHidlTest, setGetBtHfpEnabled) {
+    doc::test("Query and set the BT HFP state");
+    testOptionalAccessors("BtHfpEnabled", {true, false, true}, &IPrimaryDevice::setBtHfpEnabled,
+                          &IPrimaryDevice::getBtHfpEnabled);
+}
+
 using TtyModeAccessorPrimaryHidlTest = AccessorPrimaryHidlTest<TtyMode>;
 TEST_F(TtyModeAccessorPrimaryHidlTest, setGetTtyMode) {
     doc::test("Query and set the TTY mode state");
diff --git a/audio/core/all-versions/default/include/core/all-versions/default/PrimaryDevice.impl.h b/audio/core/all-versions/default/include/core/all-versions/default/PrimaryDevice.impl.h
index f00cac4..9b39d9c 100644
--- a/audio/core/all-versions/default/include/core/all-versions/default/PrimaryDevice.impl.h
+++ b/audio/core/all-versions/default/include/core/all-versions/default/PrimaryDevice.impl.h
@@ -16,6 +16,10 @@
 
 #include <common/all-versions/IncludeGuard.h>
 
+#ifdef AUDIO_HAL_VERSION_4_0
+#include <cmath>
+#endif
+
 namespace android {
 namespace hardware {
 namespace audio {
@@ -244,7 +248,13 @@
     return mDevice->setParam(AUDIO_PARAMETER_KEY_HFP_SET_SAMPLING_RATE, int(sampleRateHz));
 }
 Return<Result> PrimaryDevice::setBtHfpVolume(float volume) {
-    return mDevice->setParam(AUDIO_PARAMETER_KEY_HFP_VOLUME, volume);
+    if (!all_versions::implementation::isGainNormalized(volume)) {
+        ALOGW("Can not set BT HFP volume (%f) outside [0,1]", volume);
+        return Result::INVALID_ARGUMENTS;
+    }
+    // Map the normalized volume onto the range of [0, 15]
+    return mDevice->setParam(AUDIO_PARAMETER_KEY_HFP_VOLUME,
+                             static_cast<int>(std::round(volume * 15)));
 }
 Return<Result> PrimaryDevice::updateRotation(IPrimaryDevice::Rotation rotation) {
     // legacy API expects the rotation in degree
diff --git a/automotive/vehicle/2.0/types.hal b/automotive/vehicle/2.0/types.hal
index 15ba494..12e2257 100644
--- a/automotive/vehicle/2.0/types.hal
+++ b/automotive/vehicle/2.0/types.hal
@@ -654,7 +654,8 @@
      * HVAC current temperature.
      *
      * @change_mode VehiclePropertyChangeMode:ON_CHANGE
-     * @access VehiclePropertyAccess:READ_WRITE
+     * @access VehiclePropertyAccess:READ
+     * @unit VehicleUnit:CELSIUS
      */
     HVAC_TEMPERATURE_CURRENT = (
         0x0502
@@ -667,6 +668,7 @@
      *
      * @change_mode VehiclePropertyChangeMode:ON_CHANGE
      * @access VehiclePropertyAccess:READ_WRITE
+     * @unit VehicleUnit:CELSIUS
      */
     HVAC_TEMPERATURE_SET = (
         0x0503
@@ -791,7 +793,7 @@
         | VehicleArea:SEAT),
 
     /**
-     * Seat temperature
+     * Seat heating/cooling
      *
      * Negative values indicate cooling.
      * 0 indicates off.
@@ -847,9 +849,11 @@
     /**
      * Temperature units for display
      *
-     * Indicates whether the temperature is in Celsius, Fahrenheit, or a
-     * different unit from VehicleUnit enum.  This parameter MAY be used for
-     * displaying any HVAC temperature in the system.
+     * Indicates whether the vehicle is displaying temperature to the user as
+     * Celsius or Fahrenheit.
+     * This parameter MAY be used for displaying any HVAC temperature in the system.
+     * Values must be one of VehicleUnit::CELSIUS or VehicleUnit::FAHRENHEIT
+     * Note that internally, all temperatures are represented in floating point Celsius.
      *
      * @change_mode VehiclePropertyChangeMode:ON_CHANGE
      * @access VehiclePropertyAccess:READ_WRITE
@@ -1629,8 +1633,8 @@
     /**
      * Window Position
      *
-     * Max = window up / closed
-     * Min = window down / open
+     * Min = window up / closed
+     * Max = window down / open
      *
      * For a window that may open out of plane (i.e. vent mode of sunroof) this
      * parameter will work with negative values as follows:
@@ -1652,25 +1656,25 @@
     /**
      * Window Move
      *
-     * Max = window up / closed
-     * Min = window down / open
-     * Magnitude denotes relative speed.  I.e. +2 is faster than +1 in raising
+     * Max = Open the window as fast as possible
+     * Min = Close the window as fast as possible
+     * Magnitude denotes relative speed.  I.e. +2 is faster than +1 in closing
      * the window.
      *
      * For a window that may open out of plane (i.e. vent mode of sunroof) this
      * parameter will work as follows:
      *
-     *  If sunroof is open:
-     *    Max = open the sunroof further, automatically stop when fully open.
-     *    Min = close the sunroof, automatically stop when sunroof is closed.
+     * If sunroof is open:
+     *   Max = open the sunroof further, automatically stop when fully open.
+     *   Min = close the sunroof, automatically stop when sunroof is closed.
      *
      * If vent is open:
-     *  Max = close the vent, automatically stop when vent is closed.
-     *  Min = open the vent further, automatically stop when vent is fully open.
+     *   Max = close the vent, automatically stop when vent is closed.
+     *   Min = open the vent further, automatically stop when vent is fully open.
      *
-     * If window is in the closed position:
-     *  Max = open the sunroof, automatically stop when sunroof is fully open.
-     *  Min = open the vent, automatically stop when vent is fully open.
+     * If sunroof is in the closed position:
+     *   Max = open the sunroof, automatically stop when sunroof is fully open.
+     *   Min = open the vent, automatically stop when vent is fully open.
      *
      * @change_mode VehiclePropertyChangeMode:ON_CHANGE
      * @access VehiclePropertyAccess:READ_WRITE
diff --git a/camera/provider/2.4/default/CameraProvider.cpp b/camera/provider/2.4/default/CameraProvider.cpp
index 8e37b26..6313939 100644
--- a/camera/provider/2.4/default/CameraProvider.cpp
+++ b/camera/provider/2.4/default/CameraProvider.cpp
@@ -298,7 +298,8 @@
         return true;
     }
 
-    mPreferredHal3MinorVersion = property_get_int32("ro.camera.wrapper.hal3TrebleMinorVersion", 3);
+    mPreferredHal3MinorVersion =
+        property_get_int32("ro.vendor.camera.wrapper.hal3TrebleMinorVersion", 3);
     ALOGV("Preferred HAL 3 minor version is %d", mPreferredHal3MinorVersion);
     switch(mPreferredHal3MinorVersion) {
         case 2:
diff --git a/compatibility_matrices/Android.mk b/compatibility_matrices/Android.mk
index 948b4fe..ee97433 100644
--- a/compatibility_matrices/Android.mk
+++ b/compatibility_matrices/Android.mk
@@ -34,30 +34,47 @@
 LOCAL_MODULE := framework_compatibility_matrix.legacy.xml
 LOCAL_MODULE_STEM := compatibility_matrix.legacy.xml
 LOCAL_SRC_FILES := $(LOCAL_MODULE_STEM)
-LOCAL_KERNEL_VERSIONS := 3.18.0 4.4.0 4.9.0
+LOCAL_KERNEL_VERSIONS := \
+    3.18.0 \
+    4.4.0 \
+    4.9.0 \
+    4.14.0 \
+
 include $(BUILD_FRAMEWORK_COMPATIBILITY_MATRIX)
 
 include $(CLEAR_VARS)
 LOCAL_MODULE := framework_compatibility_matrix.1.xml
 LOCAL_MODULE_STEM := compatibility_matrix.1.xml
 LOCAL_SRC_FILES := $(LOCAL_MODULE_STEM)
-LOCAL_KERNEL_VERSIONS := 3.18.0 4.4.0 4.9.0
+LOCAL_KERNEL_VERSIONS := \
+    3.18.0 \
+    4.4.0 \
+    4.9.0 \
+    4.14.0 \
+
 include $(BUILD_FRAMEWORK_COMPATIBILITY_MATRIX)
 
 include $(CLEAR_VARS)
 LOCAL_MODULE := framework_compatibility_matrix.2.xml
 LOCAL_MODULE_STEM := compatibility_matrix.2.xml
 LOCAL_SRC_FILES := $(LOCAL_MODULE_STEM)
-LOCAL_KERNEL_VERSIONS := 3.18.0 4.4.0 4.9.0
-include $(BUILD_FRAMEWORK_COMPATIBILITY_MATRIX)
+LOCAL_KERNEL_VERSIONS := \
+    3.18.0 \
+    4.4.0 \
+    4.9.0 \
+    4.14.0 \
 
-# TODO(b/72409164): STOPSHIP: update kernel version requirements
+include $(BUILD_FRAMEWORK_COMPATIBILITY_MATRIX)
 
 include $(CLEAR_VARS)
 LOCAL_MODULE := framework_compatibility_matrix.3.xml
 LOCAL_MODULE_STEM := compatibility_matrix.3.xml
 LOCAL_SRC_FILES := $(LOCAL_MODULE_STEM)
-LOCAL_KERNEL_VERSIONS := 4.4.0 4.9.0
+LOCAL_KERNEL_VERSIONS := \
+    4.4.0 \
+    4.9.0 \
+    4.14.0 \
+
 include $(BUILD_FRAMEWORK_COMPATIBILITY_MATRIX)
 
 # Framework Compatibility Matrix (common to all FCM versions)
diff --git a/current.txt b/current.txt
index e79e2d6..75b1a06 100644
--- a/current.txt
+++ b/current.txt
@@ -299,7 +299,7 @@
 3b17c1fdfc389e0abe626c37054954b07201127d890c2bc05d47613ec1f4de4f android.hardware.automotive.evs@1.0::types
 b3caf524c46a47d67e6453a34419e1881942d059e146cda740502670e9a752c3 android.hardware.automotive.vehicle@2.0::IVehicle
 7ce8728b27600e840cacf0a832f6942819fe535f9d3797ae052d5eef5065921c android.hardware.automotive.vehicle@2.0::IVehicleCallback
-848fb32d5ca79dd527d966e67c0af5874b6d7b361246b491e315cf7dea7888ab android.hardware.automotive.vehicle@2.0::types
+2e1815967a3e3278a7f304ed7efc04fbc56d0bb65b3126248c3a0d515b93f63d android.hardware.automotive.vehicle@2.0::types
 32cc50cc2a7658ec613c0c2dd2accbf6a05113b749852879e818b8b7b438db19 android.hardware.bluetooth.a2dp@1.0::IBluetoothAudioHost
 ff4be64d7992f8bec97dff37f35450e79b3430c61f85f54322ce45bef229dc3b android.hardware.bluetooth.a2dp@1.0::IBluetoothAudioOffload
 27f22d2e873e6201f9620cf4d8e2facb25bd0dd30a2b911e441b4600d560fa62 android.hardware.bluetooth.a2dp@1.0::types
@@ -338,8 +338,8 @@
 b8c7ed58aa8740361e63d0ce9e7c94227572a629f356958840b34809d2393a7c android.hardware.media.bufferpool@1.0::IClientManager
 4a2c0dc82780e6c90731725a103feab8ab6ecf85a64e049b9cbd2b2c61620fe1 android.hardware.media.bufferpool@1.0::IConnection
 6aef1218e5949f867b0104752ac536c1b707222a403341720de90141df129e3e android.hardware.media.bufferpool@1.0::types
-3e4d8e0085ebe8549efb8ad4b8b400a141a3fa3f47ae23696b3e05a1612eb003 android.hardware.neuralnetworks@1.1::IDevice
-50db076b03a6760557fc60ef433ba9dd2ff983cf3305eeb504b0fff3eaa604ff android.hardware.neuralnetworks@1.1::types
+7698dc2382a2eeb43541840e3ee624f34108efdfb976b2bfa7c13ef15fb8c4c4 android.hardware.neuralnetworks@1.1::IDevice
+5604001029a255648a9e955de0a822a48d9ba7cc259b106fb8be0cd43dc8eece android.hardware.neuralnetworks@1.1::types
 8d3d86da0bfa4bf070970d8303c659f67f35d670c287d45a3f542e4fedadd578 android.hardware.nfc@1.1::INfc
 e85f566698d2a2c28100e264fcf2c691a066756ddf8dd341d009ff50cfe10614 android.hardware.nfc@1.1::INfcClientCallback
 5e278fcaa3287d397d8eebe1c22aaa28150f5caae1cf9381cd6dc32cb37899c5 android.hardware.nfc@1.1::types
diff --git a/neuralnetworks/1.0/vts/functional/GeneratedTestHarness.cpp b/neuralnetworks/1.0/vts/functional/GeneratedTestHarness.cpp
index 4f9d528..ed1fb94 100644
--- a/neuralnetworks/1.0/vts/functional/GeneratedTestHarness.cpp
+++ b/neuralnetworks/1.0/vts/functional/GeneratedTestHarness.cpp
@@ -242,8 +242,8 @@
     // launch prepare model
     sp<PreparedModelCallback> preparedModelCallback = new PreparedModelCallback();
     ASSERT_NE(nullptr, preparedModelCallback.get());
-    Return<ErrorStatus> prepareLaunchStatus =
-        device->prepareModel_1_1(model, preparedModelCallback);
+    Return<ErrorStatus> prepareLaunchStatus = device->prepareModel_1_1(
+        model, ExecutionPreference::FAST_SINGLE_ANSWER, preparedModelCallback);
     ASSERT_TRUE(prepareLaunchStatus.isOk());
     ASSERT_EQ(ErrorStatus::NONE, static_cast<ErrorStatus>(prepareLaunchStatus));
 
diff --git a/neuralnetworks/1.1/IDevice.hal b/neuralnetworks/1.1/IDevice.hal
index d2c4843..1335bde 100644
--- a/neuralnetworks/1.1/IDevice.hal
+++ b/neuralnetworks/1.1/IDevice.hal
@@ -102,6 +102,8 @@
      * Multiple threads can call prepareModel on the same model concurrently.
      *
      * @param model The model to be prepared for execution.
+     * @param preference Indicates the intended execution behavior of a prepared
+     *                   model.
      * @param callback A callback object used to return the error status of
      *                 preparing the model for execution and the prepared model
      *                 if successful, nullptr otherwise. The callback object's
@@ -115,6 +117,7 @@
      *                - INVALID_ARGUMENT if one of the input arguments is
      *                  invalid
      */
-    prepareModel_1_1(Model model, IPreparedModelCallback callback)
+    prepareModel_1_1(Model model, ExecutionPreference preference,
+                     IPreparedModelCallback callback)
           generates (ErrorStatus status);
 };
diff --git a/neuralnetworks/1.1/types.hal b/neuralnetworks/1.1/types.hal
index b4fccae..8290fbb 100644
--- a/neuralnetworks/1.1/types.hal
+++ b/neuralnetworks/1.1/types.hal
@@ -382,3 +382,24 @@
      */
     bool relaxComputationFloat32toFloat16;
 };
+
+/**
+ * Execution preferences.
+ */
+enum ExecutionPreference : int32_t {
+    /**
+     * Prefer executing in a way that minimizes battery drain.
+     * This is desirable for compilations that will be executed often.
+     */
+    LOW_POWER = 0,
+    /**
+     * Prefer returning a single answer as fast as possible, even if this causes
+     * more power consumption.
+     */
+    FAST_SINGLE_ANSWER = 1,
+    /**
+     * Prefer maximizing the throughput of successive frames, for example when
+     * processing successive frames coming from the camera.
+     */
+    SUSTAINED_SPEED = 2,
+};
diff --git a/neuralnetworks/1.1/vts/functional/ValidateModel.cpp b/neuralnetworks/1.1/vts/functional/ValidateModel.cpp
index 7a20e26..3aa55f8 100644
--- a/neuralnetworks/1.1/vts/functional/ValidateModel.cpp
+++ b/neuralnetworks/1.1/vts/functional/ValidateModel.cpp
@@ -50,13 +50,13 @@
 }
 
 static void validatePrepareModel(const sp<IDevice>& device, const std::string& message,
-                                 const V1_1::Model& model) {
+                                 const V1_1::Model& model, ExecutionPreference preference) {
     SCOPED_TRACE(message + " [prepareModel_1_1]");
 
     sp<PreparedModelCallback> preparedModelCallback = new PreparedModelCallback();
     ASSERT_NE(nullptr, preparedModelCallback.get());
     Return<ErrorStatus> prepareLaunchStatus =
-        device->prepareModel_1_1(model, preparedModelCallback);
+        device->prepareModel_1_1(model, preference, preparedModelCallback);
     ASSERT_TRUE(prepareLaunchStatus.isOk());
     ASSERT_EQ(ErrorStatus::INVALID_ARGUMENT, static_cast<ErrorStatus>(prepareLaunchStatus));
 
@@ -67,15 +67,24 @@
     ASSERT_EQ(nullptr, preparedModel.get());
 }
 
+static bool validExecutionPreference(ExecutionPreference preference) {
+    return preference == ExecutionPreference::LOW_POWER ||
+           preference == ExecutionPreference::FAST_SINGLE_ANSWER ||
+           preference == ExecutionPreference::SUSTAINED_SPEED;
+}
+
 // Primary validation function. This function will take a valid model, apply a
 // mutation to it to invalidate the model, then pass it to interface calls that
 // use the model. Note that the model here is passed by value, and any mutation
 // to the model does not leave this function.
 static void validate(const sp<IDevice>& device, const std::string& message, V1_1::Model model,
-                     const std::function<void(Model*)>& mutation) {
+                     const std::function<void(Model*)>& mutation,
+                     ExecutionPreference preference = ExecutionPreference::FAST_SINGLE_ANSWER) {
     mutation(&model);
-    validateGetSupportedOperations(device, message, model);
-    validatePrepareModel(device, message, model);
+    if (validExecutionPreference(preference)) {
+        validateGetSupportedOperations(device, message, model);
+    }
+    validatePrepareModel(device, message, model, preference);
 }
 
 // Delete element from hidl_vec. hidl_vec doesn't support a "remove" operation,
@@ -486,6 +495,22 @@
     }
 }
 
+///////////////////////// VALIDATE EXECUTION PREFERENCE /////////////////////////
+
+static const int32_t invalidExecutionPreferences[] = {
+    static_cast<int32_t>(ExecutionPreference::LOW_POWER) - 1,        // lower bound
+    static_cast<int32_t>(ExecutionPreference::SUSTAINED_SPEED) + 1,  // upper bound
+};
+
+static void mutateExecutionPreferenceTest(const sp<IDevice>& device, const V1_1::Model& model) {
+    for (int32_t preference : invalidExecutionPreferences) {
+        const std::string message =
+            "mutateExecutionPreferenceTest: preference " + std::to_string(preference);
+        validate(device, message, model, [](Model*) {},
+                 static_cast<ExecutionPreference>(preference));
+    }
+}
+
 ////////////////////////// ENTRY POINT //////////////////////////////
 
 void ValidationTest::validateModel(const V1_1::Model& model) {
@@ -503,6 +528,7 @@
     removeOperationOutputTest(device, model);
     addOperationInputTest(device, model);
     addOperationOutputTest(device, model);
+    mutateExecutionPreferenceTest(device, model);
 }
 
 }  // namespace functional
diff --git a/neuralnetworks/1.1/vts/functional/ValidateRequest.cpp b/neuralnetworks/1.1/vts/functional/ValidateRequest.cpp
index bd96614..b42f561 100644
--- a/neuralnetworks/1.1/vts/functional/ValidateRequest.cpp
+++ b/neuralnetworks/1.1/vts/functional/ValidateRequest.cpp
@@ -60,8 +60,8 @@
     // launch prepare model
     sp<PreparedModelCallback> preparedModelCallback = new PreparedModelCallback();
     ASSERT_NE(nullptr, preparedModelCallback.get());
-    Return<ErrorStatus> prepareLaunchStatus =
-        device->prepareModel_1_1(model, preparedModelCallback);
+    Return<ErrorStatus> prepareLaunchStatus = device->prepareModel_1_1(
+        model, ExecutionPreference::FAST_SINGLE_ANSWER, preparedModelCallback);
     ASSERT_TRUE(prepareLaunchStatus.isOk());
     ASSERT_EQ(ErrorStatus::NONE, static_cast<ErrorStatus>(prepareLaunchStatus));
 
diff --git a/radio/1.2/default/Android.bp b/radio/1.2/default/Android.bp
new file mode 100644
index 0000000..f8ff4c7
--- /dev/null
+++ b/radio/1.2/default/Android.bp
@@ -0,0 +1,39 @@
+cc_binary {
+    name: "android.hardware.radio@1.2-radio-service",
+    init_rc: ["android.hardware.radio@1.2-radio-service.rc"],
+    relative_install_path: "hw",
+    vendor: true,
+    srcs: [
+        "Radio.cpp",
+        "radio-service.cpp",
+    ],
+    shared_libs: [
+        "libhidlbase",
+        "libhidltransport",
+        "liblog",
+        "libutils",
+        "android.hardware.radio@1.2",
+        "android.hardware.radio@1.0",
+        "android.hardware.radio@1.1",
+    ],
+}
+
+cc_binary {
+    name: "android.hardware.radio@1.2-sap-service",
+    init_rc: ["android.hardware.radio@1.2-sap-service.rc"],
+    relative_install_path: "hw",
+    vendor: true,
+    srcs: [
+        "Sap.cpp",
+        "sap-service.cpp",
+    ],
+    shared_libs: [
+        "libhidlbase",
+        "libhidltransport",
+        "liblog",
+        "libutils",
+        "android.hardware.radio@1.2",
+        "android.hardware.radio@1.0",
+        "android.hardware.radio@1.1",
+    ],
+}
diff --git a/radio/1.2/default/Radio.cpp b/radio/1.2/default/Radio.cpp
new file mode 100644
index 0000000..73512e4
--- /dev/null
+++ b/radio/1.2/default/Radio.cpp
@@ -0,0 +1,911 @@
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.1 (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.1
+ *
+ * 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 "Radio.h"
+
+namespace android {
+namespace hardware {
+namespace radio {
+namespace V1_2 {
+namespace implementation {
+
+// Methods from ::android::hardware::radio::V1_0::IRadio follow.
+Return<void> Radio::setResponseFunctions(
+    const sp<::android::hardware::radio::V1_0::IRadioResponse>& radioResponse,
+    const sp<::android::hardware::radio::V1_0::IRadioIndication>& radioIndication) {
+    mRadioResponse = radioResponse;
+    mRadioIndication = radioIndication;
+    mRadioResponseV1_1 = ::android::hardware::radio::V1_1::IRadioResponse::castFrom(mRadioResponse)
+                             .withDefault(nullptr);
+    mRadioIndicationV1_1 =
+        ::android::hardware::radio::V1_1::IRadioIndication::castFrom(mRadioIndication)
+            .withDefault(nullptr);
+    if (mRadioResponseV1_1 == nullptr || mRadioIndicationV1_1 == nullptr) {
+        mRadioResponseV1_1 = nullptr;
+        mRadioIndicationV1_1 = nullptr;
+    }
+    mRadioResponseV1_2 = ::android::hardware::radio::V1_2::IRadioResponse::castFrom(mRadioResponse)
+                             .withDefault(nullptr);
+    mRadioIndicationV1_2 =
+        ::android::hardware::radio::V1_2::IRadioIndication::castFrom(mRadioIndication)
+            .withDefault(nullptr);
+    if (mRadioResponseV1_2 == nullptr || mRadioIndicationV1_2 == nullptr) {
+        mRadioResponseV1_2 = nullptr;
+        mRadioIndicationV1_2 = nullptr;
+    }
+    return Void();
+}
+
+Return<void> Radio::getIccCardStatus(int32_t serial) {
+    /**
+     * IRadio-defined request is called from the client and talk to the radio to get
+     * IRadioResponse-defined response or/and IRadioIndication-defined indication back to the
+     * client. This dummy implementation omits and replaces the design and implementation of vendor
+     * codes that needs to handle the receipt of the request and the return of the response from the
+     * radio; this just directly returns a dummy response back to the client.
+     */
+
+    ALOGD("Radio Request: getIccCardStatus is entering");
+
+    if (mRadioResponse != nullptr || mRadioResponseV1_1 != nullptr ||
+        mRadioResponseV1_2 != nullptr) {
+        // Dummy RadioResponseInfo as part of response to return in 1.0, 1.1 and 1.2
+        ::android::hardware::radio::V1_0::RadioResponseInfo info;
+        info.serial = serial;
+        info.type = ::android::hardware::radio::V1_0::RadioResponseType::SOLICITED;
+        info.error = ::android::hardware::radio::V1_0::RadioError::NONE;
+        /**
+         * In IRadio and IRadioResponse 1.2, getIccCardStatus can trigger radio to return
+         * getIccCardStatusResponse_1_2. In their 1.0 and 1.1, getIccCardStatus can trigger radio to
+         * return getIccCardStatusResponse.
+         */
+        if (mRadioResponseV1_2 != nullptr) {
+            // Dummy CardStatus as part of getIccCardStatusResponse_1_2 response to return
+            ::android::hardware::radio::V1_2::CardStatus card_status;
+            card_status.base.cardState = ::android::hardware::radio::V1_0::CardState::ABSENT;
+            card_status.base.gsmUmtsSubscriptionAppIndex = 0;
+            card_status.base.cdmaSubscriptionAppIndex = 0;
+            mRadioResponseV1_2->getIccCardStatusResponse_1_2(info, card_status);
+            ALOGD("Radio Response: getIccCardStatusResponse_1_2 is sent");
+        } else if (mRadioResponseV1_1 != nullptr) {
+            // Dummy CardStatus as part of getIccCardStatusResponse response to return
+            ::android::hardware::radio::V1_0::CardStatus card_status_V1_0;
+            card_status_V1_0.cardState = ::android::hardware::radio::V1_0::CardState::ABSENT;
+            card_status_V1_0.gsmUmtsSubscriptionAppIndex = 0;
+            card_status_V1_0.cdmaSubscriptionAppIndex = 0;
+            mRadioResponseV1_1->getIccCardStatusResponse(info, card_status_V1_0);
+            ALOGD("Radio Response: getIccCardStatusResponse is sent");
+        } else {
+            // Dummy CardStatus as part of getIccCardStatusResponse response to return
+            ::android::hardware::radio::V1_0::CardStatus card_status_V1_0;
+            card_status_V1_0.cardState = ::android::hardware::radio::V1_0::CardState::ABSENT;
+            card_status_V1_0.gsmUmtsSubscriptionAppIndex = 0;
+            card_status_V1_0.cdmaSubscriptionAppIndex = 0;
+            mRadioResponse->getIccCardStatusResponse(info, card_status_V1_0);
+            ALOGD("Radio Response: getIccCardStatusResponse is sent");
+        }
+    } else {
+        ALOGD("mRadioResponse, mRadioResponseV1_1, and mRadioResponseV1_2 are NULL");
+    }
+    return Void();
+}
+
+Return<void> Radio::supplyIccPinForApp(int32_t /* serial */, const hidl_string& /* pin */,
+                                       const hidl_string& /* aid */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::supplyIccPukForApp(int32_t /* serial */, const hidl_string& /* puk */,
+                                       const hidl_string& /* pin */, const hidl_string& /* aid */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::supplyIccPin2ForApp(int32_t /* serial */, const hidl_string& /* pin2 */,
+                                        const hidl_string& /* aid */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::supplyIccPuk2ForApp(int32_t /* serial */, const hidl_string& /* puk2 */,
+                                        const hidl_string& /* pin2 */,
+                                        const hidl_string& /* aid */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::changeIccPinForApp(int32_t /* serial */, const hidl_string& /* oldPin */,
+                                       const hidl_string& /* newPin */,
+                                       const hidl_string& /* aid */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::changeIccPin2ForApp(int32_t /* serial */, const hidl_string& /* oldPin2 */,
+                                        const hidl_string& /* newPin2 */,
+                                        const hidl_string& /* aid */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::supplyNetworkDepersonalization(int32_t /* serial */,
+                                                   const hidl_string& /* netPin */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::getCurrentCalls(int32_t /* serial */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::dial(int32_t /* serial */,
+                         const ::android::hardware::radio::V1_0::Dial& /* dialInfo */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::getImsiForApp(int32_t /* serial */, const hidl_string& /* aid */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::hangup(int32_t /* serial */, int32_t /* gsmIndex */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::hangupWaitingOrBackground(int32_t /* serial */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::hangupForegroundResumeBackground(int32_t /* serial */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::switchWaitingOrHoldingAndActive(int32_t /* serial */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::conference(int32_t /* serial */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::rejectCall(int32_t /* serial */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::getLastCallFailCause(int32_t /* serial */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::getSignalStrength(int32_t /* serial */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::getVoiceRegistrationState(int32_t /* serial */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::getDataRegistrationState(int32_t /* serial */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::getOperator(int32_t /* serial */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::setRadioPower(int32_t /* serial */, bool /* on */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::sendDtmf(int32_t /* serial */, const hidl_string& /* s */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::sendSms(int32_t /* serial */,
+                            const ::android::hardware::radio::V1_0::GsmSmsMessage& /* message */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::sendSMSExpectMore(
+    int32_t /* serial */, const ::android::hardware::radio::V1_0::GsmSmsMessage& /* message */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::setupDataCall(
+    int32_t /* serial */, ::android::hardware::radio::V1_0::RadioTechnology /* radioTechnology */,
+    const ::android::hardware::radio::V1_0::DataProfileInfo& /* dataProfileInfo */,
+    bool /* modemCognitive */, bool /* roamingAllowed */, bool /* isRoaming */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::iccIOForApp(int32_t /* serial */,
+                                const ::android::hardware::radio::V1_0::IccIo& /* iccIo */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::sendUssd(int32_t /* serial */, const hidl_string& /* ussd */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::cancelPendingUssd(int32_t /* serial */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::getClir(int32_t /* serial */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::setClir(int32_t /* serial */, int32_t /* status */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::getCallForwardStatus(
+    int32_t /* serial */, const ::android::hardware::radio::V1_0::CallForwardInfo& /* callInfo */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::setCallForward(
+    int32_t /* serial */, const ::android::hardware::radio::V1_0::CallForwardInfo& /* callInfo */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::getCallWaiting(int32_t /* serial */, int32_t /* serviceClass */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::setCallWaiting(int32_t /* serial */, bool /* enable */,
+                                   int32_t /* serviceClass */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::acknowledgeLastIncomingGsmSms(
+    int32_t /* serial */, bool /* success */,
+    ::android::hardware::radio::V1_0::SmsAcknowledgeFailCause /* cause */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::acceptCall(int32_t /* serial */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::deactivateDataCall(int32_t /* serial */, int32_t /* cid */,
+                                       bool /* reasonRadioShutDown */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::getFacilityLockForApp(int32_t /* serial */, const hidl_string& /* facility */,
+                                          const hidl_string& /* password */,
+                                          int32_t /* serviceClass */,
+                                          const hidl_string& /* appId */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::setFacilityLockForApp(int32_t /* serial */, const hidl_string& /* facility */,
+                                          bool /* lockState */, const hidl_string& /* password */,
+                                          int32_t /* serviceClass */,
+                                          const hidl_string& /* appId */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::setBarringPassword(int32_t /* serial */, const hidl_string& /* facility */,
+                                       const hidl_string& /* oldPassword */,
+                                       const hidl_string& /* newPassword */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::getNetworkSelectionMode(int32_t /* serial */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::setNetworkSelectionModeAutomatic(int32_t /* serial */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::setNetworkSelectionModeManual(int32_t /* serial */,
+                                                  const hidl_string& /* operatorNumeric */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::getAvailableNetworks(int32_t /* serial */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::startDtmf(int32_t /* serial */, const hidl_string& /* s */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::stopDtmf(int32_t /* serial */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::getBasebandVersion(int32_t /* serial */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::separateConnection(int32_t /* serial */, int32_t /* gsmIndex */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::setMute(int32_t /* serial */, bool /* enable */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::getMute(int32_t /* serial */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::getClip(int32_t /* serial */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::getDataCallList(int32_t /* serial */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::setSuppServiceNotifications(int32_t /* serial */, bool /* enable */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::writeSmsToSim(
+    int32_t /* serial */,
+    const ::android::hardware::radio::V1_0::SmsWriteArgs& /* smsWriteArgs */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::deleteSmsOnSim(int32_t /* serial */, int32_t /* index */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::setBandMode(int32_t /* serial */,
+                                ::android::hardware::radio::V1_0::RadioBandMode /* mode */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::getAvailableBandModes(int32_t /* serial */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::sendEnvelope(int32_t /* serial */, const hidl_string& /* command */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::sendTerminalResponseToSim(int32_t /* serial */,
+                                              const hidl_string& /* commandResponse */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::handleStkCallSetupRequestFromSim(int32_t /* serial */, bool /* accept */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::explicitCallTransfer(int32_t /* serial */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::setPreferredNetworkType(
+    int32_t /* serial */, ::android::hardware::radio::V1_0::PreferredNetworkType /* nwType */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::getPreferredNetworkType(int32_t /* serial */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::getNeighboringCids(int32_t /* serial */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::setLocationUpdates(int32_t /* serial */, bool /* enable */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::setCdmaSubscriptionSource(
+    int32_t /* serial */, ::android::hardware::radio::V1_0::CdmaSubscriptionSource /* cdmaSub */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::setCdmaRoamingPreference(
+    int32_t /* serial */, ::android::hardware::radio::V1_0::CdmaRoamingType /* type */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::getCdmaRoamingPreference(int32_t /* serial */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::setTTYMode(int32_t /* serial */,
+                               ::android::hardware::radio::V1_0::TtyMode /* mode */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::getTTYMode(int32_t /* serial */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::setPreferredVoicePrivacy(int32_t /* serial */, bool /* enable */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::getPreferredVoicePrivacy(int32_t /* serial */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::sendCDMAFeatureCode(int32_t /* serial */,
+                                        const hidl_string& /* featureCode */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::sendBurstDtmf(int32_t /* serial */, const hidl_string& /* dtmf*/,
+                                  int32_t /*on*/, int32_t /*off */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::sendCdmaSms(int32_t /* serial */,
+                                const ::android::hardware::radio::V1_0::CdmaSmsMessage& /* sms */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::acknowledgeLastIncomingCdmaSms(
+    int32_t /* serial */, const ::android::hardware::radio::V1_0::CdmaSmsAck& /* smsAck */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::getGsmBroadcastConfig(int32_t /* serial */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::setGsmBroadcastConfig(
+    int32_t /* serial */,
+    const hidl_vec<::android::hardware::radio::V1_0::GsmBroadcastSmsConfigInfo>& /* configInfo */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::setGsmBroadcastActivation(int32_t /* serial */, bool /* activate */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::getCdmaBroadcastConfig(int32_t /* serial */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::setCdmaBroadcastConfig(
+    int32_t /* serial */,
+    const hidl_vec<
+        ::android::hardware::radio::V1_0::CdmaBroadcastSmsConfigInfo>& /* configInfo */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::setCdmaBroadcastActivation(int32_t /* serial */, bool /* activate */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::getCDMASubscription(int32_t /* serial */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::writeSmsToRuim(
+    int32_t /* serial */, const ::android::hardware::radio::V1_0::CdmaSmsWriteArgs& /* cdmaSms */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::deleteSmsOnRuim(int32_t /* serial */, int32_t /* index */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::getDeviceIdentity(int32_t /* serial */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::exitEmergencyCallbackMode(int32_t /* serial */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::getSmscAddress(int32_t /* serial */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::setSmscAddress(int32_t /* serial */, const hidl_string& /* smsc */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::reportSmsMemoryStatus(int32_t /* serial */, bool /* available */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::reportStkServiceIsRunning(int32_t /* serial */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::getCdmaSubscriptionSource(int32_t /* serial */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::requestIsimAuthentication(int32_t /* serial */,
+                                              const hidl_string& /* challenge */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::acknowledgeIncomingGsmSmsWithPdu(int32_t /* serial */, bool /* success */,
+                                                     const hidl_string& /* ackPdu */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::sendEnvelopeWithStatus(int32_t /* serial */,
+                                           const hidl_string& /* contents */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::getVoiceRadioTechnology(int32_t /* serial */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::getCellInfoList(int32_t /* serial */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::setCellInfoListRate(int32_t /* serial */, int32_t /*rate */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::setInitialAttachApn(
+    int32_t /* serial */,
+    const ::android::hardware::radio::V1_0::DataProfileInfo& /* dataProfileInfo */,
+    bool /* modemCognitive */, bool /* isRoaming */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::getImsRegistrationState(int32_t /* serial */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::sendImsSms(
+    int32_t /* serial */, const ::android::hardware::radio::V1_0::ImsSmsMessage& /* message */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::iccTransmitApduBasicChannel(
+    int32_t /* serial */, const ::android::hardware::radio::V1_0::SimApdu& /* message */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::iccOpenLogicalChannel(int32_t /* serial */, const hidl_string& /* aid*/,
+                                          int32_t /*p2 */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::iccCloseLogicalChannel(int32_t /* serial */, int32_t /* channelId */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::iccTransmitApduLogicalChannel(
+    int32_t /* serial */, const ::android::hardware::radio::V1_0::SimApdu& /* message */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::nvReadItem(int32_t /* serial */,
+                               ::android::hardware::radio::V1_0::NvItem /* itemId */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::nvWriteItem(int32_t /* serial */,
+                                const ::android::hardware::radio::V1_0::NvWriteItem& /* item */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::nvWriteCdmaPrl(int32_t /* serial */, const hidl_vec<uint8_t>& /* prl */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::nvResetConfig(int32_t /* serial */,
+                                  ::android::hardware::radio::V1_0::ResetNvType /* resetType */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::setUiccSubscription(
+    int32_t /* serial */, const ::android::hardware::radio::V1_0::SelectUiccSub& /* uiccSub */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::setDataAllowed(int32_t /* serial */, bool /* allow */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::getHardwareConfig(int32_t /* serial */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::requestIccSimAuthentication(int32_t /* serial */, int32_t /* authContext */,
+                                                const hidl_string& /* authData */,
+                                                const hidl_string& /* aid */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::setDataProfile(
+    int32_t /* serial */,
+    const hidl_vec<::android::hardware::radio::V1_0::DataProfileInfo>& /* profiles */,
+    bool /* isRoaming */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::requestShutdown(int32_t /* serial */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::getRadioCapability(int32_t /* serial */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::setRadioCapability(
+    int32_t /* serial */, const ::android::hardware::radio::V1_0::RadioCapability& /* rc */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::startLceService(int32_t /* serial */, int32_t /* reportInterval */,
+                                    bool /* pullMode */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::stopLceService(int32_t /* serial */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::pullLceData(int32_t /* serial */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::getModemActivityInfo(int32_t /* serial */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::setAllowedCarriers(
+    int32_t /* serial */, bool /* allAllowed */,
+    const ::android::hardware::radio::V1_0::CarrierRestrictions& /* carriers */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::getAllowedCarriers(int32_t /* serial */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::sendDeviceState(
+    int32_t /* serial */, ::android::hardware::radio::V1_0::DeviceStateType /* deviceStateType */,
+    bool /* state */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::setIndicationFilter(int32_t /* serial */,
+                                        hidl_bitfield<IndicationFilter> /* indicationFilter */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::setSimCardPower(int32_t /* serial */, bool /* powerUp */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::responseAcknowledgement() {
+    // TODO implement
+    return Void();
+}
+
+// Methods from ::android::hardware::radio::V1_1::IRadio follow.
+Return<void> Radio::setCarrierInfoForImsiEncryption(
+    int32_t /* serial */,
+    const ::android::hardware::radio::V1_1::ImsiEncryptionInfo& /* imsiEncryptionInfo */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::setSimCardPower_1_1(
+    int32_t /* serial */, ::android::hardware::radio::V1_1::CardPowerState /* powerUp */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::startNetworkScan(
+    int32_t /* serial */,
+    const ::android::hardware::radio::V1_1::NetworkScanRequest& /* request */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::stopNetworkScan(int32_t /* serial */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::startKeepalive(
+    int32_t /* serial */,
+    const ::android::hardware::radio::V1_1::KeepaliveRequest& /* keepalive */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::stopKeepalive(int32_t /* serial */, int32_t /* sessionHandle */) {
+    // TODO implement
+    return Void();
+}
+
+// Methods from ::android::hardware::radio::V1_2::IRadio follow.
+Return<void> Radio::startNetworkScan_1_2(
+    int32_t /* serial */,
+    const ::android::hardware::radio::V1_2::NetworkScanRequest& /* request */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::setIndicationFilter_1_2(
+    int32_t /* serial */, hidl_bitfield<IndicationFilter> /* indicationFilter */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::setSignalStrengthReportingCriteria(
+    int32_t /* serial */, int32_t /*hysteresisMs*/, int32_t /*hysteresisDb */,
+    const hidl_vec<int32_t>& /* thresholdsDbm */,
+    ::android::hardware::radio::V1_2::AccessNetwork /* accessNetwork */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::setLinkCapacityReportingCriteria(
+    int32_t /* serial */, int32_t /*hysteresisMs*/, int32_t /*hysteresisDlKbps*/,
+    int32_t /*hysteresisUlKbps */, const hidl_vec<int32_t>& /* thresholdsDownlinkKbps */,
+    const hidl_vec<int32_t>& /* thresholdsUplinkKbps */,
+    ::android::hardware::radio::V1_2::AccessNetwork /* accessNetwork */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::setupDataCall_1_2(
+    int32_t /* serial */, ::android::hardware::radio::V1_2::AccessNetwork /* accessNetwork */,
+    const ::android::hardware::radio::V1_0::DataProfileInfo& /* dataProfileInfo */,
+    bool /* modemCognitive */, bool /* roamingAllowed */, bool /* isRoaming */,
+    ::android::hardware::radio::V1_2::DataRequestReason /* reason */,
+    const hidl_vec<hidl_string>& /* addresses */, const hidl_vec<hidl_string>& /* dnses */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Radio::deactivateDataCall_1_2(
+    int32_t /* serial */, int32_t /* cid */,
+    ::android::hardware::radio::V1_2::DataRequestReason /* reason */) {
+    // TODO implement
+    return Void();
+}
+
+}  // namespace implementation
+}  // namespace V1_2
+}  // namespace radio
+}  // namespace hardware
+}  // namespace android
diff --git a/radio/1.2/default/Radio.h b/radio/1.2/default/Radio.h
new file mode 100644
index 0000000..eb8ab5e
--- /dev/null
+++ b/radio/1.2/default/Radio.h
@@ -0,0 +1,291 @@
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.1 (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.1
+ *
+ * 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_RADIO_V1_2_RADIO_H
+#define ANDROID_HARDWARE_RADIO_V1_2_RADIO_H
+
+#include <android/hardware/radio/1.2/IRadio.h>
+#include <android/hardware/radio/1.2/IRadioIndication.h>
+#include <android/hardware/radio/1.2/IRadioResponse.h>
+#include <hidl/MQDescriptor.h>
+#include <hidl/Status.h>
+#include <log/log.h>
+
+namespace android {
+namespace hardware {
+namespace radio {
+namespace V1_2 {
+namespace implementation {
+
+using ::android::hardware::hidl_array;
+using ::android::hardware::hidl_memory;
+using ::android::hardware::hidl_string;
+using ::android::hardware::hidl_vec;
+using ::android::hardware::Return;
+using ::android::hardware::Void;
+using ::android::sp;
+
+struct Radio : public IRadio {
+    sp<::android::hardware::radio::V1_0::IRadioResponse> mRadioResponse;
+    sp<::android::hardware::radio::V1_0::IRadioIndication> mRadioIndication;
+    sp<::android::hardware::radio::V1_1::IRadioResponse> mRadioResponseV1_1;
+    sp<::android::hardware::radio::V1_1::IRadioIndication> mRadioIndicationV1_1;
+    sp<::android::hardware::radio::V1_2::IRadioResponse> mRadioResponseV1_2;
+    sp<::android::hardware::radio::V1_2::IRadioIndication> mRadioIndicationV1_2;
+
+    // Methods from ::android::hardware::radio::V1_0::IRadio follow.
+    Return<void> setResponseFunctions(
+        const sp<::android::hardware::radio::V1_0::IRadioResponse>& radioResponse,
+        const sp<::android::hardware::radio::V1_0::IRadioIndication>& radioIndication) override;
+    Return<void> getIccCardStatus(int32_t serial) override;
+    Return<void> supplyIccPinForApp(int32_t serial, const hidl_string& pin,
+                                    const hidl_string& aid) override;
+    Return<void> supplyIccPukForApp(int32_t serial, const hidl_string& puk, const hidl_string& pin,
+                                    const hidl_string& aid) override;
+    Return<void> supplyIccPin2ForApp(int32_t serial, const hidl_string& pin2,
+                                     const hidl_string& aid) override;
+    Return<void> supplyIccPuk2ForApp(int32_t serial, const hidl_string& puk2,
+                                     const hidl_string& pin2, const hidl_string& aid) override;
+    Return<void> changeIccPinForApp(int32_t serial, const hidl_string& oldPin,
+                                    const hidl_string& newPin, const hidl_string& aid) override;
+    Return<void> changeIccPin2ForApp(int32_t serial, const hidl_string& oldPin2,
+                                     const hidl_string& newPin2, const hidl_string& aid) override;
+    Return<void> supplyNetworkDepersonalization(int32_t serial, const hidl_string& netPin) override;
+    Return<void> getCurrentCalls(int32_t serial) override;
+    Return<void> dial(int32_t serial,
+                      const ::android::hardware::radio::V1_0::Dial& dialInfo) override;
+    Return<void> getImsiForApp(int32_t serial, const hidl_string& aid) override;
+    Return<void> hangup(int32_t serial, int32_t gsmIndex) override;
+    Return<void> hangupWaitingOrBackground(int32_t serial) override;
+    Return<void> hangupForegroundResumeBackground(int32_t serial) override;
+    Return<void> switchWaitingOrHoldingAndActive(int32_t serial) override;
+    Return<void> conference(int32_t serial) override;
+    Return<void> rejectCall(int32_t serial) override;
+    Return<void> getLastCallFailCause(int32_t serial) override;
+    Return<void> getSignalStrength(int32_t serial) override;
+    Return<void> getVoiceRegistrationState(int32_t serial) override;
+    Return<void> getDataRegistrationState(int32_t serial) override;
+    Return<void> getOperator(int32_t serial) override;
+    Return<void> setRadioPower(int32_t serial, bool on) override;
+    Return<void> sendDtmf(int32_t serial, const hidl_string& s) override;
+    Return<void> sendSms(int32_t serial,
+                         const ::android::hardware::radio::V1_0::GsmSmsMessage& message) override;
+    Return<void> sendSMSExpectMore(
+        int32_t serial, const ::android::hardware::radio::V1_0::GsmSmsMessage& message) override;
+    Return<void> setupDataCall(
+        int32_t serial, ::android::hardware::radio::V1_0::RadioTechnology radioTechnology,
+        const ::android::hardware::radio::V1_0::DataProfileInfo& dataProfileInfo,
+        bool modemCognitive, bool roamingAllowed, bool isRoaming) override;
+    Return<void> iccIOForApp(int32_t serial,
+                             const ::android::hardware::radio::V1_0::IccIo& iccIo) override;
+    Return<void> sendUssd(int32_t serial, const hidl_string& ussd) override;
+    Return<void> cancelPendingUssd(int32_t serial) override;
+    Return<void> getClir(int32_t serial) override;
+    Return<void> setClir(int32_t serial, int32_t status) override;
+    Return<void> getCallForwardStatus(
+        int32_t serial, const ::android::hardware::radio::V1_0::CallForwardInfo& callInfo) override;
+    Return<void> setCallForward(
+        int32_t serial, const ::android::hardware::radio::V1_0::CallForwardInfo& callInfo) override;
+    Return<void> getCallWaiting(int32_t serial, int32_t serviceClass) override;
+    Return<void> setCallWaiting(int32_t serial, bool enable, int32_t serviceClass) override;
+    Return<void> acknowledgeLastIncomingGsmSms(
+        int32_t serial, bool success,
+        ::android::hardware::radio::V1_0::SmsAcknowledgeFailCause cause) override;
+    Return<void> acceptCall(int32_t serial) override;
+    Return<void> deactivateDataCall(int32_t serial, int32_t cid, bool reasonRadioShutDown) override;
+    Return<void> getFacilityLockForApp(int32_t serial, const hidl_string& facility,
+                                       const hidl_string& password, int32_t serviceClass,
+                                       const hidl_string& appId) override;
+    Return<void> setFacilityLockForApp(int32_t serial, const hidl_string& facility, bool lockState,
+                                       const hidl_string& password, int32_t serviceClass,
+                                       const hidl_string& appId) override;
+    Return<void> setBarringPassword(int32_t serial, const hidl_string& facility,
+                                    const hidl_string& oldPassword,
+                                    const hidl_string& newPassword) override;
+    Return<void> getNetworkSelectionMode(int32_t serial) override;
+    Return<void> setNetworkSelectionModeAutomatic(int32_t serial) override;
+    Return<void> setNetworkSelectionModeManual(int32_t serial,
+                                               const hidl_string& operatorNumeric) override;
+    Return<void> getAvailableNetworks(int32_t serial) override;
+    Return<void> startDtmf(int32_t serial, const hidl_string& s) override;
+    Return<void> stopDtmf(int32_t serial) override;
+    Return<void> getBasebandVersion(int32_t serial) override;
+    Return<void> separateConnection(int32_t serial, int32_t gsmIndex) override;
+    Return<void> setMute(int32_t serial, bool enable) override;
+    Return<void> getMute(int32_t serial) override;
+    Return<void> getClip(int32_t serial) override;
+    Return<void> getDataCallList(int32_t serial) override;
+    Return<void> setSuppServiceNotifications(int32_t serial, bool enable) override;
+    Return<void> writeSmsToSim(
+        int32_t serial,
+        const ::android::hardware::radio::V1_0::SmsWriteArgs& smsWriteArgs) override;
+    Return<void> deleteSmsOnSim(int32_t serial, int32_t index) override;
+    Return<void> setBandMode(int32_t serial,
+                             ::android::hardware::radio::V1_0::RadioBandMode mode) override;
+    Return<void> getAvailableBandModes(int32_t serial) override;
+    Return<void> sendEnvelope(int32_t serial, const hidl_string& command) override;
+    Return<void> sendTerminalResponseToSim(int32_t serial,
+                                           const hidl_string& commandResponse) override;
+    Return<void> handleStkCallSetupRequestFromSim(int32_t serial, bool accept) override;
+    Return<void> explicitCallTransfer(int32_t serial) override;
+    Return<void> setPreferredNetworkType(
+        int32_t serial, ::android::hardware::radio::V1_0::PreferredNetworkType nwType) override;
+    Return<void> getPreferredNetworkType(int32_t serial) override;
+    Return<void> getNeighboringCids(int32_t serial) override;
+    Return<void> setLocationUpdates(int32_t serial, bool enable) override;
+    Return<void> setCdmaSubscriptionSource(
+        int32_t serial, ::android::hardware::radio::V1_0::CdmaSubscriptionSource cdmaSub) override;
+    Return<void> setCdmaRoamingPreference(
+        int32_t serial, ::android::hardware::radio::V1_0::CdmaRoamingType type) override;
+    Return<void> getCdmaRoamingPreference(int32_t serial) override;
+    Return<void> setTTYMode(int32_t serial,
+                            ::android::hardware::radio::V1_0::TtyMode mode) override;
+    Return<void> getTTYMode(int32_t serial) override;
+    Return<void> setPreferredVoicePrivacy(int32_t serial, bool enable) override;
+    Return<void> getPreferredVoicePrivacy(int32_t serial) override;
+    Return<void> sendCDMAFeatureCode(int32_t serial, const hidl_string& featureCode) override;
+    Return<void> sendBurstDtmf(int32_t serial, const hidl_string& dtmf, int32_t on,
+                               int32_t off) override;
+    Return<void> sendCdmaSms(int32_t serial,
+                             const ::android::hardware::radio::V1_0::CdmaSmsMessage& sms) override;
+    Return<void> acknowledgeLastIncomingCdmaSms(
+        int32_t serial, const ::android::hardware::radio::V1_0::CdmaSmsAck& smsAck) override;
+    Return<void> getGsmBroadcastConfig(int32_t serial) override;
+    Return<void> setGsmBroadcastConfig(
+        int32_t serial,
+        const hidl_vec<::android::hardware::radio::V1_0::GsmBroadcastSmsConfigInfo>& configInfo)
+        override;
+    Return<void> setGsmBroadcastActivation(int32_t serial, bool activate) override;
+    Return<void> getCdmaBroadcastConfig(int32_t serial) override;
+    Return<void> setCdmaBroadcastConfig(
+        int32_t serial,
+        const hidl_vec<::android::hardware::radio::V1_0::CdmaBroadcastSmsConfigInfo>& configInfo)
+        override;
+    Return<void> setCdmaBroadcastActivation(int32_t serial, bool activate) override;
+    Return<void> getCDMASubscription(int32_t serial) override;
+    Return<void> writeSmsToRuim(
+        int32_t serial, const ::android::hardware::radio::V1_0::CdmaSmsWriteArgs& cdmaSms) override;
+    Return<void> deleteSmsOnRuim(int32_t serial, int32_t index) override;
+    Return<void> getDeviceIdentity(int32_t serial) override;
+    Return<void> exitEmergencyCallbackMode(int32_t serial) override;
+    Return<void> getSmscAddress(int32_t serial) override;
+    Return<void> setSmscAddress(int32_t serial, const hidl_string& smsc) override;
+    Return<void> reportSmsMemoryStatus(int32_t serial, bool available) override;
+    Return<void> reportStkServiceIsRunning(int32_t serial) override;
+    Return<void> getCdmaSubscriptionSource(int32_t serial) override;
+    Return<void> requestIsimAuthentication(int32_t serial, const hidl_string& challenge) override;
+    Return<void> acknowledgeIncomingGsmSmsWithPdu(int32_t serial, bool success,
+                                                  const hidl_string& ackPdu) override;
+    Return<void> sendEnvelopeWithStatus(int32_t serial, const hidl_string& contents) override;
+    Return<void> getVoiceRadioTechnology(int32_t serial) override;
+    Return<void> getCellInfoList(int32_t serial) override;
+    Return<void> setCellInfoListRate(int32_t serial, int32_t rate) override;
+    Return<void> setInitialAttachApn(
+        int32_t serial, const ::android::hardware::radio::V1_0::DataProfileInfo& dataProfileInfo,
+        bool modemCognitive, bool isRoaming) override;
+    Return<void> getImsRegistrationState(int32_t serial) override;
+    Return<void> sendImsSms(
+        int32_t serial, const ::android::hardware::radio::V1_0::ImsSmsMessage& message) override;
+    Return<void> iccTransmitApduBasicChannel(
+        int32_t serial, const ::android::hardware::radio::V1_0::SimApdu& message) override;
+    Return<void> iccOpenLogicalChannel(int32_t serial, const hidl_string& aid, int32_t p2) override;
+    Return<void> iccCloseLogicalChannel(int32_t serial, int32_t channelId) override;
+    Return<void> iccTransmitApduLogicalChannel(
+        int32_t serial, const ::android::hardware::radio::V1_0::SimApdu& message) override;
+    Return<void> nvReadItem(int32_t serial,
+                            ::android::hardware::radio::V1_0::NvItem itemId) override;
+    Return<void> nvWriteItem(int32_t serial,
+                             const ::android::hardware::radio::V1_0::NvWriteItem& item) override;
+    Return<void> nvWriteCdmaPrl(int32_t serial, const hidl_vec<uint8_t>& prl) override;
+    Return<void> nvResetConfig(int32_t serial,
+                               ::android::hardware::radio::V1_0::ResetNvType resetType) override;
+    Return<void> setUiccSubscription(
+        int32_t serial, const ::android::hardware::radio::V1_0::SelectUiccSub& uiccSub) override;
+    Return<void> setDataAllowed(int32_t serial, bool allow) override;
+    Return<void> getHardwareConfig(int32_t serial) override;
+    Return<void> requestIccSimAuthentication(int32_t serial, int32_t authContext,
+                                             const hidl_string& authData,
+                                             const hidl_string& aid) override;
+    Return<void> setDataProfile(
+        int32_t serial, const hidl_vec<::android::hardware::radio::V1_0::DataProfileInfo>& profiles,
+        bool isRoaming) override;
+    Return<void> requestShutdown(int32_t serial) override;
+    Return<void> getRadioCapability(int32_t serial) override;
+    Return<void> setRadioCapability(
+        int32_t serial, const ::android::hardware::radio::V1_0::RadioCapability& rc) override;
+    Return<void> startLceService(int32_t serial, int32_t reportInterval, bool pullMode) override;
+    Return<void> stopLceService(int32_t serial) override;
+    Return<void> pullLceData(int32_t serial) override;
+    Return<void> getModemActivityInfo(int32_t serial) override;
+    Return<void> setAllowedCarriers(
+        int32_t serial, bool allAllowed,
+        const ::android::hardware::radio::V1_0::CarrierRestrictions& carriers) override;
+    Return<void> getAllowedCarriers(int32_t serial) override;
+    Return<void> sendDeviceState(int32_t serial,
+                                 ::android::hardware::radio::V1_0::DeviceStateType deviceStateType,
+                                 bool state) override;
+    Return<void> setIndicationFilter(int32_t serial,
+                                     hidl_bitfield<IndicationFilter> indicationFilter) override;
+    Return<void> setSimCardPower(int32_t serial, bool powerUp) override;
+    Return<void> responseAcknowledgement() override;
+
+    // Methods from ::android::hardware::radio::V1_1::IRadio follow.
+    Return<void> setCarrierInfoForImsiEncryption(
+        int32_t serial,
+        const ::android::hardware::radio::V1_1::ImsiEncryptionInfo& imsiEncryptionInfo) override;
+    Return<void> setSimCardPower_1_1(
+        int32_t serial, ::android::hardware::radio::V1_1::CardPowerState powerUp) override;
+    Return<void> startNetworkScan(
+        int32_t serial,
+        const ::android::hardware::radio::V1_1::NetworkScanRequest& request) override;
+    Return<void> stopNetworkScan(int32_t serial) override;
+    Return<void> startKeepalive(
+        int32_t serial,
+        const ::android::hardware::radio::V1_1::KeepaliveRequest& keepalive) override;
+    Return<void> stopKeepalive(int32_t serial, int32_t sessionHandle) override;
+
+    // Methods from ::android::hardware::radio::V1_2::IRadio follow.
+    Return<void> startNetworkScan_1_2(
+        int32_t serial,
+        const ::android::hardware::radio::V1_2::NetworkScanRequest& request) override;
+    Return<void> setIndicationFilter_1_2(int32_t serial,
+                                         hidl_bitfield<IndicationFilter> indicationFilter) override;
+    Return<void> setSignalStrengthReportingCriteria(
+        int32_t serial, int32_t hysteresisMs, int32_t hysteresisDb,
+        const hidl_vec<int32_t>& thresholdsDbm,
+        ::android::hardware::radio::V1_2::AccessNetwork accessNetwork) override;
+    Return<void> setLinkCapacityReportingCriteria(
+        int32_t serial, int32_t hysteresisMs, int32_t hysteresisDlKbps, int32_t hysteresisUlKbps,
+        const hidl_vec<int32_t>& thresholdsDownlinkKbps,
+        const hidl_vec<int32_t>& thresholdsUplinkKbps,
+        ::android::hardware::radio::V1_2::AccessNetwork accessNetwork) override;
+    Return<void> setupDataCall_1_2(
+        int32_t serial, ::android::hardware::radio::V1_2::AccessNetwork accessNetwork,
+        const ::android::hardware::radio::V1_0::DataProfileInfo& dataProfileInfo,
+        bool modemCognitive, bool roamingAllowed, bool isRoaming,
+        ::android::hardware::radio::V1_2::DataRequestReason reason,
+        const hidl_vec<hidl_string>& addresses, const hidl_vec<hidl_string>& dnses) override;
+    Return<void> deactivateDataCall_1_2(
+        int32_t serial, int32_t cid,
+        ::android::hardware::radio::V1_2::DataRequestReason reason) override;
+};
+
+}  // namespace implementation
+}  // namespace V1_2
+}  // namespace radio
+}  // namespace hardware
+}  // namespace android
+
+#endif  // ANDROID_HARDWARE_RADIO_V1_2_RADIO_H
diff --git a/radio/1.2/default/Sap.cpp b/radio/1.2/default/Sap.cpp
new file mode 100644
index 0000000..83efd30
--- /dev/null
+++ b/radio/1.2/default/Sap.cpp
@@ -0,0 +1,79 @@
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.1 (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.1
+ *
+ * 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 "Sap.h"
+
+namespace android {
+namespace hardware {
+namespace radio {
+namespace V1_2 {
+namespace implementation {
+
+// Methods from ::android::hardware::radio::V1_0::ISap follow.
+Return<void> Sap::setCallback(
+    const sp<::android::hardware::radio::V1_0::ISapCallback>& sapCallback) {
+    mSapCallback = sapCallback;
+    return Void();
+}
+
+Return<void> Sap::connectReq(int32_t /* token */, int32_t /* maxMsgSize */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Sap::disconnectReq(int32_t /* token */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Sap::apduReq(int32_t /* token */,
+                          ::android::hardware::radio::V1_0::SapApduType /* type */,
+                          const hidl_vec<uint8_t>& /* command */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Sap::transferAtrReq(int32_t /* token */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Sap::powerReq(int32_t /* token */, bool /* state */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Sap::resetSimReq(int32_t /* token */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Sap::transferCardReaderStatusReq(int32_t /* token */) {
+    // TODO implement
+    return Void();
+}
+
+Return<void> Sap::setTransferProtocolReq(
+    int32_t /* token */,
+    ::android::hardware::radio::V1_0::SapTransferProtocol /* transferProtocol */) {
+    // TODO implement
+    return Void();
+}
+
+}  // namespace implementation
+}  // namespace V1_2
+}  // namespace radio
+}  // namespace hardware
+}  // namespace android
diff --git a/radio/1.2/default/Sap.h b/radio/1.2/default/Sap.h
new file mode 100644
index 0000000..033e877
--- /dev/null
+++ b/radio/1.2/default/Sap.h
@@ -0,0 +1,61 @@
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.1 (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.1
+ *
+ * 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_RADIO_V1_2_SAP_H
+#define ANDROID_HARDWARE_RADIO_V1_2_SAP_H
+
+#include <android/hardware/radio/1.2/ISap.h>
+#include <hidl/MQDescriptor.h>
+#include <hidl/Status.h>
+
+namespace android {
+namespace hardware {
+namespace radio {
+namespace V1_2 {
+namespace implementation {
+
+using ::android::hardware::hidl_array;
+using ::android::hardware::hidl_memory;
+using ::android::hardware::hidl_string;
+using ::android::hardware::hidl_vec;
+using ::android::hardware::Return;
+using ::android::hardware::Void;
+using ::android::sp;
+
+struct Sap : public ISap {
+    sp<::android::hardware::radio::V1_0::ISapCallback> mSapCallback;
+    // Methods from ::android::hardware::radio::V1_0::ISap follow.
+    Return<void> setCallback(
+        const sp<::android::hardware::radio::V1_0::ISapCallback>& sapCallback) override;
+    Return<void> connectReq(int32_t token, int32_t maxMsgSize) override;
+    Return<void> disconnectReq(int32_t token) override;
+    Return<void> apduReq(int32_t token, ::android::hardware::radio::V1_0::SapApduType type,
+                         const hidl_vec<uint8_t>& command) override;
+    Return<void> transferAtrReq(int32_t token) override;
+    Return<void> powerReq(int32_t token, bool state) override;
+    Return<void> resetSimReq(int32_t token) override;
+    Return<void> transferCardReaderStatusReq(int32_t token) override;
+    Return<void> setTransferProtocolReq(
+        int32_t token,
+        ::android::hardware::radio::V1_0::SapTransferProtocol transferProtocol) override;
+};
+
+}  // namespace implementation
+}  // namespace V1_2
+}  // namespace radio
+}  // namespace hardware
+}  // namespace android
+
+#endif  // ANDROID_HARDWARE_RADIO_V1_2_SAP_H
diff --git a/radio/1.2/default/android.hardware.radio@1.2-radio-service.rc b/radio/1.2/default/android.hardware.radio@1.2-radio-service.rc
new file mode 100644
index 0000000..e126cd8
--- /dev/null
+++ b/radio/1.2/default/android.hardware.radio@1.2-radio-service.rc
@@ -0,0 +1,4 @@
+service vendor.radio-1-2 /vendor/bin/hw/android.hardware.radio@1.2-radio-service
+    class hal
+    user system
+    group system
diff --git a/radio/1.2/default/android.hardware.radio@1.2-sap-service.rc b/radio/1.2/default/android.hardware.radio@1.2-sap-service.rc
new file mode 100644
index 0000000..845e6e5
--- /dev/null
+++ b/radio/1.2/default/android.hardware.radio@1.2-sap-service.rc
@@ -0,0 +1,4 @@
+service vendor.sap-1-2 /vendor/bin/hw/android.hardware.radio@1.2-sap-service
+    class hal
+    user system
+    group system
diff --git a/radio/1.2/default/radio-service.cpp b/radio/1.2/default/radio-service.cpp
new file mode 100644
index 0000000..ae0d3d2
--- /dev/null
+++ b/radio/1.2/default/radio-service.cpp
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.1 (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.1
+ *
+ * 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.radio@1.2-radio-service"
+
+#include <android/hardware/radio/1.2/IRadio.h>
+#include <hidl/HidlTransportSupport.h>
+
+#include "Radio.h"
+
+using android::hardware::configureRpcThreadpool;
+using android::hardware::joinRpcThreadpool;
+using android::hardware::radio::V1_2::IRadio;
+using android::hardware::radio::V1_2::implementation::Radio;
+using android::sp;
+using android::status_t;
+using android::OK;
+
+int main() {
+    configureRpcThreadpool(1, true);
+
+    sp<IRadio> radio = new Radio;
+    status_t status = radio->registerAsService();
+    ALOGW_IF(status != OK, "Could not register IRadio v1.2");
+    ALOGD("Default service is ready.");
+
+    joinRpcThreadpool();
+    return 1;
+}
\ No newline at end of file
diff --git a/radio/1.2/default/sap-service.cpp b/radio/1.2/default/sap-service.cpp
new file mode 100644
index 0000000..796521d
--- /dev/null
+++ b/radio/1.2/default/sap-service.cpp
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.1 (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.1
+ *
+ * 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.radio@1.2-sap-service"
+
+#include <android/hardware/radio/1.2/ISap.h>
+#include <hidl/HidlTransportSupport.h>
+
+#include "Sap.h"
+
+using android::hardware::configureRpcThreadpool;
+using android::hardware::joinRpcThreadpool;
+using android::hardware::radio::V1_2::ISap;
+using android::hardware::radio::V1_2::implementation::Sap;
+using android::sp;
+using android::status_t;
+using android::OK;
+
+int main() {
+    configureRpcThreadpool(1, true);
+
+    sp<ISap> sap = new Sap;
+    status_t status = sap->registerAsService();
+    ALOGW_IF(status != OK, "Could not register ISap v1.2");
+    ALOGD("Default service is ready.");
+
+    joinRpcThreadpool();
+    return 1;
+}
\ No newline at end of file
diff --git a/wifi/1.2/vts/functional/wifi_sta_iface_hidl_test.cpp b/wifi/1.2/vts/functional/wifi_sta_iface_hidl_test.cpp
index fd4a671..92f5d14 100644
--- a/wifi/1.2/vts/functional/wifi_sta_iface_hidl_test.cpp
+++ b/wifi/1.2/vts/functional/wifi_sta_iface_hidl_test.cpp
@@ -14,6 +14,9 @@
  * limitations under the License.
  */
 
+#include <numeric>
+#include <vector>
+
 #include <android-base/logging.h>
 
 #include <android/hardware/wifi/1.2/IWifiStaIface.h>
@@ -24,8 +27,9 @@
 #include "wifi_hidl_test_utils.h"
 
 using ::android::sp;
-using ::android::hardware::wifi::V1_2::IWifiStaIface;
+using ::android::hardware::wifi::V1_0::CommandId;
 using ::android::hardware::wifi::V1_0::WifiStatusCode;
+using ::android::hardware::wifi::V1_2::IWifiStaIface;
 
 /**
  * Fixture to use for all STA Iface HIDL interface tests.
@@ -40,6 +44,13 @@
     virtual void TearDown() override { stopWifi(); }
 
    protected:
+    bool isCapabilitySupported(IWifiStaIface::StaIfaceCapabilityMask cap_mask) {
+        const auto& status_and_caps =
+            HIDL_INVOKE(wifi_sta_iface_, getCapabilities);
+        EXPECT_EQ(WifiStatusCode::SUCCESS, status_and_caps.first.code);
+        return (status_and_caps.second & cap_mask) != 0;
+    }
+
     sp<IWifiStaIface> wifi_sta_iface_;
 };
 
@@ -54,3 +65,45 @@
     EXPECT_EQ(WifiStatusCode::SUCCESS,
               HIDL_INVOKE(wifi_sta_iface_, setMacAddress, kMac).code);
 }
+
+/*
+ * ReadApfPacketFilterData:
+ * Ensures that we can read the APF working memory when supported.
+ *
+ * TODO: Test disabled because we can't even test reading and writing the APF
+ * memory while the interface is in disconnected state (b/73804303#comment25).
+ * There's a pending bug on VTS infra to add such support (b/32974062).
+ * TODO: We can't execute APF opcodes from this test because there's no way
+ * to loop test packets through the wifi firmware (b/73804303#comment29).
+ */
+TEST_F(WifiStaIfaceHidlTest, DISABLED_ReadApfPacketFilterData) {
+    if (!isCapabilitySupported(IWifiStaIface::StaIfaceCapabilityMask::APF)) {
+        // Disable test if APF packet filer is not supported.
+        LOG(WARNING) << "TEST SKIPPED: APF packet filtering not supported";
+        return;
+    }
+
+    const auto& status_and_caps =
+        HIDL_INVOKE(wifi_sta_iface_, getApfPacketFilterCapabilities);
+    EXPECT_EQ(WifiStatusCode::SUCCESS, status_and_caps.first.code);
+    LOG(WARNING) << "StaApfPacketFilterCapabilities: version="
+                 << status_and_caps.second.version
+                 << " maxLength=" << status_and_caps.second.maxLength;
+
+    const CommandId kCmd = 0;  // Matches what WifiVendorHal.java uses.
+    const uint32_t kDataSize =
+        std::min(status_and_caps.second.maxLength, static_cast<uint32_t>(500));
+
+    // Create a buffer and fill it with some values.
+    std::vector<uint8_t> data(kDataSize);
+    std::iota(data.begin(), data.end(), 0);
+
+    EXPECT_EQ(
+        HIDL_INVOKE(wifi_sta_iface_, installApfPacketFilter, kCmd, data).code,
+        WifiStatusCode::SUCCESS);
+    const auto& status_and_data =
+        HIDL_INVOKE(wifi_sta_iface_, readApfPacketFilterData);
+    EXPECT_EQ(WifiStatusCode::SUCCESS, status_and_data.first.code);
+
+    EXPECT_EQ(status_and_data.second, data);
+}