RK3288
代码编译
uboot编译
make rk3288_defconfig
make
编译完成后,u-boot根目录生成RK3288UbootLoader_V2.19.09.bin的loader文件。
Kernel编译
在kernel目录下执行:
makerockchip_defconfig
makerk3288-tb_8846.img
编译完成后,kernel根目录生成kernel.img和resource.img两个镜像文件。
Android编译(项目根目录下)
先通过执行. ./bulid/envsetup.sh配置编译环境,再通过lunch命令选择编译模式
make–j24
编译完成后,执行./mkimage.sh在rockdev/Image-rk3288目录下生成固件。
打开重力感应
device/rockchip/rk3288/BoardConfig.mk
BOARD_SENSOR_ST:= true
BOARD_SENSOR_MPU := false
新版SDK不读U盘
注释system/vold/Android.mk下的两个开关
ifeq ($(strip$(TARGET_BOARD_PLATFORM_PRODUCT)), box)
浏览器相关
Packages/apps/Browser/res/values/Strings.xml的homepage_base
添加预置标签
packages/apps/Browser/res/values/strings.xml的bookmarks的数组添加
packages/apps/Browser/res/values/bookmarks_icons.xml添加
packages/apps/Browser/raw/下添加2张图片,一个网页的预览和logo小图标
修改默认语言
修改以下三个文件中的语言项:修改1、2时将需要修改的默认语言放在第一个,修改3时,将“PRODUCT_LOCALES”项改成需要设置的默认语言即可。编译Android模块,烧录system.img文件
1、build/target/product/languages_full.mk
2、build/target/product/languages_small.mk
3、build/target/product/full_base.mk
修改默认时区
修改devices/rockchip/rk3288/system.prop文件中的“persist.sys.timezone=Europe/London”“Europe/London”来自packages/apps/Settings/res/xml/Timezones.xml
修改默认时间制式
修改布局文件
找到frameworks/base/packages/SettingsProvider/res/values/defaults.xml添加
修改Java文件
找到
frameworks/base/packages/SettingsProvider/src/com/android/provider/Settings/Databasehelper.java
在loadSystemSettings()函数添加
loadStringSetting(stmt,Settings.System.TIME_12_24,R.string.time_12_24);
修改Build Number
RK方案
找到build/core/makefile修改BUILD_DISPLAY_ID=BOZZ
S500方案
找到device/action/gbs_wxgd/device.mk修改ro.build.display.id=BOZZ
修改蓝牙名称
修改device/rockchip/rk3288/bluetooth/bdroid_buildcfg.h中的” BTM_DEF_LOCAL_NAME”.
删除默认APP
找到device/rockchip/rk3288/device.mk文件最后,找到gms_xx.mk文件路径
通过gms_xx.mk文件路径找到该文件,把不需要的APP注释掉即可。注释掉的app需放在后面。
添加编译条件
在device/rockchip/rk3288/system.prop文件中添加判断条件
修改开机动画
代码:bootAnimation.cpp
函数:bool BootAnimation::android()
图片:frameworks/base/core/res/assets/images/
修改开机LOGO
在kernel/drives/video/logo下
通过bmptoppm pic.bmp > pic.ppm //生成ppm文件
通过ppmquant 224 pic.ppm > pic224.ppm //转换成224
通过pnmnoraw pic224.ppm > log_linux_pic.ppm
将log_linux_clut224.c和log_linux_clut224.o文件删除
将log_linux_pic.ppm重命名为log_linux_clut224.ppm
再将kernel/arch/arm/configs/rockchip_defconfig中的CONFIG_LOGO和CONFIG_LOGO_LINUX_CLUT224打开
在kernel目录下make clean将中间文件删除,重新编译kernel。
修改壁纸图片
frameworks/base/core/res/res/drawable-sw720dp-nodpi
去除桌面渐变黑边
Launcher3/.../Launcher.java
SETWorkspaceBackground => setWorkspaceBackground
注释boolean isMultiMode = (0 !=Settings.System.getInt(getContentResolver(), "multi_window_config",0));
//mLauncherView.setBackground(workspace&&!isMultiMode ?mWorkspaceBackgroundDrawable : null);
mLauncherView.setBackground(null);
}
修改默认输入法
frameworks/base/services/core/java/com/android/server/InputMethodManagerService.java
resetDefaultImeLocked()函数修改
/*if(InputMethodUtils.isValidSystemDefaultIme(
mSystemReady, imi, context)) {
defIm = imi;
Slog.i(TAG, "Selected default: " + imi.getId());
}*/
if(imi.getId().equals("com.sohu.inputmethod.sogou/.SogouIME")) {
defIm = imi;
Slog.i(TAG, "Selected default: " + imi.getId());
}
frameworks/base/core/java/com/android/internal/inputmethod/InputMethodUtils.java
getMostApplicableDefaultIME()函数修改
/*if(InputMethodUtils.isSystemImeThatHasEnglishKeyboardSubtype(imi)
&& !imi.isAuxiliaryIme()) {
return imi;
}
if (firstFoundSystemIme < 0 &&InputMethodUtils.isSystemIme(imi)
&& !imi.isAuxiliaryIme()) {
firstFoundSystemIme = i;
}*/
if(imi.getId().equals("com.sohu.inputmethod.sogou/.SogouIME")){
returnimi;
}
修改recovery显示方向:
bootable文件夹下recovery, screen相关文件
打开/device/rockchip/common/BoardConfig.mk下的BOARD_HAS_FLIPPED_SCREEN
需要make clean
修改桌面布局
/packages/apps/Launcher3/res/xml/default_workspace_5x6.xml
/packages/apps/Launcher3/src/com/android/launcher3/DynamicGrid.java
隐藏全屏提示
frameworks/base/policy/src/com/android/internal/policy/impl/ImmersiveModeConfirmation.java
public class ImmersiveModeConfirmation {
public void handleMessage(Message msg) {
switch(msg.what) {
caseSHOW:
- handleShow();
+ // handleShow();
break;
caseHIDE:
handleHide();
break;
casePANIC:
- handlePanic();
+ // handlePanic();
break;
}
}
LVDS屏关机时白屏解决
Kernel/arch/arm/kernel/Process.c
永不锁屏永不休眠
1、 Settings/res/xml/display_settings.xml——————————————————删除休眠选项
注释"screen_timeout"
2、 Settings/.../DisplaySettings.java添加if条件,如果没有找到这个preference就不执行相关操作;
mScreenTimeoutPreference= (ListPreference) findPreference(KEY_SCREEN_TIMEOUT);
if (mScreenTimeoutPreference !=null ) {
....
}
3、 devices/rockchip/rk3288/system.prop——————————————————永不休眠
ro.rk.screenoff_time=2147483647
4、 frameworks/base/packages/SettingsProvider/res/values/defaults.xml——————禁止锁屏
实现彻底关机
在kernel/arch/arm/kernel/process.c的void machine_power_off(void)函数中添加
act8846_device_shutdown();
修改kernel/driver/regulator/act8846.c的act8846_device_shutdown(void)函数
voidact8846_device_shutdown(void)
{
struct act8846 *act8846 = g_act8846;
int ret = -1;
printk("%s\n",__func__);
#if 0
if (act8846->pmic_hold_gpio) {
gpio_direction_output(act8846->pmic_hold_gpio,0);
mdelay(100);
arm_pm_restart('h',"charge");
}
#else
ret = act8846_reg_read(act8846,0xc3);
ret = act8846_set_bits(act8846,0xc3,(0x1<<3),(0x1<<3));
ret = act8846_set_bits(act8846,0xc3,(0x1<<4),(0x1<<4));
if (ret < 0) {
printk("act8846 set 0xc3error!\n");
return ;
}
#endif
}
删除电池相关
—————————————————删除百分比—————————————————
a、SystemUI/.../statusbar/policy/BatteryController.java
mBatteryPercentageView.setVisibility(View.GONE);———————右上角百分比
b、SystemUI/.../statusbar/phone/StatusBarHeaderView.java
mBatteryLevel.setVisibility(View.GONE);————————————下拉百分比
c、SystemUI/.../statusbar/phone/KeyguardStatusBarView.java
mBatteryLevel.setVisibility =(View.GONE);———————————锁屏百分比
—————————————————删除图标——————————————————
d、SystemUI/.../res/layout/system_icon.xml
注释battery
e、SystemUI/.../statusbar/phone/StatusBarHeaderView.java——————下拉图标
注释((BatteryMeterView)findViewById(R.id.battery)).setBatteryController(batteryController);
f、SystemUI/.../statusbar/phone/PhoneStatusBar.java—————————右上角图标
注释((BatteryMeterView) mStatusBarView.findViewById(R.id.battery))
注释dispatchDemoCommandToView(command, args, R.id.battery);
h、SystemUI/.../statusbar/phone/KeyguardStatusBarView.java—————锁屏界面图标
注释((BatteryMeterView)findViewById(R.id.battery)).setBatteryController(batteryController);
i、statusbar/phone/PhoneStatusBarTransitions.java———————解除电池图标相关属性设置
注释mBattery相关的内容
修改“关于设备”内容
/packages/apps/Settings/res/values/strings.xml————修改“关于设备”—>“状态”上层显示
/packages/apps/Settings/res/xml/device_info_status.xml—修改点击“关于设备”—>“状态”项
packages/apps/Settings/src/com/android/settings/deviceinfo/Status.java
注释相关的内容
修改“设置”页面布局
Settings/res/xml/dashboard_categories.xml——————————删除对应布局即可
有时还需要去除AndroidManifest.xml中对应的布局
修改截屏设置
Settings/.../ScreenshotSetting.java——————————————设置默认时间
Stringsummary_delay=mDelay.getSharedPreferences().getString("screenshot_delay", "15");
Settings/res/values/arrays.xml———————————————设置截屏延时数组
搜索“”
去除“设置”HDMI选项
Settings/.../SettingsActivity.java———————————————修改以下内容
boolean isTablet= "box".equals(SystemProperties.get("ro.target.product","tablet"));改为
boolean isTablet= true;
“无线和网络”—>“更多”
res/xml/wireless_settings.xml
添加充电电池图标
在PhoneStatusBarPolicy.java中添加属性private static final StringSLOT_BATTERY = "battery";
在onReceive()函数中添加
else if(action.equals(BatteryManager.EXTRA_STATUS)) {
updateBattery();
}
在PhoneStatusBarPolicy()函数中添加
filter.addAction(BatteryManager.EXTRA_STATUS);
updateBattery();
添加方法
private final void updateBattery() {
mService.setIcon(SLOT_BATTERY,com.android.internal.R.drawable.stat_sys_battery_charge, 0,mContext.getString(R.string.accessibility_no_battery));
mService.setIconVisibility(SLOT_BATTERY,true);
}
隐藏Recent按钮
在NavigationBarView.java的setDisabledFlags
getRecentsButton().setVisibility(View.INVISIBLE);
下拉快捷菜单
frameworks/base/packages/SystemUI/res/values/config.xml文件quick_settings_tiles_default_bt
隐藏NOSIM图标
SystemUI/.../statusbar/SignalClusterView.java————————————隐藏NoSIM图标
mNoSims.setVisibility(/*mNoSimsVisible ? View.VISIBLE :*/View.GONE);
修改鼠标右键功能
/framework/native/services/inputflinger/InputReader.cpp文件
if (mBtnRight) {
//$_rochchips_$_modify_by_huangjc make sure mouse BtnRight for product
/*char *mIsBox = new char[PROPERTY_VALUE_MAX];
property_get("ro.target.product", mIsBox, "tablet");
if(strcmp(mIsBox, "tablet")==0)
result |= AMOTION_EVENT_BUTTON_SECONDARY;
else*/
result |= AMOTION_EVENT_BUTTON_BACK;
}
修改默认桌面布局
device/rockchip/rk3288/system.prop:45:ro.sf.lcd_density= //320走600dpi
//160走720dpi
修改ADC按键
kernel/drivers/input/keyboard/Rk_keys.c
kernel/arch/arm/boot/dts/include/dt-bindings/input/input.h
修改Camera预览分辨率
hardware/rockchip/camera/CameraHal/CameraIspAdapter.cpp的initDefaultParameters函数
修改相机录像分辨率
packages/apps/Camera2/src/com/android/camera/settings/SettingsUtil.java
static SelectedVideoQualitiesgetSelectedVideoQualities(int cameraId)
selectedQualities.large =sVideoQualities[largeIndex];
selectedQualities.medium =sVideoQualities[mediumIndex];
selectedQualities.small =sVideoQualities[smallIndex];
修改Camera前后置和旋转角度
hardware/rockchip/camera/CameraHal/CameraHal_Module.cpp的camera_get_camera_info函数
info->facing=CAMERA_FACING_FRONT;
info->orientation=90;
几个相关的system.prop
device/rockchip/rk3288/system.prop
device/rockchip/rk3288/rk3288_box/system.prop
device/rockchip/common/system.prop
解决开机logo屏闪
kernel/driver/video/rockchip/lcdc/rk3288lcdc.c文件static int rk3288_lcdc_parse_dt(struct lcdc_device *lcdc_dev)修改以下内容
if(of_property_read_u32(np, "rockchip,bcsh-en", &val))
dev_drv->bcsh.enable= true;
else
dev_drv->bcsh.enable= (val ? true : false);
if(of_property_read_u32(np, "rockchip,brightness", &val))
dev_drv->bcsh.brightness= 0x0080;
else
dev_drv->bcsh.brightness= val;
if(of_property_read_u32(np, "rockchip,contrast", &val))
dev_drv->bcsh.contrast= 0x01ff;
else
dev_drv->bcsh.contrast = val;
添加TP唤醒
修改TP驱动
添加extern volatile u32 flag_shutdown;
在中断函数中添加wakeup指定
eg:
input_event(wdt->input_mt,EV_KEY, KEY_WAKEUP, 1);
input_event(wdt->input_mt,EV_KEY, KEY_WAKEUP, 0);
input_sync(wdt->input_mt);
在创建驱动设备中指定
eg:
input_set_capability(input,EV_KEY, KEY_POWER);
input_set_capability(input,EV_KEY, KEY_WAKEUP);
device_init_wakeup(dev,1);
/kernel/drivers/video/rockchip/lcdc/rk3288_lcdc.c
externvolatile u32 flag_shutdown;
rk3288_lcdc_early_resume()函数里面置1
rk3288_lcdc_early_suspend()函数里面置0
EDP屏点不亮的解决方法
修改drivers/video/rockchip/rk32_dp.c中的prope函数
//edp->video_info.link_rate = LINK_RATE_1_62GBPS;
edp->video_info.link_rate = LINK_RATE_2_70GBPS;
//edp->video_info.lane_count = LANE_CNT4;
edp->video_info.lane_count = LANE_CNT2;
删除电话相关APK
将以下文件夹中的Android.mk备份为Android.bak_mk即可,编译时注意clean
packages/apps/Contacts和tests //联系人
packages/providers/ContactsProvider和tests //联系人存储
packages/apps/ContactsCommon 和tests //联系人存储
packages/services/Telecomm和tests //电话
补丁相关
单个文件
diff –uN from-file to-file >to-file.patch
patch –p0 < to-file.patch
patch –RE –p0 < to-file.patch
多个文件
diff –uNr from-docu to-docu >to-docu.patch
patch –p1 < to-docu.patch
patch –R –p1
ADB命令
升级软件流程
先切换adb用户为root,将apk文件放在adb_push目录下,切换工作目录为adb_push,然后将文件夹改为可读可写(adb shell mount –o remount,rwFilesPath/FilesName),通过adb push命令将apk文件写入文件夹(adb push *.apk /FilesPath/FilesName),然后通过(adb shell sync)命令同步一下,再将设备重启。
大固件制作流程
在修改完最终版的软件后,重新编译所修改的模块,生成最新img文件,将升级所需的img文件和其他文件放在工具文件夹的“rockdev”文件夹下的“Image”和“backupimage”文件夹下,然后运行“mkupdate.bat”批处理文件,等待生成完成,最后将生成的最新img文件更改为软件所对应项目的名字,放在“Image”和“backupimage”文件夹。
SystemUI在frameworks/base/packages/SystemUI
更新某个模块,只需在更新的目录下通过“mm”指令单独编译模块,生成*.apk文件,然后将apk文件push到system/priv-app目录
查看屏参命令dumpsys SurfaceFlinger
修改IO口命令
io –option address value
option:显示位数
address:GPIO地址
value:写入的值