a10: Move a10dd (32bit) stuffs to a10

Don't make dup files
This commit is contained in:
roynatech2544 2022-10-23 13:43:31 +09:00
commit dc4fffda82
17 changed files with 26 additions and 491 deletions

20
a10/common.mk Normal file
View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

Binary file not shown.

View file

@ -1,61 +0,0 @@
<!--
/**
* 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

@ -1,10 +0,0 @@
<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

@ -1,87 +0,0 @@
<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>

View file

@ -1,22 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
/**
* Copyright (c) 2016, 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.
*/
-->
<resources>
<!-- Default for Settings.Global.DEVICE_NAME $1=MODEL-->
<string name="def_device_name_simple">Samsung Galaxy A10</string>
</resources>

View file

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

View file

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

View file

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

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

View file

@ -1,11 +0,0 @@
<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>

View file

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