- 浏览: 24174 次
- 性别:
- 来自: 上海
最新评论
文章列表
安装apk慢是因为dex2oat行为导致的,要优化可以牺牲一些检查,强制用vmSafeMode去安装,facebook举例,低端机器从安装10分钟改善为1分钟不到。修改方法如下:
1 diff --git a/base/services/core/java/com/android/server/pm/PackageDexOptimizer.java b/base/services/core/java/com/android/server/pm/PackageDexOptimizer.java
2 index f35552d..8ae1e13 100644
3 --- a/base/s ...
1 diff --git a/base/services/core/java/com/android/server/pm/PackageManagerService.java b/base/services/core/java/com/android/server/pm/PackageManagerService.java
2 index 9af1605..cd1ddf3 100644
3 --- a/base/services/core/java/com/android/server/pm/PackageManagerService.java
4 +++ b/base/serv ...
Runtime permission介绍:
-M版本,若app支持新的permission模式,用户在安装或升级app时就不会获取到任何runtime权限
-App需要在使用permission前请求权限
-用户可以在“设置->应用”菜单选择app然后修改app的权限设置
-仅对SDK大于等于23的app生效(M版本后,Google XTS测试项要求app SDK需大于等于23,否则fail)
-不是所有的permission都是runtime permissions
-用protection level来区分permission
-只有dangerous permission ...
google在external storage的权限限制导致的原因
要解决问题,需要给external storage 一个media rw权限就可以
diff --git a/base/services/core/java/com/android/server/SystemConfig.java b/base/services/core/java/com/android/server/SystemConfig.java
index cf2a49f..88dd54d 100644
--- a/base/services/core/java/com/android/server/SystemCo ...
修改framework android policy
在PhoneWindowmanager.java中做如下修改即可
if (keyCode == KeyEvent.KEYCODE_HOME) {
// If we have released the home key, and didn't do anything else
// while it was pressed, then it is time to go home!
+/* Thu, 29 Jan 2015 17:24:38 +0800
+ *
+ */
...
1.在源码的根目录下
cd vendor
mkdir customizeapk
在 customizeapk 下再次创建 custom 文件夹
将要编译的apk 放在custom目录中 注意文件名不要带空格、非法字符如中文符号、#、()等
2.编写android.mk,内容如下:
LOCAL_PATH:= $(my-dir)
copy_from := \
HAS_CUSTOM:= $(shell test -d $(LOCAL_PATH)/custom && echo yes)
ifeq ($(HAS_CUSTOM), yes)
$(shell mkdir -p ...
[Description]
如何修改默认输入法?
[Solution]
一、适用于ICS(Android V4.0)之前的版本:
1. 安装需要用的默认输入法(.apk)到system/app
2. 修改文件 frameworks/base/packages/SettingsProvider/res/values/defaults.xml
<string name="default_input_method" translatable="false">默认输入法 ID</string>
红色标记表示输入法 ID,比如 PinyinI ...
mtk 相机差值都做在对应sensor的config featue table中,差值直白点就是自定义一个像素大小,比如640x480
举个例子:
5M ov5640摄像头,差值到8M,可以在其feature table中的picture size数组中,添加入一个8M像素大小 3264x2448
那么这个值怎么来的呢?根据计算得来的,例如axb,要得到一个8M像素,需满足如下条件:
1.a * b 约等于 8000000
2.a ,b 都是16的倍数
3.a:b = 4:3(正常都是4:3,还有全屏比如qhd 16:9等)
当然,sensor那边加入,如果上层应用不加,那么应用是不会显 ...
可以在ProjectConfig.mk中打开以下宏
MTK_LCA_RAM_OPTIMIZE = yes
RESOURCE_OVERLAY_SUPPORT 里面加入 LCA_ram
public class SoftListAdapter extends BaseAdapter {
private Context context;
private ArrayList<Map<String, Object>> list;
public SoftListAdapter(Context con, ArrayList<Map<String, Object>> lis) {
this.context = con;
this.list = lis;
}
// 决定 getView循环几次
@Ov ...
public class MySimpleCursorAdapter extends SimpleCursorAdapter {
private LayoutInflater mInflater;
private OnMyAdaptertListener mListener;
int[] ids;
String[] str;
int layoutId;
@SuppressWarnings("deprecation")
public MySimpleCursorAdapter(Context context, int layout, Cursor ...
PackageManager pkgManager = mContext.getPackageManager();
// 需要system权限
PackageDeleteObserver observer = new PackageDeleteObserver(currVirus, 1);
pkgManager.deletePackage(pakName, observer, 0);
private class PackageDeleteObserver extends IPackageDeleteObserver.Stub {
private int posit ...
Android后台发送短信方法
- 博客分类:
- Android
// 根据设置,是否发送短信
public static void autoSendMsg(Context context, String number) {
if (HouseKeeperPreferences.getAutoSendMsgConfig(context)) {//判断自动发送配置是否打开
SmsManager smsManager = SmsManager.getDefault();
String smsText = HouseKeeperPreferences
.getSmsContentConfig(context);//保存的自动回 ...
Android播放音乐方法
- 博客分类:
- Android
private void playRingTone() {
if (HouseKeeperPreferences.getInComingCallConfig(mContext)) {
Uri alert = Uri.parse(HouseKeeperPreferences
.getRingToneConfig(mContext));//这里的String是音乐文件路径,可很好的结合RingTonePreferences组件使用
final MediaPlayer mMediaPlayer = new MediaPlayer();
try {
...
直接上Patch
--- AlarmKlaxon.java.bk 2012-08-28 10:50:19.737235871 +0800
+++ AlarmKlaxon.java 2012-08-28 10:50:12.167235883 +0800
@@ -49,7 +49,7 @@
*/
public class AlarmKlaxon extends Service {
// Default of 10 minutes until alarm is silenced.
- private static final String DEFAULT_ALARM_ ...