Merge "Fix issue #593153: Broadcast time out when sending..." into froyo

This commit is contained in:
Dianne Hackborn
2010-04-14 10:16:35 -07:00
committed by Android (Google) Code Review
5 changed files with 131 additions and 99 deletions

View File

@ -150,13 +150,13 @@ public final class ActivityThread {
public static IPackageManager getPackageManager() { public static IPackageManager getPackageManager() {
if (sPackageManager != null) { if (sPackageManager != null) {
//Log.v("PackageManager", "returning cur default = " + sPackageManager); //Slog.v("PackageManager", "returning cur default = " + sPackageManager);
return sPackageManager; return sPackageManager;
} }
IBinder b = ServiceManager.getService("package"); IBinder b = ServiceManager.getService("package");
//Log.v("PackageManager", "default service binder = " + b); //Slog.v("PackageManager", "default service binder = " + b);
sPackageManager = IPackageManager.Stub.asInterface(b); sPackageManager = IPackageManager.Stub.asInterface(b);
//Log.v("PackageManager", "default service = " + sPackageManager); //Slog.v("PackageManager", "default service = " + sPackageManager);
return sPackageManager; return sPackageManager;
} }
@ -170,7 +170,7 @@ public final class ActivityThread {
} }
DisplayMetrics metrics = mDisplayMetrics = new DisplayMetrics(); DisplayMetrics metrics = mDisplayMetrics = new DisplayMetrics();
mDisplay.getMetrics(metrics); mDisplay.getMetrics(metrics);
//Log.i("foo", "New metrics: w=" + metrics.widthPixels + " h=" //Slog.i("foo", "New metrics: w=" + metrics.widthPixels + " h="
// + metrics.heightPixels + " den=" + metrics.density // + metrics.heightPixels + " den=" + metrics.density
// + " xdpi=" + metrics.xdpi + " ydpi=" + metrics.ydpi); // + " xdpi=" + metrics.xdpi + " ydpi=" + metrics.ydpi);
return metrics; return metrics;
@ -189,14 +189,14 @@ public final class ActivityThread {
synchronized (mPackages) { synchronized (mPackages) {
// Resources is app scale dependent. // Resources is app scale dependent.
if (false) { if (false) {
Log.w(TAG, "getTopLevelResources: " + resDir + " / " Slog.w(TAG, "getTopLevelResources: " + resDir + " / "
+ compInfo.applicationScale); + compInfo.applicationScale);
} }
WeakReference<Resources> wr = mActiveResources.get(key); WeakReference<Resources> wr = mActiveResources.get(key);
r = wr != null ? wr.get() : null; r = wr != null ? wr.get() : null;
if (r != null && r.getAssets().isUpToDate()) { if (r != null && r.getAssets().isUpToDate()) {
if (false) { if (false) {
Log.w(TAG, "Returning cached resources " + r + " " + resDir Slog.w(TAG, "Returning cached resources " + r + " " + resDir
+ ": appScale=" + r.getCompatibilityInfo().applicationScale); + ": appScale=" + r.getCompatibilityInfo().applicationScale);
} }
return r; return r;
@ -204,7 +204,7 @@ public final class ActivityThread {
} }
//if (r != null) { //if (r != null) {
// Log.w(TAG, "Throwing away out-of-date resources!!!! " // Slog.w(TAG, "Throwing away out-of-date resources!!!! "
// + r + " " + resDir); // + r + " " + resDir);
//} //}
@ -213,11 +213,11 @@ public final class ActivityThread {
return null; return null;
} }
//Log.i(TAG, "Resource: key=" + key + ", display metrics=" + metrics); //Slog.i(TAG, "Resource: key=" + key + ", display metrics=" + metrics);
DisplayMetrics metrics = getDisplayMetricsLocked(false); DisplayMetrics metrics = getDisplayMetricsLocked(false);
r = new Resources(assets, metrics, getConfiguration(), compInfo); r = new Resources(assets, metrics, getConfiguration(), compInfo);
if (false) { if (false) {
Log.i(TAG, "Created app resources " + resDir + " " + r + ": " Slog.i(TAG, "Created app resources " + resDir + " " + r + ": "
+ r.getConfiguration() + " appScale=" + r.getConfiguration() + " appScale="
+ r.getCompatibilityInfo().applicationScale); + r.getCompatibilityInfo().applicationScale);
} }
@ -306,7 +306,7 @@ public final class ActivityThread {
mSystemContext.getResources().updateConfiguration( mSystemContext.getResources().updateConfiguration(
mainThread.getConfiguration(), mainThread.getConfiguration(),
mainThread.getDisplayMetricsLocked(false)); mainThread.getDisplayMetricsLocked(false));
//Log.i(TAG, "Created system resources " //Slog.i(TAG, "Created system resources "
// + mSystemContext.getResources() + ": " // + mSystemContext.getResources() + ": "
// + mSystemContext.getResources().getConfiguration()); // + mSystemContext.getResources().getConfiguration());
} }
@ -465,7 +465,7 @@ public final class ActivityThread {
* create the class loader. * create the class loader.
*/ */
if (localLOGV) Log.v(TAG, "Class path: " + zip); if (localLOGV) Slog.v(TAG, "Class path: " + zip);
mClassLoader = mClassLoader =
ApplicationLoaders.getDefault().getClassLoader( ApplicationLoaders.getDefault().getClassLoader(
@ -692,7 +692,7 @@ public final class ActivityThread {
} }
} }
mUnregisteredReceivers.remove(context); mUnregisteredReceivers.remove(context);
//Log.i(TAG, "Receiver registrations: " + mReceivers); //Slog.i(TAG, "Receiver registrations: " + mReceivers);
HashMap<ServiceConnection, ServiceDispatcher> smap = HashMap<ServiceConnection, ServiceDispatcher> smap =
mServices.remove(context); mServices.remove(context);
if (smap != null) { if (smap != null) {
@ -714,7 +714,7 @@ public final class ActivityThread {
} }
} }
mUnboundServices.remove(context); mUnboundServices.remove(context);
//Log.i(TAG, "Service registrations: " + mServices); //Slog.i(TAG, "Service registrations: " + mServices);
} }
public IIntentReceiver getReceiverDispatcher(BroadcastReceiver r, public IIntentReceiver getReceiverDispatcher(BroadcastReceiver r,
@ -810,8 +810,8 @@ public final class ActivityThread {
ReceiverDispatcher rd = mDispatcher.get(); ReceiverDispatcher rd = mDispatcher.get();
if (DEBUG_BROADCAST) { if (DEBUG_BROADCAST) {
int seq = intent.getIntExtra("seq", -1); int seq = intent.getIntExtra("seq", -1);
Log.i(TAG, "Receiving broadcast " + intent.getAction() + " seq=" + seq Slog.i(TAG, "Receiving broadcast " + intent.getAction() + " seq=" + seq
+ " to " + rd); + " to " + (rd != null ? rd.mReceiver : null));
} }
if (rd != null) { if (rd != null) {
rd.performReceive(intent, resultCode, data, extras, rd.performReceive(intent, resultCode, data, extras,
@ -821,9 +821,8 @@ public final class ActivityThread {
// receiver in this process, but before it could be delivered the // receiver in this process, but before it could be delivered the
// receiver was unregistered. Acknowledge the broadcast on its // receiver was unregistered. Acknowledge the broadcast on its
// behalf so that the system's broadcast sequence can continue. // behalf so that the system's broadcast sequence can continue.
if (DEBUG_BROADCAST) { if (DEBUG_BROADCAST) Slog.i(TAG,
Log.i(TAG, "Broadcast to unregistered receiver"); "Finishing broadcast to unregistered receiver");
}
IActivityManager mgr = ActivityManagerNative.getDefault(); IActivityManager mgr = ActivityManagerNative.getDefault();
try { try {
mgr.finishReceiver(this, resultCode, data, extras, false); mgr.finishReceiver(this, resultCode, data, extras, false);
@ -855,16 +854,29 @@ public final class ActivityThread {
BroadcastReceiver receiver = mReceiver; BroadcastReceiver receiver = mReceiver;
if (DEBUG_BROADCAST) { if (DEBUG_BROADCAST) {
int seq = mCurIntent.getIntExtra("seq", -1); int seq = mCurIntent.getIntExtra("seq", -1);
Log.i(TAG, "Dispatching broadcast " + mCurIntent.getAction() Slog.i(TAG, "Dispatching broadcast " + mCurIntent.getAction()
+ " seq=" + seq + " to " + mReceiver); + " seq=" + seq + " to " + mReceiver);
Slog.i(TAG, " mRegistered=" + mRegistered
+ " mCurOrdered=" + mCurOrdered);
} }
if (receiver == null) {
return;
}
IActivityManager mgr = ActivityManagerNative.getDefault(); IActivityManager mgr = ActivityManagerNative.getDefault();
Intent intent = mCurIntent; Intent intent = mCurIntent;
mCurIntent = null; mCurIntent = null;
if (receiver == null) {
if (mRegistered && mCurOrdered) {
try {
if (DEBUG_BROADCAST) Slog.i(TAG,
"Finishing null broadcast to " + mReceiver);
mgr.finishReceiver(mIIntentReceiver,
mCurCode, mCurData, mCurMap, false);
} catch (RemoteException ex) {
}
}
return;
}
try { try {
ClassLoader cl = mReceiver.getClass().getClassLoader(); ClassLoader cl = mReceiver.getClass().getClassLoader();
intent.setExtrasClassLoader(cl); intent.setExtrasClassLoader(cl);
@ -880,6 +892,8 @@ public final class ActivityThread {
} catch (Exception e) { } catch (Exception e) {
if (mRegistered && mCurOrdered) { if (mRegistered && mCurOrdered) {
try { try {
if (DEBUG_BROADCAST) Slog.i(TAG,
"Finishing failed broadcast to " + mReceiver);
mgr.finishReceiver(mIIntentReceiver, mgr.finishReceiver(mIIntentReceiver,
mCurCode, mCurData, mCurMap, false); mCurCode, mCurData, mCurMap, false);
} catch (RemoteException ex) { } catch (RemoteException ex) {
@ -894,6 +908,8 @@ public final class ActivityThread {
} }
if (mRegistered && mCurOrdered) { if (mRegistered && mCurOrdered) {
try { try {
if (DEBUG_BROADCAST) Slog.i(TAG,
"Finishing broadcast to " + mReceiver);
mgr.finishReceiver(mIIntentReceiver, mgr.finishReceiver(mIIntentReceiver,
receiver.getResultCode(), receiver.getResultCode(),
receiver.getResultData(), receiver.getResultData(),
@ -961,7 +977,7 @@ public final class ActivityThread {
String data, Bundle extras, boolean ordered, boolean sticky) { String data, Bundle extras, boolean ordered, boolean sticky) {
if (DEBUG_BROADCAST) { if (DEBUG_BROADCAST) {
int seq = intent.getIntExtra("seq", -1); int seq = intent.getIntExtra("seq", -1);
Log.i(TAG, "Enqueueing broadcast " + intent.getAction() + " seq=" + seq Slog.i(TAG, "Enqueueing broadcast " + intent.getAction() + " seq=" + seq
+ " to " + mReceiver); + " to " + mReceiver);
} }
Args args = new Args(); Args args = new Args();
@ -972,9 +988,11 @@ public final class ActivityThread {
args.mCurOrdered = ordered; args.mCurOrdered = ordered;
args.mCurSticky = sticky; args.mCurSticky = sticky;
if (!mActivityThread.post(args)) { if (!mActivityThread.post(args)) {
if (mRegistered) { if (mRegistered && ordered) {
IActivityManager mgr = ActivityManagerNative.getDefault(); IActivityManager mgr = ActivityManagerNative.getDefault();
try { try {
if (DEBUG_BROADCAST) Slog.i(TAG,
"Finishing sync broadcast to " + mReceiver);
mgr.finishReceiver(mIIntentReceiver, args.mCurCode, mgr.finishReceiver(mIIntentReceiver, args.mCurCode,
args.mCurData, args.mCurMap, false); args.mCurData, args.mCurMap, false);
} catch (RemoteException ex) { } catch (RemoteException ex) {
@ -2133,7 +2151,7 @@ public final class ActivityThread {
IActivityManager am = ActivityManagerNative.getDefault(); IActivityManager am = ActivityManagerNative.getDefault();
ActivityRecord prev; ActivityRecord prev;
do { do {
if (localLOGV) Log.v( if (localLOGV) Slog.v(
TAG, "Reporting idle of " + a + TAG, "Reporting idle of " + a +
" finished=" + " finished=" +
(a.activity != null ? a.activity.mFinished : false)); (a.activity != null ? a.activity.mFinished : false));
@ -2252,7 +2270,7 @@ public final class ActivityThread {
ref = mResourcePackages.get(packageName); ref = mResourcePackages.get(packageName);
} }
PackageInfo packageInfo = ref != null ? ref.get() : null; PackageInfo packageInfo = ref != null ? ref.get() : null;
//Log.i(TAG, "getPackageInfo " + packageName + ": " + packageInfo); //Slog.i(TAG, "getPackageInfo " + packageName + ": " + packageInfo);
if (packageInfo != null && (packageInfo.mResources == null if (packageInfo != null && (packageInfo.mResources == null
|| packageInfo.mResources.getAssets().isUpToDate())) { || packageInfo.mResources.getAssets().isUpToDate())) {
if (packageInfo.isSecurityViolation() if (packageInfo.isSecurityViolation()
@ -2319,7 +2337,7 @@ public final class ActivityThread {
PackageInfo packageInfo = ref != null ? ref.get() : null; PackageInfo packageInfo = ref != null ? ref.get() : null;
if (packageInfo == null || (packageInfo.mResources != null if (packageInfo == null || (packageInfo.mResources != null
&& !packageInfo.mResources.getAssets().isUpToDate())) { && !packageInfo.mResources.getAssets().isUpToDate())) {
if (localLOGV) Log.v(TAG, (includeCode ? "Loading code package " if (localLOGV) Slog.v(TAG, (includeCode ? "Loading code package "
: "Loading resource-only package ") + aInfo.packageName : "Loading resource-only package ") + aInfo.packageName
+ " (in " + (mBoundApplication != null + " (in " + (mBoundApplication != null
? mBoundApplication.processName : null) ? mBoundApplication.processName : null)
@ -2402,7 +2420,7 @@ public final class ActivityThread {
context.getResources().updateConfiguration( context.getResources().updateConfiguration(
getConfiguration(), getDisplayMetricsLocked(false)); getConfiguration(), getDisplayMetricsLocked(false));
mSystemContext = context; mSystemContext = context;
//Log.i(TAG, "Created system resources " + context.getResources() //Slog.i(TAG, "Created system resources " + context.getResources()
// + ": " + context.getResources().getConfiguration()); // + ": " + context.getResources().getConfiguration());
} }
} }
@ -2442,10 +2460,10 @@ public final class ActivityThread {
void doGcIfNeeded() { void doGcIfNeeded() {
mGcIdlerScheduled = false; mGcIdlerScheduled = false;
final long now = SystemClock.uptimeMillis(); final long now = SystemClock.uptimeMillis();
//Log.i(TAG, "**** WE MIGHT WANT TO GC: then=" + Binder.getLastGcTime() //Slog.i(TAG, "**** WE MIGHT WANT TO GC: then=" + Binder.getLastGcTime()
// + "m now=" + now); // + "m now=" + now);
if ((BinderInternal.getLastGcTime()+MIN_TIME_BETWEEN_GCS) < now) { if ((BinderInternal.getLastGcTime()+MIN_TIME_BETWEEN_GCS) < now) {
//Log.i(TAG, "**** WE DO, WE DO WANT TO GC!"); //Slog.i(TAG, "**** WE DO, WE DO WANT TO GC!");
BinderInternal.forceGc("bg"); BinderInternal.forceGc("bg");
} }
} }
@ -2481,7 +2499,7 @@ public final class ActivityThread {
} else { } else {
name = "(Intent " + intent + ").getComponent() returned null"; name = "(Intent " + intent + ").getComponent() returned null";
} }
Log.v(TAG, "Performing launch: action=" + intent.getAction() Slog.v(TAG, "Performing launch: action=" + intent.getAction()
+ ", comp=" + name + ", comp=" + name
+ ", token=" + token); + ", token=" + token);
} }
@ -2495,7 +2513,7 @@ public final class ActivityThread {
public final void sendActivityResult( public final void sendActivityResult(
IBinder token, String id, int requestCode, IBinder token, String id, int requestCode,
int resultCode, Intent data) { int resultCode, Intent data) {
if (DEBUG_RESULTS) Log.v(TAG, "sendActivityResult: id=" + id if (DEBUG_RESULTS) Slog.v(TAG, "sendActivityResult: id=" + id
+ " req=" + requestCode + " res=" + resultCode + " data=" + data); + " req=" + requestCode + " res=" + resultCode + " data=" + data);
ArrayList<ResultInfo> list = new ArrayList<ResultInfo>(); ArrayList<ResultInfo> list = new ArrayList<ResultInfo>();
list.add(new ResultInfo(id, requestCode, resultCode, data)); list.add(new ResultInfo(id, requestCode, resultCode, data));
@ -2514,7 +2532,7 @@ public final class ActivityThread {
private final void queueOrSendMessage(int what, Object obj, int arg1, int arg2) { private final void queueOrSendMessage(int what, Object obj, int arg1, int arg2) {
synchronized (this) { synchronized (this) {
if (localLOGV) Log.v( if (localLOGV) Slog.v(
TAG, "SCHEDULE " + what + " " + mH.codeToString(what) TAG, "SCHEDULE " + what + " " + mH.codeToString(what)
+ ": " + arg1 + " / " + obj); + ": " + arg1 + " / " + obj);
Message msg = Message.obtain(); Message msg = Message.obtain();
@ -2576,8 +2594,8 @@ public final class ActivityThread {
try { try {
Application app = r.packageInfo.makeApplication(false, mInstrumentation); Application app = r.packageInfo.makeApplication(false, mInstrumentation);
if (localLOGV) Log.v(TAG, "Performing launch of " + r); if (localLOGV) Slog.v(TAG, "Performing launch of " + r);
if (localLOGV) Log.v( if (localLOGV) Slog.v(
TAG, r + ": app=" + app TAG, r + ": app=" + app
+ ", appName=" + app.getPackageName() + ", appName=" + app.getPackageName()
+ ", pkg=" + r.packageInfo.getPackageName() + ", pkg=" + r.packageInfo.getPackageName()
@ -2590,7 +2608,7 @@ public final class ActivityThread {
appContext.setOuterContext(activity); appContext.setOuterContext(activity);
CharSequence title = r.activityInfo.loadLabel(appContext.getPackageManager()); CharSequence title = r.activityInfo.loadLabel(appContext.getPackageManager());
Configuration config = new Configuration(mConfiguration); Configuration config = new Configuration(mConfiguration);
if (DEBUG_CONFIGURATION) Log.v(TAG, "Launching activity " if (DEBUG_CONFIGURATION) Slog.v(TAG, "Launching activity "
+ r.activityInfo.name + " with config " + config); + r.activityInfo.name + " with config " + config);
activity.attach(appContext, this, getInstrumentation(), r.token, activity.attach(appContext, this, getInstrumentation(), r.token,
r.ident, app, r.intent, r.activityInfo, title, r.parent, r.ident, app, r.intent, r.activityInfo, title, r.parent,
@ -2659,7 +2677,7 @@ public final class ActivityThread {
// we are back active so skip it. // we are back active so skip it.
unscheduleGcIdler(); unscheduleGcIdler();
if (localLOGV) Log.v( if (localLOGV) Slog.v(
TAG, "Handling launch of " + r); TAG, "Handling launch of " + r);
Activity a = performLaunchActivity(r, customIntent); Activity a = performLaunchActivity(r, customIntent);
@ -2765,6 +2783,8 @@ public final class ActivityThread {
receiver = (BroadcastReceiver)cl.loadClass(component).newInstance(); receiver = (BroadcastReceiver)cl.loadClass(component).newInstance();
} catch (Exception e) { } catch (Exception e) {
try { try {
if (DEBUG_BROADCAST) Slog.i(TAG,
"Finishing failed broadcast to " + data.intent.getComponent());
mgr.finishReceiver(mAppThread.asBinder(), data.resultCode, mgr.finishReceiver(mAppThread.asBinder(), data.resultCode,
data.resultData, data.resultExtras, data.resultAbort); data.resultData, data.resultExtras, data.resultAbort);
} catch (RemoteException ex) { } catch (RemoteException ex) {
@ -2777,7 +2797,7 @@ public final class ActivityThread {
try { try {
Application app = packageInfo.makeApplication(false, mInstrumentation); Application app = packageInfo.makeApplication(false, mInstrumentation);
if (localLOGV) Log.v( if (localLOGV) Slog.v(
TAG, "Performing receive of " + data.intent TAG, "Performing receive of " + data.intent
+ ": app=" + app + ": app=" + app
+ ", appName=" + app.getPackageName() + ", appName=" + app.getPackageName()
@ -2794,6 +2814,8 @@ public final class ActivityThread {
data.intent); data.intent);
} catch (Exception e) { } catch (Exception e) {
try { try {
if (DEBUG_BROADCAST) Slog.i(TAG,
"Finishing failed broadcast to " + data.intent.getComponent());
mgr.finishReceiver(mAppThread.asBinder(), data.resultCode, mgr.finishReceiver(mAppThread.asBinder(), data.resultCode,
data.resultData, data.resultExtras, data.resultAbort); data.resultData, data.resultExtras, data.resultAbort);
} catch (RemoteException ex) { } catch (RemoteException ex) {
@ -2807,11 +2829,15 @@ public final class ActivityThread {
try { try {
if (data.sync) { if (data.sync) {
if (DEBUG_BROADCAST) Slog.i(TAG,
"Finishing ordered broadcast to " + data.intent.getComponent());
mgr.finishReceiver( mgr.finishReceiver(
mAppThread.asBinder(), receiver.getResultCode(), mAppThread.asBinder(), receiver.getResultCode(),
receiver.getResultData(), receiver.getResultExtras(false), receiver.getResultData(), receiver.getResultExtras(false),
receiver.getAbortBroadcast()); receiver.getAbortBroadcast());
} else { } else {
if (DEBUG_BROADCAST) Slog.i(TAG,
"Finishing broadcast to " + data.intent.getComponent());
mgr.finishReceiver(mAppThread.asBinder(), 0, null, null, false); mgr.finishReceiver(mAppThread.asBinder(), 0, null, null, false);
} }
} catch (RemoteException ex) { } catch (RemoteException ex) {
@ -2820,7 +2846,7 @@ public final class ActivityThread {
// Instantiate a BackupAgent and tell it that it's alive // Instantiate a BackupAgent and tell it that it's alive
private final void handleCreateBackupAgent(CreateBackupAgentData data) { private final void handleCreateBackupAgent(CreateBackupAgentData data) {
if (DEBUG_BACKUP) Log.v(TAG, "handleCreateBackupAgent: " + data); if (DEBUG_BACKUP) Slog.v(TAG, "handleCreateBackupAgent: " + data);
// no longer idle; we have backup work to do // no longer idle; we have backup work to do
unscheduleGcIdler(); unscheduleGcIdler();
@ -2829,7 +2855,7 @@ public final class ActivityThread {
PackageInfo packageInfo = getPackageInfoNoCheck(data.appInfo); PackageInfo packageInfo = getPackageInfoNoCheck(data.appInfo);
String packageName = packageInfo.mPackageName; String packageName = packageInfo.mPackageName;
if (mBackupAgents.get(packageName) != null) { if (mBackupAgents.get(packageName) != null) {
Log.d(TAG, "BackupAgent " + " for " + packageName Slog.d(TAG, "BackupAgent " + " for " + packageName
+ " already exists"); + " already exists");
return; return;
} }
@ -2851,7 +2877,7 @@ public final class ActivityThread {
agent = (BackupAgent) cl.loadClass(data.appInfo.backupAgentName).newInstance(); agent = (BackupAgent) cl.loadClass(data.appInfo.backupAgentName).newInstance();
// set up the agent's context // set up the agent's context
if (DEBUG_BACKUP) Log.v(TAG, "Initializing BackupAgent " if (DEBUG_BACKUP) Slog.v(TAG, "Initializing BackupAgent "
+ data.appInfo.backupAgentName); + data.appInfo.backupAgentName);
ContextImpl context = new ContextImpl(); ContextImpl context = new ContextImpl();
@ -2886,7 +2912,7 @@ public final class ActivityThread {
// Tear down a BackupAgent // Tear down a BackupAgent
private final void handleDestroyBackupAgent(CreateBackupAgentData data) { private final void handleDestroyBackupAgent(CreateBackupAgentData data) {
if (DEBUG_BACKUP) Log.v(TAG, "handleDestroyBackupAgent: " + data); if (DEBUG_BACKUP) Slog.v(TAG, "handleDestroyBackupAgent: " + data);
PackageInfo packageInfo = getPackageInfoNoCheck(data.appInfo); PackageInfo packageInfo = getPackageInfoNoCheck(data.appInfo);
String packageName = packageInfo.mPackageName; String packageName = packageInfo.mPackageName;
@ -2924,7 +2950,7 @@ public final class ActivityThread {
} }
try { try {
if (localLOGV) Log.v(TAG, "Creating service " + data.info.name); if (localLOGV) Slog.v(TAG, "Creating service " + data.info.name);
ContextImpl context = new ContextImpl(); ContextImpl context = new ContextImpl();
context.init(packageInfo, null, this); context.init(packageInfo, null, this);
@ -3049,7 +3075,7 @@ public final class ActivityThread {
Service s = mServices.remove(token); Service s = mServices.remove(token);
if (s != null) { if (s != null) {
try { try {
if (localLOGV) Log.v(TAG, "Destroying service " + s); if (localLOGV) Slog.v(TAG, "Destroying service " + s);
s.onDestroy(); s.onDestroy();
Context context = s.getBaseContext(); Context context = s.getBaseContext();
if (context instanceof ContextImpl) { if (context instanceof ContextImpl) {
@ -3070,13 +3096,13 @@ public final class ActivityThread {
} }
} }
} }
//Log.i(TAG, "Running services: " + mServices); //Slog.i(TAG, "Running services: " + mServices);
} }
public final ActivityRecord performResumeActivity(IBinder token, public final ActivityRecord performResumeActivity(IBinder token,
boolean clearHide) { boolean clearHide) {
ActivityRecord r = mActivities.get(token); ActivityRecord r = mActivities.get(token);
if (localLOGV) Log.v(TAG, "Performing resume of " + r if (localLOGV) Slog.v(TAG, "Performing resume of " + r
+ " finished=" + r.activity.mFinished); + " finished=" + r.activity.mFinished);
if (r != null && !r.activity.mFinished) { if (r != null && !r.activity.mFinished) {
if (clearHide) { if (clearHide) {
@ -3122,7 +3148,7 @@ public final class ActivityThread {
if (r != null) { if (r != null) {
final Activity a = r.activity; final Activity a = r.activity;
if (localLOGV) Log.v( if (localLOGV) Slog.v(
TAG, "Resume " + r + " started activity: " + TAG, "Resume " + r + " started activity: " +
a.mStartedActivity + ", hideForNow: " + r.hideForNow a.mStartedActivity + ", hideForNow: " + r.hideForNow
+ ", finished: " + a.mFinished); + ", finished: " + a.mFinished);
@ -3159,7 +3185,7 @@ public final class ActivityThread {
// we started another activity, then don't yet make the // we started another activity, then don't yet make the
// window visible. // window visible.
} else if (!willBeVisible) { } else if (!willBeVisible) {
if (localLOGV) Log.v( if (localLOGV) Slog.v(
TAG, "Launch " + r + " mStartedActivity set"); TAG, "Launch " + r + " mStartedActivity set");
r.hideForNow = true; r.hideForNow = true;
} }
@ -3169,12 +3195,12 @@ public final class ActivityThread {
if (!r.activity.mFinished && willBeVisible if (!r.activity.mFinished && willBeVisible
&& r.activity.mDecor != null && !r.hideForNow) { && r.activity.mDecor != null && !r.hideForNow) {
if (r.newConfig != null) { if (r.newConfig != null) {
if (DEBUG_CONFIGURATION) Log.v(TAG, "Resuming activity " if (DEBUG_CONFIGURATION) Slog.v(TAG, "Resuming activity "
+ r.activityInfo.name + " with newConfig " + r.newConfig); + r.activityInfo.name + " with newConfig " + r.newConfig);
performConfigurationChanged(r.activity, r.newConfig); performConfigurationChanged(r.activity, r.newConfig);
r.newConfig = null; r.newConfig = null;
} }
if (localLOGV) Log.v(TAG, "Resuming " + r + " with isForward=" if (localLOGV) Slog.v(TAG, "Resuming " + r + " with isForward="
+ isForward); + isForward);
WindowManager.LayoutParams l = r.window.getAttributes(); WindowManager.LayoutParams l = r.window.getAttributes();
if ((l.softInputMode if ((l.softInputMode
@ -3198,7 +3224,7 @@ public final class ActivityThread {
r.nextIdle = mNewActivities; r.nextIdle = mNewActivities;
mNewActivities = r; mNewActivities = r;
if (localLOGV) Log.v( if (localLOGV) Slog.v(
TAG, "Scheduling idle handler for " + r); TAG, "Scheduling idle handler for " + r);
Looper.myQueue().addIdleHandler(new Idler()); Looper.myQueue().addIdleHandler(new Idler());
@ -3256,7 +3282,7 @@ public final class ActivityThread {
boolean userLeaving, int configChanges) { boolean userLeaving, int configChanges) {
ActivityRecord r = mActivities.get(token); ActivityRecord r = mActivities.get(token);
if (r != null) { if (r != null) {
//Log.v(TAG, "userLeaving=" + userLeaving + " handling pause of " + r); //Slog.v(TAG, "userLeaving=" + userLeaving + " handling pause of " + r);
if (userLeaving) { if (userLeaving) {
performUserLeavingActivity(r); performUserLeavingActivity(r);
} }
@ -3351,7 +3377,7 @@ public final class ActivityThread {
private final void performStopActivityInner(ActivityRecord r, private final void performStopActivityInner(ActivityRecord r,
StopInfo info, boolean keepShown) { StopInfo info, boolean keepShown) {
if (localLOGV) Log.v(TAG, "Performing stop of " + r); if (localLOGV) Slog.v(TAG, "Performing stop of " + r);
if (r != null) { if (r != null) {
if (!keepShown && r.stopped) { if (!keepShown && r.stopped) {
if (r.activity.mFinished) { if (r.activity.mFinished) {
@ -3412,7 +3438,7 @@ public final class ActivityThread {
} }
} }
if (r.newConfig != null) { if (r.newConfig != null) {
if (DEBUG_CONFIGURATION) Log.v(TAG, "Updating activity vis " if (DEBUG_CONFIGURATION) Slog.v(TAG, "Updating activity vis "
+ r.activityInfo.name + " with new config " + r.newConfig); + r.activityInfo.name + " with new config " + r.newConfig);
performConfigurationChanged(r.activity, r.newConfig); performConfigurationChanged(r.activity, r.newConfig);
r.newConfig = null; r.newConfig = null;
@ -3434,7 +3460,7 @@ public final class ActivityThread {
StopInfo info = new StopInfo(); StopInfo info = new StopInfo();
performStopActivityInner(r, info, show); performStopActivityInner(r, info, show);
if (localLOGV) Log.v( if (localLOGV) Slog.v(
TAG, "Finishing stop of " + r + ": show=" + show TAG, "Finishing stop of " + r + ": show=" + show
+ " win=" + r.window); + " win=" + r.window);
@ -3469,7 +3495,7 @@ public final class ActivityThread {
r.stopped = false; r.stopped = false;
} }
if (r.activity.mDecor != null) { if (r.activity.mDecor != null) {
if (Config.LOGV) Log.v( if (Config.LOGV) Slog.v(
TAG, "Handle window " + r + " visibility: " + show); TAG, "Handle window " + r + " visibility: " + show);
updateVisibility(r, show); updateVisibility(r, show);
} }
@ -3483,7 +3509,7 @@ public final class ActivityThread {
if (ri.mData != null) { if (ri.mData != null) {
ri.mData.setExtrasClassLoader(r.activity.getClassLoader()); ri.mData.setExtrasClassLoader(r.activity.getClassLoader());
} }
if (DEBUG_RESULTS) Log.v(TAG, if (DEBUG_RESULTS) Slog.v(TAG,
"Delivering result to activity " + r + " : " + ri); "Delivering result to activity " + r + " : " + ri);
r.activity.dispatchActivityResult(ri.mResultWho, r.activity.dispatchActivityResult(ri.mResultWho,
ri.mRequestCode, ri.mResultCode, ri.mData); ri.mRequestCode, ri.mResultCode, ri.mData);
@ -3500,7 +3526,7 @@ public final class ActivityThread {
private final void handleSendResult(ResultData res) { private final void handleSendResult(ResultData res) {
ActivityRecord r = mActivities.get(res.token); ActivityRecord r = mActivities.get(res.token);
if (DEBUG_RESULTS) Log.v(TAG, "Handling send result to " + r); if (DEBUG_RESULTS) Slog.v(TAG, "Handling send result to " + r);
if (r != null) { if (r != null) {
final boolean resumed = !r.paused; final boolean resumed = !r.paused;
if (!r.activity.mFinished && r.activity.mDecor != null if (!r.activity.mFinished && r.activity.mDecor != null
@ -3545,7 +3571,7 @@ public final class ActivityThread {
private final ActivityRecord performDestroyActivity(IBinder token, boolean finishing, private final ActivityRecord performDestroyActivity(IBinder token, boolean finishing,
int configChanges, boolean getNonConfigInstance) { int configChanges, boolean getNonConfigInstance) {
ActivityRecord r = mActivities.get(token); ActivityRecord r = mActivities.get(token);
if (localLOGV) Log.v(TAG, "Performing finish of " + r); if (localLOGV) Slog.v(TAG, "Performing finish of " + r);
if (r != null) { if (r != null) {
r.activity.mConfigChangeFlags |= configChanges; r.activity.mConfigChangeFlags |= configChanges;
if (finishing) { if (finishing) {
@ -3695,7 +3721,7 @@ public final class ActivityThread {
Configuration changedConfig = null; Configuration changedConfig = null;
if (DEBUG_CONFIGURATION) Log.v(TAG, "Relaunching activity " if (DEBUG_CONFIGURATION) Slog.v(TAG, "Relaunching activity "
+ tmp.token + " with configChanges=0x" + tmp.token + " with configChanges=0x"
+ Integer.toHexString(configChanges)); + Integer.toHexString(configChanges));
@ -3717,7 +3743,7 @@ public final class ActivityThread {
} }
if (tmp == null) { if (tmp == null) {
if (DEBUG_CONFIGURATION) Log.v(TAG, "Abort, activity not relaunching!"); if (DEBUG_CONFIGURATION) Slog.v(TAG, "Abort, activity not relaunching!");
return; return;
} }
@ -3741,7 +3767,7 @@ public final class ActivityThread {
} }
} }
if (DEBUG_CONFIGURATION) Log.v(TAG, "Relaunching activity " if (DEBUG_CONFIGURATION) Slog.v(TAG, "Relaunching activity "
+ tmp.token + ": changedConfig=" + changedConfig); + tmp.token + ": changedConfig=" + changedConfig);
// If there was a pending configuration change, execute it first. // If there was a pending configuration change, execute it first.
@ -3750,7 +3776,7 @@ public final class ActivityThread {
} }
ActivityRecord r = mActivities.get(tmp.token); ActivityRecord r = mActivities.get(tmp.token);
if (DEBUG_CONFIGURATION) Log.v(TAG, "Handling relaunch of " + r); if (DEBUG_CONFIGURATION) Slog.v(TAG, "Handling relaunch of " + r);
if (r == null) { if (r == null) {
return; return;
} }
@ -3836,7 +3862,7 @@ public final class ActivityThread {
// the activity manager may, before then, decide the // the activity manager may, before then, decide the
// activity needs to be destroyed to handle its new // activity needs to be destroyed to handle its new
// configuration. // configuration.
if (DEBUG_CONFIGURATION) Log.v(TAG, "Setting activity " if (DEBUG_CONFIGURATION) Slog.v(TAG, "Setting activity "
+ ar.activityInfo.name + " newConfig=" + newConfig); + ar.activityInfo.name + " newConfig=" + newConfig);
ar.newConfig = newConfig; ar.newConfig = newConfig;
} }
@ -3895,7 +3921,7 @@ public final class ActivityThread {
} }
} }
if (DEBUG_CONFIGURATION) Log.v(TAG, "Config callback " + cb if (DEBUG_CONFIGURATION) Slog.v(TAG, "Config callback " + cb
+ ": shouldChangeConfig=" + shouldChangeConfig); + ": shouldChangeConfig=" + shouldChangeConfig);
if (shouldChangeConfig) { if (shouldChangeConfig) {
cb.onConfigurationChanged(config); cb.onConfigurationChanged(config);
@ -3917,7 +3943,7 @@ public final class ActivityThread {
mResConfiguration = new Configuration(); mResConfiguration = new Configuration();
} }
if (!mResConfiguration.isOtherSeqNewer(config)) { if (!mResConfiguration.isOtherSeqNewer(config)) {
if (DEBUG_CONFIGURATION) Log.v(TAG, "Skipping new config: curSeq=" if (DEBUG_CONFIGURATION) Slog.v(TAG, "Skipping new config: curSeq="
+ mResConfiguration.seq + ", newSeq=" + config.seq); + mResConfiguration.seq + ", newSeq=" + config.seq);
return false; return false;
} }
@ -3932,7 +3958,7 @@ public final class ActivityThread {
Resources.updateSystemConfiguration(config, dm); Resources.updateSystemConfiguration(config, dm);
ContextImpl.ApplicationPackageManager.configurationChanged(); ContextImpl.ApplicationPackageManager.configurationChanged();
//Log.i(TAG, "Configuration changed in " + currentPackageName()); //Slog.i(TAG, "Configuration changed in " + currentPackageName());
Iterator<WeakReference<Resources>> it = Iterator<WeakReference<Resources>> it =
mActiveResources.values().iterator(); mActiveResources.values().iterator();
@ -3942,13 +3968,13 @@ public final class ActivityThread {
WeakReference<Resources> v = it.next(); WeakReference<Resources> v = it.next();
Resources r = v.get(); Resources r = v.get();
if (r != null) { if (r != null) {
if (DEBUG_CONFIGURATION) Log.v(TAG, "Changing resources " if (DEBUG_CONFIGURATION) Slog.v(TAG, "Changing resources "
+ r + " config to: " + config); + r + " config to: " + config);
r.updateConfiguration(config, dm); r.updateConfiguration(config, dm);
//Log.i(TAG, "Updated app resources " + v.getKey() //Slog.i(TAG, "Updated app resources " + v.getKey()
// + " " + r + ": " + r.getConfiguration()); // + " " + r + ": " + r.getConfiguration());
} else { } else {
//Log.i(TAG, "Removing old resources " + v.getKey()); //Slog.i(TAG, "Removing old resources " + v.getKey());
it.remove(); it.remove();
} }
} }
@ -3972,7 +3998,7 @@ public final class ActivityThread {
return; return;
} }
if (DEBUG_CONFIGURATION) Log.v(TAG, "Handle configuration changed: " if (DEBUG_CONFIGURATION) Slog.v(TAG, "Handle configuration changed: "
+ config); + config);
applyConfigurationToResourcesLocked(config); applyConfigurationToResourcesLocked(config);
@ -4002,7 +4028,7 @@ public final class ActivityThread {
return; return;
} }
if (DEBUG_CONFIGURATION) Log.v(TAG, "Handle activity config changed: " if (DEBUG_CONFIGURATION) Slog.v(TAG, "Handle activity config changed: "
+ r.activityInfo.name); + r.activityInfo.name);
performConfigurationChanged(r.activity, mConfiguration); performConfigurationChanged(r.activity, mConfiguration);
@ -4095,7 +4121,7 @@ public final class ActivityThread {
// XXX should have option to change the port. // XXX should have option to change the port.
Debug.changeDebugPort(8100); Debug.changeDebugPort(8100);
if (data.debugMode == IApplicationThread.DEBUG_WAIT) { if (data.debugMode == IApplicationThread.DEBUG_WAIT) {
Log.w(TAG, "Application " + data.info.getPackageName() Slog.w(TAG, "Application " + data.info.getPackageName()
+ " is waiting for the debugger on port 8100..."); + " is waiting for the debugger on port 8100...");
IActivityManager mgr = ActivityManagerNative.getDefault(); IActivityManager mgr = ActivityManagerNative.getDefault();
@ -4112,7 +4138,7 @@ public final class ActivityThread {
} }
} else { } else {
Log.w(TAG, "Application " + data.info.getPackageName() Slog.w(TAG, "Application " + data.info.getPackageName()
+ " can be debugged on port 8100..."); + " can be debugged on port 8100...");
} }
} }
@ -4208,7 +4234,7 @@ public final class ActivityThread {
if (mBoundApplication.profileFile != null && mBoundApplication.handlingProfiling) { if (mBoundApplication.profileFile != null && mBoundApplication.handlingProfiling) {
Debug.stopMethodTracing(); Debug.stopMethodTracing();
} }
//Log.i(TAG, "am: " + ActivityManagerNative.getDefault() //Slog.i(TAG, "am: " + ActivityManagerNative.getDefault()
// + ", app thr: " + mAppThread); // + ", app thr: " + mAppThread);
try { try {
am.finishInstrumentation(mAppThread, resultCode, results); am.finishInstrumentation(mAppThread, resultCode, results);
@ -4275,12 +4301,12 @@ public final class ActivityThread {
IContentProvider prov = installProvider(context, holder.provider, IContentProvider prov = installProvider(context, holder.provider,
holder.info, true); holder.info, true);
//Log.i(TAG, "noReleaseNeeded=" + holder.noReleaseNeeded); //Slog.i(TAG, "noReleaseNeeded=" + holder.noReleaseNeeded);
if (holder.noReleaseNeeded || holder.provider == null) { if (holder.noReleaseNeeded || holder.provider == null) {
// We are not going to release the provider if it is an external // We are not going to release the provider if it is an external
// provider that doesn't care about being released, or if it is // provider that doesn't care about being released, or if it is
// a local provider running in this process. // a local provider running in this process.
//Log.i(TAG, "*** NO RELEASE NEEDED"); //Slog.i(TAG, "*** NO RELEASE NEEDED");
synchronized(mProviderMap) { synchronized(mProviderMap) {
mProviderRefCountMap.put(prov.asBinder(), new ProviderRefCount(10000)); mProviderRefCountMap.put(prov.asBinder(), new ProviderRefCount(10000));
} }
@ -4312,7 +4338,7 @@ public final class ActivityThread {
synchronized(mProviderMap) { synchronized(mProviderMap) {
ProviderRefCount prc = mProviderRefCountMap.get(jBinder); ProviderRefCount prc = mProviderRefCountMap.get(jBinder);
if(prc == null) { if(prc == null) {
if(localLOGV) Log.v(TAG, "releaseProvider::Weird shouldnt be here"); if(localLOGV) Slog.v(TAG, "releaseProvider::Weird shouldnt be here");
return false; return false;
} else { } else {
prc.count--; prc.count--;
@ -4344,7 +4370,7 @@ public final class ActivityThread {
if (name != null) { if (name != null) {
try { try {
if(localLOGV) Log.v(TAG, "removeProvider::Invoking " + if(localLOGV) Slog.v(TAG, "removeProvider::Invoking " +
"ActivityManagerNative.removeContentProvider(" + name); "ActivityManagerNative.removeContentProvider(" + name);
ActivityManagerNative.getDefault().removeContentProvider( ActivityManagerNative.getDefault().removeContentProvider(
getApplicationThread(), name); getApplicationThread(), name);
@ -4370,10 +4396,10 @@ public final class ActivityThread {
if (myBinder == providerBinder) { if (myBinder == providerBinder) {
//find if its published by this process itself //find if its published by this process itself
if(pr.mLocalProvider != null) { if(pr.mLocalProvider != null) {
if(localLOGV) Log.i(TAG, "removeProvider::found local provider returning"); if(localLOGV) Slog.i(TAG, "removeProvider::found local provider returning");
return name; return name;
} }
if(localLOGV) Log.v(TAG, "removeProvider::Not local provider Unlinking " + if(localLOGV) Slog.v(TAG, "removeProvider::Not local provider Unlinking " +
"death recipient"); "death recipient");
//content provider is in another process //content provider is in another process
myBinder.unlinkToDeath(pr, 0); myBinder.unlinkToDeath(pr, 0);
@ -4392,7 +4418,7 @@ public final class ActivityThread {
synchronized(mProviderMap) { synchronized(mProviderMap) {
ProviderRecord pr = mProviderMap.get(name); ProviderRecord pr = mProviderMap.get(name);
if (pr.mProvider.asBinder() == provider.asBinder()) { if (pr.mProvider.asBinder() == provider.asBinder()) {
Log.i(TAG, "Removing dead content provider: " + name); Slog.i(TAG, "Removing dead content provider: " + name);
ProviderRecord removed = mProviderMap.remove(name); ProviderRecord removed = mProviderMap.remove(name);
if (removed != null) { if (removed != null) {
removed.mProvider.asBinder().unlinkToDeath(removed, 0); removed.mProvider.asBinder().unlinkToDeath(removed, 0);
@ -4404,7 +4430,7 @@ public final class ActivityThread {
final void removeDeadProviderLocked(String name, IContentProvider provider) { final void removeDeadProviderLocked(String name, IContentProvider provider) {
ProviderRecord pr = mProviderMap.get(name); ProviderRecord pr = mProviderMap.get(name);
if (pr.mProvider.asBinder() == provider.asBinder()) { if (pr.mProvider.asBinder() == provider.asBinder()) {
Log.i(TAG, "Removing dead content provider: " + name); Slog.i(TAG, "Removing dead content provider: " + name);
ProviderRecord removed = mProviderMap.remove(name); ProviderRecord removed = mProviderMap.remove(name);
if (removed != null) { if (removed != null) {
removed.mProvider.asBinder().unlinkToDeath(removed, 0); removed.mProvider.asBinder().unlinkToDeath(removed, 0);
@ -4417,7 +4443,7 @@ public final class ActivityThread {
ContentProvider localProvider = null; ContentProvider localProvider = null;
if (provider == null) { if (provider == null) {
if (noisy) { if (noisy) {
Log.d(TAG, "Loading provider " + info.authority + ": " Slog.d(TAG, "Loading provider " + info.authority + ": "
+ info.name); + info.name);
} }
Context c = null; Context c = null;
@ -4452,7 +4478,7 @@ public final class ActivityThread {
info.applicationInfo.sourceDir); info.applicationInfo.sourceDir);
return null; return null;
} }
if (Config.LOGV) Log.v( if (Config.LOGV) Slog.v(
TAG, "Instantiating local provider " + info.name); TAG, "Instantiating local provider " + info.name);
// XXX Need to create the correct context for this provider. // XXX Need to create the correct context for this provider.
localProvider.attachInfo(c, info); localProvider.attachInfo(c, info);
@ -4465,7 +4491,7 @@ public final class ActivityThread {
return null; return null;
} }
} else if (localLOGV) { } else if (localLOGV) {
Log.v(TAG, "Installing external provider " + info.authority + ": " Slog.v(TAG, "Installing external provider " + info.authority + ": "
+ info.name); + info.name);
} }
@ -4586,6 +4612,6 @@ public final class ActivityThread {
String name = (thread.mInitialApplication != null) String name = (thread.mInitialApplication != null)
? thread.mInitialApplication.getPackageName() ? thread.mInitialApplication.getPackageName()
: "<unknown>"; : "<unknown>";
Log.i(TAG, "Main thread of " + name + " is now exiting"); Slog.i(TAG, "Main thread of " + name + " is now exiting");
} }
} }

View File

@ -796,7 +796,7 @@ class ContextImpl extends Context {
scheduler = mMainThread.getHandler(); scheduler = mMainThread.getHandler();
} }
rd = new ActivityThread.PackageInfo.ReceiverDispatcher( rd = new ActivityThread.PackageInfo.ReceiverDispatcher(
receiver, context, scheduler, null, false).getIIntentReceiver(); receiver, context, scheduler, null, true).getIIntentReceiver();
} }
} }
try { try {

View File

@ -179,6 +179,8 @@ class PackageManagerService extends IPackageManager.Stub {
static final int SCAN_NEW_INSTALL = 1<<4; static final int SCAN_NEW_INSTALL = 1<<4;
static final int SCAN_NO_PATHS = 1<<5; static final int SCAN_NO_PATHS = 1<<5;
static final int REMOVE_CHATTY = 1<<16;
static final ComponentName DEFAULT_CONTAINER_COMPONENT = new ComponentName( static final ComponentName DEFAULT_CONTAINER_COMPONENT = new ComponentName(
"com.android.defcontainer", "com.android.defcontainer",
"com.android.defcontainer.DefaultContainerService"); "com.android.defcontainer.DefaultContainerService");
@ -6068,7 +6070,8 @@ class PackageManagerService extends IPackageManager.Stub {
} }
synchronized (mInstallLock) { synchronized (mInstallLock) {
res = deletePackageLI(packageName, deleteCodeAndResources, flags, info); res = deletePackageLI(packageName, deleteCodeAndResources,
flags | REMOVE_CHATTY, info);
} }
if(res && sendBroadCast) { if(res && sendBroadCast) {
@ -6134,7 +6137,7 @@ class PackageManagerService extends IPackageManager.Stub {
if (outInfo != null) { if (outInfo != null) {
outInfo.removedPackage = packageName; outInfo.removedPackage = packageName;
} }
removePackageLI(p, true); removePackageLI(p, (flags&REMOVE_CHATTY) != 0);
// Retrieve object to delete permissions for shared user later on // Retrieve object to delete permissions for shared user later on
PackageSetting deletedPs; PackageSetting deletedPs;
synchronized (mPackages) { synchronized (mPackages) {
@ -9589,8 +9592,7 @@ class PackageManagerService extends IPackageManager.Stub {
continue; continue;
} }
// Parse package // Parse package
int parseFlags = PackageParser.PARSE_CHATTY | int parseFlags = PackageParser.PARSE_ON_SDCARD | mDefParseFlags;
PackageParser.PARSE_ON_SDCARD | mDefParseFlags;
doGc = true; doGc = true;
synchronized (mInstallLock) { synchronized (mInstallLock) {
final PackageParser.Package pkg = scanPackageLI(new File(codePath), final PackageParser.Package pkg = scanPackageLI(new File(codePath),

View File

@ -9905,7 +9905,7 @@ public final class ActivityManagerService extends ActivityManagerNative implemen
} }
if (mOrderedBroadcasts.size() > 0) { if (mOrderedBroadcasts.size() > 0) {
pw.println(" "); pw.println(" ");
pw.println(" Active serialized broadcasts:"); pw.println(" Active ordered broadcasts:");
} }
for (int i=mOrderedBroadcasts.size()-1; i>=0; i--) { for (int i=mOrderedBroadcasts.size()-1; i>=0; i--) {
pw.println(" Serialized Broadcast #" + i + ":"); pw.println(" Serialized Broadcast #" + i + ":");
@ -12919,7 +12919,7 @@ public final class ActivityManagerService extends ActivityManagerNative implemen
try { try {
if (DEBUG_BROADCAST_LIGHT) { if (DEBUG_BROADCAST_LIGHT) {
int seq = r.intent.getIntExtra("seq", -1); int seq = r.intent.getIntExtra("seq", -1);
Slog.i(TAG, "Delivering to " + filter.receiverList.app Slog.i(TAG, "Delivering to " + filter
+ " (seq=" + seq + "): " + r); + " (seq=" + seq + "): " + r);
} }
performReceive(filter.receiverList.app, filter.receiverList.receiver, performReceive(filter.receiverList.app, filter.receiverList.receiver,
@ -12959,7 +12959,7 @@ public final class ActivityManagerService extends ActivityManagerNative implemen
if (DEBUG_BROADCAST) Slog.v(TAG, "processNextBroadcast: " if (DEBUG_BROADCAST) Slog.v(TAG, "processNextBroadcast: "
+ mParallelBroadcasts.size() + " broadcasts, " + mParallelBroadcasts.size() + " broadcasts, "
+ mOrderedBroadcasts.size() + " serialized broadcasts"); + mOrderedBroadcasts.size() + " ordered broadcasts");
updateCpuStats(); updateCpuStats();
@ -12977,7 +12977,7 @@ public final class ActivityManagerService extends ActivityManagerNative implemen
for (int i=0; i<N; i++) { for (int i=0; i<N; i++) {
Object target = r.receivers.get(i); Object target = r.receivers.get(i);
if (DEBUG_BROADCAST) Slog.v(TAG, if (DEBUG_BROADCAST) Slog.v(TAG,
"Delivering non-serialized to registered " "Delivering non-ordered to registered "
+ target + ": " + r); + target + ": " + r);
deliverToRegisteredReceiver(r, (BroadcastFilter)target, false); deliverToRegisteredReceiver(r, (BroadcastFilter)target, false);
} }
@ -13115,12 +13115,14 @@ public final class ActivityManagerService extends ActivityManagerNative implemen
// a direct call. // a direct call.
BroadcastFilter filter = (BroadcastFilter)nextReceiver; BroadcastFilter filter = (BroadcastFilter)nextReceiver;
if (DEBUG_BROADCAST) Slog.v(TAG, if (DEBUG_BROADCAST) Slog.v(TAG,
"Delivering serialized to registered " "Delivering ordered to registered "
+ filter + ": " + r); + filter + ": " + r);
deliverToRegisteredReceiver(r, filter, r.ordered); deliverToRegisteredReceiver(r, filter, r.ordered);
if (r.receiver == null || !r.ordered) { if (r.receiver == null || !r.ordered) {
// The receiver has already finished, so schedule to // The receiver has already finished, so schedule to
// process the next one. // process the next one.
if (DEBUG_BROADCAST) Slog.v(TAG, "Quick finishing: ordered="
+ r.ordered + " receiver=" + r.receiver);
r.state = BroadcastRecord.IDLE; r.state = BroadcastRecord.IDLE;
scheduleBroadcastsLocked(); scheduleBroadcastsLocked();
} }

View File

@ -126,7 +126,9 @@ class BroadcastRecord extends Binder {
pw.println(prefix + "curApp=" + curApp); pw.println(prefix + "curApp=" + curApp);
pw.println(prefix + "curComponent=" pw.println(prefix + "curComponent="
+ (curComponent != null ? curComponent.toShortString() : "--")); + (curComponent != null ? curComponent.toShortString() : "--"));
pw.println(prefix + "curSourceDir=" + curReceiver.applicationInfo.sourceDir); if (curReceiver != null && curReceiver.applicationInfo != null) {
pw.println(prefix + "curSourceDir=" + curReceiver.applicationInfo.sourceDir);
}
} }
String stateStr = " (?)"; String stateStr = " (?)";
switch (state) { switch (state) {