Make a11y node info parceling more robust am: 1d8eb49073
am: 93c47c9d07
Change-Id: I8677c77968c202c8c6a0553db919610a140fda58
This commit is contained in:
@@ -2585,16 +2585,19 @@ public class AccessibilityNodeInfo implements Parcelable {
|
|||||||
|
|
||||||
if (mActions != null && !mActions.isEmpty()) {
|
if (mActions != null && !mActions.isEmpty()) {
|
||||||
final int actionCount = mActions.size();
|
final int actionCount = mActions.size();
|
||||||
parcel.writeInt(actionCount);
|
|
||||||
|
|
||||||
|
int nonLegacyActionCount = 0;
|
||||||
int defaultLegacyStandardActions = 0;
|
int defaultLegacyStandardActions = 0;
|
||||||
for (int i = 0; i < actionCount; i++) {
|
for (int i = 0; i < actionCount; i++) {
|
||||||
AccessibilityAction action = mActions.get(i);
|
AccessibilityAction action = mActions.get(i);
|
||||||
if (isDefaultLegacyStandardAction(action)) {
|
if (isDefaultLegacyStandardAction(action)) {
|
||||||
defaultLegacyStandardActions |= action.getId();
|
defaultLegacyStandardActions |= action.getId();
|
||||||
|
} else {
|
||||||
|
nonLegacyActionCount++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
parcel.writeInt(defaultLegacyStandardActions);
|
parcel.writeInt(defaultLegacyStandardActions);
|
||||||
|
parcel.writeInt(nonLegacyActionCount);
|
||||||
|
|
||||||
for (int i = 0; i < actionCount; i++) {
|
for (int i = 0; i < actionCount; i++) {
|
||||||
AccessibilityAction action = mActions.get(i);
|
AccessibilityAction action = mActions.get(i);
|
||||||
@@ -2605,6 +2608,7 @@ public class AccessibilityNodeInfo implements Parcelable {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
parcel.writeInt(0);
|
parcel.writeInt(0);
|
||||||
|
parcel.writeInt(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
parcel.writeInt(mMaxTextLength);
|
parcel.writeInt(mMaxTextLength);
|
||||||
@@ -2768,16 +2772,13 @@ public class AccessibilityNodeInfo implements Parcelable {
|
|||||||
mBoundsInScreen.left = parcel.readInt();
|
mBoundsInScreen.left = parcel.readInt();
|
||||||
mBoundsInScreen.right = parcel.readInt();
|
mBoundsInScreen.right = parcel.readInt();
|
||||||
|
|
||||||
final int actionCount = parcel.readInt();
|
final int legacyStandardActions = parcel.readInt();
|
||||||
if (actionCount > 0) {
|
addLegacyStandardActions(legacyStandardActions);
|
||||||
final int legacyStandardActions = parcel.readInt();
|
final int nonLegacyActionCount = parcel.readInt();
|
||||||
addLegacyStandardActions(legacyStandardActions);
|
for (int i = 0; i < nonLegacyActionCount; i++) {
|
||||||
final int nonLegacyActionCount = actionCount - Integer.bitCount(legacyStandardActions);
|
final AccessibilityAction action = new AccessibilityAction(
|
||||||
for (int i = 0; i < nonLegacyActionCount; i++) {
|
parcel.readInt(), parcel.readCharSequence());
|
||||||
AccessibilityAction action = new AccessibilityAction(
|
addAction(action);
|
||||||
parcel.readInt(), parcel.readCharSequence());
|
|
||||||
addAction(action);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
mMaxTextLength = parcel.readInt();
|
mMaxTextLength = parcel.readInt();
|
||||||
|
|||||||
Reference in New Issue
Block a user