sriharshaarangi / BatteryChargeLimit

GNU General Public License v3.0
382 stars 104 forks source link

Sony XPERIA Mini ST15i support #58

Closed Himura2la closed 7 years ago

Himura2la commented 7 years ago

I think I found the right file for Sony XPERIA Mini ST15i on Android 4.0.4. The app also seems operational on an old Android. Why restricting for 4.4+ ?

Here's my test:

shell@android:/ # ll /sys/class/power_supply/chargalg/
lrwxrwxrwx root     root              2017-10-17 17:55 device -> ../../../chargalg
--w------- root     root         4096 2017-10-17 17:58 disable_charging
--w------- root     root         4096 2017-10-17 17:55 disable_usbhost
--w------- root     root         4096 2017-10-17 17:45 enable_monitoring_ambient_temp
-r--r--r-- root     root         4096 2017-10-17 18:02 health
drwxr-xr-x root     root              2017-10-17 17:55 power
lrwxrwxrwx root     root              2017-10-17 17:55 subsystem -> ../../../../../class/power_supply
-r--r--r-- root     root         4096 2017-10-17 17:55 type
-rw-r--r-- root     root         4096 2017-10-17 17:55 uevent
shell@android:/ # screencap -p /sdcard/1.png
shell@android:/ # echo 1 > /sys/class/power_supply/chargalg/disable_charging
shell@android:/ # screencap -p /sdcard/2.png
shell@android:/ # echo 0 > /sys/class/power_supply/chargalg/disable_charging
shell@android:/ # screencap -p /sdcard/3.png

1.png: 1

2.png: 2

3.png 3

Himura2la commented 7 years ago

Oh, thank you for noticing, I was so happy finding the that file and missed the details

Himura2la commented 7 years ago

By the way, is the device name checked somewhere? I took it from Google, not from the system

sm4rk0 commented 7 years ago

I don't think so. Didn't dive into code. I'm using "Nexus 4" control file on Moto X.

milux commented 7 years ago

@Himura2la The device name and manufacturer are not checked anywhere, you can choose them freely. It is only meant to give people a hint. The restriction to Android 4.4 was there because of certain API functions we used in the past. I reviewed this, and with some compatibility fixes in the layouts I can announce that 1.0.5 will run on ICS (SDK 14).

milux commented 7 years ago

Looks good, LGTM!