Fixed AccessibilityServiceInfo.getId()
It was throwing a NPE when the component was not set. Test: atest android.accessibilityservice.cts.AccessibilityServiceInfoTest Bug: 271166949 Bug: 271188189 Change-Id: I1755082ff40a9fe037084100ced9286639ffc101
This commit is contained in:
@@ -860,10 +860,10 @@ public class AccessibilityServiceInfo implements Parcelable {
|
||||
* <p>
|
||||
* <strong>Generated by the system.</strong>
|
||||
* </p>
|
||||
* @return The id.
|
||||
* @return The id (or {@code null} if the component is not set yet).
|
||||
*/
|
||||
public String getId() {
|
||||
return mComponentName.flattenToShortString();
|
||||
return mComponentName == null ? null : mComponentName.flattenToShortString();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user