diff --git a/a10/common.mk b/a10/common.mk new file mode 100644 index 0000000..ca1d777 --- /dev/null +++ b/a10/common.mk @@ -0,0 +1,20 @@ +DEVICE_PACKAGE_OVERLAYS += $(LOCAL_PATH)/overlay + +TARGET_BOARD_CAMERA_COUNT := 2 +TARGET_BOARD_HAS_FP := false + +# Inherit common device configuration +$(call inherit-product, device/samsung/universal7885-common/universal7885-common.mk) + +$(call inherit-product, frameworks/native/build/phone-xhdpi-2048-dalvik-heap.mk) + +# USB +PRODUCT_PACKAGES += \ + android.hardware.usb@1.0-service.a10 + +TARGET_SCREEN_HEIGHT := 1520 +TARGET_SCREEN_WIDTH := 720 + +PRODUCT_PACKAGES += \ + fstab.exynos7884B + diff --git a/a10/device.mk b/a10/device.mk index 0dd5ee7..dcf8361 100644 --- a/a10/device.mk +++ b/a10/device.mk @@ -1,27 +1,9 @@ -DEVICE_PACKAGE_OVERLAYS += $(LOCAL_PATH)/overlay - -TARGET_BOARD_CAMERA_COUNT := 2 -TARGET_BOARD_HAS_FP := false TARGET_LOCAL_ARCH := arm64 -# Inherit common device configuration -$(call inherit-product, device/samsung/universal7885-common/universal7885-common.mk) - $(call inherit-product, vendor/samsung/a10/a10-vendor.mk) -$(call inherit-product, frameworks/native/build/phone-xhdpi-2048-dalvik-heap.mk) - -# USB -PRODUCT_PACKAGES += \ - android.hardware.usb@1.0-service.a10 - # Sensors PRODUCT_PACKAGES += \ android.hardware.sensors@1.0-service.a10 -TARGET_SCREEN_HEIGHT := 1520 -TARGET_SCREEN_WIDTH := 720 - -PRODUCT_PACKAGES += \ - fstab.exynos7884B - +include device/samsung/a10/common.mk diff --git a/a10/dtbo/Android.mk b/a10/dtbo/Android.mk index 5cb675d..e53609f 100644 --- a/a10/dtbo/Android.mk +++ b/a10/dtbo/Android.mk @@ -1,4 +1,4 @@ -ifeq ($(TARGET_DEVICE),a10) +ifneq ($(filter $(TARGET_DEVICE), a10 a10dd),) LOCAL_PATH := $(call my-dir) $(call add-radio-file,eureka_dtbo.img) endif diff --git a/a10dd/BoardConfig.mk b/a10dd/BoardConfig.mk index c66b90f..6ed5497 100644 --- a/a10dd/BoardConfig.mk +++ b/a10dd/BoardConfig.mk @@ -1,21 +1,2 @@ -DEVICE_PATH := device/samsung/a10dd - -# Asserts -TARGET_OTA_ASSERT_DEVICE := a10,a10dd - -# Kernel -TARGET_KERNEL_CONFIG := exynos7885-a10_defconfig - -# Display -TARGET_SCREEN_DENSITY := 280 - -# Partitions -BOARD_RECOVERYIMAGE_PARTITION_SIZE := 55574528 # 55MB -BOARD_SYSTEMIMAGE_PARTITION_SIZE := 3556769792 # 3.31GB -BOARD_CACHEIMAGE_PARTITION_SIZE := 157286400 -BOARD_VENDORIMAGE_PARTITION_SIZE := 394264576 - -# Inherit common board flags -include device/samsung/universal7885-common/BoardConfigCommon.mk - -TARGET_VENDOR_PROP += $(DEVICE_PATH)/vendor.prop +# Inherit A10 ARM64 board flags +include device/samsung/a10/BoardConfig.mk diff --git a/a10dd/device.mk b/a10dd/device.mk index 07505a5..216b24a 100644 --- a/a10dd/device.mk +++ b/a10dd/device.mk @@ -1,28 +1,8 @@ -DEVICE_PACKAGE_OVERLAYS += $(LOCAL_PATH)/overlay - -TARGET_BOARD_CAMERA_COUNT := 2 -TARGET_BOARD_HAS_FP := false TARGET_LOCAL_ARCH := arm -# Inherit common device configuration -$(call inherit-product, device/samsung/universal7885-common/universal7885-common.mk) - $(call inherit-product, vendor/samsung/a10-arm/a10-vendor.mk) -$(call inherit-product, frameworks/native/build/phone-xhdpi-2048-dalvik-heap.mk) - -PRODUCT_PACKAGES += \ - CameraLightSensor - -# USB -PRODUCT_PACKAGES += \ - android.hardware.usb@1.0-service.a10dd - -TARGET_SCREEN_HEIGHT := 1520 -TARGET_SCREEN_WIDTH := 720 - -PRODUCT_PACKAGES += \ - fstab.exynos7884B - PRODUCT_PACKAGES += \ android.hardware.sensors@1.0-service + +include device/samsung/a10/common.mk diff --git a/a10dd/dtbo/Android.mk b/a10dd/dtbo/Android.mk deleted file mode 100644 index 6d67ee7..0000000 --- a/a10dd/dtbo/Android.mk +++ /dev/null @@ -1,4 +0,0 @@ -ifeq ($(TARGET_DEVICE),a10dd) -LOCAL_PATH := $(call my-dir) -$(call add-radio-file,eureka_dtbo.img) -endif diff --git a/a10dd/dtbo/eureka_dtbo.img b/a10dd/dtbo/eureka_dtbo.img deleted file mode 100644 index 055598c..0000000 Binary files a/a10dd/dtbo/eureka_dtbo.img and /dev/null differ diff --git a/a10dd/overlay/frameworks/base/core/res/res/values/config.xml b/a10dd/overlay/frameworks/base/core/res/res/values/config.xml deleted file mode 100644 index 533568e..0000000 --- a/a10dd/overlay/frameworks/base/core/res/res/values/config.xml +++ /dev/null @@ -1,61 +0,0 @@ - - - - - M62,0l-3.8,0l-3.9,0.2l-3.9,0.4l-4,0.8l-3.9,1.2l-3.8,1.6l-3.7,2l-3.4,2.4l-3.1,2.8l-2.9,3l-2.7,3.1l-2.6,3.1 l-2.7,2.8C12.5,28,6.2,30.3,0,30.3c-6.3,0-12.5-2.3-17.5-6.8l-2.7-2.8l-2.6-3.1l-2.7-3.1l-2.9-3l-3.2-2.8 L-35,6.2l-3.7-2l-3.8-1.6l-3.9-1.2l-4-0.8L-54.3,0.2L-58.2,0L-62,0Z @dp - @*android:string/config_mainBuiltInDisplayCutout - - false - true - false - false - false - true - - - 0:2:15 - - - - 4 - - true - - true - - 2 - diff --git a/a10dd/overlay/frameworks/base/core/res/res/values/dimens.xml b/a10dd/overlay/frameworks/base/core/res/res/values/dimens.xml deleted file mode 100644 index 06570fa..0000000 --- a/a10dd/overlay/frameworks/base/core/res/res/values/dimens.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - 24.0dip - - 31.0dip - - 40px - diff --git a/a10dd/overlay/frameworks/base/core/res/res/xml/power_profile.xml b/a10dd/overlay/frameworks/base/core/res/res/xml/power_profile.xml deleted file mode 100644 index 818340f..0000000 --- a/a10dd/overlay/frameworks/base/core/res/res/xml/power_profile.xml +++ /dev/null @@ -1,87 +0,0 @@ - - 0 - 93 - 313 - 118 - 0.98 - 0.43 - 488 - 502 - 45 - 286 - 124 - 662 - 32 - 164 - 115 - - 7.3 - 7.3 - - - 6 - 2 - - - 1586000 - 1482000 - 1352000 - 1248000 - 1144000 - 1014000 - 902000 - 839000 - 757000 - 676000 - 546000 - 449000 - - - 50 - 43 - 34 - 28 - 24 - 18 - 15 - 13 - 11 - 10 - 7 - 6 - - - 1768000 - 1664000 - 1560000 - 1352000 - 1144000 - 936000 - - - 162 - 142 - 120 - 87 - 61 - 41 - - 3.79 - 23 - 3400 - 3300 - 1 - 65 - 265 - - 0 - - 3600 - - .0002 - .002 - .02 - .2 - 2 - - diff --git a/a10dd/overlay/frameworks/base/packages/SettingsProvider/res/values/defaults.xml b/a10dd/overlay/frameworks/base/packages/SettingsProvider/res/values/defaults.xml deleted file mode 100644 index 7663c61..0000000 --- a/a10dd/overlay/frameworks/base/packages/SettingsProvider/res/values/defaults.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - Samsung Galaxy A10 - diff --git a/a10dd/usb/Android.bp b/a10dd/usb/Android.bp deleted file mode 100644 index 291e991..0000000 --- a/a10dd/usb/Android.bp +++ /dev/null @@ -1,34 +0,0 @@ -// -// Copyright (C) 2017-2018,2020 The LineageOS 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 { - name: "android.hardware.usb@1.0-service.a10dd", - relative_install_path: "hw", - init_rc: ["android.hardware.usb@1.0-service.a10dd.rc"], - vintf_fragments: ["android.hardware.usb@1.0-service.a10dd.xml"] - srcs: [ - "service.cpp", - "Usb.cpp", - ], - shared_libs: [ - "libbase", - "libcutils", - "libhidlbase", - "libutils", - "libhardware", - "android.hardware.usb@1.0", - ], - proprietary: true, -} diff --git a/a10dd/usb/Usb.cpp b/a10dd/usb/Usb.cpp deleted file mode 100644 index f45f7e5..0000000 --- a/a10dd/usb/Usb.cpp +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright (C) 2017-2018 The LineageOS 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. - */ -#include -#include -#include -#include - -#include -#include -#include - -#include "Usb.h" - -namespace android { -namespace hardware { -namespace usb { -namespace V1_0 { -namespace implementation { - -Return Usb::switchRole(const hidl_string &portName __unused, - const PortRole &newRole __unused) { - LOG(ERROR) << __func__ << ": Not supported"; - return Void(); -} - -Return Usb::queryPortStatus() { - hidl_vec currentPortStatus; - currentPortStatus.resize(1); - - currentPortStatus[0].portName = "otg_default"; - currentPortStatus[0].currentDataRole = PortDataRole::DEVICE; - currentPortStatus[0].currentPowerRole = PortPowerRole::SINK; - currentPortStatus[0].currentMode = PortMode::UFP; - currentPortStatus[0].canChangeMode = false; - currentPortStatus[0].canChangeDataRole = false; - currentPortStatus[0].canChangePowerRole = false; - currentPortStatus[0].supportedModes = PortMode::UFP; - - pthread_mutex_lock(&mLock); - if (mCallback != NULL) { - Return ret = - mCallback->notifyPortStatusChange(currentPortStatus, Status::SUCCESS); - if (!ret.isOk()) { - LOG(ERROR) << "queryPortStatus error " << ret.description(); - } - } else { - LOG(INFO) << "Notifying userspace skipped. Callback is NULL"; - } - pthread_mutex_unlock(&mLock); - - return Void(); -} - -Return Usb::setCallback(const sp &callback) { - pthread_mutex_lock(&mLock); - - mCallback = callback; - LOG(INFO) << "registering callback"; - - pthread_mutex_unlock(&mLock); - return Void(); -} - -} // namespace implementation -} // namespace V1_0 -} // namespace usb -} // namespace hardware -} // namespace android diff --git a/a10dd/usb/Usb.h b/a10dd/usb/Usb.h deleted file mode 100644 index 908d061..0000000 --- a/a10dd/usb/Usb.h +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (C) 2017-2018 The LineageOS 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_USB_V1_0_USB_H -#define ANDROID_HARDWARE_USB_V1_0_USB_H - -#include -#include -#include -#include - -#ifdef LOG_TAG -#undef LOG_TAG -#endif - -#define LOG_TAG "android.hardware.usb@1.0-service-a10dd" -#define UEVENT_MSG_LEN 2048 - -namespace android { -namespace hardware { -namespace usb { -namespace V1_0 { -namespace implementation { - -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::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 switchRole(const hidl_string &portName, - const PortRole &role) override; - Return setCallback(const sp &callback) override; - Return queryPortStatus() override; - - sp mCallback; - pthread_mutex_t mLock = PTHREAD_MUTEX_INITIALIZER; -}; - -} // namespace implementation -} // namespace V1_0 -} // namespace usb -} // namespace hardware -} // namespace android - -#endif // ANDROID_HARDWARE_USB_V1_0_USB_H diff --git a/a10dd/usb/android.hardware.usb@1.0-service.a10dd.rc b/a10dd/usb/android.hardware.usb@1.0-service.a10dd.rc deleted file mode 100644 index 3e7b62e..0000000 --- a/a10dd/usb/android.hardware.usb@1.0-service.a10dd.rc +++ /dev/null @@ -1,5 +0,0 @@ -service vendor.usb-hal-1-0 /vendor/bin/hw/android.hardware.usb@1.0-service.a10dd - interface android.hardware.usb@1.0::IUsb default - class hal - user system - group system diff --git a/a10dd/usb/android.hardware.usb@1.0-service.a10dd.xml b/a10dd/usb/android.hardware.usb@1.0-service.a10dd.xml deleted file mode 100644 index 6bfb402..0000000 --- a/a10dd/usb/android.hardware.usb@1.0-service.a10dd.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - android.hardware.usb - hwbinder - 1.0 - - IUsb - default - - - diff --git a/a10dd/usb/service.cpp b/a10dd/usb/service.cpp deleted file mode 100644 index d10264c..0000000 --- a/a10dd/usb/service.cpp +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (C) 2017-2018 The LineageOS 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. - */ - -#include "Usb.h" -#include -#include - -using android::sp; - -// libhwbinder: -using android::hardware::configureRpcThreadpool; -using android::hardware::joinRpcThreadpool; - -// Generated HIDL files -using android::hardware::usb::V1_0::IUsb; -using android::hardware::usb::V1_0::implementation::Usb; - -int main() { - android::sp service = new Usb(); - - configureRpcThreadpool(1, true /*callerWillJoin*/); - android::status_t status = service->registerAsService(); - - if (status != android::OK) { - LOG(ERROR) << "Cannot register USB HAL service"; - return 1; - } - - LOG(INFO) << "USB HAL Ready."; - joinRpcThreadpool(); - // Under normal cases, execution will not reach this line. - LOG(ERROR) << "USB HAL failed to join thread pool."; - return 1; -}