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

Commit 34d9e240 authored by Hall Liu's avatar Hall Liu
Browse files

Add docs and more annotations

Add docs to some constants in PhoneAccountSuggestion and add @TestApi
annotations to enable CTS testing for the new APIs.

Test: compiles
Bug: 111455117

Change-Id: I2b55a411ff4f0da37eefa0996f7316ea53bca41d
parent 066612a9
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -41111,8 +41111,9 @@ package android.telecom {
    method public void swapConference();
    method public void unhold();
    method public void unregisterCallback(android.telecom.Call.Callback);
    field public static final java.lang.String AVAILABLE_PHONE_ACCOUNTS = "selectPhoneAccountAccounts";
    field public static final deprecated java.lang.String AVAILABLE_PHONE_ACCOUNTS = "selectPhoneAccountAccounts";
    field public static final java.lang.String EXTRA_LAST_EMERGENCY_CALLBACK_TIME_MILLIS = "android.telecom.extra.LAST_EMERGENCY_CALLBACK_TIME_MILLIS";
    field public static final java.lang.String EXTRA_SUGGESTED_PHONE_ACCOUNTS = "android.telecom.extra.SUGGESTED_PHONE_ACCOUNTS";
    field public static final int STATE_ACTIVE = 4; // 0x4
    field public static final int STATE_CONNECTING = 9; // 0x9
    field public static final int STATE_DIALING = 1; // 0x1
@@ -41685,7 +41686,7 @@ package android.telecom {
  public final class PhoneAccountSuggestion implements android.os.Parcelable {
    method public int describeContents();
    method public android.telecom.PhoneAccountHandle getHandle();
    method public android.telecom.PhoneAccountHandle getPhoneAccountHandle();
    method public int getReason();
    method public boolean shouldAutoSelect();
    method public void writeToParcel(android.os.Parcel, int);
+4 −0
Original line number Diff line number Diff line
@@ -963,6 +963,10 @@ package android.telecom {
    ctor public CallAudioState(boolean, int, int, android.bluetooth.BluetoothDevice, java.util.Collection<android.bluetooth.BluetoothDevice>);
  }

  public final class PhoneAccountSuggestion implements android.os.Parcelable {
    ctor public PhoneAccountSuggestion(android.telecom.PhoneAccountHandle, int, boolean);
  }

}

package android.telephony {
+11 −0
Original line number Diff line number Diff line
@@ -123,9 +123,20 @@ public final class Call {
     * The key to retrieve the optional {@code PhoneAccount}s Telecom can bundle with its Call
     * extras. Used to pass the phone accounts to display on the front end to the user in order to
     * select phone accounts to (for example) place a call.
     * @deprecated Use the list from {@link #EXTRA_SUGGESTED_PHONE_ACCOUNTS} instead.
     */
    @Deprecated
    public static final String AVAILABLE_PHONE_ACCOUNTS = "selectPhoneAccountAccounts";

    /**
     * Key for extra used to pass along a list of {@link PhoneAccountSuggestion}s to the in-call
     * UI when a call enters the {@link #STATE_SELECT_PHONE_ACCOUNT} state. The list included here
     * will have the same length and be in the same order as the list passed with
     * {@link #AVAILABLE_PHONE_ACCOUNTS}.
     */
    public static final String EXTRA_SUGGESTED_PHONE_ACCOUNTS =
            "android.telecom.extra.SUGGESTED_PHONE_ACCOUNTS";

    /**
     * Extra key used to indicate the time (in milliseconds since midnight, January 1, 1970 UTC)
     * when the last outgoing emergency call was made.  This is used to identify potential emergency
+54 −1
Original line number Diff line number Diff line
/*
 * Copyright (C) 2018 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package android.telecom;

import android.annotation.IntDef;
import android.annotation.SystemApi;
import android.annotation.TestApi;
import android.os.Parcel;
import android.os.Parcelable;

@@ -16,10 +33,33 @@ public final class PhoneAccountSuggestion implements Parcelable {
            REASON_USER_SET, REASON_OTHER}, prefix = { "REASON_" })
    public @interface SuggestionReason {}

    /**
     * Indicates that this account is not suggested for use, but is still available.
     */
    public static final int REASON_NONE = 0;

    /**
     * Indicates that the {@link PhoneAccountHandle} is suggested because the number we're calling
     * is on the same carrier, and therefore may have lower rates.
     */
    public static final int REASON_INTRA_CARRIER = 1;

    /**
     * Indicates that the {@link PhoneAccountHandle} is suggested because the user uses it
     * frequently for the number that we are calling.
     */
    public static final int REASON_FREQUENT = 2;

    /**
     * Indicates that the {@link PhoneAccountHandle} is suggested because the user explicitly
     * specified that it be used for the number we are calling.
     */
    public static final int REASON_USER_SET = 3;

    /**
     * Indicates that the {@link PhoneAccountHandle} is suggested for a reason not otherwise
     * enumerated here.
     */
    public static final int REASON_OTHER = 4;

    private PhoneAccountHandle mHandle;
@@ -30,6 +70,7 @@ public final class PhoneAccountSuggestion implements Parcelable {
     * @hide
     */
    @SystemApi
    @TestApi
    public PhoneAccountSuggestion(PhoneAccountHandle handle, @SuggestionReason int reason,
            boolean shouldAutoSelect) {
        this.mHandle = handle;
@@ -56,14 +97,26 @@ public final class PhoneAccountSuggestion implements Parcelable {
                }
            };

    public PhoneAccountHandle getHandle() {
    /**
     * @return The {@link PhoneAccountHandle} for this suggestion.
     */
    public PhoneAccountHandle getPhoneAccountHandle() {
        return mHandle;
    }

    /**
     * @return The reason for this suggestion
     */
    public @SuggestionReason int getReason() {
        return mReason;
    }

    /**
     * Suggests whether the dialer should automatically place the call using this account without
     * user interaction. This may be set on multiple {@link PhoneAccountSuggestion}s, and the dialer
     * is free to choose which one to use.
     * @return {@code true} if the hint is to auto-select, {@code false} otherwise.
     */
    public boolean shouldAutoSelect() {
        return mShouldAutoSelect;
    }