Merge "Reduce unnecessary operations in the setFocusedTask" into udc-dev
This commit is contained in:
@@ -2011,6 +2011,10 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (r == mRootWindowContainer.getTopResumedActivity()) {
|
||||||
|
setLastResumedActivityUncheckLocked(r, "setFocusedTask-alreadyTop");
|
||||||
|
return;
|
||||||
|
}
|
||||||
final Transition transition = (getTransitionController().isCollecting()
|
final Transition transition = (getTransitionController().isCollecting()
|
||||||
|| !getTransitionController().isShellTransitionsEnabled()) ? null
|
|| !getTransitionController().isShellTransitionsEnabled()) ? null
|
||||||
: getTransitionController().createTransition(TRANSIT_TO_FRONT);
|
: getTransitionController().createTransition(TRANSIT_TO_FRONT);
|
||||||
@@ -4788,11 +4792,10 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {
|
|||||||
// until we've committed to the gesture. The focus will be transferred at the end of
|
// until we've committed to the gesture. The focus will be transferred at the end of
|
||||||
// the transition (if the transient launch is committed) or early if explicitly requested
|
// the transition (if the transient launch is committed) or early if explicitly requested
|
||||||
// via `setFocused*`.
|
// via `setFocused*`.
|
||||||
|
boolean focusedAppChanged = false;
|
||||||
if (!getTransitionController().isTransientCollect(r)) {
|
if (!getTransitionController().isTransientCollect(r)) {
|
||||||
final Task prevFocusTask = r.mDisplayContent.mFocusedApp != null
|
focusedAppChanged = r.mDisplayContent.setFocusedApp(r);
|
||||||
? r.mDisplayContent.mFocusedApp.getTask() : null;
|
if (focusedAppChanged) {
|
||||||
final boolean changed = r.mDisplayContent.setFocusedApp(r);
|
|
||||||
if (changed) {
|
|
||||||
mWindowManager.updateFocusedWindowLocked(UPDATE_FOCUS_NORMAL,
|
mWindowManager.updateFocusedWindowLocked(UPDATE_FOCUS_NORMAL,
|
||||||
true /*updateInputWindows*/);
|
true /*updateInputWindows*/);
|
||||||
}
|
}
|
||||||
@@ -4801,13 +4804,14 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {
|
|||||||
mTaskSupervisor.mRecentTasks.add(task);
|
mTaskSupervisor.mRecentTasks.add(task);
|
||||||
}
|
}
|
||||||
|
|
||||||
applyUpdateLockStateLocked(r);
|
if (focusedAppChanged) {
|
||||||
applyUpdateVrModeLocked(r);
|
applyUpdateLockStateLocked(r);
|
||||||
|
}
|
||||||
|
if (mVrController.mVrService != null) {
|
||||||
|
applyUpdateVrModeLocked(r);
|
||||||
|
}
|
||||||
|
|
||||||
EventLogTags.writeWmSetResumedActivity(
|
EventLogTags.writeWmSetResumedActivity(r.mUserId, r.shortComponentName, reason);
|
||||||
r == null ? -1 : r.mUserId,
|
|
||||||
r == null ? "NULL" : r.shortComponentName,
|
|
||||||
reason);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
final class SleepTokenAcquirerImpl implements ActivityTaskManagerInternal.SleepTokenAcquirer {
|
final class SleepTokenAcquirerImpl implements ActivityTaskManagerInternal.SleepTokenAcquirer {
|
||||||
|
|||||||
@@ -126,6 +126,9 @@ final class VrController {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/** If it is null after system ready, then VR mode is not supported. */
|
||||||
|
VrManagerInternal mVrService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create new VrController instance.
|
* Create new VrController instance.
|
||||||
*
|
*
|
||||||
@@ -141,6 +144,7 @@ final class VrController {
|
|||||||
public void onSystemReady() {
|
public void onSystemReady() {
|
||||||
VrManagerInternal vrManagerInternal = LocalServices.getService(VrManagerInternal.class);
|
VrManagerInternal vrManagerInternal = LocalServices.getService(VrManagerInternal.class);
|
||||||
if (vrManagerInternal != null) {
|
if (vrManagerInternal != null) {
|
||||||
|
mVrService = vrManagerInternal;
|
||||||
vrManagerInternal.addPersistentVrModeStateListener(mPersistentVrModeListener);
|
vrManagerInternal.addPersistentVrModeStateListener(mPersistentVrModeListener);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -181,7 +185,7 @@ final class VrController {
|
|||||||
public boolean onVrModeChanged(ActivityRecord record) {
|
public boolean onVrModeChanged(ActivityRecord record) {
|
||||||
// This message means that the top focused activity enabled VR mode (or an activity
|
// This message means that the top focused activity enabled VR mode (or an activity
|
||||||
// that previously set this has become focused).
|
// that previously set this has become focused).
|
||||||
VrManagerInternal vrService = LocalServices.getService(VrManagerInternal.class);
|
final VrManagerInternal vrService = mVrService;
|
||||||
if (vrService == null) {
|
if (vrService == null) {
|
||||||
// VR mode isn't supported on this device.
|
// VR mode isn't supported on this device.
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user