Merge "Allow resumed activity to turn-screen-on only when being started" into tm-qpr-dev
This commit is contained in:
@@ -5460,7 +5460,10 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
|
|||||||
wasStopped, this);
|
wasStopped, this);
|
||||||
mAppStopped = false;
|
mAppStopped = false;
|
||||||
// Allow the window to turn the screen on once the app is resumed again.
|
// Allow the window to turn the screen on once the app is resumed again.
|
||||||
setCurrentLaunchCanTurnScreenOn(true);
|
if (mAtmService.getActivityStartController().isInExecution()) {
|
||||||
|
setCurrentLaunchCanTurnScreenOn(true);
|
||||||
|
}
|
||||||
|
|
||||||
if (!wasStopped) {
|
if (!wasStopped) {
|
||||||
destroySurfaces(true /*cleanupOnResume*/);
|
destroySurfaces(true /*cleanupOnResume*/);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -90,6 +90,8 @@ public class ActivityStartController {
|
|||||||
|
|
||||||
boolean mCheckedForSetup = false;
|
boolean mCheckedForSetup = false;
|
||||||
|
|
||||||
|
private boolean mInExecution = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO(b/64750076): Capture information necessary for dump and
|
* TODO(b/64750076): Capture information necessary for dump and
|
||||||
* {@link #postStartActivityProcessingForLastStarter} rather than keeping the entire object
|
* {@link #postStartActivityProcessingForLastStarter} rather than keeping the entire object
|
||||||
@@ -123,7 +125,15 @@ public class ActivityStartController {
|
|||||||
return mFactory.obtain().setIntent(intent).setReason(reason);
|
return mFactory.obtain().setIntent(intent).setReason(reason);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void onExecutionStarted(ActivityStarter starter) {
|
||||||
|
mInExecution = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean isInExecution() {
|
||||||
|
return mInExecution;
|
||||||
|
}
|
||||||
void onExecutionComplete(ActivityStarter starter) {
|
void onExecutionComplete(ActivityStarter starter) {
|
||||||
|
mInExecution = false;
|
||||||
if (mLastStarter == null) {
|
if (mLastStarter == null) {
|
||||||
mLastStarter = mFactory.obtain();
|
mLastStarter = mFactory.obtain();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -633,6 +633,8 @@ class ActivityStarter {
|
|||||||
*/
|
*/
|
||||||
int execute() {
|
int execute() {
|
||||||
try {
|
try {
|
||||||
|
onExecutionStarted();
|
||||||
|
|
||||||
// Refuse possible leaked file descriptors
|
// Refuse possible leaked file descriptors
|
||||||
if (mRequest.intent != null && mRequest.intent.hasFileDescriptors()) {
|
if (mRequest.intent != null && mRequest.intent.hasFileDescriptors()) {
|
||||||
throw new IllegalArgumentException("File descriptors passed in Intent");
|
throw new IllegalArgumentException("File descriptors passed in Intent");
|
||||||
@@ -1247,6 +1249,10 @@ class ActivityStarter {
|
|||||||
mController.onExecutionComplete(this);
|
mController.onExecutionComplete(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void onExecutionStarted() {
|
||||||
|
mController.onExecutionStarted(this);
|
||||||
|
}
|
||||||
|
|
||||||
private boolean isHomeApp(int uid, @Nullable String packageName) {
|
private boolean isHomeApp(int uid, @Nullable String packageName) {
|
||||||
if (mService.mHomeProcess != null) {
|
if (mService.mHomeProcess != null) {
|
||||||
// Fast check
|
// Fast check
|
||||||
|
|||||||
Reference in New Issue
Block a user