am 6f33b65f: Merge "Fix issue #2999757: "Application Redirected" dialogue showing up erratically" into gingerbread

Merge commit '6f33b65f8033cf8644eb4ba727421b90bd4c0ae9' into gingerbread-plus-aosp

* commit '6f33b65f8033cf8644eb4ba727421b90bd4c0ae9':
  Fix issue #2999757: "Application Redirected" dialogue showing up erratically
This commit is contained in:
Dianne Hackborn
2010-09-21 00:27:06 -07:00
committed by Android Git Automerger

View File

@@ -1104,26 +1104,30 @@ public class ActivityStack {
// Okay we are now going to start a switch, to 'next'. We may first // Okay we are now going to start a switch, to 'next'. We may first
// have to pause the current activity, but this is an important point // have to pause the current activity, but this is an important point
// where we have decided to go to 'next' so keep track of that. // where we have decided to go to 'next' so keep track of that.
if (mLastStartedActivity != null && !mLastStartedActivity.finishing) { // XXX "App Redirected" dialog is getting too many false positives
long now = SystemClock.uptimeMillis(); // at this point, so turn off for now.
final boolean inTime = mLastStartedActivity.startTime != 0 if (false) {
&& (mLastStartedActivity.startTime + START_WARN_TIME) >= now; if (mLastStartedActivity != null && !mLastStartedActivity.finishing) {
final int lastUid = mLastStartedActivity.info.applicationInfo.uid; long now = SystemClock.uptimeMillis();
final int nextUid = next.info.applicationInfo.uid; final boolean inTime = mLastStartedActivity.startTime != 0
if (inTime && lastUid != nextUid && (mLastStartedActivity.startTime + START_WARN_TIME) >= now;
&& lastUid != next.launchedFromUid final int lastUid = mLastStartedActivity.info.applicationInfo.uid;
&& mService.checkPermission( final int nextUid = next.info.applicationInfo.uid;
android.Manifest.permission.STOP_APP_SWITCHES, if (inTime && lastUid != nextUid
-1, next.launchedFromUid) && lastUid != next.launchedFromUid
!= PackageManager.PERMISSION_GRANTED) { && mService.checkPermission(
mService.showLaunchWarningLocked(mLastStartedActivity, next); android.Manifest.permission.STOP_APP_SWITCHES,
-1, next.launchedFromUid)
!= PackageManager.PERMISSION_GRANTED) {
mService.showLaunchWarningLocked(mLastStartedActivity, next);
} else {
next.startTime = now;
mLastStartedActivity = next;
}
} else { } else {
next.startTime = now; next.startTime = SystemClock.uptimeMillis();
mLastStartedActivity = next; mLastStartedActivity = next;
} }
} else {
next.startTime = SystemClock.uptimeMillis();
mLastStartedActivity = next;
} }
// We need to start pausing the current activity so the top one // We need to start pausing the current activity so the top one