安装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/services/core/java/com/android/server/pm/PackageDexOptimizer.java
4 +++ b/base/services/core/java/com/android/server/pm/PackageDexOptimizer.java
5 @@ -115,7 +115,12 @@ final class PackageDexOptimizer {
6 return DEX_OPT_SKIPPED;
7 }
8
9 +/*
10 final boolean vmSafeMode = (pkg.applicationInfo.flags & ApplicationInfo.FLAG_VM_SAFE_MODE) != 0;
11 + */
12 + boolean vmSafeMode = (pkg.applicationInfo.flags & ApplicationInfo.FLAG_VM_SAFE_MODE) != 0;
13 final boolean debuggable = (pkg.applicationInfo.flags & ApplicationInfo.FLAG_DEBUGGABLE) != 0;
14
15 final List<String> paths = pkg.getAllCodePathsExcludingResourceOnly();
16 @@ -171,6 +176,13 @@ final class PackageDexOptimizer {
17 throw new IllegalStateException("Invalid dexopt needed: " + dexoptNeeded);
18 }
19
20 + if (pkg.applicationInfo.packageName.contains("facebook")) {
21 + vmSafeMode = true;
22 + }
23 Log.i(TAG, "Running dexopt (" + dexoptType + ") on: " + path + " pkg="
24 + pkg.applicationInfo.packageName + " isa=" + dexCodeInstructionSet
25 + " vmSafeMode=" + vmSafeMode + " debuggable=" + debuggable
分享到:
相关推荐
On-device low-memory testing for Android. Fill your phone's RAM and see how your application performs. Download the app, tap the Fill Memory button, and re-open your app - hopefully nothing breaks :) ...
最近穿戴设备发展得很火,把相关技术也带旺了,其中一项是BLE(Bluetooth Low Energy)。BLE是蓝牙4.0的核心Profile,主打功能是快速搜索,快速连接,超低功耗保持连接和传输数据,弱点是数据传输速率低,由于BLE的...
1.You can import the module lowpoly to your project by Android Studio 2.LowPoly is available in the MavenCentral, so getting it as simple as adding it as a dependency compile '...
Human Interface Device over Bluetooth Low Energy,ble的hid参考资料
Bluetooth Low Energy in Android Java Your Guide to Programming the Internet of Things 英文azw3 本资源转载自网络,如有侵权,请联系上传者或csdn删除 本资源转载自网络,如有侵权,请联系上传者或csdn删除
> 能够生成low poly风格的图片,Android版本的实现 效果图 使用方法 LowPoly.generate(inputStream,outputStream); 或者 /** * 生成low poly风格的图片 * * @param inputStream 源图片 * @param outputStream ...
The nRF Toolbox is a container app that stores your Nordic Semiconductor apps for Bluetooth Low Energy in one location. ... 编译好的apk,直接安装运行
The first is the direct Device-to-Device (D2D) communications, which enables direct links between the wireless devices that reutilize the cellular spectrum and radio interface. The second is that of ...
Bluetooth Low Energy in Android Java Your Guide to Programming the Internet of Things 英文无水印pdf pdf所有页面使用FoxitReader和PDF-XChangeViewer测试都可以打开 本资源转载自网络,如有侵权,请联系...
在以前的版本中添加了新的接口,使用更方便更好操作手机低功耗蓝牙
陳俊宏的教學投影片 High-level introduction to Android low-level 主要在介紹Adnroid的架構,如kernel, apk...,也有範例
the structure of the Android development project and implementation of core services (wireless communication, data storage and other low-level functions). Finally, it will focus on teaching readers ...
jitsi-android-master\build.xml:70: The SDKBuild Tools revision (19.0.2) is too low for project 'jitsi-android'. Minimumrequired is 19.1.0 解决:打开android sdk manager,安装19.1.0的 build tool 3....
Cyclone® III device family offers a unique combination of high functionality, low power and low cost. Based on Taiwan Semiconductor Manufacturing Company (TSMC) low-power (LP) process technology, ...
一个基于Rx java的Android库,用于将图像转换为lowpoly
available memory is low错误解决-MyEclipse优化设置-最优设置
Graphics Device Interface (GDI) is a library that collects all low-level graphics APIs. MMI application should access LCD via GDI library. GDI library provide several feature for MMI framework. Some ...
转自作者:《Google搜索引擎优化指南》由谷歌推出,当看到谷歌推出这个指南时,觉得这是谷歌的一个很伟大的作法,所以在11月13日下午看到这篇指南时就有了翻译为中文的想法。知道我的朋友都知道我的英文不好,因此这...
低成本腦控設備設計開發, 腦機介面硬件設計 腦波儀 EEG Device.