Merge changes from topic "nnapi-relax-qos-deadlines"

* changes:
  Fix NNAPI QoS Deadline test
  Relax NNAPI QoS deadline parameter
diff --git a/current.txt b/current.txt
index 8dfe34e..fad6fab 100644
--- a/current.txt
+++ b/current.txt
@@ -651,7 +651,7 @@
 d9df99be0f59d8f33a9699fe316c67bfd11818aa69440bb1123ba43e717cea85 android.hardware.dumpstate@1.1::types
 186bc152ae189ab48f3a761a44ddf5edd0d483073c5b6ca1f802f8b50488b754 android.hardware.dumpstate@1.1::IDumpstateDevice
 769d346927a94fd40ee80a5a976d8d15cf022ef99c5900738f4a82f26c0ed229 android.hardware.gnss@2.1::types
-626db710bf917ecf551a0b0b1f25be10bf52758f43e0fc808b148b6aae2ef73e android.hardware.gnss@2.1::IGnss
+c319e68b03829958404402c2d9c682019678087d60495807c0a7444e0a6af981 android.hardware.gnss@2.1::IGnss
 ba5ac712b2a656dc07c83ab4a7a2c2f3bee1bbcb752e8b8ffa9b672f3b5b0728 android.hardware.gnss@2.1::IGnssAntennaInfo
 0bc3ed97cbc3f6abc89c68f4e9f4d124f9f723431997dc88c2186cf4d2ad47ee android.hardware.gnss@2.1::IGnssAntennaInfoCallback
 3541d83adfeac16ee3e45d183a58dffe06012ccb5aa5bcd2e4f6eeae269f69cd android.hardware.gnss@2.1::IGnssCallback
@@ -662,7 +662,7 @@
 a28d6c29a7e36976acffb018208e65b3496d9152d57d864038556cdd83b35744 android.hardware.gnss.measurement_corrections@1.1::types
 ce8dbe76eb9ee94b46ef98f725be992e760a5751073d4f4912484026541371f3 android.hardware.health@2.1::IHealth
 26f04510a0b57aba5167c5c0a7c2f077c2acbb98b81902a072517829fd9fd67f android.hardware.health@2.1::IHealthInfoCallback
-3a4e7462a12589bd219599de59663d0ba9915313f45150774780d09f4e114f74 android.hardware.health@2.1::types
+e2f8bc1868fd4a3fd587c172773ea5a8c2f5a3deaf7958394102ca455252b255 android.hardware.health@2.1::types
 0589e410f519e36514e7ece18f283f022df0f70efd2c12821d822f67f74aba98 android.hardware.identity@1.0::types
 bbeee9604128ede83ee755b67e73b5ad29e6e1dbac9ec41fea6ffe2745b0c50a android.hardware.identity@1.0::IIdentityCredential
 96ce8aad80f4c476f25261f790d357c117e79e18474c7dadd850dac704bbe65e android.hardware.identity@1.0::IIdentityCredentialStore
diff --git a/gnss/2.1/IGnss.hal b/gnss/2.1/IGnss.hal
index e4da507..a880b3f 100644
--- a/gnss/2.1/IGnss.hal
+++ b/gnss/2.1/IGnss.hal
@@ -45,9 +45,9 @@
     /**
      * This method returns the IGnssMeasurement interface.
      *
-     * At least one of getExtensionGnssMeasurement(), getExtensionGnssMeasurement_1_1(),
+     * getExtensionGnssMeasurement(), getExtensionGnssMeasurement_1_1(),
      * getExtensionGnssMeasurement_2_0(), and getExtensionGnssMeasurement_2_1() methods must return
-     * a non-null handle, and the other methods must return nullptr.
+     * non-null. They can all return the same, latest version of IGnssMeasurement.
      *
      * @return gnssMeasurementIface Handle to the IGnssMeasurement interface.
      */
@@ -56,9 +56,9 @@
     /**
      * This method returns the IGnssConfiguration interface.
      *
-     * At least one of getExtensionGnssConfiguration(), getExtensionGnssConfiguration_1_1(),
+     * getExtensionGnssConfiguration(), getExtensionGnssConfiguration_1_1(),
      * getExtensionGnssConfiguration_2_0(), and getExtensionGnssConfiguration_2_1() methods must
-     * return a non-null handle, and the other methods must return nullptr.
+     * return non-null. They can all return the same, latest version of IGnssConfiguration.
      *
      * @return gnssConfigurationIface Handle to the IGnssConfiguration interface.
      */
diff --git a/graphics/composer/2.2/utils/vts/RenderEngineVts.cpp b/graphics/composer/2.2/utils/vts/RenderEngineVts.cpp
index a23d72c..c78c358 100644
--- a/graphics/composer/2.2/utils/vts/RenderEngineVts.cpp
+++ b/graphics/composer/2.2/utils/vts/RenderEngineVts.cpp
@@ -33,6 +33,10 @@
     mRenderEngine = renderengine::RenderEngine::create(args);
 }
 
