[Autofill PCC] Fix crash on picking result from Fill Dialog
Note that these are band-aid fixes, and proper fixes would come later. Also, guard an existing call behind the flag. Bug: 275608129 Test: Manually tested twitter app Change-Id: I16c63b9815358e93dd6a3e62802a4f8db1ce21b3
This commit is contained in:
@@ -127,7 +127,7 @@ public final class FillContext implements Parcelable {
|
||||
final int index = missingNodeIndexes.keyAt(i);
|
||||
final AutofillId id = ids[index];
|
||||
|
||||
if (id.equals(node.getAutofillId())) {
|
||||
if (id != null && id.equals(node.getAutofillId())) {
|
||||
foundNodes[index] = node;
|
||||
|
||||
if (mViewNodeLookupTable == null) {
|
||||
|
||||
@@ -350,6 +350,10 @@ public final class AutofillClientController implements AutofillManager.AutofillC
|
||||
final boolean[] visible = new boolean[autofillIdCount];
|
||||
for (int i = 0; i < autofillIdCount; i++) {
|
||||
final AutofillId autofillId = autofillIds[i];
|
||||
if (autofillId == null) {
|
||||
visible[i] = false;
|
||||
continue;
|
||||
}
|
||||
final View view = autofillClientFindViewByAutofillIdTraversal(autofillId);
|
||||
if (view != null) {
|
||||
if (!autofillId.isVirtualInt()) {
|
||||
@@ -383,6 +387,7 @@ public final class AutofillClientController implements AutofillManager.AutofillC
|
||||
|
||||
@Override
|
||||
public View autofillClientFindViewByAutofillIdTraversal(AutofillId autofillId) {
|
||||
if (autofillId == null) return null;
|
||||
final ArrayList<ViewRootImpl> roots =
|
||||
WindowManagerGlobal.getInstance().getRootViews(mActivity.getActivityToken());
|
||||
for (int rootNum = 0; rootNum < roots.size(); rootNum++) {
|
||||
@@ -410,7 +415,7 @@ public final class AutofillClientController implements AutofillManager.AutofillC
|
||||
if (rootView != null) {
|
||||
final int viewCount = autofillIds.length;
|
||||
for (int viewNum = 0; viewNum < viewCount; viewNum++) {
|
||||
if (views[viewNum] == null) {
|
||||
if (autofillIds[viewNum] != null && views[viewNum] == null) {
|
||||
views[viewNum] = rootView.findViewByAutofillIdTraversal(
|
||||
autofillIds[viewNum].getViewId());
|
||||
}
|
||||
|
||||
@@ -1166,7 +1166,8 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState
|
||||
// structure is taken. This causes only one fill request per burst of focus changes.
|
||||
cancelCurrentRequestLocked();
|
||||
|
||||
if (mClassificationState.mHintsToAutofillIdMap == null) {
|
||||
if (mService.getMaster().isPccClassificationEnabled()
|
||||
&& mClassificationState.mHintsToAutofillIdMap == null) {
|
||||
if (sVerbose) {
|
||||
Slog.v(TAG, "triggering field classification");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user