Remove click listeners from app op icons
Instead, the click listener is set on the app opp container since clicking on the app opp container results in the same action as clickng on the individual app icons. As per a11y guidance, only set the click listener on the container. Test: manual Fixes: 153281363 Change-Id: Ic1c2bdb2f77fc459a3a3e997ed494b4bab36a273
This commit is contained in:
@@ -17,7 +17,6 @@
|
||||
package android.view;
|
||||
|
||||
import android.annotation.Nullable;
|
||||
import android.app.AppOpsManager;
|
||||
import android.app.Notification;
|
||||
import android.compat.annotation.UnsupportedAppUsage;
|
||||
import android.content.Context;
|
||||
@@ -27,7 +26,6 @@ import android.graphics.Canvas;
|
||||
import android.graphics.Outline;
|
||||
import android.graphics.Rect;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.util.ArraySet;
|
||||
import android.util.AttributeSet;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
@@ -396,6 +394,7 @@ public class NotificationHeaderView extends ViewGroup {
|
||||
addRectAroundView(mIcon);
|
||||
mExpandButtonRect = addRectAroundView(mExpandButton);
|
||||
mAppOpsRect = addRectAroundView(mAppOps);
|
||||
setTouchDelegate(new TouchDelegate(mAppOpsRect, mAppOps));
|
||||
addWidthRect();
|
||||
mTouchSlop = ViewConfiguration.get(getContext()).getScaledTouchSlop();
|
||||
}
|
||||
|
||||
@@ -143,34 +143,35 @@
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_marginStart="6dp"
|
||||
android:orientation="horizontal" >
|
||||
<ImageButton
|
||||
android:background="?android:selectableItemBackgroundBorderless"
|
||||
android:orientation="horizontal">
|
||||
<ImageView
|
||||
android:id="@+id/camera"
|
||||
android:layout_width="?attr/notificationHeaderIconSize"
|
||||
android:layout_height="?attr/notificationHeaderIconSize"
|
||||
android:src="@drawable/ic_camera"
|
||||
android:background="?android:selectableItemBackgroundBorderless"
|
||||
android:visibility="gone"
|
||||
android:focusable="false"
|
||||
android:contentDescription="@string/notification_appops_camera_active"
|
||||
/>
|
||||
<ImageButton
|
||||
<ImageView
|
||||
android:id="@+id/mic"
|
||||
android:layout_width="?attr/notificationHeaderIconSize"
|
||||
android:layout_height="?attr/notificationHeaderIconSize"
|
||||
android:src="@drawable/ic_mic"
|
||||
android:background="?android:selectableItemBackgroundBorderless"
|
||||
android:layout_marginStart="4dp"
|
||||
android:visibility="gone"
|
||||
android:focusable="false"
|
||||
android:contentDescription="@string/notification_appops_microphone_active"
|
||||
/>
|
||||
<ImageButton
|
||||
<ImageView
|
||||
android:id="@+id/overlay"
|
||||
android:layout_width="?attr/notificationHeaderIconSize"
|
||||
android:layout_height="?attr/notificationHeaderIconSize"
|
||||
android:src="@drawable/ic_alert_window_layer"
|
||||
android:background="?android:selectableItemBackgroundBorderless"
|
||||
android:layout_marginStart="4dp"
|
||||
android:visibility="gone"
|
||||
android:focusable="false"
|
||||
android:contentDescription="@string/notification_appops_overlay_active"
|
||||
/>
|
||||
</LinearLayout>
|
||||
|
||||
@@ -195,35 +195,36 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:paddingTop="3dp"
|
||||
android:layout_marginStart="2dp"
|
||||
android:background="?android:selectableItemBackgroundBorderless"
|
||||
android:orientation="horizontal" >
|
||||
<ImageButton
|
||||
<ImageView
|
||||
android:layout_marginStart="4dp"
|
||||
android:id="@+id/camera"
|
||||
android:layout_width="?attr/notificationHeaderIconSize"
|
||||
android:layout_height="?attr/notificationHeaderIconSize"
|
||||
android:src="@drawable/ic_camera"
|
||||
android:background="?android:selectableItemBackgroundBorderless"
|
||||
android:visibility="gone"
|
||||
android:focusable="false"
|
||||
android:contentDescription="@string/notification_appops_camera_active"
|
||||
/>
|
||||
<ImageButton
|
||||
<ImageView
|
||||
android:id="@+id/mic"
|
||||
android:layout_width="?attr/notificationHeaderIconSize"
|
||||
android:layout_height="?attr/notificationHeaderIconSize"
|
||||
android:src="@drawable/ic_mic"
|
||||
android:background="?android:selectableItemBackgroundBorderless"
|
||||
android:layout_marginStart="4dp"
|
||||
android:visibility="gone"
|
||||
android:focusable="false"
|
||||
android:contentDescription="@string/notification_appops_microphone_active"
|
||||
/>
|
||||
<ImageButton
|
||||
<ImageView
|
||||
android:id="@+id/overlay"
|
||||
android:layout_width="?attr/notificationHeaderIconSize"
|
||||
android:layout_height="?attr/notificationHeaderIconSize"
|
||||
android:src="@drawable/ic_alert_window_layer"
|
||||
android:background="?android:selectableItemBackgroundBorderless"
|
||||
android:layout_marginStart="4dp"
|
||||
android:visibility="gone"
|
||||
android:focusable="false"
|
||||
android:contentDescription="@string/notification_appops_overlay_active"
|
||||
/>
|
||||
</LinearLayout>
|
||||
|
||||
@@ -18,7 +18,6 @@ package com.android.systemui.statusbar.notification.row.wrapper;
|
||||
|
||||
import static com.android.systemui.statusbar.notification.TransformState.TRANSFORM_Y;
|
||||
|
||||
import android.annotation.NonNull;
|
||||
import android.app.AppOpsManager;
|
||||
import android.app.Notification;
|
||||
import android.content.Context;
|
||||
@@ -133,15 +132,6 @@ public class NotificationHeaderViewWrapper extends NotificationViewWrapper {
|
||||
if (mAppOps != null) {
|
||||
mAppOps.setOnClickListener(listener);
|
||||
}
|
||||
if (mCameraIcon != null) {
|
||||
mCameraIcon.setOnClickListener(listener);
|
||||
}
|
||||
if (mMicIcon != null) {
|
||||
mMicIcon.setOnClickListener(listener);
|
||||
}
|
||||
if (mOverlayIcon != null) {
|
||||
mOverlayIcon.setOnClickListener(listener);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user