MTK Android13 user版本进入engineermode的Bluetooth测试项时闪退

平台:MT6771 android13

问题描述:进入到工模,点击进入Bluetooth测试项直接闪退

Log如下:

07-31 10:15:51.480  3605  3605 D EM/EmUtils: getEmAidlService ...
07-31 10:15:51.481   398   398 I servicemanager: Could not find vendor.mediatek.hardware.engineermode.IEmds/default in the VINTF manifest.
07-31 10:15:51.481  3605  3605 D EM/EmHalService: btIsEmSupport by HIDL
07-31 10:15:51.481  3605  3605 V EM/EmUtils: getEmHidlService ...
07-31 10:15:51.481  3605  3605 V EM/EmUtils: getEmHidlService init...
07-31 10:15:51.482   399   399 I hwservicemanager: getTransport: Cannot find entry vendor.mediatek.hardware.engineermode@1.3::IEmd/EmHidlServer in either framework or device VINTF manifest.
07-31 10:15:51.482  3605  3605 W System.err: java.util.NoSuchElementException
07-31 10:15:51.482  3605  3605 W System.err: 	at android.os.HwBinder.getService(Native Method)
07-31 10:15:51.482  3605  3605 W System.err: 	at vendor.mediatek.hardware.engineermode.V1_3.IEmd.getService(IEmd.java:57)
07-31 10:15:51.482  3605  3605 W System.err: 	at com.mediatek.engineermode.EmUtils.getEmHidlService(EmUtils.java:179)
07-31 10:15:51.482  3605  3605 W System.err: 	at com.mediatek.engineermode.EmHalService.btIsEmSupport(EmHalService.java:597)
07-31 10:15:51.482  3605  3605 W System.err: 	at com.mediatek.engineermode.FeatureSupport.isEmBTSupport(FeatureSupport.java:244)
07-31 10:15:51.482  3605  3605 W System.err: 	at com.mediatek.engineermode.bluetooth.BtList.onCreate(BtList.java:93)
07-31 10:15:51.482  3605  3605 W System.err: 	at android.app.Activity.performCreate(Activity.java:8290)
07-31 10:15:51.482  3605  3605 W System.err: 	at android.app.Activity.performCreate(Activity.java:8269)
07-31 10:15:51.482  3605  3605 W System.err: 	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1384)
07-31 10:15:51.482  3605  3605 W System.err: 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3697)
07-31 10:15:51.482  3605  3605 W System.err: 	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3853)
07-31 10:15:51.482  3605  3605 W System.err: 	at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:101)
07-31 10:15:51.482  3605  3605 W System.err: 	at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
07-31 10:15:51.482  3605  3605 W System.err: 	at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
07-31 10:15:51.482  3605  3605 W System.err: 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2345)
07-31 10:15:51.482  3605  3605 W System.err: 	at android.os.Handler.dispatchMessage(Handler.java:106)
07-31 10:15:51.482  3605  3605 W System.err: 	at android.os.Looper.loopOnce(Looper.java:201)
07-31 10:15:51.482  3605  3605 W System.err: 	at android.os.Looper.loop(Looper.java:288)
07-31 10:15:51.482  3605  3605 W System.err: 	at android.app.ActivityThread.main(ActivityThread.java:7941)
07-31 10:15:51.482  3605  3605 W System.err: 	at java.lang.reflect.Method.invoke(Native Method)
07-31 10:15:51.482  3605  3605 W System.err: 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:569)
07-31 10:15:51.482  3605  3605 W System.err: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1015)
07-31 10:15:51.482  3605  3605 E EM/EmUtils: EmHIDLConnection exception2 ...
07-31 10:15:51.483  3605  3605 D AndroidRuntime: Shutting down VM
07-31 10:15:51.483  3605  3605 E AndroidRuntime: FATAL EXCEPTION: main
07-31 10:15:51.483  3605  3605 E AndroidRuntime: Process: com.mediatek.engineermode, PID: 3605
07-31 10:15:51.483  3605  3605 E AndroidRuntime: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.mediatek.engineermode/com.mediatek.engineermode.bluetooth.BtList}: java.lang.NullPointerException: Attempt to invoke interface method 'int vendor.mediatek.hardware.engineermode.V1_3.IEmd.btIsEmSupport()' on a null object reference
07-31 10:15:51.483  3605  3605 E AndroidRuntime: 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3716)
07-31 10:15:51.483  3605  3605 E AndroidRuntime: 	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3853)
07-31 10:15:51.483  3605  3605 E AndroidRuntime: 	at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:101)
07-31 10:15:51.483  3605  3605 E AndroidRuntime: 	at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
07-31 10:15:51.483  3605  3605 E AndroidRuntime: 	at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
07-31 10:15:51.483  3605  3605 E AndroidRuntime: 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2345)
07-31 10:15:51.483  3605  3605 E AndroidRuntime: 	at android.os.Handler.dispatchMessage(Handler.java:106)
07-31 10:15:51.483  3605  3605 E AndroidRuntime: 	at android.os.Looper.loopOnce(Looper.java:201)
07-31 10:15:51.483  3605  3605 E AndroidRuntime: 	at android.os.Looper.loop(Looper.java:288)
07-31 10:15:51.483  3605  3605 E AndroidRuntime: 	at android.app.ActivityThread.main(ActivityThread.java:7941)
07-31 10:15:51.483  3605  3605 E AndroidRuntime: 	at java.lang.reflect.Method.invoke(Native Method)
07-31 10:15:51.483  3605  3605 E AndroidRuntime: 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:569)
07-31 10:15:51.483  3605  3605 E AndroidRuntime: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1015)
07-31 10:15:51.483  3605  3605 E AndroidRuntime: Caused by: java.lang.NullPointerException: Attempt to invoke interface method 'int vendor.mediatek.hardware.engineermode.V1_3.IEmd.btIsEmSupport()' on a null object reference
07-31 10:15:51.483  3605  3605 E AndroidRuntime: 	at com.mediatek.engineermode.EmHalService.btIsEmSupport(EmHalService.java:597)
07-31 10:15:51.483  3605  3605 E AndroidRuntime: 	at com.mediatek.engineermode.FeatureSupport.isEmBTSupport(FeatureSupport.java:244)
07-31 10:15:51.483  3605  3605 E AndroidRuntime: 	at com.mediatek.engineermode.bluetooth.BtList.onCreate(BtList.java:93)
07-31 10:15:51.483  3605  3605 E AndroidRuntime: 	at android.app.Activity.performCreate(Activity.java:8290)
07-31 10:15:51.483  3605  3605 E AndroidRuntime: 	at android.app.Activity.performCreate(Activity.java:8269)
07-31 10:15:51.483  3605  3605 E AndroidRuntime: 	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1384)
07-31 10:15:51.483  3605  3605 E AndroidRuntime: 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3697)
07-31 10:15:51.483  3605  3605 E AndroidRuntime: 	... 12 more
07-31 10:15:51.485  1190  1600 I mtkpower_client: [Legacy][PowerHal_Wrap_notifyAppState] com.mediatek.engineermode/com.mediatek.engineermode pid=3605 state:3

