[Moto G5S  Guides, News, & Discussion] kalyansundhar:
Device tree, Vendor blobs adn LOS7 build

Somehow I managed to come up with a device tree and vendor blobs for G5s.

Device: https://github.com/kayesk/android_device_motorola_montana

Vendor: https://github.com/kayesk/android_vendor_motorola_montana

Initial build of UNOFFICIAL LOS7 build is here: https://1drv.ms/f/s!Ahq68S0B7zYZjmVhmIHwvYGoz3gq.

This is completely based on STOCK. For any reason, if the shared file is not accessible, please let me know. I would upload it in GDrive.

The file size is around 450MB. Lot of clean up needs to be done. As I mentioned in my earlier posts, I don't have any mobile device software development experience. I played around the system image, placed files here and there, made some modifications and finally came up with this stuff. I don't know what files are used by the device and what are not. Don't laugh at me.

I request experienced developers help in fix issues. So feel free to access/modify source tree.

What works:

RIL (dual sim, volte)

WIFI

Tethering

Camera (Front and Back)

Bluetooth

Sensors

MTP

Sound

Fingerprint

Bugs:

Developer Options crashes. I think it could be permission related or some missing files may be. Whenever I hit the option, I get the following in logcat.

12-28 13:31:29.511 1805 3622 E UserRestrictionsUtils: Unknown restriction: null

12-28 13:31:29.515 1805 1862 E UserRestrictionsUtils: Unknown restriction: null

Not sure what it is.

Another issue is the inclusion of CMHW in Boardconfig.mk and CMActions in device.mk. When I include it in the build, I get the following error in logcat.

12-28 13:28:53.095 21735 21735 E AndroidRuntime: Process: com.cyanogenmod.settings.device, PID: 21735

12-28 13:28:53.095 21735 21735 E AndroidRuntime: java.lang.RuntimeException: Unable to create service com.cyanogenmod.settings.device.ServiceWrapper: java.lang.IllegalArgumentException: sensor cannot be null

12-28 13:28:53.095 21735 21735 E AndroidRuntime:	at android.app.ActivityThread.handleCreateService(ActivityThread.java:3226)

12-28 13:28:53.095 21735 21735 E AndroidRuntime:	at android.app.ActivityThread.-wrap5(ActivityThread.java)

12-28 13:28:53.095 21735 21735 E AndroidRuntime:	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1586)

12-28 13:28:53.095 21735 21735 E AndroidRuntime:	at android.os.Handler.dispatchMessage(Handler.java:102)

12-28 13:28:53.095 21735 21735 E AndroidRuntime:	at android.os.Looper.loop(Looper.java:154)

12-28 13:28:53.095 21735 21735 E AndroidRuntime:	at android.app.ActivityThread.main(ActivityThread.java:6186)

12-28 13:28:53.095 21735 21735 E AndroidRuntime:	at java.lang.reflect.Method.invoke(Native Method)

12-28 13:28:53.095 21735 21735 E AndroidRuntime:	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:889)

12-28 13:28:53.095 21735 21735 E AndroidRuntime:	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:779)

12-28 13:28:53.095 21735 21735 E AndroidRuntime: Caused by: java.lang.IllegalArgumentException: sensor cannot be null

12-28 13:28:53.095 21735 21735 E AndroidRuntime:	at android.hardware.SystemSensorManager.requestTriggerSensorImpl(SystemSensorManager.java:205)

12-28 13:28:53.095 21735 21735 E AndroidRuntime:	at android.hardware.SensorManager.requestTriggerSensor(SensorManager.java:1669)

12-28 13:28:53.095 21735 21735 E AndroidRuntime:	at com.cyanogenmod.settings.device.SensorHelper.requestTriggerSensor(SensorHelper.java:108)

12-28 13:28:53.095 21735 21735 E AndroidRuntime:	at com.cyanogenmod.settings.device.GlanceSensor.screenTurnedOff(GlanceSensor.java:56)

12-28 13:28:53.095 21735 21735 E AndroidRuntime:	at com.cyanogenmod.settings.device.CMActionsService.screenTurnedOff(CMActionsService.java:95)

12-28 13:28:53.095 21735 21735 E AndroidRuntime:	at com.cyanogenmod.settings.device.CMActionsService.updateState(CMActionsService.java:103)

12-28 13:28:53.095 21735 21735 E AndroidRuntime:	at com.cyanogenmod.settings.device.CMActionsService.<init>(CMActionsService.java:72)

12-28 13:28:53.095 21735 21735 E AndroidRuntime:	at com.cyanogenmod.settings.device.ServiceWrapper.onCreate(ServiceWrapper.java:47)

12-28 13:28:53.095 21735 21735 E AndroidRuntime:	at android.app.ActivityThread.handleCreateService(ActivityThread.java:3216)

Our device is not using a regular sensorhub stuff. It uses sensors.montana, sensors.rp and sensors.ssc. Above error could be related to that. Or may be a source code modification is required.

Everything works fine even without the inclusion of CMHW and CMActions, except the "Developer options" thing.

BTW, this build is for testing. So if you end up with a bricked/dead device by flashing this build, please don't hold me responsible. Flashing steps are as usual. Take a TWRP backup and Do a clean flash.

I haven't tried with GAPPS installation or rooting. But that shouldn't be an issue, I believe.

HAPPY NEW YEAR !!!

Thanks

KS