Notify system to report the rounded corners that task bar draws

Task bar draws fake rouned corner above itself and it should notify
system to report that fake ones to apps.

Bug: 196387239
Test: make

Change-Id: I1d9732de71fbe653ed56e468e211b1bfb4dd2b37
This commit is contained in:
shawnlin
2021-10-28 17:14:57 +08:00
parent 86afc595d1
commit beae64cd95
2 changed files with 15 additions and 0 deletions

View File

@@ -212,6 +212,8 @@ public class TaskbarActivityContext extends ContextThemeWrapper implements Activ
mWindowLayoutParams.providedInternalImeInsets = Insets.of(0,
getDefaultTaskbarWindowHeight() - mTaskbarHeightForIme, 0, 0);
mWindowLayoutParams.insetsRoundedCornerFrame = true;
// Initialize controllers after all are constructed.
mControllers.init(sharedState);
updateSysuiStateFlags(sharedState.sysuiStateFlags, true /* fromInit */);
@@ -445,6 +447,18 @@ public class TaskbarActivityContext extends ContextThemeWrapper implements Activ
return mIsFullscreen;
}
/**
* Notify system to inset the rounded corner frame based on the task bar insets.
*/
public void updateInsetRoundedCornerFrame(boolean shouldInsetsRoundedCorner) {
if (!mDragLayer.isAttachedToWindow()
|| mWindowLayoutParams.insetsRoundedCornerFrame == shouldInsetsRoundedCorner) {
return;
}
mWindowLayoutParams.insetsRoundedCornerFrame = shouldInsetsRoundedCorner;
mWindowManager.updateViewLayout(mDragLayer, mWindowLayoutParams);
}
/**
* Updates the TaskbarContainer height (pass {@link #getDefaultTaskbarWindowHeight()} to reset).
*/