Merge "Add aborted start result." into oc-dev
This commit is contained in:
@@ -359,6 +359,13 @@ public class ActivityManager {
|
|||||||
public static final int START_RETURN_LOCK_TASK_MODE_VIOLATION =
|
public static final int START_RETURN_LOCK_TASK_MODE_VIOLATION =
|
||||||
FIRST_START_NON_FATAL_ERROR_CODE + 1;
|
FIRST_START_NON_FATAL_ERROR_CODE + 1;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Result for IActivityManaqer.startActivity: a new activity start was aborted. Never returned
|
||||||
|
* externally.
|
||||||
|
* @hide
|
||||||
|
*/
|
||||||
|
public static final int START_ABORTED = FIRST_START_NON_FATAL_ERROR_CODE + 2;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Flag for IActivityManaqer.startActivity: do special start mode where
|
* Flag for IActivityManaqer.startActivity: do special start mode where
|
||||||
* a new activity is launched only if it is needed.
|
* a new activity is launched only if it is needed.
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
package com.android.server.am;
|
package com.android.server.am;
|
||||||
|
|
||||||
import static android.app.Activity.RESULT_CANCELED;
|
import static android.app.Activity.RESULT_CANCELED;
|
||||||
|
import static android.app.ActivityManager.START_ABORTED;
|
||||||
import static android.app.ActivityManager.START_CANCELED;
|
import static android.app.ActivityManager.START_CANCELED;
|
||||||
import static android.app.ActivityManager.START_CLASS_NOT_FOUND;
|
import static android.app.ActivityManager.START_CLASS_NOT_FOUND;
|
||||||
import static android.app.ActivityManager.START_DELIVERED_TO_TOP;
|
import static android.app.ActivityManager.START_DELIVERED_TO_TOP;
|
||||||
@@ -279,7 +280,9 @@ class ActivityStarter {
|
|||||||
// mLastStartActivityRecord[0] is set in the call to startActivity above.
|
// mLastStartActivityRecord[0] is set in the call to startActivity above.
|
||||||
outActivity[0] = mLastStartActivityRecord[0];
|
outActivity[0] = mLastStartActivityRecord[0];
|
||||||
}
|
}
|
||||||
return mLastStartActivityResult;
|
|
||||||
|
// Aborted results are treated as successes externally, but we must track them internally.
|
||||||
|
return mLastStartActivityResult != START_ABORTED ? mLastStartActivityResult : START_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** DO NOT call this method directly. Use {@link #startActivityLocked} instead. */
|
/** DO NOT call this method directly. Use {@link #startActivityLocked} instead. */
|
||||||
@@ -465,7 +468,7 @@ class ActivityStarter {
|
|||||||
// We pretend to the caller that it was really started, but
|
// We pretend to the caller that it was really started, but
|
||||||
// they will just get a cancel result.
|
// they will just get a cancel result.
|
||||||
ActivityOptions.abort(options);
|
ActivityOptions.abort(options);
|
||||||
return START_SUCCESS;
|
return START_ABORTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If permissions need a review before any of the app components can run, we
|
// If permissions need a review before any of the app components can run, we
|
||||||
|
|||||||
Reference in New Issue
Block a user