universal7885: unify arm branch

This commit is contained in:
Gabriel2392 2022-07-30 08:08:40 -03:00
commit 9b035b514f
22 changed files with 519 additions and 9 deletions

19
a10dd/BoardConfig.mk Normal file
View file

@ -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

25
a10dd/device.mk Normal file
View file

@ -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

4
a10dd/dtbo/Android.mk Normal file
View file

@ -0,0 +1,4 @@
ifeq ($(TARGET_DEVICE),a10dd)
LOCAL_PATH := $(call my-dir)
$(call add-radio-file,eureka_dtbo.img)
endif

BIN
a10dd/dtbo/eureka_dtbo.img Normal file

Binary file not shown.

17
a10dd/full_a10dd.mk Normal file
View file

@ -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

View file

@ -0,0 +1,61 @@
<!--
/**
* Copyright (c) 2009, 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.
*/
-->
<!-- These resources are around just to allow their values to be customized
for different hardware and product builds. Do not translate. -->
<resources>
<!-- The bounding path of the cutout region of the main built-in display.
Must either be empty if there is no cutout region, or a string that is parsable by
{@link android.util.PathParser}.
The path is assumed to be specified in display coordinates with pixel units and in
the display's native orientation, with the origin of the coordinate system at the
center top of the display.
To facilitate writing device-independent emulation overlays, the marker `@dp` can be
appended after the path string to interpret coordinates in dp instead of px units.
Note that a physical cutout should be configured in pixels for the best results.
Example for a 10px x 10px square top-center cutout:
<string ...>M -5,0 L -5,10 L 5,10 L 5,0 Z</string>
Example for a 10dp x 10dp square top-center cutout:
<string ...>M -5,0 L -5,10 L 5,10 L 5,0 Z @dp</string>
@see https://www.w3.org/TR/SVG/paths.html#PathData
-->
<string translatable="false" name="config_mainBuiltInDisplayCutout">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</string>
<string translatable="false" name="config_mainBuiltInDisplayCutoutRectApproximation">@*android:string/config_mainBuiltInDisplayCutout</string>
<!-- If supported, are dreams enabled? (by default) -->
<bool name="config_dreamsEnabledByDefault">false</bool>
<bool name="config_dozeAlwaysOnDisplayAvailable">true</bool>
<bool name="config_displayBlanksAfterDoze">false</bool>
<bool name="config_dozePulsePickup">false</bool>
<bool name="config_supportDoubleTapWake">false</bool>
<bool name="config_enableBurnInProtection">true</bool>
<!-- List of biometric sensors on the device, in decreasing strength. Consumed by AuthService
when registering authenticators with BiometricService. Format must be ID:Modality:Strength,
where: IDs are unique per device, Modality as defined in BiometricAuthenticator.java,
and Strength as defined in Authenticators.java -->
<string-array name="config_biometric_sensors" translatable="false">
<item>0:2:15</item>
<!-- ID0:Fingerprint:Strong -->
</string-array>
<!-- For performance and storage reasons, limit the number of fingerprints per user -->
<integer name="config_fingerprintMaxTemplatesPerUser">4</integer>
<!-- Specify if the fingerprint hardware support gestures-->
<bool name="config_fingerprintSupportsGestures">true</bool>
<!-- True if the device supports system navigation keys. -->
<bool name="config_supportSystemNavigationKeys">true</bool>
<!-- Limit for the number of face templates per user -->
<integer name="config_faceMaxTemplatesPerUser">2</integer>
</resources>

View file

@ -0,0 +1,10 @@
<resources>
<!-- Height of the status bar in landscape. The height should be
Max((status bar content height + waterfall top size), top cutout size) -->
<dimen name="status_bar_height_landscape">24.0dip</dimen>
<!-- Height of the status bar in portrait. The height should be
Max((status bar content height + waterfall top size), top cutout size) -->
<dimen name="status_bar_height_portrait">31.0dip</dimen>
<!-- Default radius of the software rounded corners. -->
<dimen name="rounded_corner_radius">40px</dimen>
</resources>

View file

