Teclast M40 Android 12L

Search This thread

AnKHqz

Member
Nov 3, 2020
14
10
Hi! I managed to get Android 12L running on the Teclast M40 by making some changes to the AOSP source code. A build of the modified AOSP source code can be downloaded from here, but I would not suggest trying it on other devices except the Teclast M40.
I will describe the changes I made to the AOSP source code so that you can reproduce this build.
1. change PRODUCT_SHIPPING_API_LEVEL from 30 to 29 in gsi_release.mk, since the Teclast M40 is shipped with Android 10.
Diff:
diff --git a/target/product/gsi_release.mk b/target/product/gsi_release.mk
index a2a29ed0fc..9a75bf8b3b 100644
--- a/target/product/gsi_release.mk
+++ b/target/product/gsi_release.mk
@@ -34,7 +34,7 @@ PRODUCT_ARTIFACT_PATH_REQUIREMENT_ALLOWED_LIST += \
 # GSI should always support up-to-date platform features.
 # Keep this value at the latest API level to ensure latest build system
 # default configs are applied.
-PRODUCT_SHIPPING_API_LEVEL := 30
+PRODUCT_SHIPPING_API_LEVEL := 29
 
 # Enable dynamic partitions to facilitate mixing onto Cuttlefish
 PRODUCT_USE_DYNAMIC_PARTITIONS := true
2. change PRODUCT_CHARACTERISTICS from emulator to tablet in emulator_vendor.mk.
Diff:
diff --git a/target/product/emulator_vendor.mk b/target/product/emulator_vendor.mk
index b9f33abb9a..93ad9482b3 100644
--- a/target/product/emulator_vendor.mk
+++ b/target/product/emulator_vendor.mk
@@ -28,7 +28,7 @@ PRODUCT_PACKAGES += \
 
 DEVICE_PACKAGE_OVERLAYS := device/generic/goldfish/overlay
 
-PRODUCT_CHARACTERISTICS := emulator
+PRODUCT_CHARACTERISTICS := tablet
 
 PRODUCT_FULL_TREBLE_OVERRIDE := true
3. change EngineBase.cpp, so that fix audioserver crash during startup.
Diff:
diff --git a/services/audiopolicy/engine/common/src/EngineBase.cpp b/services/audiopolicy/engine/common/src/EngineBase.cpp
index 150a9a8e4f..9d5dff6d9f 100644
--- a/services/audiopolicy/engine/common/src/EngineBase.cpp
+++ b/services/audiopolicy/engine/common/src/EngineBase.cpp
@@ -165,16 +165,7 @@ engineConfig::ParsingResult EngineBase::loadAudioPolicyEngineConfig()
         android::status_t ret = engineConfig::parseLegacyVolumes(config.volumeGroups);
         result = {std::make_unique<engineConfig::Config>(config),
                   static_cast<size_t>(ret == NO_ERROR ? 0 : 1)};
-    } else {
-        // Append for internal use only volume groups (e.g. rerouting/patch)
-        result.parsedConfig->volumeGroups.insert(
-                    std::end(result.parsedConfig->volumeGroups),
-                    std::begin(gSystemVolumeGroups), std::end(gSystemVolumeGroups));
     }
-    // Append for internal use only strategies (e.g. rerouting/patch)
-    result.parsedConfig->productStrategies.insert(
-                std::end(result.parsedConfig->productStrategies),
-                std::begin(gOrderedSystemStrategies), std::end(gOrderedSystemStrategies));
 
 
     ALOGE_IF(result.nbSkippedElement != 0, "skipped %zu elements", result.nbSkippedElement);
4. change AudioPolicyManager.cpp, so that fix audioserver crash when headset plugs in.
Diff:
diff --git a/services/audiopolicy/managerdefault/AudioPolicyManager.cpp b/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
index 5a18762967..f3f50f513c 100644
--- a/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
+++ b/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
@@ -5349,15 +5349,7 @@ status_t AudioPolicyManager::checkOutputsForDevice(const sp<DeviceDescriptor>& d
     }
 
     if (state == AUDIO_POLICY_DEVICE_STATE_AVAILABLE) {
-        // first call getAudioPort to get the supported attributes from the HAL
-        struct audio_port_v7 port = {};
-        device->toAudioPort(&port);
-        status_t status = mpClientInterface->getAudioPort(&port);
-        if (status == NO_ERROR) {
-            device->importAudioPort(port);
-        }
-
-        // then list already open outputs that can be routed to this device
+        // first list already open outputs that can be routed to this device
         for (size_t i = 0; i < mOutputs.size(); i++) {
             desc = mOutputs.valueAt(i);
             if (!desc->isDuplicated() && desc->supportsDevice(device)
 
Last edited:

mrdark5555

Member
Mar 17, 2017
31
19
Google Nexus 10
Nexus 7 (2013)
I've installed it on my M40 and it works. Unfortunately, ADB no longer will function with it. Drivers are loaded correctly and it will work with any other GSI rom I put on the tablet. With this one, when performing adb devices, it comes up with a blank list.

Edit: Nevermind. Helps if I read more
 
Last edited:

SapuSeven

New member
Feb 27, 2015
2
0
Hi, I'm trying to get this working on my M40, but I'm not sure how to install.
My device is rooted using Magisk.
I tried flashing via fastboot:
Bash:
fastboot -S 100M flash system system.img
The process completed, but after booting I was still at Android 10.
Any advice?
 

TCLSKY

New member
Dec 3, 2022
1
0
Hi, I'm trying to get this working on my M40, but I'm not sure how to install.
My device is rooted using Magisk.
I tried flashing via fastboot:
Bash:
fastboot -S 100M flash system system.img
The process completed, but after booting I was still at Android 10.
Any advice?
Flash,then switch your device to recovery mode using volume and power buttons, wipe all data and reboot.

There is no GMS on this system, and Bluetooth audio cannot be used, I would like to know how to solve it, thank you
 

New posts