Battery Status/Percentage on Status bar

You need to modify a lot of source code, such as linux driver, dts, android frameworks and hal.
Why did you want to add battery management? This involves hardware and software changes.
Can you tell me your product requirements? Maybe you can use Edge-V + Juice board.

@Terry

I have already added my battery charger and fuel gauge drivers in kernel and dts.
And as per @superceleron suggestions I am able to see battery symbol on status bar and charging and discharging symbol works good.
I am just not getting the percentage right on status bar while my screen is on but when I do screen lock/unlock then percentage also gets changed.

So, I am thinking only systemUI is not working here.
So, could you please guide me through it because I think we can enable that feature in VIM3?

Sharing the screenshot.

You can try to modify the device/khadas/common/core_amlogic.mk and device/khadas/kvim3/device.mk 态device/khadas/kvim3/kvim3.mk

--- a/common/core_amlogic.mk
+++ b/common/core_amlogic.mk
@@ -513,9 +513,6 @@ PRODUCT_PROPERTY_OVERRIDES += \
     dalvik.vm.heapgrowthlimit=256m
 
 
-PRODUCT_PROPERTY_OVERRIDES += \
-    ro.boot.fake_battery=42
-
 #set audioflinger heapsize,for lowramdevice
 #the default af heap size is 1M,it is not enough
 PRODUCT_PROPERTY_OVERRIDES += \
diff --git a/kvim3/device.mk b/kvim3/device.mk
index 09128f0..77e59c9 100644
--- a/kvim3/device.mk
+++ b/kvim3/device.mk
@@ -128,10 +128,5 @@ $(call inherit-product, frameworks/native/build/tablet-10in-xhdpi-2048-dalvik-he
 
 
 
-#To remove healthd from the build
-PRODUCT_PACKAGES += android.hardware.health@2.0-service.override
-DEVICE_FRAMEWORK_MANIFEST_FILE += \
-       system/libhidl/vintfdata/manifest_healthd_exclude.xml
-
 #To keep healthd in the build
 PRODUCT_PACKAGES += android.hardware.health@2.0-service
diff --git a/kvim3/kvim3.mk b/kvim3l/kvim3.mk
index 162cf06..31c9a47 100644
--- a/kvim3/kvim3.mk
+++ b/kvim3/kvim3.mk
@@ -434,6 +434,9 @@ PRODUCT_PROPERTY_OVERRIDES += \
    ro.product.firmware=00900001 \
    ro.product.otaupdateurl=http://dl.khadas.com:8089/otaupdate/update
 
+PRODUCT_PACKAGES += \
+   healthd
+
 #########################################################################
 #
 #                                     A/B update

Thanx @Terry

I tried your suggestion but still I need to do screen lock/unlock to update the percentage on status bar.

U can force refresh the systemui service through a script every few minutes.
Although this is not ideal, but might serve your purpose. (The status bar will hide and reappear every time it refreshes though.)

1 Like

Thanx @Yasir_Javed
I understand your idea but I donā€™t think that would be the right way to do so.
I want it to be permanent.

you can also probably try to force refresh only the batterymanager service but i donā€™t remember exactly which fil that is. I used to Mod navbar icons and had to face similar problem initially. However i did it using a Xposed framework so it was a little bit easier for me.

This was my project back then. neXus navbarz | Xposed Module Repository

Also this might help:
https://developer.android.com/reference/android/os/BatteryManager

Okay, I will have a look at it.
Thanx

hello, I want to install xposed framework on vim3lļ¼Œbut android system version is 9.0ļ¼Œxposed is not support 9.0ļ¼ŒI try to install by magisk, but it not work怂What should I doļ¼Ÿ

you can try vim3 android 11 firmware