Enable or disable HWUI in PMS
# cat frameworks/base/core/java/android/content/pm/PackageParser.java ... Line 1973 : control whether to enable HWUI boolean hardwareAccelerated = sa.getBoolean( com.android.internal.R.styleable.AndroidManifestApplication_hardwareAccelerated, owner.applicationInfo.targetSdkVersion >= Build.VERSION_CODES.ICE_CREAM_SANDWICH); ...
Android 4.0 Ice Cream Sandwich (API level 14)
請參考 http://androidxref.com/4.4.2_r1/xref/frameworks/base/core/java/android/content/pm/PackageParser.java 以及 http://shooting.logdown.com/posts/180440-hwui
BoardConfig.mk
... USE_OPENGL_RENDERER := true ...
請參考 https://android.googlesource.com/device/ti/panda/+/jb-dev/BoardConfig.mk
adb service 的用法
$ service -h Usage: service [-h|-?] service list service check SERVICE service call SERVICE CODE [i32 INT | s16 STR] ... Options: i32: Write the integer INT into the send parcel. s16: Write the UTF-16 string STR into the send parcel.
for example:
$ service list Found 111 services: 0 SYSSCOPE: [com.sec.android.app.sysscope.service.ISysScopeService] 1 sip: [android.net.sip.ISipService] 2 phoneext: [com.android.internal.telephony.ITelephonyExt] 3 phone: [com.android.internal.telephony.ITelephony] ...
Force to enable Hwui
adb shell setprop persist.sys.ui.hw true ... adb shell service call activity 1599295570 ...
RUNTIME 顯示硬體層更新 ON
adb setprop debug.hwui.profile visual_bars ... adb shell service call activity 1599295570 ...
RUNTIME 顯示硬體層更新 OFF
adb setprop debug.hwui.profile "" ... adb shell service call activity 1599295570 ...
debug.hwui.profile
# cat frameworks/base/libs/hwui/DrawProfiler.cpp ... #define PROPERTY_PROFILE_VISUALIZE_BARS "visual_bars" ... DrawProfiler::ProfileType DrawProfiler::loadRequestedProfileType() { ProfileType type = kNone; char buf[PROPERTY_VALUE_MAX] = {'\0',}; if (property_get(PROPERTY_PROFILE, buf, "") > 0) { if (!strcmp(buf, PROPERTY_PROFILE_VISUALIZE_BARS)) { type = kBars; } else if (!strcmp(buf, "true")) { type = kConsole; } } return type; } ...
其中 PROPERTY_PROFILE_VISUALIZE_BARS 為 visual_bars ; PROPERTY_PROFILE 則為 debug.hwui.profile .
請參考
SYSPROPS_TRANSACTION
# cat frameworks/native/include/binder/IBinder.h ... SYSPROPS_TRANSACTION = B_PACK_CHARS('_', 'S', 'P', 'R'), // ('_'<<24)|('S'<<16)|('P'<<8)|'R ...
請參考
以及
https://github.com/dhelleberg/android-scripts/blob/master/src/devtools.groovy#L121
上述的 1599295570 就是 IBinder.h 裡的 SYSPROPS_TRANSACTION
如果你覺得這篇文章對你有幫助, 請於留言板留個言, 以茲鼓勵. 謝謝! Email: jasonc@mail2000.com.tw
留言列表