1. 程式人生 > >How To Improving Android Boot Time

How To Improving Android Boot Time

diff --git a/build/target/product/core.mk b/build/target/product/core.mk
index 3b5a42c..4d9ed7e 100755
--- a/build/target/product/core.mk
+++ b/build/target/product/core.mk
@@ -76,13 +76,13 @@ PRODUCT_PROPERTY_OVERRIDES := \
     DefaultContainerService \
     Bugreport
 +
 PRODUCT_PACKAGES := \
     bouncycastle \
     com.android.location.provider \
     com.android.location.provider.xml \
     core \
     core-junit \
-    create_test_dmtrace \
dalvikvm \ dexdeps \ dexdump \ @@ -92,13 +92,6 @@ PRODUCT_PACKAGES := \ dvz \ dx \ ext \ - framework-res \ - hprof-conv \ - icu.dat \ - jasmin \ - jasmin.jar \ - libcrypto \ - libdex \ libdvm \ libexpat \ libicui18n \ @@ -108,29 +101,26 @@ PRODUCT_PACKAGES := \
libsqlite_jni \ libssl \ libz \ - sqlite-jdbc \ - Browser \ - Home \ - HTMLViewer \ + hprof-conv \ + icu.dat \ + jasmin \ + jasmin.jar \ + libcrypto \ + libdex \ + CertInstaller \ + DrmProvider \ + framework-res \ ApplicationsProvider \ + DownloadProvider \
MediaProvider \ SettingsProvider \ UserDictionaryProvider \ - DefaultContainerService + DefaultContainerService \ + BootStart  -#Phone \ - libnfc_ndef \ - PicoTts \ - ContactsProvider \ - Contacts \ - DownloadProvider \ - DownloadProviderUi \ - TelephonyProvider \ - TtsService \ - VpnServices \ - PackageInstaller \ - Bugreport + #Launcher2 + #BootStart   # host-only dependencies ifeq ($(WITH_HOST_DALVIK),true) diff --git a/build/target/product/full.mk b/build/target/product/full.mk index c204aad..9736ca3 100755 --- a/build/target/product/full.mk +++ b/build/target/product/full.mk @@ -19,7 +19,7 @@ # build of the emulator, but all those aspects can be overridden # in inherited configurations.  -PRODUCT_PACKAGES := \ +#PRODUCT_PACKAGES := \ OpenWnn \ PinyinIME \ VoiceDialer \ @@ -27,6 +27,13 @@ PRODUCT_PACKAGES := \ libWnnJpnDic \ libwnndict  +# Disable By: Bian Jiang 2012.2.26 +PRODUCT_PACKAGES := \ + OpenWnn \ + libWnnEngDic \ + libwnndict + + # Additional settings used in all AOSP builds PRODUCT_PROPERTY_OVERRIDES := \ keyguard.no_require_sim=true \ diff --git a/build/target/product/generic.mk b/build/target/product/generic.mk index 13970f9..06e358c 100755 --- a/build/target/product/generic.mk +++ b/build/target/product/generic.mk @@ -49,7 +49,6 @@   # AccountAndSyncSettings \ Music \ - CertInstaller \ PstnPhone \ DeskClock \ AlarmProvider \ @@ -67,14 +66,14 @@ CalendarProvider \ SyncProvider \ Updater \ - DrmProvider \ + Settings \  -PRODUCT_PACKAGES := \ - Camera \ + + +# Camera \ CameraVideo \ LatinIME \ Launcher2 \ - Settings \ SystemUI   diff --git a/build_android.sh b/build_android.sh index 5e75d99..3806ada 100755 --- a/build_android.sh +++ b/build_android.sh @@ -3,6 +3,9 @@ CPU_JOB_NUM=$(grep processor /proc/cpuinfo | awk '{field=$NF};END{print field+1}') CLIENT=$(whoami)  +# Enable BootChart By: Bian Jiang 2012.2.23 +export INIT_BOOTCHART=true + ROOT_DIR=$(pwd) KERNEL_DIR=../kernel-tss   diff --git a/device/samsung/smdkc110/device.mk b/device/samsung/smdkc110/device.mk index b35f686..00a437e 100644 --- a/device/samsung/smdkc110/device.mk +++ b/device/samsung/smdkc110/device.mk @@ -111,8 +111,9 @@ PRODUCT_PACKAGES += \ libcamera \ libstagefrighthw  +# Disable By: Bian Jiang 2012.2.27 # Apps -PRODUCT_PACKAGES += \ +#PRODUCT_PACKAGES += \ VoiceDialer \ SpeechRecorder \ LiveWallpapersPicker \ @@ -121,10 +122,16 @@ PRODUCT_PACKAGES += \ VisualizationWallpapers \ librs_jni  +PRODUCT_PACKAGES += \ + MagicSmokeWallpapers \ + librs_jni + + # These are the hardware-specific features PRODUCT_COPY_FILES += \ - frameworks/base/data/etc/handheld_core_hardware.xml:system/etc/permissions/handheld_core_hardware.xml \ - packages/wallpapers/LivePicker/android.software.live_wallpaper.xml:system/etc/permissions/android.software.live_wallpaper.xml + frameworks/base/data/etc/handheld_core_hardware.xml:system/etc/permissions/handheld_core_hardware.xml + +# packages/wallpapers/LivePicker/android.software.live_wallpaper.xml:system/etc/permissions/android.software.live_wallpaper.xml   # The OpenGL ES API level that is natively supported by this device. # This is a 16.16 fixed point number diff --git a/device/samsung/smdkc110/init.rc b/device/samsung/smdkc110/init.rc index 73ba7dd..d6de087 100644 --- a/device/samsung/smdkc110/init.rc +++ b/device/samsung/smdkc110/init.rc @@ -5,13 +5,13 @@ on init   sysclktz 0  -#loglevel 3 -loglevel 7 +loglevel 3 +#loglevel 7   # setup the global environment export PATH /sbin:/vendor/bin:/system/sbin:/system/bin:/system/xbin export LD_LIBRARY_PATH /vendor/lib:/system/lib - export ANDROID_BOOTLOGO 1 + export ANDROID_BOOTLOGO 0 export ANDROID_ROOT /system export ANDROID_ASSETS /system/app export ANDROID_DATA /data @@ -94,13 +94,13 @@ on fs # mount mtd partitions # Mount /system rw first to give the filesystem a chance to save a checkpoint mount yaffs2 [email protected] /system - mount yaffs2 [email protected] /system ro remount +#mount yaffs2 [email protected] /system ro remount mount yaffs2 [email protected] /data nosuid nodev mount yaffs2 [email protected] /cache nosuid nodev   on post-fs # once everything is setup, no need to modify / - mount rootfs rootfs / ro remount +#mount rootfs rootfs / ro remount   # We chown/chmod /data again so because mount is run as root + defaults chown system system /data @@ -336,11 +336,11 @@ service media /system/bin/mediaserver group system audio camera graphics inet net_bt net_bt_admin net_raw ioprio rt 4  -service bootanim /system/bin/bootanimation - user graphics - group graphics - disabled - oneshot +#service bootanim /system/bin/bootanimation +# user graphics +# group graphics +# disabled +# oneshot   service dbus /system/bin/dbus-daemon --system --nofork socket dbus stream 660 bluetooth bluetooth diff --git a/device/samsung/smdkc110/setup-makefiles.sh b/device/samsung/smdkc110/setup-makefiles.sh index e2b0501..622cf00 100644 --- a/device/samsung/smdkc110/setup-makefiles.sh +++ b/device/samsung/smdkc110/setup-makefiles.sh @@ -36,17 +36,23 @@ mkdir -p ../../../vendor/$MANUFACTURER/$DEVICE   # This file is generated by device/__MANUFACTURER__/__DEVICE__/setup-makefiles.sh  +# Disable By: Bian Jiang 2012.2.26 # Live wallpaper packages -PRODUCT_PACKAGES := \\ - LiveWallpapers \\ - LiveWallpapersPicker \\ - MagicSmokeWallpapers \\ - VisualizationWallpapers \\ +#PRODUCT_PACKAGES := \ +# LiveWallpapers \ +# LiveWallpapersPicker \ +# MagicSmokeWallpapers \ +# VisualizationWallpapers \ +# librs_jni + +PRODUCT_PACKAGES := \ + MagicSmokeWallpapers \ librs_jni  + # Publish that we support the live wallpaper feature. -PRODUCT_COPY_FILES := \\ - packages/wallpapers/LivePicker/android.software.live_wallpaper.xml:/system/etc/permissions/android.software.live_wallpaper.xml +#PRODUCT_COPY_FILES := \\ +# packages/wallpapers/LivePicker/android.software.live_wallpaper.xml:/system/etc/permissions/android.software.live_wallpaper.xml   # Pick up overlay for features that depend on non-open-source files DEVICE_PACKAGE_OVERLAYS := vendor/__MANUFACTURER__/__DEVICE__/overlay diff --git a/device/samsung/smdkv210/device.mk b/device/samsung/smdkv210/device.mk index 421f03f..6845533 100644 --- a/device/samsung/smdkv210/device.mk +++ b/device/samsung/smdkv210/device.mk @@ -112,7 +112,7 @@ PRODUCT_PACKAGES += \ libstagefrighthw   # Apps -PRODUCT_PACKAGES += \ +#PRODUCT_PACKAGES += \ VoiceDialer \ SpeechRecorder \ LiveWallpapersPicker \ @@ -123,8 +123,9 @@ PRODUCT_PACKAGES += \   # These are the hardware-specific features PRODUCT_COPY_FILES += \ - frameworks/base/data/etc/handheld_core_hardware.xml:system/etc/permissions/handheld_core_hardware.xml \ - packages/wallpapers/LivePicker/android.software.live_wallpaper.xml:system/etc/permissions/android.software.live_wallpaper.xml + frameworks/base/data/etc/handheld_core_hardware.xml:system/etc/permissions/handheld_core_hardware.xml + +# packages/wallpapers/LivePicker/android.software.live_wallpaper.xml:system/etc/permissions/android.software.live_wallpaper.xml   # The OpenGL ES API level that is natively supported by this device. # This is a 16.16 fixed point number diff --git a/frameworks/base/core/java/android/app/ActivityThread.java b/frameworks/base/core/java/android/app/ActivityThread.java index 78df780..8add7a3 100644 --- a/frameworks/base/core/java/android/app/ActivityThread.java +++ b/frameworks/base/core/java/android/app/ActivityThread.java @@ -3505,6 +3505,14 @@ public final class ActivityThread { final java.lang.ClassLoader cl = c.getClassLoader(); localProvider = (ContentProvider)cl. loadClass(info.name).newInstance(); + + if (localProvider == null) { + Slog.e(TAG, "LocalProvider Failed to instantiate class " + + info.name + " from sourceDir " + + info.applicationInfo.sourceDir); + return null; + } + provider = localProvider.getIContentProvider(); if (provider == null) { Slog.e(TAG, "Failed to instantiate class " + diff --git a/frameworks/base/core/java/android/app/NotificationManager.java b/frameworks/base/core/java/android/app/NotificationManager.java index 1fae516..9b37723 100644 --- a/frameworks/base/core/java/android/app/NotificationManager.java +++ b/frameworks/base/core/java/android/app/NotificationManager.java @@ -135,6 +135,9 @@ public class NotificationManager { INotificationManager service = getService(); String pkg = mContext.getPackageName(); + if (service == null || pkg == null) { + return; + } if (localLOGV) Log.v(TAG, pkg + ": cancel(" + id + ")"); try { service.cancelNotificationWithTag(pkg, tag, id); @@ -150,6 +153,9 @@ public class NotificationManager { INotificationManager service = getService(); String pkg = mContext.getPackageName(); + if (service == null || pkg == null) { + return; + } if (localLOGV) Log.v(TAG, pkg + ": cancelAll()"); try { service.cancelAllNotifications(pkg); diff --git a/frameworks/base/core/java/android/content/ContentService.java b/frameworks/base/core/java/android/content/ContentService.java index fc2dfc0..de1cdf1 100644 --- a/frameworks/base/core/java/android/content/ContentService.java +++ b/frameworks/base/core/java/android/content/ContentService.java @@ -40,7 +40,7 @@ import java.util.List; public final class ContentService extends IContentService.Stub { private static final String TAG = "ContentService"; private Context mContext; - private boolean mFactoryTest; + private boolean mFactoryTest = false; private final ObserverNode mRootNode = new ObserverNode(""); private SyncManager mSyncManager = null; private final Object mSyncManagerLock = new Object(); @@ -457,6 +457,8 @@ public final class ContentService extends IContentService.Stub { }   public static IContentService main(Context context, boolean factoryTest) { + // Add By: Bian Jiang 2012.2.29 + factoryTest = true; ContentService service = new ContentService(context, factoryTest); ServiceManager.addService(ContentResolver.CONTENT_SERVICE_NAME, service); return service; diff --git a/frameworks/base/core/java/android/content/SyncManager.java b/frameworks/base/core/java/android/content/SyncManager.java index 26b6ad7..ed2d0af 100644 --- a/frameworks/base/core/java/android/content/SyncManager.java +++ b/frameworks/base/core/java/android/content/SyncManager.java @@ -309,6 +309,9 @@ public class SyncManager implements OnAccountsUpdateListener{ mSyncStorageEngine = SyncStorageEngine.getSingleton(); mSyncQueue = new SyncQueue(mSyncStorageEngine);  + // Add By: Bian Jiang 2012.2.29 + factoryTest = true; + mContext = context;   HandlerThread syncThread = new HandlerThread("SyncHandlerThread", diff --git a/frameworks/base/core/java/android/view/accessibility/AccessibilityManager.java b/frameworks/base/core/java/android/view/accessibility/AccessibilityManager.java index 0186270..ba0c30c 100644 --- a/frameworks/base/core/java/android/view/accessibility/AccessibilityManager.java +++ b/frameworks/base/core/java/android/view/accessibility/AccessibilityManager.java @@ -58,7 +58,7 @@ public final class AccessibilityManager {   final Handler mHandler;  - boolean mIsEnabled; + boolean mIsEnabled = false;   final IAccessibilityManagerClient.Stub mClient = new IAccessibilityManagerClient.Stub() { public void setEnabled(boolean enabled) { @@ -110,6 +110,10 @@ public final class AccessibilityManager { IBinder iBinder = ServiceManager.getService(Context.ACCESSIBILITY_SERVICE); mService = IAccessibilityManager.Stub.asInterface(iBinder); try { + if (mService == null) { + mIsEnabled = false; + return; + } mService.addClient(mClient); } catch (RemoteException re) { Log.e(LOG_TAG, "AccessibilityManagerService is dead", re); diff --git a/frameworks/base/core/java/android/view/inputmethod/InputMethodManager.java b/frameworks/base/core/java/android/view/inputmethod/InputMethodManager.java index e30687f..d7ff8c0 100644 --- a/frameworks/base/core/java/android/view/inputmethod/InputMethodManager.java +++ b/frameworks/base/core/java/android/view/inputmethod/InputMethodManager.java @@ -904,7 +904,7 @@ public final class InputMethodManager {   // Make sure we have a window token for the served view. if (DEBUG) Log.v(TAG, "Starting input: view=" + view); - if (view == null) { + if (view == null || mService == null) { if (DEBUG) Log.v(TAG, "ABORT input: no served view!"); return; } @@ -1146,6 +1146,9 @@ public final class InputMethodManager { try { final boolean isTextEditor = focusedView != null &amp;&amp; focusedView.onCheckIsTextEditor(); + if (mService == null) { + return; + } mService.windowGainedFocus(mClient, rootView.getWindowToken(), focusedView != null, isTextEditor, softInputMode, first, windowFlags); diff --git a/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java b/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java index f0e5517..9072caf 100644 --- a/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java +++ b/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java @@ -561,9 +561,14 @@ public class ZygoteInit { registerZygoteSocket(); EventLog.writeEvent(LOG_BOOT_PROGRESS_PRELOAD_START, SystemClock.uptimeMillis()); + + + EventLog.writeEvent(LOG_BOOT_PROGRESS_PRELOAD_END, SystemClock.uptimeMillis());   diff --git a/frameworks/base/libs/utils/ZipFileRO.cpp b/frameworks/base/libs/utils/ZipFileRO.cpp index 4261196..a5d515b 100644 --- a/frameworks/base/libs/utils/ZipFileRO.cpp +++ b/frameworks/base/libs/utils/ZipFileRO.cpp @@ -349,11 +349,14 @@ bool ZipFileRO::parseZipArchive(void) goto bail; }  +   unsigned int fileNameLen, extraLen, commentLen, hash;   diff --git a/frameworks/base/packages/SettingsProvider/res/xml/bookmarks.xml b/frameworks/base/packages/SettingsProvider/res/xml/bookmarks.xml index dfaeeaf..b695afe 100644 --- a/frameworks/base/packages/SettingsProvider/res/xml/bookmarks.xml +++ b/frameworks/base/packages/SettingsProvider/res/xml/bookmarks.xml @@ -15,6 +15,7 @@ --&gt;  +<!-- <bookmark package="com.android.browser" class="com.android.browser.BrowserActivity" @@ -39,12 +40,10 @@ package="com.android.calendar" class="com.android.calendar.LaunchActivity" shortcut="l" /> -<!-- <bookmark package="com.google.android.apps.maps" class="com.google.android.maps.MapsActivity" shortcut="m" /> --->  +--&gt;   diff --git a/frameworks/base/services/java/com/android/server/ConnectivityService.java b/frameworks/base/services/java/com/android/server/ConnectivityService.java index a663c3a..f51fb32 100644 --- a/frameworks/base/services/java/com/android/server/ConnectivityService.java +++ b/frameworks/base/services/java/com/android/server/ConnectivityService.java @@ -66,7 +66,7 @@ public class ConnectivityService extends IConnectivityManager.Stub { "android.telephony.apn-restore";  - private Tethering mTethering; + private Tethering mTethering = null; private boolean mTetheringConfigValid = false;   if (DBG) { mInetLog = new ArrayList(); } @@ -953,6 +954,9 @@ public class ConnectivityService extends IConnectivityManager.Stub { */ private void handleDisconnect(NetworkInfo info) {  + if (info == null) { + return; + } int prevNetType = info.getType();   mNetTrackers[prevNetType].setTeardownRequested(false); @@ -974,6 +978,9 @@ public class ConnectivityService extends IConnectivityManager.Stub { }   Intent intent = new Intent(ConnectivityManager.CONNECTIVITY_ACTION); + if (intent == null) { + return; + } intent.putExtra(ConnectivityManager.EXTRA_NETWORK_INFO, info); if (info.isFailover()) { intent.putExtra(ConnectivityManager.EXTRA_IS_FAILOVER, true); @@ -1457,7 +1464,9 @@ public class ConnectivityService extends IConnectivityManager.Stub { } pw.println();  - mTethering.dump(fd, pw, args); + if (mTethering != null) { + mTethering.dump(fd, pw, args); + }   if (mInetLog != null) { pw.println(); @@ -1599,7 +1608,7 @@ public class ConnectivityService extends IConnectivityManager.Stub { public int tether(String iface) { enforceTetherChangePermission();  - if (isTetheringSupported()) { + if (isTetheringSupported() &amp;&amp; mTethering != null) { return mTethering.tether(iface); } else { return ConnectivityManager.TETHER_ERROR_UNSUPPORTED; @@ -1610,7 +1619,7 @@ public class ConnectivityService extends IConnectivityManager.Stub { public int untether(String iface) { enforceTetherChangePermission();  - if (isTetheringSupported()) { + if (isTetheringSupported() &amp;&amp; mTethering != null) { return mTethering.untether(iface); } else { return ConnectivityManager.TETHER_ERROR_UNSUPPORTED; @@ -1621,7 +1630,7 @@ public class ConnectivityService extends IConnectivityManager.Stub { public int getLastTetherError(String iface) { enforceTetherAccessPermission();  - if (isTetheringSupported()) { + if (isTetheringSupported() &amp;&amp; mTethering != null) { return mTethering.getLastTetherError(iface); } else { return ConnectivityManager.TETHER_ERROR_UNSUPPORTED; @@ -1631,7 +1640,7 @@ public class ConnectivityService extends IConnectivityManager.Stub { // TODO - proper iface API for selection by property, inspection, etc public String[] getTetherableUsbRegexs() { enforceTetherAccessPermission(); - if (isTetheringSupported()) { + if (isTetheringSupported() &amp;&amp; mTethering != null) { return mTethering.getTetherableUsbRegexs(); } else { return new String[0]; @@ -1640,7 +1649,7 @@ public class ConnectivityService extends IConnectivityManager.Stub {   public String[] getTetherableWifiRegexs() { enforceTetherAccessPermission(); - if (isTetheringSupported()) { + if (isTetheringSupported() &amp;&amp; mTethering != null) { return mTethering.getTetherableWifiRegexs(); } else { return new String[0]; @@ -1651,16 +1660,25 @@ public class ConnectivityService extends IConnectivityManager.Stub { // javadoc from interface public String[] getTetherableIfaces() { enforceTetherAccessPermission(); + if (mTethering == null) { + return null; + } return mTethering.getTetherableIfaces(); }   public String[] getTetheredIfaces() { enforceTetherAccessPermission(); + if (mTethering == null) { + return null; + } return mTethering.getTetheredIfaces(); }   public String[] getTetheringErroredIfaces() { enforceTetherAccessPermission(); + if (mTethering == null) { + return null; + } return mTethering.getErroredIfaces(); }   diff --git a/frameworks/base/services/java/com/android/server/NotificationManagerService.java b/frameworks/base/services/java/com/android/server/NotificationManagerService.java index e8c1613..bbcef6c 100644 --- a/frameworks/base/services/java/com/android/server/NotificationManagerService.java +++ b/frameworks/base/services/java/com/android/server/NotificationManagerService.java @@ -1005,6 +1005,9 @@ public class NotificationManagerService extends INotificationManager.Stub }   public void cancelAllNotifications(String pkg) { + if (pkg == null) { + return; + } checkIncomingCall(pkg);   // Calling from user space, don't allow the canceling of actively diff --git a/frameworks/base/services/java/com/android/server/SystemServer.java b/frameworks/base/services/java/com/android/server/SystemServer.java index df69b76..8ee2f04 100644 --- a/frameworks/base/services/java/com/android/server/SystemServer.java +++ b/frameworks/base/services/java/com/android/server/SystemServer.java @@ -111,6 +111,9 @@ class ServerThread extends Thread { int factoryTest = "".equals(factoryTestStr) ? SystemServer.FACTORY_TEST_OFF : Integer.parseInt(factoryTestStr);  + // FACTORY_TEST_LOW_LEVEL By: Bian Jiang + //factoryTest = SystemServer.FACTORY_TEST_LOW_LEVEL; + LightsService lights = null; PowerManagerService power = null; BatteryService battery = null; @@ -139,9 +142,12 @@ class ServerThread extends Thread { Slog.i(TAG, "Activity Manager"); context = ActivityManagerService.main(factoryTest);  + + AttributeCache.init(context);   Slog.i(TAG, "Package Manager"); @@ -152,6 +158,7 @@ class ServerThread extends Thread {   mContentResolver = context.getContentResolver();  +   Slog.i(TAG, "Content Manager"); ContentService.main(context, @@ -182,6 +190,7 @@ class ServerThread extends Thread { // lights service, content providers and the battery service. power.init(context, lights, ActivityManagerService.getDefault(), battery);  +   Slog.i(TAG, "Window Manager"); wm = WindowManagerService.main(context, power, @@ -198,6 +208,8 @@ class ServerThread extends Thread { ((ActivityManagerService)ServiceManager.getService("activity")) .setWindowManager(wm);  +  } catch (RuntimeException e) { Slog.e("System", "Failure starting core service", e); @@ -236,6 +249,7 @@ class ServerThread extends Thread { LocationManagerService location = null;   if (factoryTest != SystemServer.FACTORY_TEST_LOW_LEVEL) { +  +   try { Slog.i(TAG, "Connectivity Service"); @@ -292,6 +309,7 @@ class ServerThread extends Thread { Slog.e(TAG, "Failure starting Connectivity Service", e); }  +   try {   try { Slog.i(TAG, "USB Observer"); @@ -404,6 +425,7 @@ class ServerThread extends Thread { Slog.e(TAG, "Failure starting UsbObserver", e); }  +   try { Slog.i(TAG, "AppWidget Service"); @@ -428,12 +451,14 @@ class ServerThread extends Thread { Slog.e(TAG, "Failure starting AppWidget Service", e); }  +   try { Slog.i(TAG, "DiskStats Service"); @@ -453,7 +478,10 @@ class ServerThread extends Thread {   // Before things start rolling, be sure we have decided whether // we are in safe mode. - final boolean safeMode = wm.detectSafeMode(); + // Disable By: Bian Jiang 2012.2.29 + final boolean safeMode = false; + //final boolean safeMode = wm.detectSafeMode(); + if (safeMode) { try { ActivityManagerNative.getDefault().enterSafeMode(); @@ -481,7 +509,9 @@ class ServerThread extends Thread { if (statusBar != null) { statusBar.systemReady(); } - wm.systemReady(); + if (wm != null) { + wm.systemReady(); + } power.systemReady(); try { pm.systemReady(); diff --git a/frameworks/base/services/java/com/android/server/am/ActivityManagerService.java b/frameworks/base/services/java/com/android/server/am/ActivityManagerService.java index 6db4559..40957a1 100644 --- a/frameworks/base/services/java/com/android/server/am/ActivityManagerService.java +++ b/frameworks/base/services/java/com/android/server/am/ActivityManagerService.java @@ -6560,8 +6560,11 @@ public final class ActivityManagerService extends ActivityManagerNative (process.info.flags &amp; (ApplicationInfo.FLAG_SYSTEM | ApplicationInfo.FLAG_UPDATED_SYSTEM_APP)) != 0; final String dropboxTag = isSystemApp ? "system_app_strictmode" : "data_app_strictmode"; + + final DropBoxManager dbox = null;   // Exit early if the dropbox isn't configured to accept this report type. if (dbox == null || !dbox.isTagEnabled(dropboxTag)) return; @@ -6768,9 +6771,11 @@ public final class ActivityManagerService extends ActivityManagerNative // otherwise the watchdog may be prevented from resetting the system.   final String dropboxTag = processClass(process) + "_" + eventType; + + final DropBoxManager dbox = null; // Exit early if the dropbox isn't configured to accept this report type. if (dbox == null || !dbox.isTagEnabled(dropboxTag)) return;   diff --git a/frameworks/base/services/java/com/android/server/connectivity/Tethering.java b/frameworks/base/services/java/com/android/server/connectivity/Tethering.java index a73a4ce..12fda39 100644 --- a/frameworks/base/services/java/com/android/server/connectivity/Tethering.java +++ b/frameworks/base/services/java/com/android/server/connectivity/Tethering.java @@ -127,6 +127,9 @@ public class Tethering extends INetworkManagementEventObserver.Stub { IBinder b = ServiceManager.getService(Context.NETWORKMANAGEMENT_SERVICE); INetworkManagementService service = INetworkManagementService.Stub.asInterface(b); try { + if (service == null) { + return; + } service.registerObserver(this); } catch (RemoteException e) { Log.e(TAG, "Error registering observer :" + e); diff --git a/system/core/init/init.c b/system/core/init/init.c index 75ffb5c..665a1bd 100644 --- a/system/core/init/init.c +++ b/system/core/init/init.c @@ -579,6 +579,10 @@ static int set_init_properties_action(int nargs, char **args)   if (qemu[0]) import_kernel_cmdline(1); + + // bootmode set to factory By: Bian Jiang 2012.2.24 + //unsigned char *factory = "factory"; + //memcpy(bootmode, factory, strlen(factory));   if (!strcmp(bootmode,"factory")) property_set("ro.factorytest", "1"); @@ -646,6 +650,7 @@ static int bootchart_init_action(int nargs, char **args) } else { NOTICE("bootcharting ignored\n"); } + return 0; } #endif diff --git a/vendor/samsung/smdkv210/device-vendor.mk b/vendor/samsung/smdkv210/device-vendor.mk index b8c26f4..d75cefa 100644 --- a/vendor/samsung/smdkv210/device-vendor.mk +++ b/vendor/samsung/smdkv210/device-vendor.mk @@ -15,7 +15,7 @@ # This file is generated by device/samsung/smdkv210/setup-makefiles.sh   # Live wallpaper packages -PRODUCT_PACKAGES := \ +#PRODUCT_PACKAGES := \ LiveWallpapers \ LiveWallpapersPicker \ MagicSmokeWallpapers \ @@ -23,7 +23,7 @@ PRODUCT_PACKAGES := \ librs_jni   # Publish that we support the live wallpaper feature. -PRODUCT_COPY_FILES := \ +#PRODUCT_COPY_FILES := \ packages/wallpapers/LivePicker/android.software.live_wallpaper.xml:/system/etc/permissions/android.software.live_wallpaper.xml

