Merge "Fix docstrings for RIL_CellIdentity" into oc-mr1-dev
diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedVehicleHal.cpp b/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedVehicleHal.cpp
index 385f03d..6bc0522 100644
--- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedVehicleHal.cpp
+++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedVehicleHal.cpp
@@ -162,12 +162,29 @@
return StatusCode::OK;
}
+static bool isDiagnosticProperty(VehiclePropConfig propConfig) {
+ switch (propConfig.prop) {
+ case OBD2_LIVE_FRAME:
+ case OBD2_FREEZE_FRAME:
+ case OBD2_FREEZE_FRAME_CLEAR:
+ case OBD2_FREEZE_FRAME_INFO:
+ return true;
+ }
+ return false;
+}
+
// Parse supported properties list and generate vector of property values to hold current values.
void EmulatedVehicleHal::onCreate() {
for (auto& it : kVehicleProperties) {
VehiclePropConfig cfg = it.config;
int32_t supportedAreas = cfg.supportedAreas;
+ if (isDiagnosticProperty(cfg)) {
+ // do not write an initial empty value for the diagnostic properties
+ // as we will initialize those separately.
+ continue;
+ }
+
// A global property will have supportedAreas = 0
if (isGlobalProp(cfg.prop)) {
supportedAreas = 0;
diff --git a/keymaster/3.0/vts/functional/keymaster_hidl_hal_test.cpp b/keymaster/3.0/vts/functional/keymaster_hidl_hal_test.cpp
index 78353ea..3d78f45 100644
--- a/keymaster/3.0/vts/functional/keymaster_hidl_hal_test.cpp
+++ b/keymaster/3.0/vts/functional/keymaster_hidl_hal_test.cpp
@@ -1774,7 +1774,7 @@
.Authorization(TAG_NO_AUTH_REQUIRED)
.EcdsaSigningKey(224)
.Digest(Digest::NONE)));
- string message(64 * 1024, 'a');
+ string message(2 * 1024, 'a');
SignMessage(message, AuthorizationSetBuilder().Digest(Digest::NONE));
}
@@ -2607,7 +2607,7 @@
}
/*
- * EncryptionOperationsTest.RsaNoPaddingTooLong
+ * EncryptionOperationsTest.RsaNoPaddingTooLarge
*
* Verifies that raw RSA encryption of too-large (numerically) messages fails in the expected way.
*/
@@ -3907,7 +3907,7 @@
* Verifies that the addRngEntropy method doesn't blow up when given a largish amount of data.
*/
TEST_F(AddEntropyTest, AddLargeEntropy) {
- EXPECT_EQ(ErrorCode::OK, keymaster().addRngEntropy(HidlBuf(string(16 * 1024, 'a'))));
+ EXPECT_EQ(ErrorCode::OK, keymaster().addRngEntropy(HidlBuf(string(2 * 1024, 'a'))));
}
typedef KeymasterHidlTest AttestationTest;
diff --git a/media/omx/1.0/vts/functional/component/VtsHalMediaOmxV1_0TargetComponentTest.cpp b/media/omx/1.0/vts/functional/component/VtsHalMediaOmxV1_0TargetComponentTest.cpp
index 235cfef..2ec86b2 100644
--- a/media/omx/1.0/vts/functional/component/VtsHalMediaOmxV1_0TargetComponentTest.cpp
+++ b/media/omx/1.0/vts/functional/component/VtsHalMediaOmxV1_0TargetComponentTest.cpp
@@ -583,6 +583,67 @@
kPortIndexInput, kPortIndexOutput);
}
+// test port mode configuration when the component is in various states
+TEST_F(ComponentHidlTest, PortModeConfig) {
+ description("Test Port Mode Configuration");
+ if (disableTest) return;
+ android::hardware::media::omx::V1_0::Status status;
+ uint32_t kPortIndexInput = 0, kPortIndexOutput = 1;
+ Message msg;
+
+ status = setRole(omxNode, gEnv->getRole().c_str());
+ ASSERT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK);
+ OMX_PORT_PARAM_TYPE params;
+ if (compClass == audio_decoder || compClass == audio_encoder) {
+ status = getParam(omxNode, OMX_IndexParamAudioInit, ¶ms);
+ } else {
+ status = getParam(omxNode, OMX_IndexParamVideoInit, ¶ms);
+ }
+ if (status == ::android::hardware::media::omx::V1_0::Status::OK) {
+ ASSERT_EQ(params.nPorts, 2U);
+ kPortIndexInput = params.nStartPortNumber;
+ kPortIndexOutput = kPortIndexInput + 1;
+ }
+
+ android::Vector<BufferInfo> iBuffer, oBuffer;
+
+ // set port mode
+ PortMode portMode[2];
+ initPortMode(portMode, isSecure, compClass);
+ status = omxNode->setPortMode(kPortIndexInput, portMode[0]);
+ EXPECT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK);
+ status = omxNode->setPortMode(kPortIndexOutput, portMode[1]);
+ EXPECT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK);
+
+ // set state to idle
+ changeStateLoadedtoIdle(omxNode, observer, &iBuffer, &oBuffer,
+ kPortIndexInput, kPortIndexOutput, portMode);
+ // Only Allow Port Mode configuration in loaded state
+ status = omxNode->setPortMode(kPortIndexInput, portMode[0]);
+ EXPECT_NE(status, ::android::hardware::media::omx::V1_0::Status::OK);
+ status = omxNode->setPortMode(kPortIndexOutput, portMode[1]);
+ EXPECT_NE(status, ::android::hardware::media::omx::V1_0::Status::OK);
+
+ // set state to executing
+ changeStateIdletoExecute(omxNode, observer);
+ // Only Allow Port Mode configuration in loaded state
+ status = omxNode->setPortMode(kPortIndexInput, portMode[0]);
+ EXPECT_NE(status, ::android::hardware::media::omx::V1_0::Status::OK);
+ status = omxNode->setPortMode(kPortIndexOutput, portMode[1]);
+ EXPECT_NE(status, ::android::hardware::media::omx::V1_0::Status::OK);
+
+ // set state to idle
+ changeStateExecutetoIdle(omxNode, observer, &iBuffer, &oBuffer);
+ // set state to loaded
+ changeStateIdletoLoaded(omxNode, observer, &iBuffer, &oBuffer,
+ kPortIndexInput, kPortIndexOutput);
+
+ status = omxNode->setPortMode(kPortIndexInput, portMode[0]);
+ EXPECT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK);
+ status = omxNode->setPortMode(kPortIndexOutput, portMode[1]);
+ EXPECT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK);
+}
+
// state transitions test
TEST_F(ComponentHidlTest, StateTransitions) {
description("Test State Transitions Loaded<->Idle<->Execute");
diff --git a/neuralnetworks/1.0/IDevice.hal b/neuralnetworks/1.0/IDevice.hal
index b826b23..9e19097 100644
--- a/neuralnetworks/1.0/IDevice.hal
+++ b/neuralnetworks/1.0/IDevice.hal
@@ -18,6 +18,7 @@
package android.hardware.neuralnetworks@1.0;
+import IEvent;
import IPreparedModel;
interface IDevice {
@@ -25,7 +26,7 @@
getSupportedSubgraph(Model model) generates(vec<bool> supported);
- prepareModel(Model model) generates(IPreparedModel preparedModel);
+ prepareModel(Model model, IEvent event) generates(IPreparedModel preparedModel);
getStatus() generates(DeviceStatus status);
};
diff --git a/neuralnetworks/1.0/vts/functional/Event.cpp b/neuralnetworks/1.0/vts/functional/Event.cpp
index 0fab86b..67de4f5 100644
--- a/neuralnetworks/1.0/vts/functional/Event.cpp
+++ b/neuralnetworks/1.0/vts/functional/Event.cpp
@@ -10,9 +10,15 @@
Event::Event() : mStatus(Status::WAITING) {}
Event::~Event() {
- if (mThread.joinable()) {
- mThread.join();
- }
+ // Note that we cannot call Event::join_thread from here: Event is
+ // intended to be reference counted, and it is possible that the
+ // reference count drops to zero in the bound thread, causing the
+ // bound thread to call this destructor. If a thread tries to join
+ // itself, it throws an exception, producing a message like the
+ // following:
+ //
+ // terminating with uncaught exception of type std::__1::system_error:
+ // thread::join failed: Resource deadlock would occur
}
Return<void> Event::notify(ReturnedStatus status) {
@@ -38,6 +44,7 @@
Event::Status Event::wait() {
std::unique_lock<std::mutex> lock(mMutex);
mCondition.wait(lock, [this]{return mStatus != Status::WAITING;});
+ join_thread_locked();
return mStatus;
}
@@ -69,6 +76,17 @@
return true;
}
+void Event::join_thread() {
+ std::lock_guard<std::mutex> lock(mMutex);
+ join_thread_locked();
+}
+
+void Event::join_thread_locked() {
+ if (mThread.joinable()) {
+ mThread.join();
+ }
+}
+
} // namespace implementation
} // namespace V1_0
} // namespace neuralnetworks
diff --git a/neuralnetworks/1.0/vts/functional/Event.h b/neuralnetworks/1.0/vts/functional/Event.h
index 2e19585..4f7f2f6 100644
--- a/neuralnetworks/1.0/vts/functional/Event.h
+++ b/neuralnetworks/1.0/vts/functional/Event.h
@@ -136,12 +136,21 @@
* TODO: What if notify has already been called before on_finish?
* TODO: Why does the return value of the callback matter?
*/
- bool on_finish(std::function<bool(void)> callback);
+ bool on_finish(std::function<bool(void)> callback);
/**
- * Event::bind_thread binds a thread to the event ensuring that the thread
- * has fully finished and cleaned its resources before the event is
- * destroyed. The thread should be bound using std::move.
+ * Event::bind_thread binds a thread to the event for later use by
+ * Event::join_thread.
+ *
+ * The thread must be passed using std::move.
+ *
+ * Once a thread is bound with Event::bind_thread, the client code
+ * should ensure that one of the following occurs before the event is
+ * destroyed:
+ * - Event::join_thread has been called.
+ * - Event::wait has been called.
+ * - Event::wait_for has been called and returned other than TIMEOUT.
+ * - Event::wait_until has been called and returned other than TIMEOUT.
*
* The bound thread shall not call any Event method with the exception of
* IEvent::notify, which it will call when the thread has finished its
@@ -154,9 +163,20 @@
* asyncThread.joinable() must be true.
* @return bool True if successful, false if thread was not properly bound.
*/
- bool bind_thread(std::thread&& asyncThread);
+ bool bind_thread(std::thread&& asyncThread);
+
+ /**
+ * Event::join_thread ensures that the thread (if any) bound to
+ * this event with Event::bind_thread has fully finished and
+ * cleaned its resources. It is legal to call this function
+ * multiple times, concurrently or sequentially.
+ */
+ void join_thread();
private:
+ // Same as Event::join_thread but assumes we already hold a lock on mMutex.
+ void join_thread_locked();
+
Status mStatus;
std::mutex mMutex;
std::condition_variable mCondition;
@@ -172,6 +192,9 @@
std::unique_lock<std::mutex> lock(mMutex);
std::cv_status status = mCondition.wait_for(lock, timeout_duration,
[this]{return mStatus != Status::WAITING;});
+ if (status != std::cv_status::timeout) {
+ join_thread_locked();
+ }
return status != std::cv_status::timeout ? mStatus : Status::TIMEOUT;
}
@@ -180,6 +203,9 @@
std::unique_lock<std::mutex> lock(mMutex);
std::cv_status status = mCondition.wait_until(lock, timeout_time,
[this]{return mStatus != Status::WAITING;});
+ if (status != std::cv_status::timeout) {
+ join_thread_locked();
+ }
return status != std::cv_status::timeout ? mStatus : Status::TIMEOUT;
}
diff --git a/neuralnetworks/1.0/vts/functional/VtsHalNeuralnetworksV1_0TargetTest.cpp b/neuralnetworks/1.0/vts/functional/VtsHalNeuralnetworksV1_0TargetTest.cpp
index 90ccd06..9c64c04 100644
--- a/neuralnetworks/1.0/vts/functional/VtsHalNeuralnetworksV1_0TargetTest.cpp
+++ b/neuralnetworks/1.0/vts/functional/VtsHalNeuralnetworksV1_0TargetTest.cpp
@@ -209,10 +209,14 @@
const uint32_t INPUT = 0;
const uint32_t OUTPUT = 1;
- // prpeare request
+ // prepare request
Model model = createTestModel();
- sp<IPreparedModel> preparedModel = device->prepareModel(model);
+ sp<Event> preparationEvent = new Event();
+ ASSERT_NE(nullptr, preparationEvent.get());
+ sp<IPreparedModel> preparedModel = device->prepareModel(model, preparationEvent);
ASSERT_NE(nullptr, preparedModel.get());
+ Event::Status preparationStatus = preparationEvent->wait();
+ EXPECT_EQ(Event::Status::SUCCESS, preparationStatus);
// prepare inputs
uint32_t inputSize = static_cast<uint32_t>(inputData.size() * sizeof(float));
@@ -245,13 +249,13 @@
outputMemory->commit();
// execute request
- sp<Event> event = sp<Event>(new Event());
- ASSERT_NE(nullptr, event.get());
+ sp<Event> executionEvent = new Event();
+ ASSERT_NE(nullptr, executionEvent.get());
bool success = preparedModel->execute({.inputs = inputs, .outputs = outputs, .pools = pools},
- event);
+ executionEvent);
EXPECT_TRUE(success);
- Event::Status status = event->wait();
- EXPECT_EQ(Event::Status::SUCCESS, status);
+ Event::Status executionStatus = executionEvent->wait();
+ EXPECT_EQ(Event::Status::SUCCESS, executionStatus);
// validate results { 1+5, 2+6, 3+7, 4+8 }
outputMemory->read();
diff --git a/power/1.1/default/Android.bp b/power/1.1/default/Android.bp
deleted file mode 100644
index 0b3598b..0000000
--- a/power/1.1/default/Android.bp
+++ /dev/null
@@ -1,33 +0,0 @@
-// Copyright (C) 2016 The Android Open Source Project
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-cc_binary {
- proprietary: true,
- defaults: ["hidl_defaults"],
- relative_install_path: "hw",
- name: "android.hardware.power@1.1-service",
- init_rc: ["android.hardware.power@1.1-service.rc"],
- srcs: ["service.cpp" , "Power.cpp"],
-
- shared_libs: [
- "liblog",
- "libdl",
- "libutils",
- "libhardware",
- "libhidlbase",
- "libhidltransport",
- "android.hardware.power@1.0",
- "android.hardware.power@1.1",
- ],
-}
diff --git a/power/1.1/default/Power.cpp b/power/1.1/default/Power.cpp
deleted file mode 100644
index b5d0c84..0000000
--- a/power/1.1/default/Power.cpp
+++ /dev/null
@@ -1,177 +0,0 @@
-/*
- * Copyright (C) 2016 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define LOG_TAG "android.hardware.power@1.1-impl"
-
-#include <log/log.h>
-
-#include <hardware/hardware.h>
-#include <hardware/power.h>
-
-#include "Power.h"
-
-namespace android {
-namespace hardware {
-namespace power {
-namespace V1_1 {
-namespace implementation {
-
-using ::android::hardware::power::V1_0::Feature;
-using ::android::hardware::power::V1_0::PowerHint;
-using ::android::hardware::power::V1_0::PowerStatePlatformSleepState;
-using ::android::hardware::power::V1_0::Status;
-using ::android::hardware::power::V1_1::PowerStateSubsystem;
-using ::android::hardware::hidl_vec;
-using ::android::hardware::Return;
-using ::android::hardware::Void;
-
-Power::Power(power_module_t *module) : mModule(module) {
- if (mModule)
- mModule->init(mModule);
-}
-
-Power::~Power() {
- delete(mModule);
-}
-
-// Methods from ::android::hardware::power::V1_0::IPower follow.
-Return<void> Power::setInteractive(bool interactive) {
- if (mModule->setInteractive)
- mModule->setInteractive(mModule, interactive ? 1 : 0);
- return Void();
-}
-
-Return<void> Power::powerHint(PowerHint hint, int32_t data) {
- int32_t param = data;
- if (mModule->powerHint) {
- if (data)
- mModule->powerHint(mModule, static_cast<power_hint_t>(hint), ¶m);
- else
- mModule->powerHint(mModule, static_cast<power_hint_t>(hint), NULL);
- }
- return Void();
-}
-
-Return<void> Power::setFeature(Feature feature, bool activate) {
- if (mModule->setFeature)
- mModule->setFeature(mModule, static_cast<feature_t>(feature),
- activate ? 1 : 0);
- return Void();
-}
-
-Return<void> Power::getPlatformLowPowerStats(getPlatformLowPowerStats_cb _hidl_cb) {
- hidl_vec<PowerStatePlatformSleepState> states;
- ssize_t number_platform_modes;
- size_t *voters = nullptr;
- power_state_platform_sleep_state_t *legacy_states = nullptr;
- int ret;
-
- if (mModule->get_number_of_platform_modes == nullptr ||
- mModule->get_voter_list == nullptr ||
- mModule->get_platform_low_power_stats == nullptr)
- {
- _hidl_cb(states, Status::SUCCESS);
- return Void();
- }
-
- number_platform_modes = mModule->get_number_of_platform_modes(mModule);
- if (number_platform_modes)
- {
- if ((ssize_t) (SIZE_MAX / sizeof(size_t)) <= number_platform_modes) // overflow
- goto done;
- voters = new (std::nothrow) size_t [number_platform_modes];
- if (voters == nullptr)
- goto done;
-
- ret = mModule->get_voter_list(mModule, voters);
- if (ret != 0)
- goto done;
-
- if ((ssize_t) (SIZE_MAX / sizeof(power_state_platform_sleep_state_t))
- <= number_platform_modes) // overflow
- goto done;
- legacy_states = new (std::nothrow)
- power_state_platform_sleep_state_t [number_platform_modes];
- if (legacy_states == nullptr)
- goto done;
-
- for (int i = 0; i < number_platform_modes; i++)
- {
- legacy_states[i].voters = nullptr;
- legacy_states[i].voters = new power_state_voter_t [voters[i]];
- if (legacy_states[i].voters == nullptr)
- goto done;
- }
-
- ret = mModule->get_platform_low_power_stats(mModule, legacy_states);
- if (ret != 0)
- goto done;
-
- states.resize(number_platform_modes);
- for (int i = 0; i < number_platform_modes; i++)
- {
- power_state_platform_sleep_state_t& legacy_state = legacy_states[i];
- PowerStatePlatformSleepState& state = states[i];
- state.name = legacy_state.name;
- state.residencyInMsecSinceBoot = legacy_state.residency_in_msec_since_boot;
- state.totalTransitions = legacy_state.total_transitions;
- state.supportedOnlyInSuspend = legacy_state.supported_only_in_suspend;
- state.voters.resize(voters[i]);
- for(size_t j = 0; j < voters[i]; j++)
- {
- state.voters[j].name = legacy_state.voters[j].name;
- state.voters[j].totalTimeInMsecVotedForSinceBoot = legacy_state.voters[j].total_time_in_msec_voted_for_since_boot;
- state.voters[j].totalNumberOfTimesVotedSinceBoot = legacy_state.voters[j].total_number_of_times_voted_since_boot;
- }
- }
- }
-done:
- if (legacy_states)
- {
- for (int i = 0; i < number_platform_modes; i++)
- {
- if(legacy_states[i].voters)
- delete(legacy_states[i].voters);
- }
- }
- delete[] legacy_states;
- delete[] voters;
- _hidl_cb(states, Status::SUCCESS);
- return Void();
-}
-
-// Methods from ::android::hardware::power::V1_1::IPower follow.
-Return<void> Power::getSubsystemLowPowerStats(getSubsystemLowPowerStats_cb _hidl_cb) {
- hidl_vec<PowerStateSubsystem> subsystems;
- ssize_t number_subsystems = 0;
-
- //This API will report zero subsystems to support older devices
- //For devices that support this API, they will have their own implementation
- subsystems.resize(number_subsystems);
- _hidl_cb(subsystems, Status::SUCCESS);
- return Void();
-}
-
-Return<void> Power::powerHintAsync(PowerHint hint, int32_t data) {
- // just call the normal power hint in this oneway function
- return powerHint(hint, data);
-}
-
-} // namespace implementation
-} // namespace V1_1
-} // namespace power
-} // namespace hardware
-} // namespace android
diff --git a/power/1.1/default/Power.h b/power/1.1/default/Power.h
deleted file mode 100644
index e779d64..0000000
--- a/power/1.1/default/Power.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Copyright (C) 2016 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef ANDROID_HARDWARE_POWER_V1_1_POWER_H
-#define ANDROID_HARDWARE_POWER_V1_1_POWER_H
-
-#include <android/hardware/power/1.1/IPower.h>
-#include <hidl/MQDescriptor.h>
-#include <hidl/Status.h>
-#include <hardware/power.h>
-
-namespace android {
-namespace hardware {
-namespace power {
-namespace V1_1 {
-namespace implementation {
-
-using ::android::hardware::power::V1_0::Feature;
-using ::android::hardware::power::V1_0::PowerHint;
-using ::android::hardware::power::V1_1::IPower;
-using ::android::hardware::Return;
-using ::android::hardware::Void;
-
-struct Power : public IPower {
- Power(power_module_t* module);
- ~Power();
-
- // Methods from ::android::hardware::power::V1_0::IPower follow
- Return<void> setInteractive(bool interactive) override;
- Return<void> powerHint(PowerHint hint, int32_t data) override;
- Return<void> setFeature(Feature feature, bool activate) override;
- Return<void> getPlatformLowPowerStats(getPlatformLowPowerStats_cb _hidl_cb) override;
-
- // Methods from ::android::hardware::power::V1_1::IPower follow.
- Return<void> getSubsystemLowPowerStats(getSubsystemLowPowerStats_cb _hidl_cb) override;
- Return<void> powerHintAsync(PowerHint hint, int32_t data) override;
-
- // Methods from ::android::hidl::base::V1_0::IBase follow.
-
- private:
- power_module_t* mModule;
-};
-
-} // namespace implementation
-} // namespace V1_1
-} // namespace power
-} // namespace hardware
-} // namespace android
-
-#endif // ANDROID_HARDWARE_POWER_V1_1_POWER_H
diff --git a/power/1.1/default/android.hardware.power@1.1-service.rc b/power/1.1/default/android.hardware.power@1.1-service.rc
deleted file mode 100644
index f2512f1..0000000
--- a/power/1.1/default/android.hardware.power@1.1-service.rc
+++ /dev/null
@@ -1,4 +0,0 @@
-service power-hal-1-1 /vendor/bin/hw/android.hardware.power@1.1-service
- class hal
- user system
- group system
diff --git a/power/1.1/default/service.cpp b/power/1.1/default/service.cpp
deleted file mode 100644
index 571db2f..0000000
--- a/power/1.1/default/service.cpp
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Copyright (C) 2016 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define LOG_TAG "android.hardware.power@1.1-service"
-
-#include <android/log.h>
-#include <hidl/HidlTransportSupport.h>
-#include <android/hardware/power/1.1/IPower.h>
-#include <hardware/power.h>
-#include "Power.h"
-
-using android::sp;
-using android::status_t;
-using android::OK;
-
-// libhwbinder:
-using android::hardware::configureRpcThreadpool;
-using android::hardware::joinRpcThreadpool;
-
-// Generated HIDL files
-using android::hardware::power::V1_1::IPower;
-using android::hardware::power::V1_1::implementation::Power;
-
-int main() {
-
- status_t status;
- android::sp<IPower> service = nullptr;
- const hw_module_t* hw_module = nullptr;
- power_module_t* power_module = nullptr;
- int err;
-
- ALOGI("Power HAL Service 1.1 (Default) is starting.");
-
- err = hw_get_module(POWER_HARDWARE_MODULE_ID, &hw_module);
- if (err) {
- ALOGE("hw_get_module %s failed: %d", POWER_HARDWARE_MODULE_ID, err);
- goto shutdown;
- }
-
- if (!hw_module->methods || !hw_module->methods->open) {
- power_module = reinterpret_cast<power_module_t*>(
- const_cast<hw_module_t*>(hw_module));
- } else {
- err = hw_module->methods->open(hw_module, POWER_HARDWARE_MODULE_ID,
- reinterpret_cast<hw_device_t**>(&power_module));
- if (err) {
- ALOGE("Passthrough failed to load legacy HAL.");
- goto shutdown;
- }
- }
-
- service = new Power(power_module);
- if (service == nullptr) {
- ALOGE("Can not create an instance of Power HAL Iface, exiting.");
-
- goto shutdown;
- }
-
- configureRpcThreadpool(1, true /*callerWillJoin*/);
-
- status = service->registerAsService();
- if (status != OK) {
- ALOGE("Could not register service for Power HAL Iface (%d).", status);
- goto shutdown;
- }
-
- ALOGI("Power Service is ready");
- joinRpcThreadpool();
- //Should not pass this line
-
-shutdown:
- // In normal operation, we don't expect the thread pool to exit
-
- ALOGE("Power Service is shutting down");
- return 1;
-}
diff --git a/power/Android.bp b/power/Android.bp
index 7a315fa..a5415df 100644
--- a/power/Android.bp
+++ b/power/Android.bp
@@ -4,6 +4,5 @@
"1.0/default",
"1.0/vts/functional",
"1.1",
- "1.1/default",
"1.1/vts/functional",
]