Loading redfin/overlay/frameworks/base/packages/SystemUI/res/values/config.xml +6 −0 Original line number Diff line number Diff line Loading @@ -51,6 +51,12 @@ <!-- Doze: can we assume the pickup sensor includes a proximity check? --> <bool name="doze_pickup_performs_proximity_check">true</bool> <!-- Doze: only register sensors that use prox when device is in certain Display states. This may delay registering sensors when device first shows dozing UI but the Display & Power state hasn't changed to low-power mode yet. --> <bool name="doze_selectively_register_prox">true</bool> <!-- Doze: whether the double tap sensor reports 2D touch coordinates --> <bool name="doze_double_tap_reports_touch_coordinates">true</bool> Loading redfin/overlay/frameworks/base/packages/SystemUI/res/values/dimens.xml +13 −0 Original line number Diff line number Diff line Loading @@ -31,5 +31,18 @@ <dimen name="config_rounded_mask_size">156px</dimen> <dimen name="config_rounded_mask_size_top">156px</dimen> <dimen name="config_rounded_mask_size_bottom">156px</dimen> <!-- Location on the screen of the center of the physical power button. --> <dimen name="physical_power_button_center_screen_location_y">620px</dimen> <!-- Location on the screen of the center of the physical volume up/down buttons. --> <dimen name="physical_volume_up_button_center_screen_location_y">950px</dimen> <dimen name="physical_volume_down_button_center_screen_location_y">1150px</dimen> <!-- Location on the screen of the center of the fingerprint sensor. For devices with under display fingerprint sensors, this directly corresponds to the fingerprint sensor's location. For devices with sensors on the back of the device, this corresponds to the location on the screen directly in front of the sensor. --> <dimen name="physical_fingerprint_sensor_center_screen_location_y">620px</dimen> </resources> usb/Android.bp +2 −3 Original line number Diff line number Diff line // // Copyright (C) 2021 The Android Open Source Project // Copyright (C) 2018 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. Loading @@ -23,7 +23,7 @@ cc_binary { init_rc: ["android.hardware.usb@1.3-service.redfin.rc"], vintf_fragments: [ "android.hardware.usb@1.3-service.redfin.xml", "android.hardware.usb.gadget@1.2-service.redfin.xml", "android.hardware.usb.gadget@1.1-service.redfin.xml", ], srcs: ["service.cpp", "Usb.cpp", "UsbGadget.cpp"], shared_libs: [ Loading @@ -33,7 +33,6 @@ cc_binary { "android.hardware.usb@1.3", "android.hardware.usb.gadget@1.0", "android.hardware.usb.gadget@1.1", "android.hardware.usb.gadget@1.2", "libbase", "libcutils", "libhardware", Loading usb/UsbGadget.cpp +4 −38 Original line number Diff line number Diff line /* * Copyright (C) 2020 The Android Open Source Project * Copyright (C) 2018 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. Loading @@ -14,7 +14,7 @@ * limitations under the License. */ #define LOG_TAG "android.hardware.usb.gadget@1.2-service.redfin" #define LOG_TAG "android.hardware.usb.gadget@1.1-service.redfin" #include "UsbGadget.h" #include <dirent.h> Loading @@ -30,7 +30,7 @@ namespace android { namespace hardware { namespace usb { namespace gadget { namespace V1_2 { namespace V1_1 { namespace implementation { UsbGadget::UsbGadget() { Loading @@ -55,40 +55,6 @@ Return<void> UsbGadget::getCurrentUsbFunctions(const sp<V1_0::IUsbGadgetCallback return Void(); } Return<void> UsbGadget::getUsbSpeed(const sp<V1_2::IUsbGadgetCallback> &callback) { std::string current_speed; if (ReadFileToString(SPEED_PATH, ¤t_speed)) { current_speed = Trim(current_speed); ALOGI("current USB speed is %s", current_speed.c_str()); if (current_speed == "low-speed") mUsbSpeed = UsbSpeed::LOWSPEED; else if (current_speed == "full-speed") mUsbSpeed = UsbSpeed::FULLSPEED; else if (current_speed == "high-speed") mUsbSpeed = UsbSpeed::HIGHSPEED; else if (current_speed == "super-speed") mUsbSpeed = UsbSpeed::SUPERSPEED; else if (current_speed == "super-speed-plus") mUsbSpeed = UsbSpeed::SUPERSPEED_10Gb; else if (current_speed == "UNKNOWN") mUsbSpeed = UsbSpeed::UNKNOWN; else mUsbSpeed = UsbSpeed::RESERVED_SPEED; } else { ALOGE("Fail to read current speed"); mUsbSpeed = UsbSpeed::UNKNOWN; } if (callback) { Return<void> ret = callback->getUsbSpeedCb(mUsbSpeed); if (!ret.isOk()) ALOGE("Call to getUsbSpeedCb failed %s", ret.description().c_str()); } return Void(); } V1_0::Status UsbGadget::tearDownGadget() { if (resetGadget() != Status::SUCCESS) return Status::ERROR; Loading Loading @@ -391,7 +357,7 @@ error: return Void(); } } // namespace implementation } // namespace V1_2 } // namespace V1_1 } // namespace gadget } // namespace usb } // namespace hardware Loading usb/UsbGadget.h +6 −17 Original line number Diff line number Diff line /* * Copyright (C) 2020 The Android Open Source Project * Copyright (C) 2018 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. Loading @@ -19,9 +19,7 @@ #include <android-base/file.h> #include <android-base/properties.h> #include <android-base/unique_fd.h> #include <android-base/strings.h> #include <android/hardware/usb/gadget/1.2/types.h> #include <android/hardware/usb/gadget/1.2/IUsbGadget.h> #include <android/hardware/usb/gadget/1.1/IUsbGadget.h> #include <hidl/MQDescriptor.h> #include <hidl/Status.h> #include <pixelusb/UsbGadgetCommon.h> Loading @@ -38,15 +36,13 @@ namespace android { namespace hardware { namespace usb { namespace gadget { namespace V1_2 { namespace V1_1 { namespace implementation { using ::android::sp; using ::android::base::GetProperty; using ::android::base::SetProperty; using ::android::base::Trim; using ::android::base::unique_fd; using ::android::base::ReadFileToString; using ::android::base::WriteStringToFile; using ::android::hardware::hidl_array; using ::android::hardware::hidl_memory; Loading @@ -64,18 +60,14 @@ using ::android::hardware::google::pixel::usb::MonitorFfs; using ::android::hardware::google::pixel::usb::resetGadget; using ::android::hardware::google::pixel::usb::setVidPid; using ::android::hardware::google::pixel::usb::unlinkFunctions; using ::android::hardware::usb::gadget::V1_0::IUsbGadgetCallback; using ::android::hardware::usb::gadget::V1_0::GadgetFunction; using ::android::hardware::usb::gadget::V1_0::Status; using ::android::hardware::usb::gadget::V1_2::IUsbGadget; using ::android::hardware::usb::gadget::V1_2::GadgetFunction; using ::android::hardware::usb::gadget::V1_1::IUsbGadget; using ::std::string; constexpr char kGadgetName[] = "a600000.dwc3"; static MonitorFfs monitorFfs(kGadgetName); #define UDC_PATH "/sys/class/udc/a600000.dwc3/" #define SPEED_PATH UDC_PATH "current_speed" struct UsbGadget : public IUsbGadget { UsbGadget(); Loading @@ -83,7 +75,6 @@ struct UsbGadget : public IUsbGadget { std::mutex mLockSetCurrentFunction; uint64_t mCurrentUsbFunctions; bool mCurrentUsbFunctionsApplied; UsbSpeed mUsbSpeed; Return<void> setCurrentUsbFunctions(uint64_t functions, const sp<V1_0::IUsbGadgetCallback> &callback, Loading @@ -93,8 +84,6 @@ struct UsbGadget : public IUsbGadget { Return<Status> reset() override; Return<void> getUsbSpeed(const sp<V1_2::IUsbGadgetCallback> &callback) override; private: Status tearDownGadget(); Status setupFunctions(uint64_t functions, const sp<V1_0::IUsbGadgetCallback> &callback, Loading @@ -102,7 +91,7 @@ private: }; } // namespace implementation } // namespace V1_2 } // namespace V1_1 } // namespace gadget } // namespace usb } // namespace hardware Loading Loading
redfin/overlay/frameworks/base/packages/SystemUI/res/values/config.xml +6 −0 Original line number Diff line number Diff line Loading @@ -51,6 +51,12 @@ <!-- Doze: can we assume the pickup sensor includes a proximity check? --> <bool name="doze_pickup_performs_proximity_check">true</bool> <!-- Doze: only register sensors that use prox when device is in certain Display states. This may delay registering sensors when device first shows dozing UI but the Display & Power state hasn't changed to low-power mode yet. --> <bool name="doze_selectively_register_prox">true</bool> <!-- Doze: whether the double tap sensor reports 2D touch coordinates --> <bool name="doze_double_tap_reports_touch_coordinates">true</bool> Loading
redfin/overlay/frameworks/base/packages/SystemUI/res/values/dimens.xml +13 −0 Original line number Diff line number Diff line Loading @@ -31,5 +31,18 @@ <dimen name="config_rounded_mask_size">156px</dimen> <dimen name="config_rounded_mask_size_top">156px</dimen> <dimen name="config_rounded_mask_size_bottom">156px</dimen> <!-- Location on the screen of the center of the physical power button. --> <dimen name="physical_power_button_center_screen_location_y">620px</dimen> <!-- Location on the screen of the center of the physical volume up/down buttons. --> <dimen name="physical_volume_up_button_center_screen_location_y">950px</dimen> <dimen name="physical_volume_down_button_center_screen_location_y">1150px</dimen> <!-- Location on the screen of the center of the fingerprint sensor. For devices with under display fingerprint sensors, this directly corresponds to the fingerprint sensor's location. For devices with sensors on the back of the device, this corresponds to the location on the screen directly in front of the sensor. --> <dimen name="physical_fingerprint_sensor_center_screen_location_y">620px</dimen> </resources>
usb/Android.bp +2 −3 Original line number Diff line number Diff line // // Copyright (C) 2021 The Android Open Source Project // Copyright (C) 2018 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. Loading @@ -23,7 +23,7 @@ cc_binary { init_rc: ["android.hardware.usb@1.3-service.redfin.rc"], vintf_fragments: [ "android.hardware.usb@1.3-service.redfin.xml", "android.hardware.usb.gadget@1.2-service.redfin.xml", "android.hardware.usb.gadget@1.1-service.redfin.xml", ], srcs: ["service.cpp", "Usb.cpp", "UsbGadget.cpp"], shared_libs: [ Loading @@ -33,7 +33,6 @@ cc_binary { "android.hardware.usb@1.3", "android.hardware.usb.gadget@1.0", "android.hardware.usb.gadget@1.1", "android.hardware.usb.gadget@1.2", "libbase", "libcutils", "libhardware", Loading
usb/UsbGadget.cpp +4 −38 Original line number Diff line number Diff line /* * Copyright (C) 2020 The Android Open Source Project * Copyright (C) 2018 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. Loading @@ -14,7 +14,7 @@ * limitations under the License. */ #define LOG_TAG "android.hardware.usb.gadget@1.2-service.redfin" #define LOG_TAG "android.hardware.usb.gadget@1.1-service.redfin" #include "UsbGadget.h" #include <dirent.h> Loading @@ -30,7 +30,7 @@ namespace android { namespace hardware { namespace usb { namespace gadget { namespace V1_2 { namespace V1_1 { namespace implementation { UsbGadget::UsbGadget() { Loading @@ -55,40 +55,6 @@ Return<void> UsbGadget::getCurrentUsbFunctions(const sp<V1_0::IUsbGadgetCallback return Void(); } Return<void> UsbGadget::getUsbSpeed(const sp<V1_2::IUsbGadgetCallback> &callback) { std::string current_speed; if (ReadFileToString(SPEED_PATH, ¤t_speed)) { current_speed = Trim(current_speed); ALOGI("current USB speed is %s", current_speed.c_str()); if (current_speed == "low-speed") mUsbSpeed = UsbSpeed::LOWSPEED; else if (current_speed == "full-speed") mUsbSpeed = UsbSpeed::FULLSPEED; else if (current_speed == "high-speed") mUsbSpeed = UsbSpeed::HIGHSPEED; else if (current_speed == "super-speed") mUsbSpeed = UsbSpeed::SUPERSPEED; else if (current_speed == "super-speed-plus") mUsbSpeed = UsbSpeed::SUPERSPEED_10Gb; else if (current_speed == "UNKNOWN") mUsbSpeed = UsbSpeed::UNKNOWN; else mUsbSpeed = UsbSpeed::RESERVED_SPEED; } else { ALOGE("Fail to read current speed"); mUsbSpeed = UsbSpeed::UNKNOWN; } if (callback) { Return<void> ret = callback->getUsbSpeedCb(mUsbSpeed); if (!ret.isOk()) ALOGE("Call to getUsbSpeedCb failed %s", ret.description().c_str()); } return Void(); } V1_0::Status UsbGadget::tearDownGadget() { if (resetGadget() != Status::SUCCESS) return Status::ERROR; Loading Loading @@ -391,7 +357,7 @@ error: return Void(); } } // namespace implementation } // namespace V1_2 } // namespace V1_1 } // namespace gadget } // namespace usb } // namespace hardware Loading
usb/UsbGadget.h +6 −17 Original line number Diff line number Diff line /* * Copyright (C) 2020 The Android Open Source Project * Copyright (C) 2018 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. Loading @@ -19,9 +19,7 @@ #include <android-base/file.h> #include <android-base/properties.h> #include <android-base/unique_fd.h> #include <android-base/strings.h> #include <android/hardware/usb/gadget/1.2/types.h> #include <android/hardware/usb/gadget/1.2/IUsbGadget.h> #include <android/hardware/usb/gadget/1.1/IUsbGadget.h> #include <hidl/MQDescriptor.h> #include <hidl/Status.h> #include <pixelusb/UsbGadgetCommon.h> Loading @@ -38,15 +36,13 @@ namespace android { namespace hardware { namespace usb { namespace gadget { namespace V1_2 { namespace V1_1 { namespace implementation { using ::android::sp; using ::android::base::GetProperty; using ::android::base::SetProperty; using ::android::base::Trim; using ::android::base::unique_fd; using ::android::base::ReadFileToString; using ::android::base::WriteStringToFile; using ::android::hardware::hidl_array; using ::android::hardware::hidl_memory; Loading @@ -64,18 +60,14 @@ using ::android::hardware::google::pixel::usb::MonitorFfs; using ::android::hardware::google::pixel::usb::resetGadget; using ::android::hardware::google::pixel::usb::setVidPid; using ::android::hardware::google::pixel::usb::unlinkFunctions; using ::android::hardware::usb::gadget::V1_0::IUsbGadgetCallback; using ::android::hardware::usb::gadget::V1_0::GadgetFunction; using ::android::hardware::usb::gadget::V1_0::Status; using ::android::hardware::usb::gadget::V1_2::IUsbGadget; using ::android::hardware::usb::gadget::V1_2::GadgetFunction; using ::android::hardware::usb::gadget::V1_1::IUsbGadget; using ::std::string; constexpr char kGadgetName[] = "a600000.dwc3"; static MonitorFfs monitorFfs(kGadgetName); #define UDC_PATH "/sys/class/udc/a600000.dwc3/" #define SPEED_PATH UDC_PATH "current_speed" struct UsbGadget : public IUsbGadget { UsbGadget(); Loading @@ -83,7 +75,6 @@ struct UsbGadget : public IUsbGadget { std::mutex mLockSetCurrentFunction; uint64_t mCurrentUsbFunctions; bool mCurrentUsbFunctionsApplied; UsbSpeed mUsbSpeed; Return<void> setCurrentUsbFunctions(uint64_t functions, const sp<V1_0::IUsbGadgetCallback> &callback, Loading @@ -93,8 +84,6 @@ struct UsbGadget : public IUsbGadget { Return<Status> reset() override; Return<void> getUsbSpeed(const sp<V1_2::IUsbGadgetCallback> &callback) override; private: Status tearDownGadget(); Status setupFunctions(uint64_t functions, const sp<V1_0::IUsbGadgetCallback> &callback, Loading @@ -102,7 +91,7 @@ private: }; } // namespace implementation } // namespace V1_2 } // namespace V1_1 } // namespace gadget } // namespace usb } // namespace hardware Loading