Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 895c8e56 authored by Felipe Leme's avatar Felipe Leme
Browse files

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
parent da0db6bd
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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();
    }

    /**