diff --git a/a10/device.mk b/a10/device.mk index 22f3507..cc60b03 100644 --- a/a10/device.mk +++ b/a10/device.mk @@ -21,7 +21,7 @@ PRODUCT_PACKAGES += \ PRODUCT_PACKAGES += \ android.hardware.sensors@1.0-service.a10 -TARGET_SCREEN_HEIGHT := 1560 +TARGET_SCREEN_HEIGHT := 1520 TARGET_SCREEN_WIDTH := 720 PRODUCT_PACKAGES += \ diff --git a/a10dd/BoardConfig.mk b/a10dd/BoardConfig.mk new file mode 100644 index 0000000..9eb9287 --- /dev/null +++ b/a10dd/BoardConfig.mk @@ -0,0 +1,19 @@ +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 diff --git a/a10dd/device.mk b/a10dd/device.mk new file mode 100644 index 0000000..fc38e47 --- /dev/null +++ b/a10dd/device.mk @@ -0,0 +1,25 @@ +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, 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.a10 + +TARGET_SCREEN_HEIGHT := 1520 +TARGET_SCREEN_WIDTH := 720 + +PRODUCT_PACKAGES += \ + fstab.exynos7884B + diff --git a/a10dd/dtbo/Android.mk b/a10dd/dtbo/Android.mk new file mode 100644 index 0000000..6d67ee7 --- /dev/null +++ b/a10dd/dtbo/Android.mk @@ -0,0 +1,4 @@ +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 new file mode 100644 index 0000000..055598c Binary files /dev/null and b/a10dd/dtbo/eureka_dtbo.img differ diff --git a/a10dd/full_a10dd.mk b/a10dd/full_a10dd.mk new file mode 100644 index 0000000..24f3318 --- /dev/null +++ b/a10dd/full_a10dd.mk @@ -0,0 +1,17 @@ +# Copyright (C) 2018 The LineageOS Project +# SPDX-License-Identifier: Apache-2.0 + +# Inherit from those products. Most specific first. +$(call inherit-product, $(SRC_TARGET_DIR)/product/product_launched_with_p.mk) +$(call inherit-product, $(SRC_TARGET_DIR)/product/full_base.mk) +$(call inherit-product, $(SRC_TARGET_DIR)/product/full_base_telephony.mk) + +# Inherit device configuration +$(call inherit-product, device/samsung/a10dd/device.mk) + +# Device identifier. This must come after all inclusions +PRODUCT_DEVICE := a10dd +PRODUCT_NAME := full_a10dd +PRODUCT_MODEL := SM-A105F +PRODUCT_BRAND := samsung +PRODUCT_MANUFACTURER := samsung diff --git a/a10dd/overlay/frameworks/base/core/res/res/values/config.xml b/a10dd/overlay/frameworks/base/core/res/res/values/config.xml new file mode 100644 index 0000000..533568e --- /dev/null +++ b/a10dd/overlay/frameworks/base/core/res/res/values/config.xml @@ -0,0 +1,61 @@ + + + + + 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 new file mode 100644 index 0000000..06570fa --- /dev/null +++ b/a10dd/overlay/frameworks/base/core/res/res/values/dimens.xml @@ -0,0 +1,10 @@ + + + 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 new file mode 100644 index 0000000..818340f --- /dev/null +++ b/a10dd/overlay/frameworks/base/core/res/res/xml/power_profile.xml @@ -0,0 +1,87 @@ + + 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/setup.sh b/a10dd/setup.sh new file mode 100755 index 0000000..4765156 --- /dev/null +++ b/a10dd/setup.sh @@ -0,0 +1,22 @@ +VENDOR=$(cat device/samsung/universal7885-common/vendor_name) +if [ ! $VENDOR ]; then +VENDOR=aosp; +fi +# Generate AndroidProducts.mk +echo "# Auto-Generated by device/samsung/a10dd/setup.sh" > device/samsung/a10dd/AndroidProducts.mk +echo "PRODUCT_MAKEFILES += \$(LOCAL_DIR)/"$VENDOR"_a10dd.mk" >> device/samsung/a10dd/AndroidProducts.mk + +# Generate _a10dd.mk +echo "# Auto-Generated by device/samsung/a10dd/setup.sh" > device/samsung/a10dd/"$VENDOR"_a10dd.mk +echo "\$(call inherit-product, device/samsung/a10dd/full_a10dd.mk)" >> device/samsung/a10dd/"$VENDOR"_a10dd.mk +if test -f vendor/"$VENDOR"/config/common_full_phone.mk && echo "common_full_phone"; then + echo "\$(call inherit-product, vendor/"$VENDOR"/config/common_full_phone.mk)" >> device/samsung/a10dd/"$VENDOR"_a10dd.mk +elif test -f vendor/"$VENDOR"/config/common.mk && echo "common"; then + echo "\$(call inherit-product, vendor/"$VENDOR"/config/common.mk)" >> device/samsung/a10dd/"$VENDOR"_a10dd.mk +fi +echo "PRODUCT_NAME := "$VENDOR"_a10dd" >> device/samsung/a10dd/"$VENDOR"_a10dd.mk +echo "" >> device/samsung/a10dd/"$VENDOR"_a10dd.mk +echo "# Additional Props" >> device/samsung/a10dd/"$VENDOR"_a10dd.mk +echo "TARGET_FACE_UNLOCK_SUPPORTED := true" >> device/samsung/a10dd/"$VENDOR"_a10dd.mk +echo "TARGET_BOOT_ANIMATION_RES := 720" >> device/samsung/a10dd/"$VENDOR"_a10dd.mk + diff --git a/a10dd/usb/Android.bp b/a10dd/usb/Android.bp new file mode 100644 index 0000000..274df2f --- /dev/null +++ b/a10dd/usb/Android.bp @@ -0,0 +1,35 @@ +// +// 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.a10", + relative_install_path: "hw", + init_rc: ["android.hardware.usb@1.0-service.a10.rc"], + vintf_fragments: ["android.hardware.usb@1.0-service.a10.xml"], + defaults: ["eureka_defaults"], + 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 new file mode 100644 index 0000000..f45f7e5 --- /dev/null +++ b/a10dd/usb/Usb.cpp @@ -0,0 +1,81 @@ +/* + * 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 new file mode 100644 index 0000000..45abe9a --- /dev/null +++ b/a10dd/usb/Usb.h @@ -0,0 +1,66 @@ +/* + * 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-a10" +#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.a10.rc b/a10dd/usb/android.hardware.usb@1.0-service.a10.rc new file mode 100644 index 0000000..8bc1af8 --- /dev/null +++ b/a10dd/usb/android.hardware.usb@1.0-service.a10.rc @@ -0,0 +1,5 @@ +service vendor.usb-hal-1-0 /vendor/bin/hw/android.hardware.usb@1.0-service.a10 + 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.a10.xml b/a10dd/usb/android.hardware.usb@1.0-service.a10.xml new file mode 100644 index 0000000..6bfb402 --- /dev/null +++ b/a10dd/usb/android.hardware.usb@1.0-service.a10.xml @@ -0,0 +1,11 @@ + + + android.hardware.usb + hwbinder + 1.0 + + IUsb + default + + + diff --git a/a10dd/usb/service.cpp b/a10dd/usb/service.cpp new file mode 100644 index 0000000..d10264c --- /dev/null +++ b/a10dd/usb/service.cpp @@ -0,0 +1,47 @@ +/* + * 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; +} diff --git a/universal7885-common/Android.mk b/universal7885-common/Android.mk index fa2d654..5088ab5 100644 --- a/universal7885-common/Android.mk +++ b/universal7885-common/Android.mk @@ -1,6 +1,6 @@ LOCAL_PATH := $(call my-dir) -ifneq ($(filter a10 a20 a20e a30 a30s a40, $(TARGET_DEVICE)),) +ifneq ($(filter a10dd a10 a20 a20e a30 a30s a40, $(TARGET_DEVICE)),) subdir_makefiles=$(call first-makefiles-under,$(LOCAL_PATH)) $(foreach mk,$(subdir_makefiles),$(info including $(mk) ...)$(eval include $(mk))) diff --git a/universal7885-common/BoardConfigCommon.mk b/universal7885-common/BoardConfigCommon.mk index 4eecd8d..3e3f28c 100644 --- a/universal7885-common/BoardConfigCommon.mk +++ b/universal7885-common/BoardConfigCommon.mk @@ -3,7 +3,7 @@ COMMON_PATH := device/samsung/universal7885-common BOARD_VENDOR := samsung # Platform -ifeq ($(TARGET_DEVICE), $(filter $(TARGET_DEVICE),a10 a20 a20e)) +ifeq ($(TARGET_DEVICE), $(filter $(TARGET_DEVICE),a10dd a10 a20 a20e)) TARGET_SOC := exynos7884B TARGET_BOARD_PLATFORM := universal7884B TARGET_BOOTLOADER_BOARD_NAME := universal7884B @@ -17,17 +17,26 @@ TARGET_NO_BOOTLOADER := true TARGET_NO_RADIOIMAGE := true # Architecture +ifeq ($(TARGET_DEVICE),a10dd) +TARGET_ARCH := arm +TARGET_ARCH_VARIANT := armv8-a +TARGET_CPU_ABI := armeabi-v7a +TARGET_CPU_ABI2 := armeabi +TARGET_CPU_VARIANT := cortex-a53 +TARGET_CPU_SMP := true +TARGET_USES_64_BIT_BINDER := true +else TARGET_ARCH := arm64 TARGET_ARCH_VARIANT := armv8-a TARGET_CPU_ABI := arm64-v8a TARGET_CPU_ABI2 := TARGET_CPU_VARIANT := cortex-a53 - TARGET_2ND_ARCH := arm TARGET_2ND_ARCH_VARIANT := armv8-a TARGET_2ND_CPU_ABI := armeabi-v7a TARGET_2ND_CPU_ABI2 := armeabi TARGET_2ND_CPU_VARIANT := cortex-a53 +endif # Bluetooth BOARD_BLUETOOTH_BDROID_BUILDCFG_INCLUDE_DIR := $(COMMON_PATH)/bluetooth @@ -80,6 +89,11 @@ BOARD_FLASH_BLOCK_SIZE := 131072 BOARD_PROPERTY_OVERRIDES_SPLIT_ENABLED := true TARGET_VENDOR_PROP += $(COMMON_PATH)/vendor.prop TARGET_SYSTEM_PROP += $(COMMON_PATH)/system.prop +ifeq ($(TARGET_ARCH),arm64) +TARGET_VENDOR_PROP += $(COMMON_PATH)/configs/vendor_64.prop +else +TARGET_VENDOR_PROP += $(COMMON_PATH)/configs/vendor_32.prop +endif # Recovery BOARD_HAS_DOWNLOAD_MODE := true diff --git a/universal7885-common/configs/vendor_32.prop b/universal7885-common/configs/vendor_32.prop new file mode 100644 index 0000000..96bd56c --- /dev/null +++ b/universal7885-common/configs/vendor_32.prop @@ -0,0 +1,3 @@ +## RIL +vendor.sec.rild.libpath=/vendor/lib/libsec-ril.so +vendor.sec.rild.libpath2=/vendor/lib/libsec-ril-dsds.so diff --git a/universal7885-common/configs/vendor_64.prop b/universal7885-common/configs/vendor_64.prop new file mode 100644 index 0000000..0d319ff --- /dev/null +++ b/universal7885-common/configs/vendor_64.prop @@ -0,0 +1,3 @@ +## RIL +vendor.sec.rild.libpath=/vendor/lib64/libsec-ril.so +vendor.sec.rild.libpath2=/vendor/lib64/libsec-ril-dsds.so diff --git a/universal7885-common/universal7885-common.mk b/universal7885-common/universal7885-common.mk index a5208ea..f3efd2e 100644 --- a/universal7885-common/universal7885-common.mk +++ b/universal7885-common/universal7885-common.mk @@ -287,9 +287,13 @@ PRODUCT_PACKAGES += \ # VNDK PRODUCT_COPY_FILES += \ - prebuilts/vndk/v29/arm64/arch-arm64-armv8-a/shared/vndk-sp/libcutils.so:$(TARGET_COPY_OUT_VENDOR)/lib64/libcutils-v29.so \ prebuilts/vndk/v29/arm64/arch-arm-armv8-a/shared/vndk-sp/libcutils.so:$(TARGET_COPY_OUT_VENDOR)/lib/libcutils-v29.so +ifeq ($(TARGET_ARCH),arm64) +PRODUCT_COPY_FILES += \ + prebuilts/vndk/v29/arm64/arch-arm64-armv8-a/shared/vndk-sp/libcutils.so:$(TARGET_COPY_OUT_VENDOR)/lib64/libcutils-v29.so +endif + # Workaround for vintf issues... PRODUCT_COPY_FILES += \ $(LOCAL_PATH)/configs/vintf/compatibility_matrix.3.xml:$(TARGET_COPY_OUT_SYSTEM)/etc/vintf/compatibility_matrix.3.xml diff --git a/universal7885-common/vendor.prop b/universal7885-common/vendor.prop index acc5a24..9f5c55b 100644 --- a/universal7885-common/vendor.prop +++ b/universal7885-common/vendor.prop @@ -25,10 +25,6 @@ ro.hwui.use_vulkan=true graphics.gpu.profiler.support=true debug.hwui.renderer=skiavk -## RIL -vendor.sec.rild.libpath=/vendor/lib64/libsec-ril.so -vendor.sec.rild.libpath2=/vendor/lib64/libsec-ril-dsds.so - # LTE, GSM and WCDMA ro.telephony.default_network=9,9