相關推薦

How To Improving Android Boot Time

diff --git a/build/target/product/core.mk b/build/target/product/core.mk index 3b5a42c..4d9ed7e 100755 --- a/build/target/product/core.mk +++ b/build/targ

How To Update Android Apk Outside The Playstore

Let’s learn how to update android apk outside the playstore in this short post! Perhaps you have a scenario where you don’t want to publish your app in

How To Create Android Swipe Views With Tabs

Android swipe views provide lateral navigation between sibling screens such as tabs with a horizontal finger gesture (a pattern sometimes known as horiz

[iOS] How to get the current time as datetime in swift

let date = Date() let calendar = Calendar.current let hour = calendar.component(.hour, from: date) let minutes = calendar.component(.minute, from: date

How to know if now time is between two time?

try this int from = 2300; int to = 800; Date date = new Date(); Calendar c = Calendar.getInstance(); c.setTime(date); int t =

How to develop Android UI Component for React Native

In one of our project that we developed in React Native, we faced a problem. We wanted to use a video player with the text overlay. Though there are lots o

How to use Android Studio's SVG-to-VectorDrawable converter from the command line

Since the very beginning, one of the most annoying aspects of using VectorDrawables on Android has been the lack of a reliable SVG converter. Goog

How To Debug Android By Adb

You can use the adb commands pull and push to copy files to and from an emulator/device instance. Unlike the install command, which only copies an APK fi

How to Load and Explore Time Series Data in Python

Tweet Share Share Google Plus The Pandas library in Python provides excellent, built-in support

How To: Capture Android & iOS Traffic with Fiddler

http with aware rac email logs apt amp source How To: Capture iOS Traffic with Fiddlerhttps://www.telerik.com/blogs/how-to-capture-ios-tr

linux kernel x86 arch how to boot to init

sta tar x86_64 arch global pre mod cte ret arch/x86/boot/header.S --> _start --> calll main arch/x86/boot/main.c -->

How to download and compile Android kernel goldfish ?

virtual table rap dynamic site vid debugging rbo i386 Prerequisites Assuming that we already downloaded the android-ndk-r12b and sdk. w4

How to port new audio codec into Android

  How to port new audio codec into Android 1.Prepare the codec driver  The codec driver i

How to read version (and other) information from Android and iOS apps using Java

How to read version (and other) information from Android and iOS apps using Java https://medium.com/@mart.schneider/how-to-read-version-and-oth

how to mount /system as read/write in android? 在除錯RK3288的OV2718的驅動時,需要remount /system目錄為rw以push檔案到/system/lib/hw目錄下,常規的是用adb登入上去後以root許可權執行mount -o re

在除錯RK3288的OV2718的驅動時,需要remount  /system目錄為rw以push檔案到/system/lib/hw目錄下,常規的是用adb登入上去後以root許可權執行mount -o remount,rw /system即可,然而在拿的新板子後這麼做失效了,於是百

How to remove popup on boot on Windows 2003

Administrative Tools\Manage Your Server\Add or remove a role\Add or Remove Programs Local Computer Policy\Computer Configuration\Administrative Templat

How to inject mock dependencies into Android components using Dagger AndroidInjector

How to inject mock dependencies into Android components using Dagger AndroidInjector https://android.jlelse.eu/how-to-inject-mock-dependencies-into-

HOW TO CREATE A UEFI WINDOWS 7 USB BOOT DISK

Extract the files from DVD or ISO file Partition your USB Drive (optional) a. Open Command Window (CMD) as administrator b. diskpart c. list disk d. sele

How to extract WeChat chat messages from a smartphone running Android 7.x or above

ever all wan 分享 rtai function complete effort log A friend of mine she was frustarted in extracting WeChat chat messages from suspect‘s s

每日TED How to get better at the things you care about? Working hard but not improving?

How to get better at the things you care about? Working hard but not improving? Most of us go through life trying to do our best at whatever we