@ -0,0 +1,87 @@
<device name="Android">
<item name="none">0</item>
<item name="screen.on.display0">93</item>
<item name="screen.full.display0">313</item>
<item name="bluetooth.active">118</item>
<item name="bluetooth.on">0.98</item>
<item name="wifi.on">0.43</item>
<item name="wifi.active">488</item>
<item name="wifi.scan">502</item>
<item name="dsp.audio">45</item>
<item name="dsp.video">286</item>
<item name="camera.flashlight">124</item>
<item name="camera.avg">662</item>
<item name="gps.on">32</item>
<item name="radio.active">164</item>
<item name="radio.scanning">115</item>
<array name="radio.on">
<value>7.3</value>
<value>7.3</value>
</array>
<array name="cpu.clusters.cores">
<value>6</value>
<value>2</value>
</array>
<array name="cpu.speeds.cluster0">
<value>1586000</value>
<value>1482000</value>
<value>1352000</value>
<value>1248000</value>
<value>1144000</value>
<value>1014000</value>
<value>902000</value>
<value>839000</value>
<value>757000</value>
<value>676000</value>
<value>546000</value>
<value>449000</value>
</array>
<array name="cpu.active.cluster0">
<value>50</value>
<value>43</value>
<value>34</value>
<value>28</value>
<value>24</value>
<value>18</value>
<value>15</value>
<value>13</value>
<value>11</value>
<value>10</value>
<value>7</value>
<value>6</value>
</array>
<array name="cpu.speeds.cluster1">
<value>1768000</value>
<value>1664000</value>
<value>1560000</value>
<value>1352000</value>
<value>1144000</value>
<value>936000</value>
</array>
<array name="cpu.active.cluster1">
<value>162</value>
<value>142</value>
<value>120</value>
<value>87</value>
<value>61</value>
<value>41</value>
</array>
<item name="cpu.idle">3.79</item>
<item name="cpu.awake">23</item>
<item name="battery.capacity">3400</item>
<item name="battery.typical.capacity">3300</item>
<item name="wifi.controller.idle">1</item>
<item name="wifi.controller.rx">65</item>
<item name="wifi.controller.tx">265</item>
<array name="wifi.controller.tx_levels">
<value>0</value>
</array>
<item name="wifi.controller.voltage">3600</item>
<array name="wifi.batchedscan">
<value>.0002</value>
<value>.002</value>
<value>.02</value>
<value>.2</value>
<value>2</value>
</array>
</device>

22
a10dd/setup.sh Executable file
View file

@ -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 <vendor>_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

35
a10dd/usb/Android.bp Normal file
View file

@ -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,
}

81
a10dd/usb/Usb.cpp Normal file
View file

@ -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 <pthread.h>
#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>
#include <android-base/logging.h>
#include <utils/Errors.h>
#include <utils/StrongPointer.h>
#include "Usb.h"
namespace android {
namespace hardware {
namespace usb {
namespace V1_0 {
namespace implementation {
Return<void> Usb::switchRole(const hidl_string &portName __unused,
const PortRole &newRole __unused) {
LOG(ERROR) << __func__ << ": Not supported";
return Void();
}
Return<void> Usb::queryPortStatus() {
hidl_vec<PortStatus> 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<void> 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<void> Usb::setCallback(const sp<IUsbCallback> &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

66
a10dd/usb/Usb.h Normal file
View file

@ -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 <android/hardware/usb/1.0/IUsb.h>
#include <hidl/MQDescriptor.h>
#include <hidl/Status.h>
#include <utils/Log.h>
#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<void> switchRole(const hidl_string &portName,
const PortRole &role) override;
Return<void> setCallback(const sp<IUsbCallback> &callback) override;
Return<void> queryPortStatus() override;
sp<IUsbCallback> 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

View file

@ -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

View file

@ -0,0 +1,11 @@
<manifest version="1.0" type="device">
<hal format="hidl" override="true">
<name>android.hardware.usb</name>
<transport>hwbinder</transport>
<version>1.0</version>
<interface>
<name>IUsb</name>
<instance>default</instance>
</interface>
</hal>
</manifest>

47
a10dd/usb/service.cpp Normal file
View file

@ -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 <android-base/logging.h>
#include <hidl/HidlTransportSupport.h>
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<IUsb> 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;
}