Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 96c29355 authored by android-build-team Robot's avatar android-build-team Robot
Browse files

release-request-66ee9889-2756-44aa-9b4c-91e7b5c1058c-for-git_oc-dr1-release-39...

release-request-66ee9889-2756-44aa-9b4c-91e7b5c1058c-for-git_oc-dr1-release-3988462 snap-temp-L14700000061937187

Change-Id: Iab15a91f9e1d1419831d4fbfa73a35451b628b92
parents d1818b64 4a1461ea
Loading
Loading
Loading
Loading
+204 −253
Original line number Diff line number Diff line
@@ -64,36 +64,34 @@ struct ConfigDeclaration {
};

const ConfigDeclaration kVehicleProperties[]{
    {.config =
         {
        .config = {
             .prop = toInt(VehicleProperty::INFO_MAKE),
             .access = VehiclePropertyAccess::READ,
             .changeMode = VehiclePropertyChangeMode::STATIC,
         },
        .initialValue = { .stringValue = "Toy Vehicle" }
    },
     .initialValue = {.stringValue = "Toy Vehicle"}},
    {.config =
         {
        .config = {
             .prop = toInt(VehicleProperty::PERF_VEHICLE_SPEED),
             .access = VehiclePropertyAccess::READ,
             .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
             .minSampleRate = 1.0f,
             .maxSampleRate = 1000.0f,
         },
        .initialValue = { .floatValues = {0.0f} }
    },
     .initialValue = {.floatValues = {0.0f}}},

    {.config =
         {
        .config = {
             .prop = toInt(VehicleProperty::PERF_ODOMETER),
             .access = VehiclePropertyAccess::READ,
             .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
         },
        .initialValue = { .floatValues = {0.0f} }
    },
     .initialValue = {.floatValues = {0.0f}}},

    {
        .config = {
        .config =
            {
                .prop = toInt(VehicleProperty::ENGINE_RPM),
                .access = VehiclePropertyAccess::READ,
                .changeMode = VehiclePropertyChangeMode::CONTINUOUS,
@@ -103,35 +101,32 @@ const ConfigDeclaration kVehicleProperties[] {
        .initialValue = {.floatValues = {0.0f}},
    },

    {.config =
         {
        .config = {
             .prop = toInt(VehicleProperty::CURRENT_GEAR),
             .access = VehiclePropertyAccess::READ,
             .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
         },
        .initialValue = { .int32Values = { toInt(VehicleGear::GEAR_PARK) } }
    },
     .initialValue = {.int32Values = {toInt(VehicleGear::GEAR_PARK)}}},

    {.config =
         {
        .config = {
             .prop = toInt(VehicleProperty::PARKING_BRAKE_ON),
             .access = VehiclePropertyAccess::READ,
             .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
         },
        .initialValue = { .int32Values = {1} }
    },
     .initialValue = {.int32Values = {1}}},

    {.config =
         {
        .config = {
             .prop = toInt(VehicleProperty::FUEL_LEVEL_LOW),
             .access = VehiclePropertyAccess::READ,
             .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
         },
        .initialValue = { .int32Values = {0} }
    },
     .initialValue = {.int32Values = {0}}},

    {.config =
         {
        .config = {
             .prop = toInt(VehicleProperty::HVAC_POWER_ON),
             .access = VehiclePropertyAccess::READ_WRITE,
             .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
@@ -140,88 +135,58 @@ const ConfigDeclaration kVehicleProperties[] {
             // kHvacPowerProperties.
             .configString = "0x12400500,0x12400501"  // HVAC_FAN_SPEED,HVAC_FAN_DIRECTION
         },
        .initialValue = { .int32Values = {1} }
    },
     .initialValue = {.int32Values = {1}}},

    {
        .config = {
            .prop = toInt(VehicleProperty::HVAC_DEFROSTER),
        .config = {.prop = toInt(VehicleProperty::HVAC_DEFROSTER),
                   .access = VehiclePropertyAccess::READ_WRITE,
                   .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
                   .supportedAreas =
            VehicleAreaWindow::FRONT_WINDSHIELD
            | VehicleAreaWindow::REAR_WINDSHIELD
        },
                       VehicleAreaWindow::FRONT_WINDSHIELD | VehicleAreaWindow::REAR_WINDSHIELD},
        .initialValue = {.int32Values = {0}}  // Will be used for all areas.
    },

    {
        .config = {
            .prop = toInt(VehicleProperty::HVAC_RECIRC_ON),
    {.config = {.prop = toInt(VehicleProperty::HVAC_RECIRC_ON),
                .access = VehiclePropertyAccess::READ_WRITE,
                .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
            .supportedAreas = toInt(VehicleAreaZone::ROW_1)
        },
        .initialValue = { .int32Values = {1} }
    },
                .supportedAreas = toInt(VehicleAreaZone::ROW_1)},
     .initialValue = {.int32Values = {1}}},

    {
        .config = {
            .prop = toInt(VehicleProperty::HVAC_AC_ON),
    {.config = {.prop = toInt(VehicleProperty::HVAC_AC_ON),
                .access = VehiclePropertyAccess::READ_WRITE,
                .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
            .supportedAreas = toInt(VehicleAreaZone::ROW_1)
        },
        .initialValue = { .int32Values = {1} }
    },
                .supportedAreas = toInt(VehicleAreaZone::ROW_1)},
     .initialValue = {.int32Values = {1}}},

    {
        .config = {
            .prop = toInt(VehicleProperty::HVAC_AUTO_ON),
    {.config = {.prop = toInt(VehicleProperty::HVAC_AUTO_ON),
                .access = VehiclePropertyAccess::READ_WRITE,
                .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
            .supportedAreas = toInt(VehicleAreaZone::ROW_1)
        },
        .initialValue = { .int32Values = {1} }
    },
                .supportedAreas = toInt(VehicleAreaZone::ROW_1)},
     .initialValue = {.int32Values = {1}}},

    {
        .config = {
            .prop = toInt(VehicleProperty::HVAC_FAN_SPEED),
    {.config = {.prop = toInt(VehicleProperty::HVAC_FAN_SPEED),
                .access = VehiclePropertyAccess::READ_WRITE,
                .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
                .supportedAreas = toInt(VehicleAreaZone::ROW_1),
            .areaConfigs = {
                VehicleAreaConfig {
                    .areaId = toInt(VehicleAreaZone::ROW_1),
                .areaConfigs = {VehicleAreaConfig{.areaId = toInt(VehicleAreaZone::ROW_1),
                                                  .minInt32Value = 1,
                    .maxInt32Value = 7
                }
            }
        },
        .initialValue = { .int32Values = {3} }
    },
                                                  .maxInt32Value = 7}}},
     .initialValue = {.int32Values = {3}}},

    {.config =
         {
        .config = {
             .prop = toInt(VehicleProperty::HVAC_FAN_DIRECTION),
             .access = VehiclePropertyAccess::READ_WRITE,
             .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
             .supportedAreas = toInt(VehicleAreaZone::ROW_1),
         },
        .initialValue = { .int32Values = { toInt(VehicleHvacFanDirection::FACE) } }
    },
     .initialValue = {.int32Values = {toInt(VehicleHvacFanDirection::FACE)}}},

    {
        .config = {
            .prop = toInt(VehicleProperty::HVAC_TEMPERATURE_SET),
    {.config = {.prop = toInt(VehicleProperty::HVAC_TEMPERATURE_SET),
                .access = VehiclePropertyAccess::READ_WRITE,
                .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
            .supportedAreas =
            VehicleAreaZone::ROW_1_LEFT
            | VehicleAreaZone::ROW_1_RIGHT,
            .areaConfigs = {
                VehicleAreaConfig {
                .supportedAreas = VehicleAreaZone::ROW_1_LEFT | VehicleAreaZone::ROW_1_RIGHT,
                .areaConfigs = {VehicleAreaConfig{
                                    .areaId = toInt(VehicleAreaZone::ROW_1_LEFT),
                                    .minFloatValue = 16,
                                    .maxFloatValue = 32,
@@ -230,22 +195,12 @@ const ConfigDeclaration kVehicleProperties[] {
                                    .areaId = toInt(VehicleAreaZone::ROW_1_RIGHT),
                                    .minFloatValue = 16,
                                    .maxFloatValue = 32,
                }
            }
        },
        .initialAreaValues = {
            {
                toInt(VehicleAreaZone::ROW_1_LEFT),
                { .floatValues = {16} }
            }, {
                toInt(VehicleAreaZone::ROW_1_RIGHT),
                { .floatValues = {20} }
            }
        }
    },
                                }}},
     .initialAreaValues = {{toInt(VehicleAreaZone::ROW_1_LEFT), {.floatValues = {16}}},
                           {toInt(VehicleAreaZone::ROW_1_RIGHT), {.floatValues = {20}}}}},

    {.config =
         {
        .config = {
             .prop = toInt(VehicleProperty::ENV_OUTSIDE_TEMPERATURE),
             .access = VehiclePropertyAccess::READ,
             // TODO(bryaneyler): Support ON_CHANGE as well.
@@ -253,38 +208,35 @@ const ConfigDeclaration kVehicleProperties[] {
             .minSampleRate = 1.0f,
             .maxSampleRate = 2.0f,
         },
        .initialValue = { .floatValues = {25.0f} }
    },
     .initialValue = {.floatValues = {25.0f}}},

    {.config =
         {
        .config = {
             .prop = toInt(VehicleProperty::NIGHT_MODE),
             .access = VehiclePropertyAccess::READ,
             .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
         },
        .initialValue = { .int32Values = {0} }
    },
     .initialValue = {.int32Values = {0}}},

    {.config =
         {
        .config = {
             .prop = toInt(VehicleProperty::DRIVING_STATUS),
             .access = VehiclePropertyAccess::READ,
             .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
         },
        .initialValue = { .int32Values = { toInt(VehicleDrivingStatus::UNRESTRICTED) } }
    },
     .initialValue = {.int32Values = {toInt(VehicleDrivingStatus::UNRESTRICTED)}}},

    {.config =
         {
        .config = {
             .prop = toInt(VehicleProperty::GEAR_SELECTION),
             .access = VehiclePropertyAccess::READ,
             .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
         },
        .initialValue = { .int32Values = { toInt(VehicleGear::GEAR_PARK) } }
    },
     .initialValue = {.int32Values = {toInt(VehicleGear::GEAR_PARK)}}},

    {
        .config = {
        .config =
            {
                .prop = toInt(VehicleProperty::INFO_FUEL_CAPACITY),
                .access = VehiclePropertyAccess::READ,
                .changeMode = VehiclePropertyChangeMode::STATIC,
@@ -292,48 +244,47 @@ const ConfigDeclaration kVehicleProperties[] {
        .initialValue = {.floatValues = {123000.0f}}  // In Milliliters
    },

    {
        .config = {
            .prop = toInt(VehicleProperty::DISPLAY_BRIGHTNESS),
    {.config = {.prop = toInt(VehicleProperty::DISPLAY_BRIGHTNESS),
                .access = VehiclePropertyAccess::READ_WRITE,
                .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
            .areaConfigs = {
                VehicleAreaConfig {
                    .minInt32Value = 0,
                    .maxInt32Value = 10
                }
            }
        },
        .initialValue = { .int32Values = {7} }
    },
                .areaConfigs = {VehicleAreaConfig{.minInt32Value = 0, .maxInt32Value = 10}}},
     .initialValue = {.int32Values = {7}}},

    {.config =
         {
        .config = {
             .prop = toInt(VehicleProperty::IGNITION_STATE),
             .access = VehiclePropertyAccess::READ,
             .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
         },
        .initialValue = { .int32Values = { toInt(VehicleIgnitionState::ON) } }
    },
     .initialValue = {.int32Values = {toInt(VehicleIgnitionState::ON)}}},

    {.config =
         {
        .config = {
             .prop = toInt(VehicleProperty::ENGINE_OIL_TEMP),
             .access = VehiclePropertyAccess::READ,
             .changeMode = VehiclePropertyChangeMode::CONTINUOUS,
             .minSampleRate = 0.1,  // 0.1 Hz, every 10 seconds
             .maxSampleRate = 10,   // 10 Hz, every 100 ms
         },
        .initialValue = { .floatValues = {101.0f} }
    },
     .initialValue = {.floatValues = {101.0f}}},

    {
        .config = {
        .config =
            {
                .prop = kGenerateFakeDataControllingProperty,
                .access = VehiclePropertyAccess::WRITE,
                .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
            },
    }
    },

    {.config =
         {
             .prop = toInt(VehicleProperty::DOOR_LOCK),
             .access = VehiclePropertyAccess::READ,
             .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
         },
     .initialValue = {.int32Values = {1}}}

};

}  // impl
+6 −6
Original line number Diff line number Diff line
@@ -105,7 +105,7 @@ class AsyncFdWatcherSocketTest : public ::testing::Test {
      int connection_fd = AcceptConnection(fd);
      ALOGD("%s: Conn_watcher fd = %d", __func__, fd);

      conn_watcher_.ConfigureTimeout(std::chrono::seconds(0), [this]() {
      conn_watcher_.ConfigureTimeout(std::chrono::seconds(0), []() {
        bool connection_timeout_cleared = false;
        ASSERT_TRUE(connection_timeout_cleared);
      });
@@ -117,7 +117,7 @@ class AsyncFdWatcherSocketTest : public ::testing::Test {
      // Time out if it takes longer than a second.
      SetTimeout(std::chrono::seconds(1));
    });
    conn_watcher_.ConfigureTimeout(std::chrono::seconds(1), [this]() {
    conn_watcher_.ConfigureTimeout(std::chrono::seconds(1), []() {
      bool connection_timeout = true;
      ASSERT_FALSE(connection_timeout);
    });
@@ -207,7 +207,7 @@ TEST_F(AsyncFdWatcherSocketTest, Connect) {
  });

  // Fail if the client doesn't connect within 1 second.
  conn_watcher.ConfigureTimeout(std::chrono::seconds(1), [this]() {
  conn_watcher.ConfigureTimeout(std::chrono::seconds(1), []() {
    bool connection_timeout = true;
    ASSERT_FALSE(connection_timeout);
  });
@@ -231,7 +231,7 @@ TEST_F(AsyncFdWatcherSocketTest, TimedOutConnect) {

  // Set the timeout flag after 100ms.
  conn_watcher.ConfigureTimeout(std::chrono::milliseconds(100),
                                [this, timeout_ptr]() { *timeout_ptr = true; });
                                [timeout_ptr]() { *timeout_ptr = true; });
  EXPECT_FALSE(timed_out);
  sleep(1);
  EXPECT_TRUE(timed_out);
@@ -254,7 +254,7 @@ TEST_F(AsyncFdWatcherSocketTest, TimedOutSchedulesTimeout) {
  // Set a timeout flag in each callback.
  conn_watcher.ConfigureTimeout(
      std::chrono::milliseconds(500),
      [this, &conn_watcher, &timed_out, &timed_out2]() {
      [&conn_watcher, &timed_out, &timed_out2]() {
        timed_out = true;
        conn_watcher.ConfigureTimeout(std::chrono::seconds(1),
                                      [&timed_out2]() { timed_out2 = true; });
@@ -298,7 +298,7 @@ TEST_F(AsyncFdWatcherSocketTest, WatchTwoFileDescriptors) {
  });

  // Fail if the test doesn't pass within 3 seconds
  watcher.ConfigureTimeout(std::chrono::seconds(3), [this]() {
  watcher.ConfigureTimeout(std::chrono::seconds(3), []() {
    bool connection_timeout = true;
    ASSERT_FALSE(connection_timeout);
  });
+2 −4
Original line number Diff line number Diff line
@@ -23,8 +23,7 @@
        <name>android.hardware.camera.provider</name>
        <version>2.4</version>
    </hal>
    <!-- TODO(b/35356977): configstore is required. -->
    <hal format="hidl" optional="true">
    <hal format="hidl" optional="false">
        <name>android.hardware.configstore</name>
        <version>1.0-1</version>
    </hal>
@@ -72,8 +71,7 @@
        <name>android.hardware.light</name>
        <version>2.0</version>
    </hal>
    <!-- TODO(b/36097717): omx is required. -->
    <hal format="hidl" optional="true">
    <hal format="hidl" optional="false">
        <name>android.hardware.media.omx</name>
        <version>1.0</version>
    </hal>
+8 −4
Original line number Diff line number Diff line
@@ -66,7 +66,8 @@ TEST_F(SapHidlTest, transferAtrReq) {
  EXPECT_EQ(std::cv_status::no_timeout, wait());
  EXPECT_EQ(sapCb->sapResponseToken, token);

  ASSERT_TRUE(SapResultCode::DATA_NOT_AVAILABLE == sapCb->sapResultCode ||
  ASSERT_TRUE(SapResultCode::GENERIC_FAILURE == sapCb->sapResultCode ||
              SapResultCode::DATA_NOT_AVAILABLE == sapCb->sapResultCode ||
              SapResultCode::CARD_ALREADY_POWERED_OFF == sapCb->sapResultCode ||
              SapResultCode::CARD_REMOVED == sapCb->sapResultCode);
}
@@ -82,7 +83,8 @@ TEST_F(SapHidlTest, powerReq) {
  EXPECT_EQ(std::cv_status::no_timeout, wait());
  EXPECT_EQ(sapCb->sapResponseToken, token);

  ASSERT_TRUE(SapResultCode::CARD_NOT_ACCESSSIBLE == sapCb->sapResultCode ||
  ASSERT_TRUE(SapResultCode::GENERIC_FAILURE == sapCb->sapResultCode ||
              SapResultCode::CARD_NOT_ACCESSSIBLE == sapCb->sapResultCode ||
              SapResultCode::CARD_ALREADY_POWERED_OFF == sapCb->sapResultCode ||
              SapResultCode::CARD_REMOVED == sapCb->sapResultCode ||
              SapResultCode::CARD_ALREADY_POWERED_ON == sapCb->sapResultCode);
@@ -98,7 +100,8 @@ TEST_F(SapHidlTest, resetSimReq) {
  EXPECT_EQ(std::cv_status::no_timeout, wait());
  EXPECT_EQ(sapCb->sapResponseToken, token);

  ASSERT_TRUE(SapResultCode::CARD_NOT_ACCESSSIBLE == sapCb->sapResultCode ||
  ASSERT_TRUE(SapResultCode::GENERIC_FAILURE == sapCb->sapResultCode ||
              SapResultCode::CARD_NOT_ACCESSSIBLE == sapCb->sapResultCode ||
              SapResultCode::CARD_ALREADY_POWERED_OFF == sapCb->sapResultCode ||
              SapResultCode::CARD_REMOVED == sapCb->sapResultCode);
}
@@ -113,7 +116,8 @@ TEST_F(SapHidlTest, transferCardReaderStatusReq) {
  EXPECT_EQ(std::cv_status::no_timeout, wait());
  EXPECT_EQ(sapCb->sapResponseToken, token);

  EXPECT_EQ(SapResultCode::DATA_NOT_AVAILABLE, sapCb->sapResultCode);
  ASSERT_TRUE(SapResultCode::GENERIC_FAILURE == sapCb->sapResultCode ||
              SapResultCode::DATA_NOT_AVAILABLE == sapCb->sapResultCode);
}

/*
+6 −7
Original line number Diff line number Diff line
@@ -200,8 +200,7 @@ void SensorsHidlEnvironment::pollingThread(
  bool needExit = *stop;

  while(!needExit) {
    env->sensors->poll(1,
        [&](auto result, const auto &events, const auto &dynamicSensorsAdded) {
      env->sensors->poll(64, [&](auto result, const auto& events, const auto& dynamicSensorsAdded) {
          if (result != Result::OK
              || (events.size() == 0 && dynamicSensorsAdded.size() == 0)
              || *stop) {
@@ -209,8 +208,8 @@ void SensorsHidlEnvironment::pollingThread(
              return;
          }

          if (events.size() > 0) {
            env->addEvent(events[0]);
          for (const auto& e : events) {
              env->addEvent(e);
          }
      });
  }
Loading