从日志咱们可以看到:

c 复制代码
servicemanager: Could not find vendor.mediatek.hardware.engineermode.IEmds/default in the VINTF manifest.

很明显这个服务没有注册,找到编译规则s0_vnd/device/mediatek/vendor/common/device.mk,可以看到以下:

c 复制代码
ifneq ($(filter $(TARGET_BUILD_VARIANT),eng userdebug),)
DEVICE_MANIFEST_FILE += $(LOCAL_PATH)/project_manifest/manifest_em.xml
PRODUCT_PACKAGES += em_hidl

可以看到只有在编译eng,userdebug版本时会编译em_hidl,那在编译规则中加上user即可解决这个问题

c 复制代码
-      ifneq ($(filter $(TARGET_BUILD_VARIANT),eng userdebug),)
+      ifneq ($(filter $(TARGET_BUILD_VARIANT),eng userdebug user),)
        DEVICE_MANIFEST_FILE += $(LOCAL_PATH)/project_manifest/manifest_em.xml
        PRODUCT_PACKAGES += em_hidl
      endif
相关推荐
曾经的三心草43 分钟前
Mysql之约束与事件
android·数据库·mysql·事件·约束
guoruijun_2012_45 小时前
fastadmin多个表crud连表操作步骤
android·java·开发语言
Winston Wood5 小时前
一文了解Android中的AudioFlinger
android·音频
B.-6 小时前
Flutter 应用在真机上调试的流程
android·flutter·ios·xcode·android-studio
有趣的杰克6 小时前
Flutter【04】高性能表单架构设计
android·flutter·dart
大耳猫12 小时前
主动测量View的宽高
android·ui
帅次14 小时前
Android CoordinatorLayout:打造高效交互界面的利器
android·gradle·android studio·rxjava·android jetpack·androidx·appcompat
枯骨成佛15 小时前
Android中Crash Debug技巧
android
kim565920 小时前
android studio 更改gradle版本方法(备忘)
android·ide·gradle·android studio
咸芝麻鱼20 小时前
Android Studio | 最新版本配置要求高,JDK运行环境不适配,导致无法启动App
android·ide·android studio