Merge "Fix privacy indicators in QQS with new headers" into tm-qpr-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
6b3114884e
@@ -25,6 +25,7 @@ import android.graphics.Rect;
|
||||
import android.util.AttributeSet;
|
||||
import android.util.Pair;
|
||||
import android.view.DisplayCutout;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.WindowInsets;
|
||||
@@ -231,6 +232,16 @@ public class QuickStatusBarHeader extends FrameLayout {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onTouchEvent(MotionEvent event) {
|
||||
// If using combined headers, only react to touches inside QuickQSPanel
|
||||
if (!mUseCombinedQSHeader || event.getY() > mHeaderQsPanel.getTop()) {
|
||||
return super.onTouchEvent(event);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
void updateResources() {
|
||||
Resources resources = mContext.getResources();
|
||||
boolean largeScreenHeaderActive =
|
||||
|
||||
@@ -280,6 +280,9 @@ class LargeScreenShadeHeaderController @Inject constructor(
|
||||
context.getString(com.android.internal.R.string.status_bar_alarm_clock)
|
||||
)
|
||||
}
|
||||
if (combinedHeaders) {
|
||||
privacyIconsController.onParentVisible()
|
||||
}
|
||||
}
|
||||
|
||||
override fun onViewAttached() {
|
||||
|
||||
@@ -645,6 +645,20 @@ class LargeScreenShadeHeaderControllerCombinedTest : SysuiTestCase() {
|
||||
verify(animator).start()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun privacyChipParentVisibleFromStart() {
|
||||
verify(privacyIconsController).onParentVisible()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun privacyChipParentVisibleAlways() {
|
||||
controller.largeScreenActive = true
|
||||
controller.largeScreenActive = false
|
||||
controller.largeScreenActive = true
|
||||
|
||||
verify(privacyIconsController, never()).onParentInvisible()
|
||||
}
|
||||
|
||||
private fun createWindowInsets(
|
||||
topCutout: Rect? = Rect()
|
||||
): WindowInsets {
|
||||
|
||||
Reference in New Issue
Block a user