}
if (!r.isFocusable()) {
- if (DEBUG_FOCUS) Slog.d(TAG_FOCUS,
- "setFocusedActivityLocked: unfocusable r=" + r);
+ if (DEBUG_FOCUS) Slog.d(TAG_FOCUS, "setFocusedActivityLocked: unfocusable r=" + r);
return false;
}
synchronized (ActivityManagerService.this) {
TaskRecord task = mStackSupervisor.anyTaskForIdLocked(taskId);
if (task != null) {
- ActivityRecord r = task.topRunningActivityLocked();
- if (r != null) {
- setFocusedActivityLocked(r, "setFocusedTask");
+ final ActivityRecord r = task.topRunningActivityLocked();
+ if (setFocusedActivityLocked(r, "setFocusedTask")) {
mStackSupervisor.resumeFocusedStackTopActivityLocked();
}
}