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

Commit db5b77c2 authored by Hall Liu's avatar Hall Liu Committed by Gerrit Code Review
Browse files

Merge changes from topics "dialer-account-suggestion-3", "dialer-account-suggestion-2"

* changes:
  Enable CTS testing for phone account suggestions
  Add the PhoneAccountSuggestionService
parents 795641f2 7ddcfd69
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -484,6 +484,8 @@ java_defaults {
        "telecomm/java/com/android/internal/telecom/IConnectionServiceAdapter.aidl",
        "telecomm/java/com/android/internal/telecom/IInCallAdapter.aidl",
        "telecomm/java/com/android/internal/telecom/IInCallService.aidl",
        "telecomm/java/com/android/internal/telecom/IPhoneAccountSuggestionCallback.aidl",
        "telecomm/java/com/android/internal/telecom/IPhoneAccountSuggestionService.aidl",
        "telecomm/java/com/android/internal/telecom/ITelecomService.aidl",
        "telecomm/java/com/android/internal/telecom/RemoteServiceCallback.aidl",
        "telephony/java/android/telephony/data/IDataService.aidl",
+9 −0
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ package android {
    field public static final java.lang.String BIND_KEYGUARD_APPWIDGET = "android.permission.BIND_KEYGUARD_APPWIDGET";
    field public static final java.lang.String BIND_NETWORK_RECOMMENDATION_SERVICE = "android.permission.BIND_NETWORK_RECOMMENDATION_SERVICE";
    field public static final java.lang.String BIND_NOTIFICATION_ASSISTANT_SERVICE = "android.permission.BIND_NOTIFICATION_ASSISTANT_SERVICE";
    field public static final java.lang.String BIND_PHONE_ACCOUNT_SUGGESTION_SERVICE = "android.permission.BIND_PHONE_ACCOUNT_SUGGESTION_SERVICE";
    field public static final java.lang.String BIND_PRINT_RECOMMENDATION_SERVICE = "android.permission.BIND_PRINT_RECOMMENDATION_SERVICE";
    field public static final java.lang.String BIND_RESOLVER_RANKER_SERVICE = "android.permission.BIND_RESOLVER_RANKER_SERVICE";
    field public static final java.lang.String BIND_RUNTIME_PERMISSION_PRESENTER_SERVICE = "android.permission.BIND_RUNTIME_PERMISSION_PRESENTER_SERVICE";
@@ -4942,6 +4943,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";
  }

  public final class RemoteConference {
    method public deprecated void setAudioState(android.telecom.AudioState);
  }
+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 {
+41 −30
Original line number Diff line number Diff line
@@ -51,6 +51,8 @@ public final class Telecom extends BaseCommand {
    private static final String COMMAND_ADD_OR_REMOVE_CALL_COMPANION_APP =
            "add-or-remove-call-companion-app";
    private static final String COMMAND_SET_TEST_AUTO_MODE_APP = "set-test-auto-mode-app";
    private static final String COMMAND_SET_PHONE_ACCOUNT_SUGGESTION_COMPONENT =
            "set-phone-acct-suggestion-component";
    private static final String COMMAND_UNREGISTER_PHONE_ACCOUNT = "unregister-phone-account";
    private static final String COMMAND_SET_DEFAULT_DIALER = "set-default-dialer";
    private static final String COMMAND_GET_DEFAULT_DIALER = "get-default-dialer";
@@ -64,35 +66,36 @@ public final class Telecom extends BaseCommand {

    @Override
    public void onShowUsage(PrintStream out) {
        out.println(
                "usage: telecom [subcommand] [options]\n" +
                "usage: telecom set-phone-account-enabled <COMPONENT> <ID> <USER_SN>\n" +
                "usage: telecom set-phone-account-disabled <COMPONENT> <ID> <USER_SN>\n" +
                "usage: telecom register-phone-account <COMPONENT> <ID> <USER_SN> <LABEL>\n" +
                "usage: telecom set-test-call-redirection-app <PACKAGE>\n" +
                "usage: telecom set-test-call-screening-app <PACKAGE>\n" +
                "usage: telecom set-test-auto-mode-app <PACKAGE>\n" +
                "usage: telecom add-or-remove-call-companion-app <PACKAGE> <1/0>\n" +
                "usage: telecom register-sim-phone-account <COMPONENT> <ID> <USER_SN> <LABEL> <ADDRESS>\n" +
                "usage: telecom unregister-phone-account <COMPONENT> <ID> <USER_SN>\n" +
                "usage: telecom set-default-dialer <PACKAGE>\n" +
                "usage: telecom get-default-dialer\n" +
                "usage: telecom get-system-dialer\n" +
                "usage: telecom wait-on-handlers\n" +
                "\n" +
                "telecom set-phone-account-enabled: Enables the given phone account, if it has \n" +
                " already been registered with Telecom.\n" +
                "\n" +
                "telecom set-phone-account-disabled: Disables the given phone account, if it \n" +
                " has already been registered with telecom.\n" +
                "\n" +
                "telecom set-default-dialer: Sets the default dialer to the given component. \n" +
                "\n" +
                "telecom get-default-dialer: Displays the current default dialer. \n" +
                "\n" +
                "telecom get-system-dialer: Displays the current system dialer. \n" +
                "\n" +
                "telecom wait-on-handlers: Wait until all handlers finish their work. \n"
        out.println("usage: telecom [subcommand] [options]\n"
                + "usage: telecom set-phone-account-enabled <COMPONENT> <ID> <USER_SN>\n"
                + "usage: telecom set-phone-account-disabled <COMPONENT> <ID> <USER_SN>\n"
                + "usage: telecom register-phone-account <COMPONENT> <ID> <USER_SN> <LABEL>\n"
                + "usage: telecom set-test-call-redirection-app <PACKAGE>\n"
                + "usage: telecom set-test-call-screening-app <PACKAGE>\n"
                + "usage: telecom set-test-auto-mode-app <PACKAGE>\n"
                + "usage: telecom set-phone-acct-suggestion-component <COMPONENT>\n"
                + "usage: telecom add-or-remove-call-companion-app <PACKAGE> <1/0>\n"
                + "usage: telecom register-sim-phone-account <COMPONENT> <ID> <USER_SN>"
                + " <LABEL> <ADDRESS>\n"
                + "usage: telecom unregister-phone-account <COMPONENT> <ID> <USER_SN>\n"
                + "usage: telecom set-default-dialer <PACKAGE>\n"
                + "usage: telecom get-default-dialer\n"
                + "usage: telecom get-system-dialer\n"
                + "usage: telecom wait-on-handlers\n"
                + "\n"
                + "telecom set-phone-account-enabled: Enables the given phone account, if it has \n"
                + " already been registered with Telecom.\n"
                + "\n"
                + "telecom set-phone-account-disabled: Disables the given phone account, if it \n"
                + " has already been registered with telecom.\n"
                + "\n"
                + "telecom set-default-dialer: Sets the default dialer to the given component. \n"
                + "\n"
                + "telecom get-default-dialer: Displays the current default dialer. \n"
                + "\n"
                + "telecom get-system-dialer: Displays the current system dialer. \n"
                + "\n"
                + "telecom wait-on-handlers: Wait until all handlers finish their work. \n"
        );
    }

@@ -134,6 +137,9 @@ public final class Telecom extends BaseCommand {
            case COMMAND_SET_TEST_AUTO_MODE_APP:
                runSetTestAutoModeApp();
                break;
            case COMMAND_SET_PHONE_ACCOUNT_SUGGESTION_COMPONENT:
                runSetTestPhoneAcctSuggestionComponent();
                break;
            case COMMAND_REGISTER_SIM_PHONE_ACCOUNT:
                runRegisterSimPhoneAccount();
                break;
@@ -216,6 +222,11 @@ public final class Telecom extends BaseCommand {
        mTelecomService.setTestAutoModeApp(packageName);
    }

    private void runSetTestPhoneAcctSuggestionComponent() throws RemoteException {
        final String componentName = nextArg();
        mTelecomService.setTestPhoneAcctSuggestionComponent(componentName);
    }

    private void runUnregisterPhoneAccount() throws RemoteException {
        final PhoneAccountHandle handle = getPhoneAccountHandleFromArgs();
        mTelecomService.unregisterPhoneAccount(handle);
+9 −0
Original line number Diff line number Diff line
@@ -1832,6 +1832,15 @@
    <permission android:name="android.permission.BIND_SCREENING_SERVICE"
        android:protectionLevel="signature|privileged" />

    <!-- Must be required by a {@link android.telecom.PhoneAccountSuggestionService},
         to ensure that only the system can bind to it.
         <p>Protection level: signature|privileged
         @SystemApi
         @hide
    -->
    <permission android:name="android.permission.BIND_PHONE_ACCOUNT_SUGGESTION_SERVICE"
        android:protectionLevel="signature|privileged" />

    <!-- Must be required by a {@link android.telecom.CallRedirectionService},
         to ensure that only the system can bind to it.
         <p>Protection level: signature|privileged
Loading