+TestRenderEngine::~TestRenderEngine() {
+    mRenderEngine.release();
+}
+
 void TestRenderEngine::setRenderLayers(std::vector<std::shared_ptr<TestLayer>> layers) {
     sort(layers.begin(), layers.end(),
          [](const std::shared_ptr<TestLayer>& lhs, const std::shared_ptr<TestLayer>& rhs) -> bool {
diff --git a/graphics/composer/2.2/utils/vts/include/composer-vts/2.2/RenderEngineVts.h b/graphics/composer/2.2/utils/vts/include/composer-vts/2.2/RenderEngineVts.h
index 4eb4bb7..f2d5f19 100644
--- a/graphics/composer/2.2/utils/vts/include/composer-vts/2.2/RenderEngineVts.h
+++ b/graphics/composer/2.2/utils/vts/include/composer-vts/2.2/RenderEngineVts.h
@@ -41,7 +41,7 @@
     static constexpr uint32_t sMaxFrameBufferAcquireBuffers = 2;
 
     TestRenderEngine(const RenderEngineCreationArgs& args);
-    ~TestRenderEngine() = default;
+    ~TestRenderEngine();
 
     void setRenderLayers(std::vector<std::shared_ptr<TestLayer>> layers);
     void initGraphicBuffer(uint32_t width, uint32_t height, uint32_t layerCount, uint64_t usage);
diff --git a/health/2.1/types.hal b/health/2.1/types.hal
index be1eaf8..d775491 100644
--- a/health/2.1/types.hal
+++ b/health/2.1/types.hal
@@ -19,6 +19,10 @@
 import @1.0::HealthConfig;
 import @2.0::HealthInfo;
 
+enum Constants : int64_t {
+    BATTERY_CHARGE_TIME_TO_FULL_NOW_SECONDS_UNSUPPORTED = -1,
+};
+
 /**
  * Battery capacity level. This enum provides additional information along side
  * with the battery capacity.
@@ -27,11 +31,17 @@
  */
 enum BatteryCapacityLevel : int32_t {
     /**
+     * Battery capacity level is unsupported.
+     * Battery capacity level must be set to this value if and only if the
+     * implementation is unsupported.
+     */
+    UNSUPPORTED = -1,
+    /**
      * Battery capacity level is unknown.
      * Battery capacity level must be set to this value if and only if battery
-     * is not present.
+     * is not present or the battery capacity level is unknown/uninitialized.
      */
-    UNKNOWN = 0,
+    UNKNOWN,
     /**
      * Battery is at critical level. The Android framework must schedule a
      * shutdown when it sees this value from the HAL.
@@ -78,6 +88,8 @@
 
     /**
      * Estimated time to fully charge the device (in seconds).
+     * Value must be BATTERY_CHARGE_TIME_TO_FULL_NOW_SECONDS_UNSUPPORTED if and
+     * only if the implementation is unsupported.
      * Value must be 0 if and only if batteryCapacityLevel is FULL or UNKNOWN.
      * Otherwise, value must be positive.
      */
diff --git a/sensors/2.0/vts/functional/Android.bp b/sensors/2.0/vts/functional/Android.bp
index 22a5091..08c59b6 100644
--- a/sensors/2.0/vts/functional/Android.bp
+++ b/sensors/2.0/vts/functional/Android.bp
@@ -36,7 +36,7 @@
         "android.hardware.sensors@2.1",
         "libfmq",
         "VtsHalSensorsTargetTestUtils",
-        "VtsHalSensorsV2_XTargetTest",
+        "VtsHalSensorsV2_0TargetTest-lib",
     ],
     test_suites: [
         "general-tests",
diff --git a/sensors/2.1/vts/functional/Android.bp b/sensors/2.1/vts/functional/Android.bp
index c92bab3..c4f5e9d 100644
--- a/sensors/2.1/vts/functional/Android.bp
+++ b/sensors/2.1/vts/functional/Android.bp
@@ -18,7 +18,6 @@
     name: "VtsHalSensorsV2_1TargetTest",
     cflags: [
         "-DLOG_TAG=\"sensors_hidl_hal_test\"",
-        "-DSENSORS_HAL_2_1",
     ],
     defaults: ["VtsHalTargetTestDefaults"],
     srcs: [
@@ -39,7 +38,7 @@
         "android.hardware.sensors@2.1",
         "libfmq",
         "VtsHalSensorsTargetTestUtils",
-        "VtsHalSensorsV2_XTargetTest",
+        "VtsHalSensorsV2_1TargetTest-lib",
     ],
     test_suites: [
         "general-tests",
diff --git a/sensors/common/vts/2_X/Android.bp b/sensors/common/vts/2_X/Android.bp
index 8cf1486..8cdb5d1 100644
--- a/sensors/common/vts/2_X/Android.bp
+++ b/sensors/common/vts/2_X/Android.bp
@@ -14,8 +14,8 @@
 // limitations under the License.
 //
 
-cc_test_library {
-    name: "VtsHalSensorsV2_XTargetTest",
+cc_defaults {
+    name: "VtsHalSensorsV2_XTargetTest-defaults",
     cflags: ["-DLOG_TAG=\"sensors_hidl_hal_test\""],
     defaults: ["VtsHalTargetTestDefaults"],
     srcs: [
@@ -42,3 +42,14 @@
         "VtsHalSensorsTargetTestUtils",
     ],
 }
+
+cc_test_library {
+    name: "VtsHalSensorsV2_0TargetTest-lib",
+    defaults: ["VtsHalSensorsV2_XTargetTest-defaults"],
+}
+
+cc_test_library {
+    name: "VtsHalSensorsV2_1TargetTest-lib",
+    cflags: ["-DSENSORS_HAL_2_1"],
+    defaults: ["VtsHalSensorsV2_XTargetTest-defaults"],
+}