We believe we are seeing a similar problem when we try to upgrade our APK. The APK contains a custom launcher implementation. We see a loop of ActivityManager trying to start our launcher activity, followed by the "force closing activity message" followed again by starting the launcher activity. Looking at the filesystem suggests that the upgrade was never completed successfully.
07-01 11:29:02.965: INFO/ActivityManager(2728): Force finishing activity ActivityRecord{b5923938 com.ourdomain/com.oldpackagename.OurLauncherActivity}
07-01 11:29:02.965: INFO/ActivityManager(2728): START {act=android.intent.action.MAIN cat=[android.intent.category.HOME] flg=0x10000000 cmp=com.ourdomain/com.oldpackagename.OurLauncherActivity u=0} from pid 0
07-01 11:29:02.975: INFO/ActivityManager(2728): Start proc com.ourdomain for activity com.ourdomain/com.oldpackagename.OurLauncherActivity: pid=3250 uid=10044 gids={3003, 1015, 1028}
07-01 11:29:02.985: INFO/ActivityManager(2728): Force finishing activity ActivityRecord{b5921a18 com.ourdomain/com.oldpackagename.OurLauncherActivity}
07-01 11:29:02.985: INFO/ActivityManager(2728): START {act=android.intent.action.MAIN cat=[android.intent.category.HOME] flg=0x10000000 cmp=com.ourdomain/com.oldpackagename.OurLauncherActivity u=0} from pid 0
07-01 11:29:02.985: INFO/ActivityManager(2728): Force finishing activity ActivityRecord{b597f4a0 com.ourdomain/com.oldpackagename.OurLauncherActivity}
07-01 11:29:02.985: INFO/ActivityManager(2728): START {act=android.intent.action.MAIN cat=[android.intent.category.HOME] flg=0x10000000 cmp=com.ourdomain/com.oldpackagename.OurLauncherActivity u=0} from pid 0
07-01 11:29:02.985: INFO/ActivityManager(2728): Force finishing activity ActivityRecord{b5980b18 com.ourdomain/com.oldpackagename.OurLauncherActivity}
07-01 11:29:02.985: INFO/ActivityManager(2728): START {act=android.intent.action.MAIN cat=[android.intent.category.HOME] flg=0x10000000 cmp=com.ourdomain/com.oldpackagename.OurLauncherActivity u=0} from pid 0
07-01 11:29:02.985: INFO/ActivityManager(2728): Force finishing activity ActivityRecord{b5941620 com.ourdomain/com.oldpackagename.OurLauncherActivity}
07-01 11:29:02.985: INFO/ActivityManager(2728): START {act=android.intent.action.MAIN cat=[android.intent.category.HOME] flg=0x10000000 cmp=com.ourdomain/com.oldpackagename.OurLauncherActivity u=0} from pid 0
07-01 11:29:02.985: INFO/ActivityManager(2728): Force finishing activity ActivityRecord{b591ac50 com.ourdomain/com.oldpackagename.OurLauncherActivity}
07-01 11:29:02.985: INFO/ActivityManager(2728): START {act=android.intent.action.MAIN cat=[android.intent.category.HOME] flg=0x10000000 cmp=com.ourdomain/com.oldpackagename.OurLauncherActivity u=0} from pid 0
07-01 11:29:02.985: INFO/ActivityManager(2728): Force finishing activity ActivityRecord{b591c308 com.ourdomain/com.oldpackagename.OurLauncherActivity}
07-01 11:29:02.985: INFO/ActivityManager(2728): START {act=android.intent.action.MAIN cat=[android.intent.category.HOME] flg=0x10000000 cmp=com.ourdomain/com.oldpackagename.OurLauncherActivity u=0} from pid 0
07-01 11:29:02.985: INFO/ActivityManager(2728): Force finishing activity ActivityRecord{b594beb8 com.ourdomain/com.oldpackagename.OurLauncherActivity}
On Wednesday, May 15, 2013 5:00:04 AM UTC-4, Lalit Kansara wrote:
Description: We are observing framework reboot issue when there is only Launcher activity from Launcher2 package in the activity stack and a new activity WallpaperChooser activity form same package is started through adb shell. The Launcher activity is finished forcefully in this case and started back but it traps in an infinite loop being finished and started continuously. Watchdog kills system process resulting in framework reboot. This can happen with other packages too.
Steps to reproduce the issue:
1. After rebooting the phone let the home screen come or lock screen or launcher screen
2. Run the following command
$ adb shell am start -S com.android.launcher/com.android.launcher2.WallpaperChooser
Android OS: Jelly Bean
Android OS: JB-MR1-DEV
A possible fix for this issue is given in Green text as-
private final boolean
forceStopPackageLocked(String name, int uid,
boolean
callerWillRestart, boolean purgeCache, boolean doit,
boolean
evenPersistent, int userId) {
int i;
int N;
int lastHistorySize;
...
...
...
for (i=0;
i<mMainStack.mHistory.size(); i++) {
ActivityRecord r = (ActivityRecord)mMainStack.mHistory.get(i);
final
boolean samePackage = r.packageName.equals(name);
if (r.userId
== userId
&& (samePackage || r.task == lastTask)
&& (r.app == null || evenPersistent || !r.app.persistent)) {
...
...
lastTask = r.task;
lastHistorySize = mMainStack.mHistory.size();
if (r.stack.finishActivityLocked(r, i, Activity.RESULT_CANCELED,
null, "force-stop", true)) {
int historySize = mMainStack.mHistory.size();
// If lastHistorySize before finishing the activity is equal to
// current history Size and also it was the last record in the
// stack then we should skip decrement of index to avoid an
// infinite loop.
if (lastHistorySize == historySize && i == historySize - 1) {
continue;
}
i--;
}
}
}
...
...
...
return didSomething;
}
Can someone from Google provide fix?
Thanks,
Lalit Kansara.