Send bubble bar location update source to shell

Shell can use the location update trigger information for logging
purposes.

Bug: 349845968
Test: manual
Flag: com.android.wm.shell.enable_bubble_bar
Change-Id: I5af4375f88ea438b1aed9b3b2bd02d0c33fff53f
This commit is contained in:
Ats Jenk
2024-11-06 12:07:32 -08:00
parent 270e1c3dc4
commit 5140e8ca7e
6 changed files with 29 additions and 16 deletions
@@ -526,9 +526,10 @@ public class BubbleBarController extends IBubblesListener.Stub {
* <p>
* Updates the value locally in Launcher and in WMShell.
*/
public void updateBubbleBarLocation(BubbleBarLocation location) {
public void updateBubbleBarLocation(BubbleBarLocation location,
@BubbleBarLocation.UpdateSource int source) {
updateBubbleBarLocationInternal(location);
mSystemUiProxy.setBubbleBarLocation(location);
mSystemUiProxy.setBubbleBarLocation(location, source);
}
private void updateBubbleBarLocationInternal(BubbleBarLocation location) {
@@ -407,11 +407,13 @@ public class BubbleBarView extends FrameLayout {
return true;
}
if (action == R.id.action_move_left) {
mController.updateBubbleBarLocation(BubbleBarLocation.LEFT);
mController.updateBubbleBarLocation(BubbleBarLocation.LEFT,
BubbleBarLocation.UpdateSource.A11Y_ACTION_BAR);
return true;
}
if (action == R.id.action_move_right) {
mController.updateBubbleBarLocation(BubbleBarLocation.RIGHT);
mController.updateBubbleBarLocation(BubbleBarLocation.RIGHT,
BubbleBarLocation.UpdateSource.A11Y_ACTION_BAR);
return true;
}
return false;
@@ -1560,6 +1562,7 @@ public class BubbleBarView extends FrameLayout {
void dismissBubbleBar();
/** Requests the controller to update bubble bar location to the given value */
void updateBubbleBarLocation(BubbleBarLocation location);
void updateBubbleBarLocation(BubbleBarLocation location,
@BubbleBarLocation.UpdateSource int source);
}
}
@@ -217,8 +217,9 @@ public class BubbleBarViewController {
}
@Override
public void updateBubbleBarLocation(BubbleBarLocation location) {
mBubbleBarController.updateBubbleBarLocation(location);
public void updateBubbleBarLocation(BubbleBarLocation location,
@BubbleBarLocation.UpdateSource int source) {
mBubbleBarController.updateBubbleBarLocation(location, source);
}
});
@@ -242,8 +243,9 @@ public class BubbleBarViewController {
}
@Override
public void updateBubbleBarLocation(BubbleBarLocation location) {
mBubbleBarController.updateBubbleBarLocation(location);
public void updateBubbleBarLocation(BubbleBarLocation location,
@BubbleBarLocation.UpdateSource int source) {
mBubbleBarController.updateBubbleBarLocation(location, source);
}
};
}
@@ -161,7 +161,8 @@ public class BubbleDragController {
@Override
void onDragEnd() {
mBubbleBarController.updateBubbleBarLocation(mReleasedLocation);
mBubbleBarController.updateBubbleBarLocation(mReleasedLocation,
BubbleBarLocation.UpdateSource.DRAG_BUBBLE);
mBubbleBarViewController.onBubbleDragEnd();
mBubblePinController.setListener(null);
}
@@ -226,7 +227,8 @@ public class BubbleDragController {
@Override
void onDragEnd() {
// Make sure to update location as the first thing. Pivot update causes a relayout
mBubbleBarController.updateBubbleBarLocation(mReleasedLocation);
mBubbleBarController.updateBubbleBarLocation(mReleasedLocation,
BubbleBarLocation.UpdateSource.DRAG_BAR);
bubbleBarView.setIsDragging(false);
// Restoring the initial pivot for the bubble bar view
bubbleBarView.setRelativePivot(initialRelativePivot.x, initialRelativePivot.y);
@@ -222,12 +222,14 @@ public class BubbleView extends ConstraintLayout {
}
if (action == R.id.action_move_left) {
if (mController != null) {
mController.updateBubbleBarLocation(BubbleBarLocation.LEFT);
mController.updateBubbleBarLocation(BubbleBarLocation.LEFT,
BubbleBarLocation.UpdateSource.A11Y_ACTION_BUBBLE);
}
}
if (action == R.id.action_move_right) {
if (mController != null) {
mController.updateBubbleBarLocation(BubbleBarLocation.RIGHT);
mController.updateBubbleBarLocation(BubbleBarLocation.RIGHT,
BubbleBarLocation.UpdateSource.A11Y_ACTION_BUBBLE);
}
}
return false;
@@ -456,6 +458,7 @@ public class BubbleView extends ConstraintLayout {
void collapse();
/** Request bubble bar location to be updated to the given location */
void updateBubbleBarLocation(BubbleBarLocation location);
void updateBubbleBarLocation(BubbleBarLocation location,
@BubbleBarLocation.UpdateSource int source);
}
}
@@ -885,10 +885,12 @@ public class SystemUiProxy implements ISystemUiProxy, NavHandle {
/**
* Tells SysUI to update the bubble bar location to the new location.
* @param location new location for the bubble bar
* @param source what triggered the location update
*/
public void setBubbleBarLocation(BubbleBarLocation location) {
public void setBubbleBarLocation(BubbleBarLocation location,
@BubbleBarLocation.UpdateSource int source) {
try {
mBubbles.setBubbleBarLocation(location);
mBubbles.setBubbleBarLocation(location, source);
} catch (RemoteException e) {
Log.w(TAG, "Failed call setBubbleBarLocation");
}