eg:mediatek/custom/common/lk/logo/cu_qhd
//如果添加新的第二帧图片,在此文件中注册
mediatek/custom/common/lk/logo/rules.mk
mediatek/custom/common/lk/logo/update
//第一帧动画修改位置
mediatek/platform/mt6572/lk/rules.mk
mediatek/platform/mt6572/lk/mt_logo.c
在函数 void mt_disp_show_boot_logo(void)中
if ( logo_id == 0x31 || logo_id == 0x00)
{
fill_animation_logo(39/*该数字为对应第一帧图片编号 39为UI 1*/, mt_get_fb_addr(), (void *)mt_get_tempfb_addr(), logo_addr, phical_screen);
}
编译后可将需要的动画和铃声拷贝到out/target/product/lcsh82_wet_jb5/system/media/ --查看
二:切换指令的修改:
packages/apps/Dialer/src/com/mediatek/dialer/SpecialCharSequenceMgrProxy.java
a).在onReceive()方法中更改切换指令,对应用户Log和切换Log
eg: if(input.equals("*#*#18020#*#*")){// 客户ID
int logoErrCode = ProjectManager.writeLogoId(0);
if ( logoErrCode == 0 )
{
int userErrCode = ProjectManager.writeUserId(1);
DisplayResult(context, userErrCode);
saveCurrentSwitchLogIdFile(0);
}
else
{
Log.e(TAG,"sw260_Dial write logo id fail");
DisplayResult(context, logoErrCode);
}
switched = true;
}
if(input.equals("*#*#0000#*#*")){ //log ID
int logo_id = 0;
if ( !checkLogoSwitch(logo_id) )
{
Log.e(TAG,"sw260_Dial check logo fail");
Toast.makeText(context, "fail", 1000).show();
return true;
}
int errCode = ProjectManager.writeLogoId(logo_id);
DisplayResult(context, errCode);
switched = true;
Settings.System.putInt(mContext.getContentResolver(),Settings.System.SETTINGS_SYSTEM_TIME_ZONE, 0);
forceChangeUserLocale(new Locale("en", "US"));
Intent intent = new Intent();
ComponentName componentName = new ComponentName("com.example.reboot","com.example.reboot.MainActivity");
intent.setComponent(componentName);
mContext.startActivity(intent);
}
b).在 checkLogoSwitch(int logo_num)方法中更改对应的用户Log可以切换的Log
case 1: //对应客户ID
case 1:
if(logo_num == 1){//将对应的logID 写在里面
result = true;
}
break;
修改蓝牙,型号名称:
涉及文件
1、frameworks/base/core/java/android/os/ProjectManager.java
//获取蓝牙名称
public static String getBlueToothName()
{
String bluename2 = null;
if(isUi1()){
bluename2 = "Lovme-X55";
}else{
bluename2 = "DW-E62";
}
return bluename2;
}
2、frameworks/base/core/java/android/bluetooth/BluetoothAdapter.java
1、在 public String getName()方法中添加对应的蓝牙名称
public String getName() {
try {
Log.d("getName()", "persist.sys.story_bluetooth" + android.os.SystemProperties.getInt
("persist.sys.story_bluetooth", 0));
if(android.os.SystemProperties.getInt("persist.sys.story_bluetooth", 0) == 0){
if("ANDROID BT".equals(mService.getName())
|| "X55".equals(mService.getName())
|| "Galaxy Note3".equals(mService.getName())
|| "SM-N9000".equals(mService.getName())
|| "SM-N900".equals(mService.getName())
|| "Android-BT".equals(mService.getName())
|| "DW-E62".equals(mService.getName())
){
if(!android.os.ProjectManager.getBlueToothName().equals(mService.getName())){
setCurLogoBTName(android.os.ProjectManager.getBlueToothName());
}
return android.os.ProjectManager.getBlueToothName();
} else {
return mService.getName();
}
}else {
return mService.getName();
}
} catch (RemoteException e) {Log.e(TAG, "", e);}
return null;
}
修改wifi热点名称
涉及文件
1、frameworks/base/core/java/android/os/ProjectManager.java
//获取wifi名称
public static String getWifiName()
{
String name = null;
if(isUi1()){
name = "Lovme-X55";
}else{
name = "DW-E62";
}
return name;
}
2、frameworks/base/wifi/java/android/net/wifi/WifiConfiguration.java
a)、导入import android.os.ProjectManager;包
b)、在 public static final Creator
//zbg130917修改热点名称
if((config.SSID != null) && (config.SSID.equals("AndroidAP"))){
config.SSID = ProjectManager.getWifiName();
}
修改wifi本地名称
在frameworks/base/wifi/java/android/net/wifi/p2p/WifiP2pService.java文件中
getPersistedDeviceName()方法中当deviceName == null时设置默认值
private String getPersistedDeviceName() {
String deviceName = Settings.Global.getString(mContext.getContentResolver(),
Settings.Global.WIFI_P2P_DEVICE_NAME);
if (deviceName == null) {
/* We use the 4 digits of the ANDROID_ID to have a friendly
* default that has low likelihood of collision with a peer */
String id = Settings.Secure.getString(mContext.getContentResolver(),
Settings.Secure.ANDROID_ID);
//return "Android_" + id.substring(0,4);
return ProjectManager.getWifiName();
}
return deviceName;
}
修改wifi热点名称
在frameworks/base/wifi/java/android/net/wifi/p2p/WifiP2pService.java文件中
getPersistedDeviceName()方法中
private String getPersistedDeviceName() {
String deviceName = Settings.Global.getString(mContext.getContentResolver(),
Settings.Global.WIFI_P2P_DEVICE_NAME);
if (deviceName == null) {
/* We use the 4 digits of the ANDROID_ID to have a friendly
* default that has low likelihood of collision with a peer */
String id = Settings.Secure.getString(mContext.getContentResolver(),
Settings.Secure.ANDROID_ID);
//return "Android_" + id.substring(0,4);
return ProjectManager.getWifiName();
}
return deviceName;
}
更改默认网址
packages/apps/Browser/res/values/strings.xml 中添加要修改的网址
packages/apps/Browser/src/com/android/browser/BrowserSettings.java
1、在private Runnable mSetup = new Runnable()方法中下面位置修改对应UI对应的默认网址
if(FeatureOption.CUSTOM_FOREIGEN_LANGUAGE){
if(ProjectManager.isUi4()){
sFactoryResetUrl = mContext.getResources().getString(R.string.homepage_base_gtide);
}else{
sFactoryResetUrl = mContext.getResources().getString(R.string.homepage_base_en);
}
}
//连接电脑端机型:
system/core/libcutils/properties.c
在property_get(函数中
if(key){
if(!strcmp(key,"ro.product.brand") || !strcmp(key,"ro.product.model")){
char *logoFlagFile = "/proc/logo_id";
int fd = open(logoFlagFile, O_RDONLY);
if(fd > 0){
char buf[20]= {0};
int count = read(fd, buf, sizeof(buf));
char *modeValue;
if(count > 0){
if(!strcmp(key,"ro.product.brand")){
if(!strncmp(buf, "48"/*数字为logid编号,48未UI0*/, 2)){
modeValue = "Android";
}else{
modeValue = "SK2";
}
}else{
if(!strncmp(buf, "48", 2)){
modeValue = "Android";
}else{
modeValue = "SK2";
}
}
len = strlen(modeValue);
//int tmplen = strlen(buf);
//ALOGI("property_get modeValue :%s tmplen :%d \n", modeValue, tmplen);
memcpy(value, modeValue, len + 1);
close(fd);
return len;
}
close(fd);
}
}
//更改是否显示关机动画
frameworks/base/services/java/com/android/server/power/ShutdownThread.java
中通过控制 mShutOffAnimation 变量来控制动画
synchronized (mEnableAnimatingSync) {
if(ProjectManager.isAndroid() || ProjectManager.isUi3()){ ///更改处---控制变量
mShutOffAnimation = true;
}else{
mShutOffAnimation = false;
}
if(!mEnableAnimating) {
// sInstance.mPowerManager.setBacklightBrightness(PowerManager.BRIGHTNESS_DIM);
} else {
if (mShutOffAnimation) {
Log.e(TAG, "mIBootAnim.isCustBootAnim() is true");
bootanimCust();
} else {
//显示关机弹出框
pd = new ProgressDialog(context);
pd.setTitle(context.getText(com.android.internal.R.string.power_off));
pd.setMessage(context.getText(com.android.internal.R.string.shutdown_progress));
pd.setIndeterminate(true);
pd.setCancelable(false);
pd.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG);
/* To fix video+UI+blur flick issue */
pd.getWindow().addFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
pd.show();
}
sInstance.mPowerManager.setShutDown(true);
sInstance.mHandler.postDelayed(mDelayDim, screenTurnOffTime);
}
}