mirror of
https://github.com/chararomandroid/android_device_samsung_a20
synced 2026-08-23 12:35:33 -04:00
universal7885: run clang-format based on system-clang-format
* On every *.cpp *.h files Signed-off-by: roynatech2544 <whiteshell2544@naver.com>
This commit is contained in:
parent
6bc1c25485
commit
098179eabb
47 changed files with 1545 additions and 1709 deletions
9
universal7885-common/usb/typeb/Usb.cpp
Executable file → Normal file
9
universal7885-common/usb/typeb/Usb.cpp
Executable file → Normal file
|
|
@ -30,8 +30,8 @@ namespace usb {
|
|||
namespace V1_0 {
|
||||
namespace implementation {
|
||||
|
||||
Return<void> Usb::switchRole(const hidl_string &portName __unused,
|
||||
const PortRole &newRole __unused) {
|
||||
Return<void> Usb::switchRole(const hidl_string& portName __unused,
|
||||
const PortRole& newRole __unused) {
|
||||
LOG(ERROR) << __func__ << ": Not supported";
|
||||
return Void();
|
||||
}
|
||||
|
|
@ -51,8 +51,7 @@ Return<void> Usb::queryPortStatus() {
|
|||
|
||||
pthread_mutex_lock(&mLock);
|
||||
if (mCallback != NULL) {
|
||||
Return<void> ret =
|
||||
mCallback->notifyPortStatusChange(currentPortStatus, Status::SUCCESS);
|
||||
Return<void> ret = mCallback->notifyPortStatusChange(currentPortStatus, Status::SUCCESS);
|
||||
if (!ret.isOk()) {
|
||||
LOG(ERROR) << "queryPortStatus error " << ret.description();
|
||||
}
|
||||
|
|
@ -64,7 +63,7 @@ Return<void> Usb::queryPortStatus() {
|
|||
return Void();
|
||||
}
|
||||
|
||||
Return<void> Usb::setCallback(const sp<IUsbCallback> &callback) {
|
||||
Return<void> Usb::setCallback(const sp<IUsbCallback>& callback) {
|
||||
pthread_mutex_lock(&mLock);
|
||||
|
||||
mCallback = callback;
|
||||
|
|
|
|||
10
universal7885-common/usb/typeb/Usb.h
Executable file → Normal file
10
universal7885-common/usb/typeb/Usb.h
Executable file → Normal file
|
|
@ -35,17 +35,17 @@ namespace usb {
|
|||
namespace V1_0 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::hardware::usb::V1_0::IUsb;
|
||||
using ::android::hardware::usb::V1_0::IUsbCallback;
|
||||
using ::android::hardware::usb::V1_0::PortRole;
|
||||
using ::android::hidl::base::V1_0::IBase;
|
||||
using ::android::sp;
|
||||
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;
|
||||
using ::android::hardware::usb::V1_0::IUsb;
|
||||
using ::android::hardware::usb::V1_0::IUsbCallback;
|
||||
using ::android::hardware::usb::V1_0::PortRole;
|
||||
using ::android::hidl::base::V1_0::IBase;
|
||||
|
||||
struct Usb : public IUsb {
|
||||
Return<void> switchRole(const hidl_string& portName, const PortRole& role) override;
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -2,8 +2,8 @@
|
|||
#define ANDROID_HARDWARE_USB_V1_1_USB_H
|
||||
|
||||
#include <android/hardware/usb/1.1/IUsb.h>
|
||||
#include <android/hardware/usb/1.1/types.h>
|
||||
#include <android/hardware/usb/1.1/IUsbCallback.h>
|
||||
#include <android/hardware/usb/1.1/types.h>
|
||||
#include <hidl/Status.h>
|
||||
#include <utils/Log.h>
|
||||
|
||||
|
|
@ -20,10 +20,17 @@ namespace usb {
|
|||
namespace V1_1 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::hardware::usb::V1_0::PortRole;
|
||||
using ::android::hardware::usb::V1_0::PortRoleType;
|
||||
using ::android::sp;
|
||||
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::hardware::usb::V1_0::PortDataRole;
|
||||
using ::android::hardware::usb::V1_0::PortPowerRole;
|
||||
using ::android::hardware::usb::V1_0::PortRole;
|
||||
using ::android::hardware::usb::V1_0::PortRoleType;
|
||||
using ::android::hardware::usb::V1_0::Status;
|
||||
using ::android::hardware::usb::V1_1::IUsb;
|
||||
using ::android::hardware::usb::V1_1::IUsbCallback;
|
||||
|
|
@ -31,13 +38,6 @@ using ::android::hardware::usb::V1_1::PortMode_1_1;
|
|||
using ::android::hardware::usb::V1_1::PortStatus_1_1;
|
||||
using ::android::hidl::base::V1_0::DebugInfo;
|
||||
using ::android::hidl::base::V1_0::IBase;
|
||||
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 Usb : public IUsb {
|
||||
Usb();
|
||||
|
|
@ -46,7 +46,6 @@ struct Usb : public IUsb {
|
|||
Return<void> setCallback(const sp<V1_0::IUsbCallback>& callback) override;
|
||||
Return<void> queryPortStatus() override;
|
||||
|
||||
|
||||
sp<V1_0::IUsbCallback> mCallback_1_0;
|
||||
// Protects mCallback variable
|
||||
pthread_mutex_t mLock;
|
||||
|
|
@ -59,12 +58,12 @@ struct Usb : public IUsb {
|
|||
// Variable to signal partner coming back online after type switch
|
||||
bool mPartnerUp;
|
||||
|
||||
private:
|
||||
pthread_t mPoll;
|
||||
private:
|
||||
pthread_t mPoll;
|
||||
};
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_0
|
||||
} // namespace V1_1
|
||||
} // namespace usb
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
|
|
|
|||
|
|
@ -29,8 +29,8 @@ using android::hardware::joinRpcThreadpool;
|
|||
using android::hardware::usb::V1_1::IUsb;
|
||||
using android::hardware::usb::V1_1::implementation::Usb;
|
||||
|
||||
using android::status_t;
|
||||
using android::OK;
|
||||
using android::status_t;
|
||||
|
||||
int main() {
|
||||
android::sp<IUsb> service = new Usb();
|
||||
|
|
@ -48,5 +48,4 @@ int main() {
|
|||
// Under noraml cases, execution will not reach this line.
|
||||
ALOGI("USB HAL failed to join thread pool.");
|
||||
return 1;
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue