1.关机充电图标不显示:
现象:开机后,插入充电器,再按正常流程关机。 关机后,短按power键,屏幕无充电图标显示(此时充电器还是插入的)。
解决方法:配置 [pmu_para] power_start = 0 即可
2.设置-语言与输入法-Japanese IME,点击学习词典初始化报错;
现象及解决方法:
正常情况,需要选择默认输入法为Japanese IME后才可以清空词典。 case OpenWnnEvent.INITIALIZE_LEARNING_DICTIONARY: mConverterEN.initializeDictionary(WnnEngine.DICTIONARY_TYPE_LEARN); mConverterJAJP.initializeDictionary(WnnEngine.DICTIONARY_TYPE_LEARN); return true; 这里在按了“学习词典初始化”菜单后会调用到以上代码,而此时mConverterEN和mConverterJAJP未被初始化,为null,只有在选择了默认输入法为Japanese IME后,相关的onCreate函数被调用才会new这两个对象以及生成相应的词典文件。
3.data分区扩到4G 恢复出厂设置就没作用了
解决方法:
diff --git a/drivers/mtd/nand/sunxi_nand.c b/drivers/mtd/nand/sunxi_nand.c
old mode 100644
new mode 100755
index 10b672a..469ce7c
--- a/drivers/mtd/nand/sunxi_nand.c
+++ b/drivers/mtd/nand/sunxi_nand.c
@ -38,7 +38,7 @ int sunxi_nand_read_opts(nand_info_t *nand, uint offset, size_t *length,
unsigned int nSectNum, nSectorCnt;
- nSectNum = (unsigned int)(offset / 512);
+ nSectNum = (unsigned int)(offset );
nSectorCnt = (unsigned int)(*length / 512);
#ifdef DEBUG
printf("sunxi nand read: start sector %x counts %x ", nSectNum, nSectorCnt);
@ -51,7 +51,7 @ int sunxi_nand_write_opts(nand_info_t *nand, uint offset, size_t *length,
unsigned int nSectNum, nSectorCnt;
- nSectNum = (unsigned int)(offset / 512);
+ nSectNum = (unsigned int)(offset);
nSectorCnt = (unsigned int)(*length / 512);
#ifdef DEBUG
printf("sunxi nand write: start sector %x counts %x ", nSectNum, nSectorCnt);
diff --git a/drivers/storage_type/sunxi_flash.c b/drivers/storage_type/sunxi_flash.c
index c78c392..2c9cf17 100755
--- a/drivers/storage_type/sunxi_flash.c
+++ b/drivers/storage_type/sunxi_flash.c
@ -66,7 +66,7 @ sunxi_flash_nand_read(unsigned int start_block, unsigned int nblock, void *buffe
tick_printf(FILE, LINE);
nsize = nblock<<9;
- ret = sunxi_nand_read_opts(&nand_info[0], start_block<<9, &nsize, buffer, 0);
+ ret = sunxi_nand_read_opts(&nand_info[0], start_block, &nsize, buffer, 0);
tick_printf(FILE, LINE);
return ret;
@ -77,7 +77,7 @ sunxi_flash_nand_write(unsigned int start_block, unsigned int nblock, void *buff
unsigned int nsize;
nsize = nblock<<9;
- return sunxi_nand_write_opts(&nand_info[0], start_block<<9, &nsize, buffer, 0);
+ return sunxi_nand_write_opts(&nand_info[0], start_block, &nsize, buffer, 0);
}
修改后ok。
4.支持多用户功能
<integer name=”config_multiuserMaximumUsers”>8</integer>
5.在首次开机时默认将Play商店停用:
修改:packages\apps\Provision,在这里将vending应用停用
try{
pm.setApplicationEnabledSetting(“com.android.vending”, PackageManager.COMPONENT_ENABLED_STATE_DISABLED_USER, 0);}catch(…){}
并在
Provision应用的AndroidManifest.xml中增加权限
<uses-permission android:name=”android.permission.CHANGE_COMPONENT_ENABLED_STATE” />
6. 4.1 在播放视频时,视频切换会出现花屏:
在 device\softwinner\common\hardware\libhardware\hwcomposer\hwcomposer.cpp 里
static int hwc_show(sun4i_hwc_context_t *ctx,uint32_t value)
{
unsigned long args[4]={0};
unsigned int screen_idx;
int ret = 0;
for(screen_idx=0; screen_idx<2; screen_idx++)
{
if(((screen_idx == 0) && (ctx->mode==HWC_MODE_SCREEN0 || ctx->mode==HWC_MODE_SCREEN0_AND_SCREEN1 ))
|| ((screen_idx == 1) && (ctx->mode == HWC_MODE_SCREEN1 || ctx->mode==HWC_MODE_SCREEN0_TO_SCREEN1 || ctx->mode==HWC_MODE_SCREEN0_AND_SCREEN1)))
{
if(ctx->video_layerhdl[screen_idx] != 0)
{
if(value == 0)
{
args[0] = screen_idx;
args[1] = ctx->video_layerhdl[screen_idx];
ioctl(ctx->dispfd, DISP_CMD_LAYER_CLOSE,args);
args[0] = screen_idx;
args[1] = ctx->video_layerhdl[screen_idx];
ret = ioctl(ctx->dispfd, DISP_CMD_VIDEO_STOP, args);
}
else
{
args[0] = screen_idx;
args[1] = ctx->video_layerhdl[screen_idx];
ioctl(ctx->dispfd, DISP_CMD_LAYER_OPEN,args);
args[0] = screen_idx;
args[1] = ctx->video_layerhdl[screen_idx];
ret = ioctl(ctx->dispfd, DISP_CMD_VIDEO_START, args);
}
}
}
}
return ret;
}
在 hwc_setparameter 函数加上
}else if(param == HWC_LAYER_SHOW){
ret = hwc_show(ctx,value);
}
7.添加新的产品编译项:
cp -r crane-m1003h6 crane-abcd
cd crane-abcd
grep -r -l “m1003h6” ./* | xargs sed -i ‘s/m1003h6/abcd/g’
mv crane_m1003h6.mk crane_abcd.mk
8.播放Mp3,屏幕暗下去以后,调节音量键无效:
a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
+++ b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
@@ -3352,7 +3352,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
case KeyEvent.KEYCODE_VOLUME_MUTE: {
if (keyCode == KeyEvent.KEYCODE_VOLUME_DOWN) {
if (down) {
- if (isScreenOn && !mVolumeDownKeyTriggered
+ if (!mVolumeDownKeyTriggered
&& (event.getFlags() & KeyEvent.FLAG_FALLBACK) == 0) {
mVolumeDownKeyTriggered = true;
mVolumeDownKeyTime = event.getDownTime();
@@ -3366,7 +3366,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
}
} else if (keyCode == KeyEvent.KEYCODE_VOLUME_UP) {
if (down) {
- if (isScreenOn && !mVolumeUpKeyTriggered
+ if (!mVolumeUpKeyTriggered
&& (event.getFlags() & KeyEvent.FLAG_FALLBACK) == 0) {
mVolumeUpKeyTriggered = true;
cancelPendingPowerKeyAction();
2. 不让按键进入suspend
--- a/drivers/input/keyboard/sun4i-keyboard.c
+++ b/drivers/input/keyboard/sun4i-keyboard.c
@@ -183,7 +183,7 @@ static void sun4i_keyboard_suspend(struct early_suspend *h)
if (NORMAL_STANDBY == standby_type) {
- writel(0,KEY_BASSADDRESS + LRADC_CTRL);
+ //writel(0,KEY_BASSADDRESS + LRADC_CTRL);
/*process for super standby*/
} else if(SUPER_STANDBY == standby_type) {
;
@@ -466,5 +466,5 @@ MODULE_AUTHOR(" <@>");
9.Google Play 搜不到某个应用:
搜不到应用是设备缺少该应用所必须的权限,即使安装了也可能出现部分功能不能正常使用的情况。如何让A1X搜到应用,下面以搜索IDTV应用为例:
1. 先在pc上打开google play搜到IDTV这个应用
2. 查看这个应用所需要的权限,需要定位,WIFI等
3. 查看设备所具有的权限etc/permissions/*
4. 比较找到设备所缺少的权限,例如A10默认缺少IDTV所必须的定位权限。
5. 将可疑的权限文件push到etc/permissions/下,恢复出厂设置再次测试能否搜到。
6. 在项目中拷贝所需的权限,例如打开网络定位的功能。
如果难以定位缺少所需的权限,其他手机可搜索到,比较etc/permissions/*下的内容,反复push,恢复出厂设置后测试。
所有权限文件路径:frameworks/native/data/etc/*
10. Google Play 上下载的水果忍者运行出错
请检查 config_networkLocationProvider 是否为 null
修改:
<string name=”config_networkLocationProviderPackageName” translatable=”false”>com.google.android.location</string>
11.内存使用状态显示问题:
diff --git a/src/com/android/settings/applications/ManageApplications.java b/src/com/android/settings/applications/ManageApplications.java
--- a/src/com/android/settings/applications/ManageApplications.java
+++ b/src/com/android/settings/applications/ManageApplications.java
@@ -855,13 +855,16 @@ public class ManageApplications extends Fragment implements
mColorBar.setRatios((totalStorage-freeStorage-appStorage)/(float)totalStorage,
appStorage/(float)totalStorage, freeStorage/(float)totalStorage);
long usedStorage = totalStorage - freeStorage;
- if (mLastUsedStorage != usedStorage) {
+
+ //if (mLastUsedStorage != usedStorage) {
+ if (true) {
mLastUsedStorage = usedStorage;
String sizeStr = Formatter.formatShortFileSize(getActivity(), usedStorage);
mUsedStorageText.setText(getActivity().getResources().getString(
R.string.service_foreground_processes, sizeStr));
}
- if (mLastFreeStorage != freeStorage) {
+ //if (mLastFreeStorage != freeStorage) {
+ if (true) {
mLastFreeStorage = freeStorage;
String sizeStr = Formatter.formatShortFileSize(getActivity(), freeStorage);
mFreeStorageText.setText(getActivity().getResources().getString(
12.隐藏状态栏:
如果没有应用的源码,在PhoneWindowManager.java文件 finishAnimationLw函数中,针对特殊的应用判断。已有视频播放的参考代码,参照修改即可。
13.预装APK过大,升级固件在一定百分比出错
1:修改 BoardConfig.mk
mv out/target/product/crane-evb_mmc/system.img out/target/product/crane-evb_mmc/system.img_old
simg2img out/target/product/crane-evb_mmc/system.img_old out/target/product/crane-evb_mmc/system.img
cd $PACKAGE
./pack -c sun4i -p crane -b evb_mmc
cd –
14.蓝牙可用设备会显示之前搜索到但已关闭的设备
修改如下:
在CachedBluetoothDeviceManager中添加删除接口
void removeAllCacheDevices() {
synchronized(this) {
List<CachedBluetoothDevice> mCachedList = mCachedDevices;
for (int i = mCachedList.size() – 1; i >= 0; i–) {
mCachedList.remove(mCachedList.get(0));
}
}
}
在startScanning的地方调用,调用方式
mLocalManager = LocalBluetoothManager.getInstance(context);
if (mLocalManager == null) {
Log.e(TAG, “Bluetooth is not supported on this device”);
return;
}
mLocalManager.getCachedDeviceManager().removeAllCacheDevices();
15.修改Launcher显示的列数:
16.状态栏的日期格式不随设置的日期格式改变
17.超请播放器分享功能相关问题:
mAdapter.setShowFooterView(true);
18.Google Chrome 进Setting 停止运行:
修改文件 frameworks\base\core\java\android\preference\PreferenceActivity.java
19.升级后首次开机不显示音量图标:
20、视频实时旋转
21、开启wifi连3G会出现wifi和3G两个图标,退出3G后3G图标不消失
./frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java
void refreshViews() {
Context context = mContext;
int combinedSignalIconId = 0;
int combinedActivityIconId = 0;
String combinedLabel = “”;
String wifiLabel = “”;
String mobileLabel = “”;
int N;
if (mWifiConnected && !mDataConnected) {
mDataSignalIconId = mPhoneSignalIconId = 0;
mobileLabel = “”;
}
if (!mHasMobileDataFeature) {
mDataSignalIconId = mPhoneSignalIconId = 0;
mobileLabel = “”;
} else {
22.解锁界面应用图标特大:
把下面代码红色部分注释掉
public void setTargetResources(ArrayList<Drawable> drawables)
{
Resources res = getContext().getResources();
int count = drawables.size();
Drawable drawable = null;
ArrayList<TargetDrawable> targetDrawables = new ArrayList<TargetDrawable>(count);
if(count > mMaxAppIconNum)
count = mMaxAppIconNum;
for (int i = 0; i < count; i++) {
// if(i!=0)
// {
// drawable = zoomDrawable(drawables.get(i),mIconSize,mIconSize);
// }else
//
{
drawable = drawables.get(i);
//}
}
23.高清播放器图片预览时,不是居中
packages\apps\Gallery2\src\com\android\gallery3d\ui\SlideshowView.java
public void apply(GLCanvas canvas) {
约 152 行
// float centerX = viewWidth / 2 + mMovingVector.x * mProgress;
// float centerY = viewHeight / 2 + mMovingVector.y * mProgress;
float centerX = viewWidth / 2 ;
float centerY = viewHeight / 2 ;
24.休眠间歇性唤醒:
由于android本身timer机制导致,可以通过如下配置进行优化:
1. 进入menuconfig
2. 选择device drivers -> real time clock
3. 选择android alarm clock wakeup
25、音乐播放器中,均衡器界面不起作用
packages\apps\MusicFX\src\com\android\musicfx\ActivityMusic.java
protected void onResume() {
中 460 行
\\ mIsHeadsetOn = (audioManager.isWiredHeadsetOn() || audioManager.isBluetoothA2dpOn());
改为 mIsHeadsetOn = true;
private void updateUI() {
中 551 行
/**
* final boolean isEnabled = ControlPanelEffect.getParameterBoolean(mContext,
* mCallingPackageName, mAudioSession, ControlPanelEffect.Key.global_enabled);
**/
改为
final boolean isEnabled = ControlPanelEffect.getParameterBoolean(mContext,
mCallingPackageName, mAudioSession,
ControlPanelEffect.Key.virt_enabled);
26、修改播放器拖动时的状态条宽度:
android4.0\packages\apps\Gallery2\res\layout\media_status.xml
<SeekBar
android:id=”@+id/mediacontroller_progress”
style=”?android:attr/progressBarStyleHorizontal”
android:layout_width=”0dip”
android:layout_weight=”1″
android:paddingTop=”30dp”
android:layout_height=”60dip”
/>
数值根据需要进行调整。
27、Music播放器无法点击前一首
28、Google拼音输入法,横屏时有些应用没有中文选项:
29、播放电影字幕与菜单重叠:
30、卡启动,Nand分区识别:
关于要在卡启动识别到nand,有两种情况:
1. nand上已经有分区;
2. nand是裸片;
第一种情况下卡启动时nand驱动能够初始化成功,用户可以通过mount命令挂载nand的分区;
第二种情况下要先给nand一个虚拟的mbr,使得启动时nand能够初始化成功,
可以通过修改nand驱动的源码达到这一目的。
A10平台修改linux-3.0/drivers/block/sun4i_nand/nfd/mbr.c
A1X平台修改linux-3.0/drivers/block/sun5i_nand/nfd/mbr.c
具体改动如下:
int mbr2disks(struct nand_disk* disk_array)
{
int part_cnt = 0;
int part_index;
#if 0
if(_get_mbr()){
printk(“get mbr error\n” );
return part_cnt;
}
part_index = 0;
for(part_cnt = 0; part_cnt<MAX_PART_COUNT; part_cnt++)
part_secur[part_index] = 0;
//查找出所有的LINUX盘符
for(part_cnt = 0; part_cnt < mbr->PartCount && part_cnt < MAX_PART_COUNT; part_cnt++)
{
//if((mbr->array[part_cnt].user_type == 2) || (mbr->array[part_cnt].user_type == 0))
{
PRINT(“The %d disk name = %s, class name = %s, disk size = %d\n”, part_index, mbr->array[part_cnt].name,
mbr->array[part_cnt].classname, mbr->array[part_cnt].lenlo);
disk_array[part_index].offset = mbr->array[part_cnt].addrlo;
disk_array[part_index].size = mbr->array[part_cnt].lenlo;
part_secur[part_index] = mbr->array[part_cnt].user_type;
part_index ++;
}
}
disk_array[part_index – 1].size = DiskSize – mbr->array[mbr->PartCount – 1].addrlo;
_free_mbr();
PRINT(“The %d disk size = %lu\n”, part_index – 1, disk_array[part_index – 1].size);
PRINT(“part total count = %d\n”, part_index);
#else
part_index = 1;
disk_array[0].offset = 0;
disk_array[0].size = DiskSize;
part_secur[0] = 0;
#endif
return part_index;
}
红色部分为改动的内容,旧版的SDK需要做适当的修改才可通过编译,
去掉:part_secur[0] = 0;
31、Android4.0 蓝牙键盘不能用:
32.让多台机器公用一个下载帐号:
将授权机器的密钥文件(id_rsa和id_rsa.pub)copy到新机器用户目录下面的.ssh文件夹里,如果没有就新建。
同时将相关文件的权限进行修改:
owner 和group 设置成新机器上的用户
id_rsa文件权限设置成600
33.高清播放器删除最后一张图片,图片再无法移动:
public void startSlideInAnimation(int direction) {
…
mTransitionMode = direction; 改成 mTransitionMode = TRANS_NONE;
}
34.在系统中去掉蓝牙相关功能:
注释掉 <feature name=”android.hardware.bluetooth” />
35.默认竖屏模式下,高清播放器休眠后自动播放视频
import android.os.PowerManager;
import android.content.Context;
import android.os.SystemClock;
private PowerManager mPowerManager;
@Overridepublic void onCreate(Bundle icicle) { 。。。
mPowerManager = (PowerManager)getApplicationContext().getSystemService(Context.POWER_SERVICE);
}
public void onPause() { if(mPowerManager != null){
if(!mPowerManager.isScreenOn()){
SystemClock.sleep(1000);}}mControl.onPause();super.onPause();}
36.阿拉伯文下高清播放器不能搜索到.avi 格式的媒体文件
frameworks\base\media\java\android\media\MediaFile.java
public static MediaFileType getFileType(String path) {
int lastDot = path.lastIndexOf(“.”);
if (lastDot < 0)
return null;
return sFileTypeMap.get(path.substring(lastDot + 1).toUpperCase(Locale.ENGLISH));
}
37.字体为超大时,竖屏在解锁界面,解锁的图标显示不全:
适当加大72行的android:layout_weight=”1″
这样解锁部分的面积会增加,解决这个问题
其他分辨率需要修改其他layout文件夹下的keyguard_screen_tab_unlock.xml
38.音效里的Normal和Flat功能反:
gEqualizerPresets数组,名字可以随意修改
39.动态壁纸,线性光幕效果有黑块:
修改:
android\packages\wallpapers\Basic\src\com\android\wallpaper\nexus\NexusRS.java
@Override
public void setOffset(float xOffset, float yOffset, int xPixels, int yPixels) {
//mXOffset = xOffset;
//mScript.set_gXOffset(xOffset);
}
40.修改Setting里面各字体对应的大小:
<string-array name=”entryvalues_font_size” translatable=”false”>
<item>
0.85
</item>
<item>
1.0
</item>
<item>
1.15
</item>
<item>
1.30
</item>
</string-array>
默认是0.15的梯度 改成合适的梯度如
<string-array name=”entryvalues_font_size” translatable=”false”>
<item>
0.90
</item>
<item>
1.0
</item>
<item>
1.10
</item>
<item>
1.20
</item>
</string-array>
41.浏览器为Android模式时在线看视频卡:
1:在浏览时有时偶尔会退出
2:浏览器用android模式,看在线视频十几分钟左右后会卡,但用ipad模式不会卡
2。android模式采用的flash格式播放,而ipad采用的html5。flash由于自身格式和片源分割的关系,在线视频有机率产生不同步或卡顿问题。该问题由flash自身引起,这也是为何flash会逐渐被html5取代的一个方面。
42.Android4.0自动弹出USB:
修改 frameworks\base\packages\SystemUI\src\com\android\systemui\usb\StorageNotification.java
private void onStorageStateChangedAsync(String path, String oldState, String newState) { Slog.i(TAG, String.format( private void onStorageStateChangedAsync(String path, String oldState, String newState) { Slog.i(TAG, String.format( private void onStorageStateChangedAsync(String path, String oldState, String newState) {
...
//注释掉以下代码
// Intent intent = new Intent();// intent.setClass(mContext, com.android.systemui.usb.UsbStorageActivity.class);// PendingIntent pi = PendingIntent.getActivity(mContext, 0, intent, 0);// setUsbStorageNotification(// com.android.internal.R.string.usb_storage_stop_notification_title,// com.android.internal.R.string.usb_storage_stop_notification_message,// com.android.internal.R.drawable.stat_sys_warning, false, true, pi); //Intent intent = new Intent();
// Intent intent = new Intent();// intent.setClass(mContext, com.android.systemui.usb.UsbStorageActivity.class);// PendingIntent pi = PendingIntent.getActivity(mContext, 0, intent, 0);// setUsbStorageNotification(// com.android.internal.R.string.usb_storage_stop_notification_title,// com.android.internal.R.string.usb_storage_stop_notification_message,// com.android.internal.R.drawable.stat_sys_warning, false, true, pi) ;//intent.setClass(mContext, com.android.systemui.usb.UsbStorageActivity.class);
//PendingIntent pi = PendingIntent.getActivity(mContext, 0, intent, 0);
//setUsbStorageNotification(
// com.android.internal.R.string.usb_storage_stop_notification_title,
// com.android.internal.R.string.usb_storage_stop_notification_message,
// com.android.internal.R.drawable.stat_sys_warning, false, true, pi);
...
}
void updateUsbMassStorageNotification(boolean available) {
StorageManager mStorageManager = null;
if (available)
{
if(mContext != null)
{
mStorageManager = (StorageManager) mContext.getSystemService(Context.STORAGE_SERVICE);
}
else
{
Slog.w(TAG, "mContext is null ,getSystemService error !");
}
// Intent intent = new Intent();
// intent.setClass(mContext, com.android.systemui.usb.UsbStorageActivity.class);
// intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
// PendingIntent pi = PendingIntent.getActivity(mContext, 0, intent, 0);
// setUsbStorageNotification(
// com.android.internal.R.string.usb_storage_notification_title,
// com.android.internal.R.string.usb_storage_notification_message,
// com.android.internal.R.drawable.stat_sys_data_usb,
// false, true, pi);
if(mStorageManager != null)
{
mStorageManager.enableUsbMassStorage();
}
// intent.setClass(mContext, com.android.systemui.usb.UsbStorageActivity.class);// intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); PendingIntent pi = PendingIntent.getActivity(mContext, 0, intent, 0);// setUsbStorageNotification(// com.android.internal.R.string.usb_storage_notification_title,// com.android.internal.R.string.usb_storage_notification_message,// com.android.internal.R.drawable.stat_sys_data_usb,// false, true, pi);// intent.setClass(mContext, com.android.systemui.usb.UsbStorageActivity.class);// intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); PendingIntent pi = PendingIntent.getActivity(mContext, 0, intent, 0);// setUsbStorageNotification(// com.android.internal.R.string.usb_storage_notification_title,// com.android.internal.R.string.usb_storage_notification_message,// com.android.internal.R.drawable.stat_sys_data_usb,// false, true, pi);// intent.setClass(mContext, com.android.systemui.usb.UsbStorageActivity.class);// intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); PendingIntent pi = PendingIntent.getActivity(mContext, 0, intent, 0);// setUsbStorageNotification(// com.android.internal.R.string.usb_storage_notification_title,// com.android.internal.R.string.usb_storage_notification_message,// com.android.internal.R.drawable.stat_sys_data_usb,// false, true, pi);// intent.setClass(mContext, com.android.systemui.usb.UsbStorageActivity.class);// intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); PendingIntent pi = PendingIntent.getActivity(mContext, 0, intent, 0);// setUsbStorageNotification(// com.android.internal.R.string.usb_storage_notification_title,// com.android.internal.R.string.usb_storage_notification_message,// com.android.internal.R.drawable.stat_sys_data_usb,// false, true, pi);// intent.setClass(mContext, com.android.systemui.usb.UsbStorageActivity.class);// intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); PendingIntent pi = PendingIntent.getActivity(mContext, 0, intent, 0);// setUsbStorageNotification(// com.android.internal.R.string.usb_storage_notification_title,// com.android.internal.R.string.usb_storage_notification_message,// com.android.internal.R.drawable.stat_sys_data_usb,// false, true, pi);// intent.setClass(mContext, com.android.systemui.usb.UsbStorageActivity.class);// intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); PendingIntent pi = PendingIntent.getActivity(mContext, 0, intent, 0);// setUsbStorageNotification(// com.android.internal.R.string.usb_storage_notification_title,// com.android.internal.R.string.usb_storage_notification_message,// com.android.internal.R.drawable.stat_sys_data_usb,// false, true, pi)
}
else if(!mUmsAvailable || !atLeastOneDeviceMounted())
{
setUsbStorageNotification(0, 0, 0, false, false, null);
if(mStorageManager != null)
{
mStorageManager.disableUsbMassStorage();
}
}
}
43.电池提示无法获取电池使用数据:
android4.0 (1.2版本之后,之前没有此功能)
在device\softwinner\crane-xxx\overlay\frameworks\base\core\res\res\xml 目录下, 增加 power_profile.xml
power_profile.xml 内容如下
<?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"> <item name="none">0</item> <item name="screen.on">55</item> <item name="bluetooth.active">142</item> <item name="bluetooth.on">1</item> <item name="bluetooth.at">35690</item> <item name="screen.full">115</item> <item name="wifi.on">4</item> <item name="wifi.active">130</item> <item name="wifi.scan">104</item> <item name="dsp.audio">75</item> <item name="dsp.video">75</item> <item name="radio.active">300</item> <item name="gps.on">170</item> <item name="radio.scanning">70</item> <array name="radio.on"> <value>3</value> <value>3</value> </array> <array name="cpu.speeds"> <value>1000000</value> <value>900000</value> <value>800000</value> <value>700000</value> <value>600000</value> <value>500000</value> <value>400000</value> <value>300000</value> <value>200000</value> <value>100000</value> </array> <item name="cpu.idle">10</item> <array name="cpu.active"> <value>840</value> <value>760</value> <value>680</value> <value>520</value> <value>440</value> <value>360</value> <value>280</value> <value>200</value> <value>120</value> <value>40</value> </array> <item name="battery.capacity">1000</item></device>
<?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"> <item name="none">0</item> <item name="screen.on">55</item> <item name="bluetooth.active">142</item> <item name="bluetooth.on">1</item> <item name="bluetooth.at">35690</item> <item name="screen.full">115</item> <item name="wifi.on">4</item> <item name="wifi.active">130</item> <item name="wifi.scan">104</item> <item name="dsp.audio">75</item> <item name="dsp.video">75</item> <item name="radio.active">300</item> <item name="gps.on">170</item> <item name="radio.scanning">70</item> <array name="radio.on"> <value>3</value> <value>3</value> </array> <array name="cpu.speeds"> <value>1000000</value> <value>900000</value> <value>800000</value> <value>700000</value> <value>600000</value> <value>500000</value> <value>400000</value> <value>300000</value> <value>200000</value> <value>100000</value> </array> <item name="cpu.idle">10</item> <array name="cpu.active"> <value>840</value> <value>760</value> <value>680</value> <value>520</value> <value>440</value> <value>360</value> <value>280</value> <value>200</value> <value>120</value> <value>40</value> </array> <item name="battery.capacity">1000</item></device>
<?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"> <item name="none">0</item> <item name="screen.on">55</item> <item name="bluetooth.active">142</item> <item name="bluetooth.on">1</item> <item name="bluetooth.at">35690</item> <item name="screen.full">115</item> <item name="wifi.on">4</item> <item name="wifi.active">130</item> <item name="wifi.scan">104</item> <item name="dsp.audio">75</item> <item name="dsp.video">75</item> <item name="radio.active">300</item> <item name="gps.on">170</item> <item name="radio.scanning">70</item> <array name="radio.on"> <value>3</value> <value>3</value> </array> <array name="cpu.speeds"> <value>1000000</value> <value>900000</value> <value>800000</value> <value>700000</value> <value>600000</value> <value>500000</value> <value>400000</value> <value>300000</value> <value>200000</value> <value>100000</value> </array> <item name="cpu.idle">10</item> <array name="cpu.active"> <value>840</value> <value>760</value> <value>680</value> <value>520</value> <value>440</value> <value>360</value> <value>280</value> <value>200</value> <value>120</value> <value>40</value> </array> <item name="battery.capacity">1000</item></device>
<?xml version="1.0" encoding="utf-8"?>
<device name="Android">
<item name="none">0</item><item name="screen.on">55</item> <item name="bluetooth.active">142</item> <item name="bluetooth.on">1</item> <item name="bluetooth.at">35690</item> <item name="screen.full">115</item> <item name="wifi.on">4</item> <item name="wifi.active">130</item> <item name="wifi.scan">104</item> <item name="dsp.audio">75</item> <item name="dsp.video">75</item> <item name="radio.active">300</item> <item name="gps.on">170</item> <item name="radio.scanning">70</item>
<item name="screen.on">55</item>
<item name="bluetooth.active">142</item>
<item name="bluetooth.on">1</item>
<item name="bluetooth.at">35690</item>
<item name="screen.full">115</item>
<item name="wifi.on">4</item>
<item name="wifi.active">130</item>
<item name="wifi.scan">104</item>
<item name="dsp.audio">75</item>
<item name="dsp.video">75</item>
<item name="radio.active">300</item>
<item name="gps.on">170</item>
<item name="radio.scanning">70</item>
<array name="radio.on">
<value>3</value>
<value>3</value>
</array>
<array name="cpu.speeds">
<value>1000000</value>
<value>900000</value>
<value>800000</value>
<value>600000</value>
<value>400000</value>
<value>100000</value>
</array>
<item name="cpu.idle">6</item>
<array name="cpu.active">
<value>1008</value>
<value>960</value>
<value>860</value>
<value>680</value>
<value>440</value>
<value>40</value>
</array>
<item name="battery.capacity">1000</item>
</device>
44.Android2.3上开启U盘自扫描:
frameworks\base\core\java\android\provider\Settings.java
frameworks\base\packages\SettingsProvider\src\com\android\providers\settings\DatabaseHelper.java
packages\providers\MediaProvider\src\com\android\providers\media\MediaScannerReceiver.java
packages\providers\MediaProvider\src\com\android\providers\media\MediaScannerService.java
具体修改如若无法完成,可参考相关补丁包—-补丁呢!!!
45.如何降低CPU最高频率:
现象:目前系统为动态调频,如何限定最高CPU频率
降低CPU频率需要作以下两个修改:
1)在lichee\tools\pack\chips\sun5i\configs\android\xxx\sys_config1.fex文件(“xxx”为对应的方案配置文件目录)中修改启动频率:
[target]boot_clock =1008
boot_clock为启动的CPU频率,单位为MHz,根据需要自行修改,该值不能大于最高频率;
2)在lichee\linux-3.0\arch\arm\mach-sun4i\cpu-freq\cpu-freq.h文件中修改CPU的最高频率:
#define SUN4I_CPUFREQ_MAX (1008000000)
SUN4I_CPUFREQ_MAX为CPU允许运行的最高频率,单位是Hz,根据需要自行修改;
46、Android4.0阿拉伯语言的问题:
具体此问题,需要修改
frameworks\base\services\java\com\android\server\MountService.java
将
public int createSecureContainer(String id, int sizeMb, String fstype,String key, int ownerUid) {
。。。
String cmd = String.format(“asec create %s %d %s %s %d”, id, sizeMb, fstype, key, ownerUid);
修改为 String cmd = “asec create “+id+” “+ sizeMb+” “+ fstype+” “+ key+” “+ ownerUid;
47.摄像头在录像界面,使预览画面随录像分辨率变化:
<EncoderProfile quality=”720p” fileFormat=”mp4″ duration=”30″>
<Video codec=”h264″
bitRate=”3000000″
width=”1280“
height=”720“
frameRate=”30″ />
<Audio codec=”aac”
bitRate=”128000″
sampleRate=”44100″
channels=”2″ />
</EncoderProfile>
<EncoderProfile quality=”480p” fileFormat=”mp4″ duration=”30″>
<Video codec=”h264″
bitRate=”1500000″
width=”640″
height=”480″
frameRate=”25″ />
<Audio codec=”aac”
bitRate=”12200″
sampleRate=”8000″
channels=”1″ />
</EncoderProfile>
在camera.cfg文件中,对应的摄像头配置里面,需根据上面红色字体在
key_support_preview_size = 添加1280×720,640×480 跟录像设置的分辨率一样的预览支持分辨率
48、Nexus和Galaxy4动态壁纸的显示问题:
nexus
packages/wallpapers/Basic/src/com/android/wallpaper/nexus/NexusRS.java
69行resize函数
@Override
public void resize(int width, int height) {
super.resize(width, height); // updates mWidth, mHeight
// android.util.Log.d("NexusRS", String.format("resize(%d, %d)", width, height));
}
改成
@Override
public void resize(int width, int height) {
super.resize(width, height); // updates mWidth, mHeight
createProgramVertex();
// android.util.Log.d("NexusRS", String.format("resize(%d, %d)", width, height));
}
galaxy4
packages/wallpapers/Galaxy4/src/com/android/galaxy4/Galaxy4Wallpaper.java
onSurfaceChanged函数改为
@Override
public void onSurfaceChanged(SurfaceHolder surfaceHolder, int format, int width, int height) {
super.onSurfaceChanged(surfaceHolder, format, width, height);
if (mRenderScript != null) {
mRenderScript.setSurface(surfaceHolder, width, height);
}
if (mWallpaperRS == null) {
mWallpaperRS = new GalaxyRS();
mWallpaperRS.init(mRenderScript, getResources(), width, height);
mWallpaperRS.start();
}
mWallpaperRS.resize(width, height);
}
packages/wallpapers/Galaxy4/src/com/android/galaxy4/GalaxyRS.java文件,
添加如下代码
public void resize(int w,int h) {
mWidth = w;
mHeight = h;
createProgramVertex();
}
49、修改System/build.prop看不到相关变化:
解决方法:修改文件后,使用make systemimage-nodeps命令后,再pack
50、修改sys_config.fex,不升级整个固件,就使其生效:
mount -t vfat /dev/block/nanda /mnt/nand
2. 修改sys_config1后build固件,然后在lichee\tools\pack\out\bootfs下找到scrpt.bin和script0.bin
3. 然后用adb连接后,将scritp.bin和script0.bin推到所mount节点的根目录下,替换原有同名文件:
adb push script*.bin /mnt/nand/
4. 最后sync重启即可
adb shell
sync
reboot
51.修改浏览器默认浏览模式:
<ListPreference
39 android:key=”user_agent”
40 android:title=”@string/pref_development_uastring”
41 android:entries=”@array/pref_development_ua_choices”
42 android:entryValues=”@array/pref_development_ua_values”
43 android:defaultValue=”3″/>
中修改defaultValue的值,对应如下:
Android :0
Desktop :1
iPhone:2
iPad :3
Froyo-N1:4
Honeycomb-Xoom:5
52.电源管理不准以及低电不关机:
1. pmu_battery_rdc的值为100
2. pmu_battery_cap为正确的电池电量
3. pmu_bat_para的放电曲线校正
对于低电系统没有自动关机问题,一般尝试修改pmu_battery_cap:
pmu_bat_para4 = 0
pmu_bat_para5 = 5
53.如何单独替换内核:
mount -t vfat /dev/block/nanda /mnt/nand
然后用adb连接后,将bImage直接push到所mount节点的linux目录下,替换bImage:
adb push bImage /mnt/nand/linux
最后sync重启即可
adb shell
sync
reboot
54.摄像头Zoom功能生效:
修改packages/apps/Camera/src/com/android/camera/ui/IndicatorControlWheel.java
dispatchTouchEvent函数,第269行
if ((mZoomControl != null) && (index == 0)) { 改为
if ((mZoomControl != null) && (index == 0) && mCurrentLevel == 0) {
55.录象时不能选择分辨率:
摄像头录像时,选择分辨率的选项没有
如果想在720p和480p之间选择,在mediaprofile.xml文件中,按如下设置:
<CamcorderProfiles>
<EncoderProfile quality="720p" fileFormat="mp4" duration="30">
<Video codec="h264"
bitRate="3000000"
width="1280"
height="720"
frameRate="30" />
<Audio codec="aac"
bitRate="128000"
sampleRate="44100"
channels="2" />
</EncoderProfile>
<EncoderProfile quality="480p" fileFormat="mp4" duration="30">
<Video codec="h264"
bitRate="1500000"
width="640"
height="480"
frameRate="25" />
<Audio codec="aac"
bitRate="12200"
sampleRate="8000"
channels="1" />
</EncoderProfile>
<EncoderProfile quality="timelapse720p" fileFormat="mp4" duration="30">
<Video codec="h264"
bitRate="3000000"
width="1280"
height="720"
frameRate="30" />
<!-- audio setting is ignored -->
<Audio codec="aac"
bitRate="128000"
sampleRate="44100"
channels="2" />
</EncoderProfile>
<EncoderProfile quality="timelapse480p" fileFormat="mp4" duration="30">
<Video codec="h264"
bitRate="1500000"
width="640"
height="480"
frameRate="25" />
<Audio codec="aac"
bitRate="12200"
sampleRate="8000"
channels="1" />
</EncoderProfile>
<ImageEncoding quality="90" />
<ImageEncoding quality="80" />
<ImageEncoding quality="70" />
<ImageDecoding memCap="20000000" />
<Camera previewFrameRate="0" />
</CamcorderProfiles>
56.修改蓝牙名称:
文件external/bluetooth/bluez/src/main.c
将main_opts.name = g_strdup(“BlueZ”);里面的BlueZ换成你想要的名字即可!
57.为何用UsbManager调用getDeviceList获取设备列表总是空的:
http://www.oschina.net/code/download_src?file=android-4.0.1%2Fdata%2Fetc%2Fandroid.hardware.usb.host.xml
下载该文件,放在/system/etc/permisson/下,可以解决
58.低电自动关机重启:
1:boot阶段开机的门限电压设置方法 :
在sys_config1脚本中
[boot_extend]
vol_threshold = 3500
2:修改Android 低电关机的门限
BatteryService.java
// shut down gracefully if our battery is critically low and we are not powered.
// wait until the system has booted before attempting to display the shutdown dialog.
if (mBatteryLevel <
5 && (
5为5%即可关机修改 为更大的值,具体值可以根据具体情况而定)
59.修改鼠标的按键定义:
uint32_t CursorButtonAccumulator::getButtonState() const {
uint32_t result = 0;
if (mBtnLeft) {
result |= AMOTION_EVENT_BUTTON_PRIMARY;
}
if (mBtnRight) {
result |= AMOTION_EVENT_BUTTON_SECONDARY;
}
if (mBtnMiddle) {
result |= AMOTION_EVENT_BUTTON_TERTIARY;
}
if (mBtnBack || mBtnSide) {
result |= AMOTION_EVENT_BUTTON_BACK;
}
if (mBtnForward || mBtnExtra) {
result |= AMOTION_EVENT_BUTTON_FORWARD;
}
return result;
}
目前因为下面函数
static bool isPointerDown(int32_t buttonState) {
return buttonState &
(AMOTION_EVENT_BUTTON_PRIMARY | AMOTION_EVENT_BUTTON_SECONDARY
| AMOTION_EVENT_BUTTON_TERTIARY);
}
将鼠标左右键的功能设置成判断鼠标是否点击的操作,所以功能一致,如果需要修改,这需要改一下上面的getButtonState函数中的标志位即可,比如需要将右键改为后退键,只需要
函数中:
if (mBtnRight) {
result |= AMOTION_EVENT_BUTTON_SECONDARY;
}
改为
if (mBtnRight) {
result |= AMOTION_EVENT_BUTTON_BACK;
}
即可。
60.修改system分区大小:
1。修改sys_config.fex中的
[partition3]
class_name = DISK
name = system
size_hi = 0
size_lo = 524288 //此处单位为K
user_type = 2
ro = 0
2。修改device对应目录下的BoardConfig.mk中的
BOARD_SYSTEMIMAGE_PARTITION_SIZE := 536870912 //此处单位为byte
今天的文章WinXW_android分享到此就结束了,感谢您的阅读。
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
如需转载请保留出处:https://bianchenghao.cn/65551.html