android5.1平板或手机应用层一些常用的修改项(eg:MTK8163)
2017-12-05 15:13
375 查看
文章来源:http://blog.csdn.net/j086924/article/details/51613055
android5.1平板或手机应用层一些常用的修改项及目录所在:
1、所以系统应用所在的目录:
[java] view
plain copy
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/a7c8e286f463007e2a900848b93dd72c.png)
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/9e12f1d3e499fc949c886e7c9e0484f9)
\alps\packages\apps
2、一些系统属性的定义:并且可以仿写自行定义变量
[java] view
plain copy
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/a7c8e286f463007e2a900848b93dd72c.png)
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/9e12f1d3e499fc949c886e7c9e0484f9)
\alps\build\tools\buildinfo.sh
3、一些apk的添加和删除:
[java] view
plain copy
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/a7c8e286f463007e2a900848b93dd72c.png)
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/9e12f1d3e499fc949c886e7c9e0484f9)
\alps\build\target\product\generic.mk
\alps\build\target\product\generic_no_telephony.mk
\alps\build\target\product\telephony.mk
\alps\build\target\product\core.mk
4、wifi,bt,sn的烧写位置:
[java] view
plain copy
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/a7c8e286f463007e2a900848b93dd72c.png)
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/9e12f1d3e499fc949c886e7c9e0484f9)
alps\out\target\product\elink8163_tb_l1\obj\CGEN\
5、第三方apps目录:
[java] view
plain copy
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/a7c8e286f463007e2a900848b93dd72c.png)
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/9e12f1d3e499fc949c886e7c9e0484f9)
\alps\vendor\mediatek\proprietary\operator\common\packages
\alps\vendor\mediatek\proprietary\operator\common\frameworks
6、VideoPlayer、Stk1、Stk2、MTKThermalManager的values存放的目录:
[java] view
plain copy
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/a7c8e286f463007e2a900848b93dd72c.png)
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/9e12f1d3e499fc949c886e7c9e0484f9)
\alps\device\mediatek\common\overlay\tablet\vendor\mediatek\proprietary\packages\apps
\alps\device\mediatek\common\overlay\tablet\vendor\mediatek\proprietary\frameworks
\alps\device\mediatek\common\overlay\tablet\vendor\mediatek\proprietary\protect-app
7、Launcher3、Settings、DeskClock的values存放的位置(单wifi):
[java] view
plain copy
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/a7c8e286f463007e2a900848b93dd72c.png)
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/9e12f1d3e499fc949c886e7c9e0484f9)
\alps\device\mediatek\common\overlay\tablet\packages\apps
8、\frameworks values存放的位置:
[java] view
plain copy
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/a7c8e286f463007e2a900848b93dd72c.png)
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/9e12f1d3e499fc949c886e7c9e0484f9)
\alps\device\mediatek\common\overlay\tablet\frameworks\base\core\res\res
9、导航栏显示或隐藏config.xml:
[java] view
plain copy
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/a7c8e286f463007e2a900848b93dd72c.png)
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/9e12f1d3e499fc949c886e7c9e0484f9)
\alps\device\mediatek\common\overlay\navbar\frameworks\base\core\res\res\values
10、MemoryDeviceList对照表:
[java] view
plain copy
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/a7c8e286f463007e2a900848b93dd72c.png)
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/9e12f1d3e499fc949c886e7c9e0484f9)
\alps\device\mediatek\build\build\tools\emigen\项目\MemoryDeviceList_MT8163.xls
11、开机动画存放的目录Android.mk进行配置说明:
[java] view
plain copy
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/a7c8e286f463007e2a900848b93dd72c.png)
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/9e12f1d3e499fc949c886e7c9e0484f9)
\alps\vendor\mediatek\proprietary\operator\OP09\prebuilt\bootanim\bootanimation
\alps\vendor\mediatek\proprietary\operator\OP09\prebuilt\bootanim\bootaudio开机铃声
\alps\vendor\mediatek\proprietary\operator\OP09\prebuilt\bootanim\shutanimation关机动画
12、内存更改目录:
[java] view
plain copy
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/a7c8e286f463007e2a900848b93dd72c.png)
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/9e12f1d3e499fc949c886e7c9e0484f9)
\alps\bootable\bootloader\preloader\custom\elink8163_tb_l1\inc\custom_MemoryDevice.h
\alps\bootable\bootloader\preloader\tools\emigen\MT8163\MemoryDeviceList_MT8163.xls
\alps\bootable\bootloader\preloader\tools\emigen\MT8163\full_elink8163_e 修改版本号,语言类
13、lcm,logo等的配置目录:
[java] view
plain copy
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/a7c8e286f463007e2a900848b93dd72c.png)
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/9e12f1d3e499fc949c886e7c9e0484f9)
\alps\bootable\bootloader\lk\dev
14、对应的屏大小,配置不同的图标:
[java] view
plain copy
wxga 竖屏
wxgal 横屏
[java] view
plain copy
</pre>都指显示模式其中WXGA是16:10宽屏,各显示模式支持分辨率如下<pre name="code" class="java">QVGA 240×320
HVGA 480*320
VGA 640X480
SVGA 800X600
XGA 1024X768
SXGA 1280X1024
SXGA+ 1400X1050
UXGA 1600X1200
WXGA 1280X800
WXGA+ 1400X900
WSXGA 1600X1024
WSXGA+ 1680X1050
WUXGA 1920X1200
WQXGA 2560X1600
按需选购可能平板使用类似WSVGA的1024×576以及WXGA的1280×768等等,Google将设备分为small(2~3英寸)、normal(4英寸左右)、large(5~7英寸)、xlarge(7英寸以上)不同大小屏幕用不同大小的图片,low:medium:high:extra-high图片大小的比例为3:4:6:8;举例来说,对于中等密度(medium)的屏幕你的图片像素大小为48×48,那么低密度(low)屏幕的图片大小应为36×36,高(high)的为72×72,extra-high为96×96.
15、配置文件的修改(屏的宽高,logo的配置etc):
[java] view
plain copy
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/a7c8e286f463007e2a900848b93dd72c.png)
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/9e12f1d3e499fc949c886e7c9e0484f9)
\alps\device\elink\elink8163_e\ProjectConfig.mk
CUSTOM_LK_LCM = KR070IA4T_DSI_VDO
CUSTOM_UBOOT_LCM = KR070IA4T_DSI_VDO
MTK_BUILD_VERNO = ALPS.**(自定义版本号)
\alps\device\elink\elink8163_e\full_elink8163_e
set locales & aapt config.
PRODUCT_LOCALES := en_US es_ES zh_CN zh_TW ru_RU pt_BR fr_FR de_DE tr_TR it_IT in_ID ms_MY vi_VN ar_EG hi_IN th_TH bn_IN pt_PT ur_PK fa_IR nl_NL el_GR hu_HU tl_PH ro_RO cs_CZ iw_IL my_MM km_KH ko_KR pl_PL es_US bg_BG hr_HR lv_LV lt_LT sk_SK uk_UA de_AT da_DK fi_FI nb_NO sv_SE en_GB ja_JP
#AAPT configuration
PRODUCT_AAPT_CONFIG := normal large xlarge
PRODUCT_AAPT_PREF_CONFIG := hdpi
# Set those variables here to overwrite the inherited values.
PRODUCT_MANUFACTURER := alps
PRODUCT_NAME := **
PRODUCT_DEVICE :=**
PRODUCT_MODEL := **
PRODUCT_POLICY := android.policy_phone
PRODUCT_BRAND := alps
DEFAULT_INPUT_METHOD = com.sohu.inputmethod.sogou.SogouIME //默认输入法
DEFAULT_LATIN_IME_LANGUAGES = en-US fr ru
16、lcd密度的设置:
[java] view
plain copy
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/a7c8e286f463007e2a900848b93dd72c.png)
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/9e12f1d3e499fc949c886e7c9e0484f9)
\alps\device\elink\elink8163_e\system.prop
ro.sf.lcd_density=213
17、默认壁纸的存放位置:
[java] view
plain copy
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/a7c8e286f463007e2a900848b93dd72c.png)
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/9e12f1d3e499fc949c886e7c9e0484f9)
\alps\frameworks\base\core\res\res\drawable-nodpi\default_wallpaper
18、第三方应用所在目录,eg:Sina微博
[java] view
plain copy
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/a7c8e286f463007e2a900848b93dd72c.png)
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/9e12f1d3e499fc949c886e7c9e0484f9)
\alps\vendor\mediatek\proprietary\binary\3rd-party\free\Sina_Weibo
添加完后,打开文件device\mediatek\common\device.mk
将 Sina添加到 PRODUCT_PACKAGES 里面。PRODUCT_PACKAGES += Sina,然后重新build整个工程
19、对应的drawable:
[java] view
plain copy
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/a7c8e286f463007e2a900848b93dd72c.png)
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/9e12f1d3e499fc949c886e7c9e0484f9)
320dp: a typical phone screen (240x320 ldpi, 320x480 mdpi, 480x800 hdpi, etc).
480dp: a tweener tablet like the Streak (480x800 mdpi).
600dp: a 7” tablet (600x1024 mdpi).
720dp: a 10” tablet (720x1280 mdpi, 800x1280 mdpi, etc).
所以1280*720 就用720dp的.
20、长按power键弹出的选项:
[java] view
plain copy
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/a7c8e286f463007e2a900848b93dd72c.png)
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/9e12f1d3e499fc949c886e7c9e0484f9)
framework\policies\base\phone\com\android\internal\policy\impl\PhoneWindowManager.java
Runnable mPowerLongPress = new Runnable() {
public void run(){
mShouldTurnOffOnKeyUp = false;
performHapticsFeedbackLw(null,HapticFeedbackConstants.LONG_PRESS,false);
sendCloseSystemWindows(SYSTEM_DIALOG_REASON_GLOBAL_ACTIONS);
showGlobalActionsDialog();
} };
调用showGlobalActionDialog方法将会显示“飞行模式”、“静音”,“关机”,选项的对话框,这个时候我们就可以把位于此处的frameworks\policies\base\phone\com\android\internal\policy\impl\GlobalActions.java该文件的createDialog方法中代码
21、系统默认只有一张内置的静态壁纸,如如何修改可以内置多张静态壁纸:
KK版本:
1).在Launcher3/res/drawable-xxx 的文件夹下增加wallpaer的图片,每个wallpaper需要两种图片一张原图一张缩略图,如下形式
[html] view
plain copy
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/a7c8e286f463007e2a900848b93dd72c.png)
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/9e12f1d3e499fc949c886e7c9e0484f9)
wallpaper_01.jpg
wallpaper_01_small.jpg
wallpaper_02.jpg
wallpaper_02_small.jpg
缩略图的文件名必须原图"文件名"+"_small"
2).在Launcher3/res/values-nodpi的wallpapers.xml中修改如下:
[html] view
plain copy
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/a7c8e286f463007e2a900848b93dd72c.png)
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/9e12f1d3e499fc949c886e7c9e0484f9)
<resources>
<string-array name="wallpapers" translatable="false">
<item>wallpaper_01</item>
<item>wallpaper_02</item>
</string-array>
</resources>
L版本:
1).在Launcher3/WallpaperPicker/res/drawable-xxx 的文件夹下增加wallpaer的图片,每个wallpaper需要两种图片一张原图一张缩略图,如下形式
[html] view
plain copy
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/a7c8e286f463007e2a900848b93dd72c.png)
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/9e12f1d3e499fc949c886e7c9e0484f9)
wallpaper_01.jpg
wallpaper_01_small.jpg
wallpaper_02.jpg
wallpaper_02_small.jpg
缩略图的文件名必须原图"文件名"+"_small"
2).在Launcher3/WallpaperPicker/res/values-nodpi的wallpapers.xml中修改如下:
[html] view
plain copy
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/a7c8e286f463007e2a900848b93dd72c.png)
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/9e12f1d3e499fc949c886e7c9e0484f9)
<resources>
<string-array name="wallpapers" translatable="false">
<item>wallpaper_01</item>
<item>wallpaper_02</item>
</string-array>
</resources>
22、添加reboot
如果需要添加重新启动菜单做重启手机的动作,可以参考如下步骤修改实现:
1)、 在alps\frameworks\base\core\res\res\values\strings.xml 中添加标签:
[html] view
plain copy
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/a7c8e286f463007e2a900848b93dd72c.png)
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/9e12f1d3e499fc949c886e7c9e0484f9)
<string name="zzzzz_global_action_power_reboot">Reboot</string>
用来显示重新启动菜单项的字符串资源,如果需要添加其他语言的标识,请在其他可替换资源的res folder下添加对应资源。
请注意,为了保证资源文件能够被编译进去,请同步将此资源添加到symbols.xml中。
2)、 在alps\frameworks\base\core\res\res\drawable-hdpi中添加图标:
[html] view
plain copy
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/a7c8e286f463007e2a900848b93dd72c.png)
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/9e12f1d3e499fc949c886e7c9e0484f9)
zzzzz_ic_lock_power_reboot.png
3)、 在alps\frameworks\base\policy\src\com\android\internal\policy\impl\GlobalActions.java
文件中的createDialog()函数中添加:
[java] view
plain copy
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/a7c8e286f463007e2a900848b93dd72c.png)
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/9e12f1d3e499fc949c886e7c9e0484f9)
Private GlobalActionsDialog createDialog(){
……
mItems = new ArrayList<Action>();
// first: power off
mItems.add(……);
/////////////////////////////////////////////Added for reboot items start
mItems.add(
new SinglePressAction(
com.android.internal.R. zzzzz_ic_lock_power_reboot,
R.string.zzzzz_global_action_power_reboot) {
public void onPress() {
mWindowManagerFuncs.reboot(true);
}
public boolean onLongPress() {
mWindowManagerFuncs.rebootSafeMode(true);
return true;
}
public boolean showDuringKeyguard() {
return true;
}
public boolean showBeforeProvisioning() {
return true;
}
});
/////////////////////////added end
// next: airplane mode
mItems.add(mAirplaneModeOn);
……
}
4)、 在frameworks\base\core\java\android\view\WindowManagerPolicy.java文件中,找到WindowManagerFuncs这个interface的定义,增加如下function的声明:
[java] view
plain copy
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/a7c8e286f463007e2a900848b93dd72c.png)
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/9e12f1d3e499fc949c886e7c9e0484f9)
public interface WindowManagerFuncs {
public void reboot(boolean confirm);
}
5)、 在Frameworks\base\services\java\com\android\server\wm\WindowManagerService.java中,因为其实现了WindowManagerFuncs这个接口,需要在该文件中添加reboot()函数的实现体。
找到shutdown()函数,在其后面添加reboot()函数,函数内容如下:
[java] view
plain copy
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/a7c8e286f463007e2a900848b93dd72c.png)
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/9e12f1d3e499fc949c886e7c9e0484f9)
// Called by window manager policy. Not exposed externally.
@Override
public void reboot(boolean confirm) {
ShutdownThread.reboot(mContext, confirm);
}
还需要在array.xml的config_globalActionsList添加reboot选项
public.xml中进行配置
字符串添加:(第一次可以编过,后面有碰到编译res找不到)
[java] view
plain copy
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/a7c8e286f463007e2a900848b93dd72c.png)
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/9e12f1d3e499fc949c886e7c9e0484f9)
strings.xml:
<string name="reboot_confirm_question">"Do you want to reboot?"</string>
<string name="global_action_reboot">"Reboot"</string>
<string name="reboot_progress">"Rebooting..."</string>
symbols.xml
<java-symbol type="string" name="reboot_confirm_question" />
<java-symbol type="string" name="global_action_reboot" />
<java-symbol type="string" name="reboot_progress" />(遇到编译res找不到,先屏蔽掉symbols.xml,编译后再重新加上继续编译)
注:android5.1的config_globalActionsList在 X:\8163_eng\alps\frameworks\base\core\res\res\values\config.xml中已定义
23、GMS预置:
L版本GMS预置比较简单,只需要把GMS需要预置内容放置在 alps/vendor/google/文件夹下(google文件夹需要自行创建)
然后检查vendor/google/下是否存在Android.mk文件,若没有此Android.mk,请新建一个,并把以下内容拷贝进去:
[html] view
plain copy
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/a7c8e286f463007e2a900848b93dd72c.png)
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/9e12f1d3e499fc949c886e7c9e0484f9)
ifdef BUILD_GMS
ifeq ($(strip $(BUILD_GMS)), yes)
include $(call all-subdir-makefiles)
endif
endif
同时再检查vendor/google/以下两个文件夹apps/ 和 frameworks/第一层目录下是否存在Android.mk如果不存在,也各新建一个,将以下内容拷贝进去:
[html] view
plain copy
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/a7c8e286f463007e2a900848b93dd72c.png)
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/9e12f1d3e499fc949c886e7c9e0484f9)
include $(call all-subdir-makefiles)
最后在build的时候带入"BUILD_GMS=yes",如:
[java] view
plain copy
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/a7c8e286f463007e2a900848b93dd72c.png)
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/9e12f1d3e499fc949c886e7c9e0484f9)
source build/envsetup.sh && lunch full_<YourProjectName>-user && source ./mbldenv.sh && BUILD_GMS=yes make -j24
若提示找不到mbldenv.sh,则使用如下命令:
[java] view
plain copy
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/a7c8e286f463007e2a900848b93dd72c.png)
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/9e12f1d3e499fc949c886e7c9e0484f9)
source build/envsetup.sh && lunch full_<YourProjectName>-user && BUILD_GMS=yes make -j24
注意,源代码的build文件中会有判断 BUILD_GMS 的值做不同build行为的语句,请不要修改,否则会造成GMS预置冲突或者预置不完整问题
24、预置apk到vendor/operator/app下面
预置apk到vendor/operator/app下面,有时候会编译不过
这种情况一般是apk本身没有对齐导致的,可以先使用zipalign重新对齐apk后再预置,具体做法如下:
[java] view
plain copy
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/a7c8e286f463007e2a900848b93dd72c.png)
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/9e12f1d3e499fc949c886e7c9e0484f9)
out/host/linux-x86/bin/zipalign -f 4 unalign.apk aligned.apk
其中,unalign.apk指当前source apk,aligned.apk指对齐后输出的apk.
25、mtk自带的一些工具文件,eg:工程模式
[java] view
plain copy
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/a7c8e286f463007e2a900848b93dd72c.png)
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/9e12f1d3e499fc949c886e7c9e0484f9)
\alps\vendor\mediatek\proprietary\packages\apps\EngineerMode
26、Launcher3的添加所在目录:
[java] view
plain copy
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/a7c8e286f463007e2a900848b93dd72c.png)
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/9e12f1d3e499fc949c886e7c9e0484f9)
\alps\device\mediatek\mt8163\device.mk
27、apn配置文件所在目录:
[java] view
plain copy
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/a7c8e286f463007e2a900848b93dd72c.png)
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/9e12f1d3e499fc949c886e7c9e0484f9)
\alps\device\generic\goldfish\data\etc\apns-conf.mk
28、GMS包接口所在目录:
[java] view
plain copy
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/a7c8e286f463007e2a900848b93dd72c.png)
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/9e12f1d3e499fc949c886e7c9e0484f9)
\alps\device\mediatek\common\device.mk
29、可以在该目录下添加.jar和.so库(gms需要的库可在此添加)
[java] view
plain copy
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/a7c8e286f463007e2a900848b93dd72c.png)
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/9e12f1d3e499fc949c886e7c9e0484f9)
eg:\alps\vendor\**\libs\**\com.google.widevine.software.drm\com.google.widevine.software.drm.jar
30、hotseat布局排版,所在目录:default_workspace_5x6
[java] view
plain copy
\alps\device\mediatek\common\overlay\wifi\packages\apps\Launcher3\res\xml\default_workspace_5x6.xml
31、工程测试模式指令(暗码)
在\alps\frameworks\base\telephony\Java\com\android\internal\telephony\TelephonyIntents.java
有接口(android.provider.Telephony.SECRET_CODE)
在packages/services/telephony/src/com/android/phone/SpecialCharSequenceMgr.java的handleSecretCode方法中对暗码就行了处理
\alps\vendor\mediatek\proprietary\packages\apps中添加FactoryMode,并在\alps\device\mediatek\common\device.mk文件中添加FactoryMode,
报莫名其妙的错误(后来问同事发现 , 必须对新增类中的函数或成员变量如果是public的话必须添加 /**{@hide}*/ 修饰. )
可在计算器中用如下demo进行暗码调用
[java] view
plain copy
if(text.contains("(2586)")) {
// mDisplay.setText(mResult, scroll);
// setDeleteMode(DELETE_MODE_CLEAR);
int len = text.length();
// Intent intent = new Intent(TelephonyIntents.SECRET_CODE_ACTION,Uri.parse("android_secret_code://" + text.substring(1, len - 1)));
Intent intent = new Intent("android.provider.Telephony.SECRET_CODE",Uri.parse("android_secret_code://" + text.substring(1, len - 1)));
mContext.sendBroadcast(intent);
return;
}
接收在Settings.java的
[java] view
plain copy
<receiver android:name="TestingSettingsBroadcastReceiver">
<intent-filter>
<action android:name="android.provider.Telephony.SECRET_CODE" />
<data android:scheme="android_secret_code" android:host="4636" />
</intent-filter>
</receiver>
也可以自己写apk直接调用工厂模式:
[java] view
plain copy
Intent intent=new Intent();
intent.setComponent(new ComponentName("com.mediatek.engineermode", "com.mediatek.engineermode.EngineerMode"));
startActivity(intent);
31、Launcher3中,android.mk文件中加入LOCAL_PRIVILEGED_MODULE := true,才能使Launcher3添加appwidget有效
32、Launcher3 桌面横屏显示:
1).修改AndroidManifest.xml
[html] view
plain copy
<activity
ndroid:name="com.android.launcher3.Launcher"
android:launchMode="singleTask"
android:clearTaskOnLaunch="true"
android:stateNotNeeded="true"
android:theme="@style/Theme"
android:configChanges="mcc|mnc"
android:windowSoftInputMode="adjustPan"
android:screenOrientation="sensor"> <!--modify to sensor -->
2).修改Utilities.java的isRotationEnabled方法
[java] view
plain copy
public static boolean isRotationEnabled(Context c)
{
return true;//直接返回true
}
此时旋转手机,Launcher会横竖屏切换。但hotseat会显示在屏幕的右方。如果要让hotseat显示在屏幕底部,可以按照如下步骤操作:
3).修改res/values/config.xml
[html] view
plain copy
<!--hotseat -->
<bool name="hotseat_transpose_layout_with_orientation">false</bool> <!--改为false-->
4).修改Hotseat.java的onFinishInflate方法
[java] view
plain copy
@Override
protected void onFinishInflate() {
super.onFinishInflate();
LauncherAppState app = LauncherAppState.getInstance();
DeviceProfile grid = app.getDynamicGrid().getDeviceProfile();
AllAppsButtonRank = grid.hotseatAllAppsRank;
mContent = (CellLayout) findViewById(R.id.layout);
if (grid.isLandscape && !grid.isLargeTablet()) {
mContent.setGridSize((int) grid.numHotseatIcons, 1); //modify
} else {
mContent.setGridSize((int) grid.numHotseatIcons, 1);
}
mContent.setIsHotseat(true);
Log.i(TAG, "onFinishInflate,(int) grid.numHotseatIcons: " + (int) grid.numHotseatIcons);
resetLayout();
}
33、电池曲线修改目录:
[java] view
plain copy
\alps\kernel-3.10\drivers\misc\mediatek\mach\..\..\power\cust_battery_meter_table.h
34、配置内存大小:
excel表格对应位置:
[java] view
plain copy
\alps\bootable\bootloader\preloader\tools\emigen\..\MemoryDeviceList_MT8163.xls
\alps\bootable\bootloader\preloader\custom\..\inc\custom_MemoryDevice.h
添加 #define CS_PART_NUMBER[1] H5TC4G63AFR-PBA
35、变化设备屏幕尺寸:
[java] view
plain copy
\alps\kernel-3.10\arch\arm64\configs\**_e_debug_defconfig.mk
\alps\device\..\..\ProjectConfig.mk
android5.1平板或手机应用层一些常用的修改项及目录所在:
1、所以系统应用所在的目录:
[java] view
plain copy
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/a7c8e286f463007e2a900848b93dd72c.png)
\alps\packages\apps
2、一些系统属性的定义:并且可以仿写自行定义变量
[java] view
plain copy
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/a7c8e286f463007e2a900848b93dd72c.png)
\alps\build\tools\buildinfo.sh
3、一些apk的添加和删除:
[java] view
plain copy
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/a7c8e286f463007e2a900848b93dd72c.png)
\alps\build\target\product\generic.mk
\alps\build\target\product\generic_no_telephony.mk
\alps\build\target\product\telephony.mk
\alps\build\target\product\core.mk
4、wifi,bt,sn的烧写位置:
[java] view
plain copy
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/a7c8e286f463007e2a900848b93dd72c.png)
alps\out\target\product\elink8163_tb_l1\obj\CGEN\
5、第三方apps目录:
[java] view
plain copy
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/a7c8e286f463007e2a900848b93dd72c.png)
\alps\vendor\mediatek\proprietary\operator\common\packages
\alps\vendor\mediatek\proprietary\operator\common\frameworks
6、VideoPlayer、Stk1、Stk2、MTKThermalManager的values存放的目录:
[java] view
plain copy
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/a7c8e286f463007e2a900848b93dd72c.png)
\alps\device\mediatek\common\overlay\tablet\vendor\mediatek\proprietary\packages\apps
\alps\device\mediatek\common\overlay\tablet\vendor\mediatek\proprietary\frameworks
\alps\device\mediatek\common\overlay\tablet\vendor\mediatek\proprietary\protect-app
7、Launcher3、Settings、DeskClock的values存放的位置(单wifi):
[java] view
plain copy
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/a7c8e286f463007e2a900848b93dd72c.png)
\alps\device\mediatek\common\overlay\tablet\packages\apps
8、\frameworks values存放的位置:
[java] view
plain copy
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/a7c8e286f463007e2a900848b93dd72c.png)
\alps\device\mediatek\common\overlay\tablet\frameworks\base\core\res\res
9、导航栏显示或隐藏config.xml:
[java] view
plain copy
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/a7c8e286f463007e2a900848b93dd72c.png)
\alps\device\mediatek\common\overlay\navbar\frameworks\base\core\res\res\values
10、MemoryDeviceList对照表:
[java] view
plain copy
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/a7c8e286f463007e2a900848b93dd72c.png)
\alps\device\mediatek\build\build\tools\emigen\项目\MemoryDeviceList_MT8163.xls
11、开机动画存放的目录Android.mk进行配置说明:
[java] view
plain copy
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/a7c8e286f463007e2a900848b93dd72c.png)
\alps\vendor\mediatek\proprietary\operator\OP09\prebuilt\bootanim\bootanimation
\alps\vendor\mediatek\proprietary\operator\OP09\prebuilt\bootanim\bootaudio开机铃声
\alps\vendor\mediatek\proprietary\operator\OP09\prebuilt\bootanim\shutanimation关机动画
12、内存更改目录:
[java] view
plain copy
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/a7c8e286f463007e2a900848b93dd72c.png)
\alps\bootable\bootloader\preloader\custom\elink8163_tb_l1\inc\custom_MemoryDevice.h
\alps\bootable\bootloader\preloader\tools\emigen\MT8163\MemoryDeviceList_MT8163.xls
\alps\bootable\bootloader\preloader\tools\emigen\MT8163\full_elink8163_e 修改版本号,语言类
13、lcm,logo等的配置目录:
[java] view
plain copy
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/a7c8e286f463007e2a900848b93dd72c.png)
\alps\bootable\bootloader\lk\dev
14、对应的屏大小,配置不同的图标:
[java] view
plain copy
wxga 竖屏
wxgal 横屏
[java] view
plain copy
</pre>都指显示模式其中WXGA是16:10宽屏,各显示模式支持分辨率如下<pre name="code" class="java">QVGA 240×320
HVGA 480*320
VGA 640X480
SVGA 800X600
XGA 1024X768
SXGA 1280X1024
SXGA+ 1400X1050
UXGA 1600X1200
WXGA 1280X800
WXGA+ 1400X900
WSXGA 1600X1024
WSXGA+ 1680X1050
WUXGA 1920X1200
WQXGA 2560X1600
按需选购可能平板使用类似WSVGA的1024×576以及WXGA的1280×768等等,Google将设备分为small(2~3英寸)、normal(4英寸左右)、large(5~7英寸)、xlarge(7英寸以上)不同大小屏幕用不同大小的图片,low:medium:high:extra-high图片大小的比例为3:4:6:8;举例来说,对于中等密度(medium)的屏幕你的图片像素大小为48×48,那么低密度(low)屏幕的图片大小应为36×36,高(high)的为72×72,extra-high为96×96.
15、配置文件的修改(屏的宽高,logo的配置etc):
[java] view
plain copy
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/a7c8e286f463007e2a900848b93dd72c.png)
\alps\device\elink\elink8163_e\ProjectConfig.mk
CUSTOM_LK_LCM = KR070IA4T_DSI_VDO
CUSTOM_UBOOT_LCM = KR070IA4T_DSI_VDO
MTK_BUILD_VERNO = ALPS.**(自定义版本号)
\alps\device\elink\elink8163_e\full_elink8163_e
set locales & aapt config.
PRODUCT_LOCALES := en_US es_ES zh_CN zh_TW ru_RU pt_BR fr_FR de_DE tr_TR it_IT in_ID ms_MY vi_VN ar_EG hi_IN th_TH bn_IN pt_PT ur_PK fa_IR nl_NL el_GR hu_HU tl_PH ro_RO cs_CZ iw_IL my_MM km_KH ko_KR pl_PL es_US bg_BG hr_HR lv_LV lt_LT sk_SK uk_UA de_AT da_DK fi_FI nb_NO sv_SE en_GB ja_JP
#AAPT configuration
PRODUCT_AAPT_CONFIG := normal large xlarge
PRODUCT_AAPT_PREF_CONFIG := hdpi
# Set those variables here to overwrite the inherited values.
PRODUCT_MANUFACTURER := alps
PRODUCT_NAME := **
PRODUCT_DEVICE :=**
PRODUCT_MODEL := **
PRODUCT_POLICY := android.policy_phone
PRODUCT_BRAND := alps
DEFAULT_INPUT_METHOD = com.sohu.inputmethod.sogou.SogouIME //默认输入法
DEFAULT_LATIN_IME_LANGUAGES = en-US fr ru
16、lcd密度的设置:
[java] view
plain copy
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/a7c8e286f463007e2a900848b93dd72c.png)
\alps\device\elink\elink8163_e\system.prop
ro.sf.lcd_density=213
17、默认壁纸的存放位置:
[java] view
plain copy
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/a7c8e286f463007e2a900848b93dd72c.png)
\alps\frameworks\base\core\res\res\drawable-nodpi\default_wallpaper
18、第三方应用所在目录,eg:Sina微博
[java] view
plain copy
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/a7c8e286f463007e2a900848b93dd72c.png)
\alps\vendor\mediatek\proprietary\binary\3rd-party\free\Sina_Weibo
添加完后,打开文件device\mediatek\common\device.mk
将 Sina添加到 PRODUCT_PACKAGES 里面。PRODUCT_PACKAGES += Sina,然后重新build整个工程
19、对应的drawable:
[java] view
plain copy
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/a7c8e286f463007e2a900848b93dd72c.png)
320dp: a typical phone screen (240x320 ldpi, 320x480 mdpi, 480x800 hdpi, etc).
480dp: a tweener tablet like the Streak (480x800 mdpi).
600dp: a 7” tablet (600x1024 mdpi).
720dp: a 10” tablet (720x1280 mdpi, 800x1280 mdpi, etc).
所以1280*720 就用720dp的.
20、长按power键弹出的选项:
[java] view
plain copy
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/a7c8e286f463007e2a900848b93dd72c.png)
framework\policies\base\phone\com\android\internal\policy\impl\PhoneWindowManager.java
Runnable mPowerLongPress = new Runnable() {
public void run(){
mShouldTurnOffOnKeyUp = false;
performHapticsFeedbackLw(null,HapticFeedbackConstants.LONG_PRESS,false);
sendCloseSystemWindows(SYSTEM_DIALOG_REASON_GLOBAL_ACTIONS);
showGlobalActionsDialog();
} };
调用showGlobalActionDialog方法将会显示“飞行模式”、“静音”,“关机”,选项的对话框,这个时候我们就可以把位于此处的frameworks\policies\base\phone\com\android\internal\policy\impl\GlobalActions.java该文件的createDialog方法中代码
21、系统默认只有一张内置的静态壁纸,如如何修改可以内置多张静态壁纸:
KK版本:
1).在Launcher3/res/drawable-xxx 的文件夹下增加wallpaer的图片,每个wallpaper需要两种图片一张原图一张缩略图,如下形式
[html] view
plain copy
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/a7c8e286f463007e2a900848b93dd72c.png)
wallpaper_01.jpg
wallpaper_01_small.jpg
wallpaper_02.jpg
wallpaper_02_small.jpg
缩略图的文件名必须原图"文件名"+"_small"
2).在Launcher3/res/values-nodpi的wallpapers.xml中修改如下:
[html] view
plain copy
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/a7c8e286f463007e2a900848b93dd72c.png)
<resources>
<string-array name="wallpapers" translatable="false">
<item>wallpaper_01</item>
<item>wallpaper_02</item>
</string-array>
</resources>
L版本:
1).在Launcher3/WallpaperPicker/res/drawable-xxx 的文件夹下增加wallpaer的图片,每个wallpaper需要两种图片一张原图一张缩略图,如下形式
[html] view
plain copy
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/a7c8e286f463007e2a900848b93dd72c.png)
wallpaper_01.jpg
wallpaper_01_small.jpg
wallpaper_02.jpg
wallpaper_02_small.jpg
缩略图的文件名必须原图"文件名"+"_small"
2).在Launcher3/WallpaperPicker/res/values-nodpi的wallpapers.xml中修改如下:
[html] view
plain copy
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/a7c8e286f463007e2a900848b93dd72c.png)
<resources>
<string-array name="wallpapers" translatable="false">
<item>wallpaper_01</item>
<item>wallpaper_02</item>
</string-array>
</resources>
22、添加reboot
如果需要添加重新启动菜单做重启手机的动作,可以参考如下步骤修改实现:
1)、 在alps\frameworks\base\core\res\res\values\strings.xml 中添加标签:
[html] view
plain copy
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/a7c8e286f463007e2a900848b93dd72c.png)
<string name="zzzzz_global_action_power_reboot">Reboot</string>
用来显示重新启动菜单项的字符串资源,如果需要添加其他语言的标识,请在其他可替换资源的res folder下添加对应资源。
请注意,为了保证资源文件能够被编译进去,请同步将此资源添加到symbols.xml中。
2)、 在alps\frameworks\base\core\res\res\drawable-hdpi中添加图标:
[html] view
plain copy
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/a7c8e286f463007e2a900848b93dd72c.png)
zzzzz_ic_lock_power_reboot.png
3)、 在alps\frameworks\base\policy\src\com\android\internal\policy\impl\GlobalActions.java
文件中的createDialog()函数中添加:
[java] view
plain copy
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/a7c8e286f463007e2a900848b93dd72c.png)
Private GlobalActionsDialog createDialog(){
……
mItems = new ArrayList<Action>();
// first: power off
mItems.add(……);
/////////////////////////////////////////////Added for reboot items start
mItems.add(
new SinglePressAction(
com.android.internal.R. zzzzz_ic_lock_power_reboot,
R.string.zzzzz_global_action_power_reboot) {
public void onPress() {
mWindowManagerFuncs.reboot(true);
}
public boolean onLongPress() {
mWindowManagerFuncs.rebootSafeMode(true);
return true;
}
public boolean showDuringKeyguard() {
return true;
}
public boolean showBeforeProvisioning() {
return true;
}
});
/////////////////////////added end
// next: airplane mode
mItems.add(mAirplaneModeOn);
……
}
4)、 在frameworks\base\core\java\android\view\WindowManagerPolicy.java文件中,找到WindowManagerFuncs这个interface的定义,增加如下function的声明:
[java] view
plain copy
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/a7c8e286f463007e2a900848b93dd72c.png)
public interface WindowManagerFuncs {
public void reboot(boolean confirm);
}
5)、 在Frameworks\base\services\java\com\android\server\wm\WindowManagerService.java中,因为其实现了WindowManagerFuncs这个接口,需要在该文件中添加reboot()函数的实现体。
找到shutdown()函数,在其后面添加reboot()函数,函数内容如下:
[java] view
plain copy
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/a7c8e286f463007e2a900848b93dd72c.png)
// Called by window manager policy. Not exposed externally.
@Override
public void reboot(boolean confirm) {
ShutdownThread.reboot(mContext, confirm);
}
还需要在array.xml的config_globalActionsList添加reboot选项
public.xml中进行配置
字符串添加:(第一次可以编过,后面有碰到编译res找不到)
[java] view
plain copy
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/a7c8e286f463007e2a900848b93dd72c.png)
strings.xml:
<string name="reboot_confirm_question">"Do you want to reboot?"</string>
<string name="global_action_reboot">"Reboot"</string>
<string name="reboot_progress">"Rebooting..."</string>
symbols.xml
<java-symbol type="string" name="reboot_confirm_question" />
<java-symbol type="string" name="global_action_reboot" />
<java-symbol type="string" name="reboot_progress" />(遇到编译res找不到,先屏蔽掉symbols.xml,编译后再重新加上继续编译)
注:android5.1的config_globalActionsList在 X:\8163_eng\alps\frameworks\base\core\res\res\values\config.xml中已定义
23、GMS预置:
L版本GMS预置比较简单,只需要把GMS需要预置内容放置在 alps/vendor/google/文件夹下(google文件夹需要自行创建)
然后检查vendor/google/下是否存在Android.mk文件,若没有此Android.mk,请新建一个,并把以下内容拷贝进去:
[html] view
plain copy
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/a7c8e286f463007e2a900848b93dd72c.png)
ifdef BUILD_GMS
ifeq ($(strip $(BUILD_GMS)), yes)
include $(call all-subdir-makefiles)
endif
endif
同时再检查vendor/google/以下两个文件夹apps/ 和 frameworks/第一层目录下是否存在Android.mk如果不存在,也各新建一个,将以下内容拷贝进去:
[html] view
plain copy
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/a7c8e286f463007e2a900848b93dd72c.png)
include $(call all-subdir-makefiles)
最后在build的时候带入"BUILD_GMS=yes",如:
[java] view
plain copy
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/a7c8e286f463007e2a900848b93dd72c.png)
source build/envsetup.sh && lunch full_<YourProjectName>-user && source ./mbldenv.sh && BUILD_GMS=yes make -j24
若提示找不到mbldenv.sh,则使用如下命令:
[java] view
plain copy
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/a7c8e286f463007e2a900848b93dd72c.png)
source build/envsetup.sh && lunch full_<YourProjectName>-user && BUILD_GMS=yes make -j24
注意,源代码的build文件中会有判断 BUILD_GMS 的值做不同build行为的语句,请不要修改,否则会造成GMS预置冲突或者预置不完整问题
24、预置apk到vendor/operator/app下面
预置apk到vendor/operator/app下面,有时候会编译不过
这种情况一般是apk本身没有对齐导致的,可以先使用zipalign重新对齐apk后再预置,具体做法如下:
[java] view
plain copy
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/a7c8e286f463007e2a900848b93dd72c.png)
out/host/linux-x86/bin/zipalign -f 4 unalign.apk aligned.apk
其中,unalign.apk指当前source apk,aligned.apk指对齐后输出的apk.
25、mtk自带的一些工具文件,eg:工程模式
[java] view
plain copy
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/a7c8e286f463007e2a900848b93dd72c.png)
\alps\vendor\mediatek\proprietary\packages\apps\EngineerMode
26、Launcher3的添加所在目录:
[java] view
plain copy
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/a7c8e286f463007e2a900848b93dd72c.png)
\alps\device\mediatek\mt8163\device.mk
27、apn配置文件所在目录:
[java] view
plain copy
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/a7c8e286f463007e2a900848b93dd72c.png)
\alps\device\generic\goldfish\data\etc\apns-conf.mk
28、GMS包接口所在目录:
[java] view
plain copy
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/a7c8e286f463007e2a900848b93dd72c.png)
\alps\device\mediatek\common\device.mk
29、可以在该目录下添加.jar和.so库(gms需要的库可在此添加)
[java] view
plain copy
![](https://oscdn.geek-share.com/Uploads/Images/Content/201611/a7c8e286f463007e2a900848b93dd72c.png)
eg:\alps\vendor\**\libs\**\com.google.widevine.software.drm\com.google.widevine.software.drm.jar
30、hotseat布局排版,所在目录:default_workspace_5x6
[java] view
plain copy
\alps\device\mediatek\common\overlay\wifi\packages\apps\Launcher3\res\xml\default_workspace_5x6.xml
31、工程测试模式指令(暗码)
在\alps\frameworks\base\telephony\Java\com\android\internal\telephony\TelephonyIntents.java
有接口(android.provider.Telephony.SECRET_CODE)
在packages/services/telephony/src/com/android/phone/SpecialCharSequenceMgr.java的handleSecretCode方法中对暗码就行了处理
\alps\vendor\mediatek\proprietary\packages\apps中添加FactoryMode,并在\alps\device\mediatek\common\device.mk文件中添加FactoryMode,
报莫名其妙的错误(后来问同事发现 , 必须对新增类中的函数或成员变量如果是public的话必须添加 /**{@hide}*/ 修饰. )
可在计算器中用如下demo进行暗码调用
[java] view
plain copy
if(text.contains("(2586)")) {
// mDisplay.setText(mResult, scroll);
// setDeleteMode(DELETE_MODE_CLEAR);
int len = text.length();
// Intent intent = new Intent(TelephonyIntents.SECRET_CODE_ACTION,Uri.parse("android_secret_code://" + text.substring(1, len - 1)));
Intent intent = new Intent("android.provider.Telephony.SECRET_CODE",Uri.parse("android_secret_code://" + text.substring(1, len - 1)));
mContext.sendBroadcast(intent);
return;
}
接收在Settings.java的
[java] view
plain copy
<receiver android:name="TestingSettingsBroadcastReceiver">
<intent-filter>
<action android:name="android.provider.Telephony.SECRET_CODE" />
<data android:scheme="android_secret_code" android:host="4636" />
</intent-filter>
</receiver>
也可以自己写apk直接调用工厂模式:
[java] view
plain copy
Intent intent=new Intent();
intent.setComponent(new ComponentName("com.mediatek.engineermode", "com.mediatek.engineermode.EngineerMode"));
startActivity(intent);
31、Launcher3中,android.mk文件中加入LOCAL_PRIVILEGED_MODULE := true,才能使Launcher3添加appwidget有效
32、Launcher3 桌面横屏显示:
1).修改AndroidManifest.xml
[html] view
plain copy
<activity
ndroid:name="com.android.launcher3.Launcher"
android:launchMode="singleTask"
android:clearTaskOnLaunch="true"
android:stateNotNeeded="true"
android:theme="@style/Theme"
android:configChanges="mcc|mnc"
android:windowSoftInputMode="adjustPan"
android:screenOrientation="sensor"> <!--modify to sensor -->
2).修改Utilities.java的isRotationEnabled方法
[java] view
plain copy
public static boolean isRotationEnabled(Context c)
{
return true;//直接返回true
}
此时旋转手机,Launcher会横竖屏切换。但hotseat会显示在屏幕的右方。如果要让hotseat显示在屏幕底部,可以按照如下步骤操作:
3).修改res/values/config.xml
[html] view
plain copy
<!--hotseat -->
<bool name="hotseat_transpose_layout_with_orientation">false</bool> <!--改为false-->
4).修改Hotseat.java的onFinishInflate方法
[java] view
plain copy
@Override
protected void onFinishInflate() {
super.onFinishInflate();
LauncherAppState app = LauncherAppState.getInstance();
DeviceProfile grid = app.getDynamicGrid().getDeviceProfile();
AllAppsButtonRank = grid.hotseatAllAppsRank;
mContent = (CellLayout) findViewById(R.id.layout);
if (grid.isLandscape && !grid.isLargeTablet()) {
mContent.setGridSize((int) grid.numHotseatIcons, 1); //modify
} else {
mContent.setGridSize((int) grid.numHotseatIcons, 1);
}
mContent.setIsHotseat(true);
Log.i(TAG, "onFinishInflate,(int) grid.numHotseatIcons: " + (int) grid.numHotseatIcons);
resetLayout();
}
33、电池曲线修改目录:
[java] view
plain copy
\alps\kernel-3.10\drivers\misc\mediatek\mach\..\..\power\cust_battery_meter_table.h
34、配置内存大小:
excel表格对应位置:
[java] view
plain copy
\alps\bootable\bootloader\preloader\tools\emigen\..\MemoryDeviceList_MT8163.xls
\alps\bootable\bootloader\preloader\custom\..\inc\custom_MemoryDevice.h
添加 #define CS_PART_NUMBER[1] H5TC4G63AFR-PBA
35、变化设备屏幕尺寸:
[java] view
plain copy
\alps\kernel-3.10\arch\arm64\configs\**_e_debug_defconfig.mk
\alps\device\..\..\ProjectConfig.mk
相关文章推荐
- android5.1平板或手机应用层一些常用的修改项(eg:MTK8163)
- android5.1平板或手机应用层一些常用的修改项(eg:MTK8163)
- android5.1平板或手机应用层一些常用的修改项(MTK8163)
- Android5.1平板/手机应用层一些常用的修改项所在目录(MTK8163)
- 应用开发中常用的一些手机设置的检测和调用
- 关于手机应用的一些解决方案
- [Flex]转来的 Flex 一些常用物理公式和as3的结合应用
- MATLAB应用中常用的一些网址
- Android平台根据分辨率计算屏幕尺寸,基于物理尺寸来验证手机和平板应用合并的可行性
- LBS 手机位置服务应用的一些想法
- android的一些常用手机信息获取
- SqlServer和Oracle中一些常用的sql语句10 特殊应用
- Android平台根据分辨率计算屏幕尺寸,基于物理尺寸来验证手机和平板应用合并的可行性
- 关于PackagerManager的一些使用:判断手机上是否安装了某个应用
- 『归档』 初始化Linux一些主要应用的常用配置
- 手机应用加速网络请求的一些理解
- Android平台根据分辨率计算屏幕尺寸,基于物理尺寸来验证手机和平板应用合并的可行性
- Android平台根据分辨率计算屏幕尺寸,基于物理尺寸来验证手机和平板应用合并的可行性
- 做平板和手机,在软件上一些区别在哪里
- 常用Android手机软件应用