Loading packages/PrintSpooler/src/com/android/printspooler/widget/PreviewPageFrame.java +22 −1 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ package com.android.printspooler.widget; import static android.view.accessibility.Flags.triStateChecked; import android.content.Context; import android.util.AttributeSet; import android.view.accessibility.AccessibilityEvent; Loading @@ -37,6 +39,20 @@ public final class PreviewPageFrame extends LinearLayout { return CompoundButton.class.getName(); } @Override public boolean performClick() { final boolean result = super.performClick(); // This widget is incorrectly using the notion of "selection" // to represent checked state. We can't send this event in // setSelected() because setSelected() is called when this widget // is not attached. if (triStateChecked()) { notifyViewAccessibilityStateChangedIfNeeded( AccessibilityEvent.CONTENT_CHANGE_TYPE_CHECKED); } return result; } @Override public void onInitializeAccessibilityEvent(AccessibilityEvent event) { super.onInitializeAccessibilityEvent(event); Loading @@ -48,6 +64,11 @@ public final class PreviewPageFrame extends LinearLayout { super.onInitializeAccessibilityNodeInfo(info); info.setSelected(false); info.setCheckable(true); if (triStateChecked()) { info.setChecked(isSelected() ? AccessibilityNodeInfo.CHECKED_STATE_TRUE : AccessibilityNodeInfo.CHECKED_STATE_FALSE); } else { info.setChecked(isSelected()); } } } Loading
packages/PrintSpooler/src/com/android/printspooler/widget/PreviewPageFrame.java +22 −1 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ package com.android.printspooler.widget; import static android.view.accessibility.Flags.triStateChecked; import android.content.Context; import android.util.AttributeSet; import android.view.accessibility.AccessibilityEvent; Loading @@ -37,6 +39,20 @@ public final class PreviewPageFrame extends LinearLayout { return CompoundButton.class.getName(); } @Override public boolean performClick() { final boolean result = super.performClick(); // This widget is incorrectly using the notion of "selection" // to represent checked state. We can't send this event in // setSelected() because setSelected() is called when this widget // is not attached. if (triStateChecked()) { notifyViewAccessibilityStateChangedIfNeeded( AccessibilityEvent.CONTENT_CHANGE_TYPE_CHECKED); } return result; } @Override public void onInitializeAccessibilityEvent(AccessibilityEvent event) { super.onInitializeAccessibilityEvent(event); Loading @@ -48,6 +64,11 @@ public final class PreviewPageFrame extends LinearLayout { super.onInitializeAccessibilityNodeInfo(info); info.setSelected(false); info.setCheckable(true); if (triStateChecked()) { info.setChecked(isSelected() ? AccessibilityNodeInfo.CHECKED_STATE_TRUE : AccessibilityNodeInfo.CHECKED_STATE_FALSE); } else { info.setChecked(isSelected()); } } }