Merge "Pass displayId to onActivityRotation()" into rvc-dev
This commit is contained in:
@@ -224,6 +224,8 @@ oneway interface ITaskStackListener {
|
||||
* * forced rotation
|
||||
* * rotation settings set through adb command line
|
||||
* * rotation that occurs when rotation tile is toggled in quick settings
|
||||
*
|
||||
* @param displayId id of the display where activity will rotate
|
||||
*/
|
||||
void onActivityRotation();
|
||||
void onActivityRotation(int displayId);
|
||||
}
|
||||
|
||||
@@ -201,6 +201,6 @@ public abstract class TaskStackListener extends ITaskStackListener.Stub {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityRotation() {
|
||||
public void onActivityRotation(int displayId) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -115,6 +115,6 @@ public abstract class TaskStackChangeListener {
|
||||
/** @see ITaskStackListener#onRecentTaskListFrozenChanged(boolean) */
|
||||
public void onRecentTaskListFrozenChanged(boolean frozen) { }
|
||||
|
||||
/** @see ITaskStackListener#onActivityRotation()*/
|
||||
public void onActivityRotation() { }
|
||||
/** @see ITaskStackListener#onActivityRotation(int)*/
|
||||
public void onActivityRotation(int displayId) { }
|
||||
}
|
||||
|
||||
@@ -238,8 +238,9 @@ public class TaskStackChangeListeners extends TaskStackListener {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityRotation() {
|
||||
mHandler.obtainMessage(H.ON_ACTIVITY_ROTATION).sendToTarget();
|
||||
public void onActivityRotation(int displayId) {
|
||||
mHandler.obtainMessage(H.ON_ACTIVITY_ROTATION, displayId, 0 /* unused */)
|
||||
.sendToTarget();
|
||||
}
|
||||
|
||||
private final class H extends Handler {
|
||||
@@ -435,7 +436,7 @@ public class TaskStackChangeListeners extends TaskStackListener {
|
||||
}
|
||||
case ON_ACTIVITY_ROTATION: {
|
||||
for (int i = mTaskStackListeners.size() - 1; i >= 0; i--) {
|
||||
mTaskStackListeners.get(i).onActivityRotation();
|
||||
mTaskStackListeners.get(i).onActivityRotation(msg.arg1);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -185,7 +185,7 @@ class TaskChangeNotificationController {
|
||||
};
|
||||
|
||||
private final TaskStackConsumer mNotifyOnActivityRotation = (l, m) -> {
|
||||
l.onActivityRotation();
|
||||
l.onActivityRotation(m.arg1);
|
||||
};
|
||||
|
||||
@FunctionalInterface
|
||||
@@ -583,9 +583,10 @@ class TaskChangeNotificationController {
|
||||
msg.sendToTarget();
|
||||
}
|
||||
|
||||
/** @see android.app.ITaskStackListener#onActivityRotation() */
|
||||
void notifyOnActivityRotation() {
|
||||
final Message msg = mHandler.obtainMessage(NOTIFY_ACTIVITY_ROTATED_MSG);
|
||||
/** @see android.app.ITaskStackListener#onActivityRotation(int) */
|
||||
void notifyOnActivityRotation(int displayId) {
|
||||
final Message msg = mHandler.obtainMessage(NOTIFY_ACTIVITY_ROTATED_MSG,
|
||||
displayId, 0 /* unused */);
|
||||
forAllLocalListeners(mNotifyOnActivityRotation, msg);
|
||||
msg.sendToTarget();
|
||||
}
|
||||
|
||||
@@ -3850,7 +3850,7 @@ public class WindowManagerService extends IWindowManager.Stub
|
||||
|
||||
if (rotationChanged) {
|
||||
mAtmService.getTaskChangeNotificationController()
|
||||
.notifyOnActivityRotation();
|
||||
.notifyOnActivityRotation(displayContent.mDisplayId);
|
||||
}
|
||||
|
||||
if (!rotationChanged || forceRelayout) {
|
||||
|
||||
Reference in New Issue
Block a user