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

Commit 7ddcfd69 authored by Hall Liu's avatar Hall Liu
Browse files

Enable CTS testing for phone account suggestions

Add TestApi annotation on PhoneAccountSuggestionService and add sensible
equals and hashCode methods to PhoneAccountSuggestions

Bug: 111455117
Test: CTS
Change-Id: I112e350cc637cb086252c53be5e08596e743537d
parent c47570d5
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -967,6 +967,14 @@ package android.telecom {
    ctor public PhoneAccountSuggestion(android.telecom.PhoneAccountHandle, int, boolean);
  }

  public class PhoneAccountSuggestionService extends android.app.Service {
    ctor public PhoneAccountSuggestionService();
    method public void onAccountSuggestionRequest(java.lang.String);
    method public android.os.IBinder onBind(android.content.Intent);
    method public final void suggestPhoneAccounts(java.lang.String, java.util.List<android.telecom.PhoneAccountSuggestion>);
    field public static final java.lang.String SERVICE_INTERFACE = "android.telecom.PhoneAccountSuggestionService";
  }

}

package android.telephony {
+16 −0
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@ import android.os.Parcelable;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.Objects;

public final class PhoneAccountSuggestion implements Parcelable {

@@ -132,4 +133,19 @@ public final class PhoneAccountSuggestion implements Parcelable {
        dest.writeInt(mReason);
        dest.writeByte((byte) (mShouldAutoSelect ? 1 : 0));
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        PhoneAccountSuggestion that = (PhoneAccountSuggestion) o;
        return mReason == that.mReason
                && mShouldAutoSelect == that.mShouldAutoSelect
                && Objects.equals(mHandle, that.mHandle);
    }

    @Override
    public int hashCode() {
        return Objects.hash(mHandle, mReason, mShouldAutoSelect);
    }
}
+2 −0
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ package android.telecom;
import android.annotation.NonNull;
import android.annotation.SdkConstant;
import android.annotation.SystemApi;
import android.annotation.TestApi;
import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
@@ -56,6 +57,7 @@ import java.util.Map;
 * @hide
 */
@SystemApi
@TestApi
public class PhoneAccountSuggestionService extends Service {
    /**
     * The {@link Intent} that must be declared in the {@code intent-filter} element of the