Skip to content

Commit

Permalink
Add overlay for HWI
Browse files Browse the repository at this point in the history
  • Loading branch information
vGreatDragon committed Nov 14, 2023
1 parent 1a2ee9d commit 25874d7
Show file tree
Hide file tree
Showing 6 changed files with 179 additions and 73 deletions.
2 changes: 1 addition & 1 deletion Huawei/hi3660/HWI/Android.mk
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE_TAGS := optional
LOCAL_PACKAGE_NAME := treble-overlay-huawei-hi3660
LOCAL_PACKAGE_NAME := treble-overlay-huawei-HWI
LOCAL_MODULE_PATH := $(TARGET_OUT_PRODUCT)/overlay
LOCAL_IS_RUNTIME_RESOURCE_OVERLAY := true
LOCAL_PRIVATE_PLATFORM_APIS := true
Expand Down
6 changes: 3 additions & 3 deletions Huawei/hi3660/HWI/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.dil3mm4.huawei.hi3660"
package="com.dil3mm4.huawei.HWI"
android:versionCode="1"
android:versionName="1.0">
<overlay android:targetPackage="android"
android:requiredSystemPropertyName="ro.hw.oemName"
android:requiredSystemPropertyValue="+hi3660*"
android:priority="231"
android:requiredSystemPropertyValue="+HWI*"
android:priority="196"
android:isStatic="true" />
</manifest>
167 changes: 99 additions & 68 deletions Huawei/hi3660/HWI/res/xml/power_profile.xml
Original file line number Diff line number Diff line change
@@ -1,69 +1,100 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
**
** Copyright 2009, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License")
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
-->
<device name="Android">
<!-- All values are in mA except as noted -->
<item name="none">0</item>
<item name="screen.on">265</item> <!-- min brite -->
<item name="bluetooth.active">97</item>
<item name="bluetooth.on">0.6</item>
<item name="bluetooth.at">0.6</item> <!-- TBD -->
<item name="screen.full">485</item> <!-- backlight 32 leds -->
<item name="wifi.on">0.6</item>
<item name="wifi.active">128</item>
<item name="wifi.scan">146</item>
<item name="dsp.audio">38</item> <!-- k3v6 -->
<item name="dsp.video">163</item>
<item name="radio.active">180</item>
<item name="gps.on">70</item>
<item name="battery.capacity">5100</item> <!-- 5100mAh -->
<item name="radio.scanning">60</item> <!-- TBD -->
<!-- Current consumed by the radio at different signal strengths, when paging -->
<array name="radio.on"> <!-- 1 entry per signal strength bin, TBD -->
<value>13.0</value>
<value>10.0</value>
<value>10.0</value>
<value>10.0</value>
<value>10.0</value>
</array>
<array name="cpu.speeds">
<value>533000</value> <!-- 533 MHz CPU speed -->
<value>999000</value> <!-- 999 MHz CPU speed -->
<value>1402000</value> <!-- 1.4 GHz CPU speed -->
<value>1709000</value><!-- 1.7 GHz CPU speed -->
<value>1844000</value><!-- 1.8 GHz CPU speed -->
<value>2112000</value><!-- 2.1 GHz CPU speed -->
<value>2362000</value><!-- 2.3 GHz CPU speed -->
<value>2612000</value><!-- 2.6 GHz CPU speed -->
</array>
<!-- Power consumption in suspend -->
<item name="cpu.idle">4</item> <!-- k3v5 -->
<!-- Power consumption due to wake lock held -->
<item name="cpu.awake">35</item> <!-- k3v5 -->
<!-- Power consumption at different speeds -->
<array name="cpu.active">
<value>30</value>
<value>72</value>
<value>133</value>
<value>201</value>
<value>250</value>
<value>990</value>
<value>1761</value>
<value>1948</value>
</array>
</device>
<device
name="Android">
<item
name="ambient.on">0.1</item>
<item
name="screen.on">0.1</item>
<item
name="screen.full">0.1</item>
<item
name="bluetooth.active">0.1</item>
<item
name="bluetooth.on">0.1</item>
<item
name="wifi.on">0.1</item>
<item
name="wifi.active">0.1</item>
<item
name="wifi.scan">0.1</item>
<item
name="audio">0.1</item>
<item
name="video">0.1</item>
<item
name="camera.flashlight">0.1</item>
<item
name="camera.avg">0.1</item>
<item
name="gps.on">0.1</item>
<item
name="radio.active">0.1</item>
<item
name="radio.scanning">0.1</item>
<array
name="radio.on">
<value>0.2</value>
<value>0.1</value>
</array>
<array
name="cpu.clusters.cores">
<value>1</value>
</array>
<array
name="cpu.speeds.cluster0">
<value>400000</value>
</array>
<array
name="cpu.active.cluster0">
<value>0.1</value>
</array>
<item
name="cpu.idle">0.1</item>
<array
name="memory.bandwidths">
<value>22.7</value>
</array>
<item
name="battery.capacity">1000</item>
<item
name="wifi.controller.idle">0</item>
<item
name="wifi.controller.rx">0</item>
<item
name="wifi.controller.tx">0</item>
<array
name="wifi.controller.tx_levels" />
<item
name="wifi.controller.voltage">0</item>
<array
name="wifi.batchedscan">
<value>.0002</value>
<value>.002</value>
<value>.02</value>
<value>.2</value>
<value>2</value>
</array>
<item
name="modem.controller.sleep">0</item>
<item
name="modem.controller.idle">0</item>
<item
name="modem.controller.rx">0</item>
<array
name="modem.controller.tx">
<value>0</value>
<value>0</value>
<value>0</value>
<value>0</value>
<value>0</value>
</array>
<item
name="modem.controller.voltage">0</item>
<array
name="gps.signalqualitybased">
<value>0</value>
<value>0</value>
</array>
<item
name="gps.voltage">0</item>
</device>
75 changes: 75 additions & 0 deletions Huawei/hi3660/HWI/res/xml/power_profile_test.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
<?xml version="1.0" encoding="utf-8"?>
<device
name="Android">
<item
name="battery.capacity">3000</item>
<array
name="cpu.clusters.cores">
<value>4</value>
<value>4</value>
</array>
<item
name="cpu.suspend">5</item>
<item
name="cpu.idle">1.11</item>
<item
name="cpu.active">2.55</item>
<item
name="cpu.cluster_power.cluster0">2.11</item>
<item
name="cpu.cluster_power.cluster1">2.22</item>
<array
name="cpu.core_speeds.cluster0">
<value>300000</value>
<value>1000000</value>
<value>2000000</value>
</array>
<array
name="cpu.core_speeds.cluster1">
<value>300000</value>
<value>1000000</value>
<value>2500000</value>
<value>3000000</value>
</array>
<array
name="cpu.core_power.cluster0">
<value>10</value>
<value>20</value>
<value>30</value>
</array>
<array
name="cpu.core_power.cluster1">
<value>25</value>
<value>35</value>
<value>50</value>
<value>60</value>
</array>
<item
name="ambient.on">0.5</item>
<item
name="screen.on">100</item>
<item
name="screen.full">800</item>
<item
name="camera.flashlight">500</item>
<item
name="camera.avg">600</item>
<item
name="audio">100.0</item>
<item
name="video">150.0</item>
<item
name="gps.on">10</item>
<item
name="radio.active">60</item>
<item
name="radio.scanning">3</item>
<array
name="radio.on">
<value>6</value>
<value>5</value>
<value>4</value>
<value>3</value>
<value>3</value>
</array>
</device>
Empty file removed fail
Empty file.
2 changes: 1 addition & 1 deletion overlay.mk
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ PRODUCT_PACKAGES += \
treble-overlay-huawei-DUK \
treble-overlay-huawei-EML \
treble-overlay-huawei-FIG \
treble-overlay-huawei-hi3660 \
treble-overlay-huawei-HWI \
treble-overlay-huawei-LLD \
treble-overlay-huawei-MAR \
treble-overlay-huawei-PIC \
Expand Down

0 comments on commit 25874d7

Please sign in to comment.