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

Commit d3bf1aa2 authored by Tyler Gunn's avatar Tyler Gunn Committed by Automerger Merge Worker
Browse files

Merge "CallDiagnosticService API" am: c9033503 am: 9882ff4b

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1607109

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: If7de00877b77e4594c05eb6e4fd2ff8f0318bad5
parents 1745c7a1 9882ff4b
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -66,6 +66,7 @@ public final class Telecom extends BaseCommand {
    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_CALL_DIAGNOSTIC_SERVICE = "set-call-diagnostic-service";
    private static final String COMMAND_SET_DEFAULT_DIALER = "set-default-dialer";
    private static final String COMMAND_GET_DEFAULT_DIALER = "get-default-dialer";
    private static final String COMMAND_STOP_BLOCK_SUPPRESSION = "stop-block-suppression";
@@ -111,6 +112,7 @@ public final class Telecom extends BaseCommand {
                + "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-call-diagnostic-service <PACKAGE>\n"
                + "usage: telecom set-default-dialer <PACKAGE>\n"
                + "usage: telecom get-default-dialer\n"
                + "usage: telecom get-system-dialer\n"
@@ -130,6 +132,7 @@ public final class Telecom extends BaseCommand {
                + "telecom set-phone-account-disabled: Disables the given phone account, if it"
                        + " has already been registered with telecom.\n"
                + "\n"
                + "telecom set-call-diagnostic-service: overrides call diagnostic service.\n"
                + "telecom set-default-dialer: Sets the override default dialer to the given"
                        + " component; this will override whatever the dialer role is set to.\n"
                + "\n"
@@ -205,6 +208,9 @@ public final class Telecom extends BaseCommand {
            case COMMAND_SET_PHONE_ACCOUNT_SUGGESTION_COMPONENT:
                runSetTestPhoneAcctSuggestionComponent();
                break;
            case COMMAND_SET_CALL_DIAGNOSTIC_SERVICE:
                runSetCallDiagnosticService();
                break;
            case COMMAND_REGISTER_SIM_PHONE_ACCOUNT:
                runRegisterSimPhoneAccount();
                break;
@@ -319,6 +325,13 @@ public final class Telecom extends BaseCommand {
        mTelecomService.addOrRemoveTestCallCompanionApp(packageName, isAddedBool);
    }

    private void runSetCallDiagnosticService() throws RemoteException {
        String packageName = nextArg();
        if ("default".equals(packageName)) packageName = null;
        mTelecomService.setTestCallDiagnosticService(packageName);
        System.out.println("Success - " + packageName + " set as call diagnostic service.");
    }

    private void runSetTestPhoneAcctSuggestionComponent() throws RemoteException {
        final String componentName = nextArg();
        mTelecomService.setTestPhoneAcctSuggestionComponent(componentName);
+4 −0
Original line number Diff line number Diff line
@@ -37886,6 +37886,10 @@ package android.telecom {
    method public void unhold();
    method public void unregisterCallback(android.telecom.Call.Callback);
    field @Deprecated public static final String AVAILABLE_PHONE_ACCOUNTS = "selectPhoneAccountAccounts";
    field public static final String EVENT_CLEAR_DIAGNOSTIC_MESSAGE = "android.telecom.event.CLEAR_DIAGNOSTIC_MESSAGE";
    field public static final String EVENT_DISPLAY_DIAGNOSTIC_MESSAGE = "android.telecom.event.DISPLAY_DIAGNOSTIC_MESSAGE";
    field public static final String EXTRA_DIAGNOSTIC_MESSAGE = "android.telecom.extra.DIAGNOSTIC_MESSAGE";
    field public static final String EXTRA_DIAGNOSTIC_MESSAGE_ID = "android.telecom.extra.DIAGNOSTIC_MESSAGE_ID";
    field public static final String EXTRA_LAST_EMERGENCY_CALLBACK_TIME_MILLIS = "android.telecom.extra.LAST_EMERGENCY_CALLBACK_TIME_MILLIS";
    field public static final String EXTRA_SILENT_RINGING_REQUESTED = "android.telecom.extra.SILENT_RINGING_REQUESTED";
    field public static final String EXTRA_SUGGESTED_PHONE_ACCOUNTS = "android.telecom.extra.SUGGESTED_PHONE_ACCOUNTS";
+42 −0
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@ package android {
    field public static final String BACKUP = "android.permission.BACKUP";
    field public static final String BIND_ATTENTION_SERVICE = "android.permission.BIND_ATTENTION_SERVICE";
    field public static final String BIND_AUGMENTED_AUTOFILL_SERVICE = "android.permission.BIND_AUGMENTED_AUTOFILL_SERVICE";
    field public static final String BIND_CALL_DIAGNOSTIC_SERVICE = "android.permission.BIND_CALL_DIAGNOSTIC_SERVICE";
    field public static final String BIND_CELL_BROADCAST_SERVICE = "android.permission.BIND_CELL_BROADCAST_SERVICE";
    field @Deprecated public static final String BIND_CONNECTION_SERVICE = "android.permission.BIND_CONNECTION_SERVICE";
    field public static final String BIND_CONTENT_CAPTURE_SERVICE = "android.permission.BIND_CONTENT_CAPTURE_SERVICE";
@@ -8943,6 +8944,16 @@ package android.telecom {
    ctor @Deprecated public Call.Listener();
  }
  public abstract class CallDiagnosticService extends android.app.Service {
    ctor public CallDiagnosticService();
    method @Nullable public android.os.IBinder onBind(@NonNull android.content.Intent);
    method public abstract void onBluetoothCallQualityReportReceived(@NonNull android.telecom.BluetoothCallQualityReport);
    method public abstract void onCallAudioStateChanged(@NonNull android.telecom.CallAudioState);
    method @NonNull public abstract android.telecom.DiagnosticCall onInitializeDiagnosticCall(@NonNull android.telecom.Call.Details);
    method public abstract void onRemoveDiagnosticCall(@NonNull android.telecom.DiagnosticCall);
    field public static final String SERVICE_INTERFACE = "android.telecom.CallDiagnosticService";
  }
  public static class CallScreeningService.CallResponse.Builder {
    method @NonNull @RequiresPermission(android.Manifest.permission.CAPTURE_AUDIO_OUTPUT) public android.telecom.CallScreeningService.CallResponse.Builder setShouldScreenCallViaAudioProcessing(boolean);
  }
@@ -8974,6 +8985,9 @@ package android.telecom {
    method public void setTelecomCallId(@NonNull String);
    field public static final int CAPABILITY_CONFERENCE_HAS_NO_CHILDREN = 2097152; // 0x200000
    field public static final int CAPABILITY_SPEED_UP_MT_AUDIO = 262144; // 0x40000
    field public static final String EVENT_DEVICE_TO_DEVICE_MESSAGE = "android.telecom.event.DEVICE_TO_DEVICE_MESSAGE";
    field public static final String EXTRA_DEVICE_TO_DEVICE_MESSAGE_TYPE = "android.telecom.extra.DEVICE_TO_DEVICE_MESSAGE_TYPE";
    field public static final String EXTRA_DEVICE_TO_DEVICE_MESSAGE_VALUE = "android.telecom.extra.DEVICE_TO_DEVICE_MESSAGE_VALUE";
    field public static final String EXTRA_DISABLE_ADD_CALL = "android.telecom.extra.DISABLE_ADD_CALL";
    field public static final int PROPERTY_EMERGENCY_CALLBACK_MODE = 1; // 0x1
    field public static final int PROPERTY_GENERIC_CONFERENCE = 2; // 0x2
@@ -8989,6 +9003,34 @@ package android.telecom {
    method public final void addExistingConnection(@NonNull android.telecom.PhoneAccountHandle, @NonNull android.telecom.Connection, @NonNull android.telecom.Conference);
  }
  public abstract class DiagnosticCall {
    ctor public DiagnosticCall();
    method public final void clearDiagnosticMessage(int);
    method public final void displayDiagnosticMessage(int, @NonNull CharSequence);
    method @NonNull public android.telecom.Call.Details getCallDetails();
    method public abstract void onCallDetailsChanged(@NonNull android.telecom.Call.Details);
    method @Nullable public abstract CharSequence onCallDisconnected(int, int);
    method @Nullable public abstract CharSequence onCallDisconnected(@NonNull android.telephony.ims.ImsReasonInfo);
    method public abstract void onCallQualityReceived(@NonNull android.telephony.CallQuality);
    method public abstract void onReceiveDeviceToDeviceMessage(int, int);
    method public final void sendDeviceToDeviceMessage(int, int);
    field public static final int AUDIO_CODEC_AMR_NB = 3; // 0x3
    field public static final int AUDIO_CODEC_AMR_WB = 2; // 0x2
    field public static final int AUDIO_CODEC_EVS = 1; // 0x1
    field public static final int BATTERY_STATE_CHARGING = 3; // 0x3
    field public static final int BATTERY_STATE_GOOD = 2; // 0x2
    field public static final int BATTERY_STATE_LOW = 1; // 0x1
    field public static final int COVERAGE_GOOD = 2; // 0x2
    field public static final int COVERAGE_POOR = 1; // 0x1
    field public static final int MESSAGE_CALL_AUDIO_CODEC = 2; // 0x2
    field public static final int MESSAGE_CALL_NETWORK_TYPE = 1; // 0x1
    field public static final int MESSAGE_DEVICE_BATTERY_STATE = 3; // 0x3
    field public static final int MESSAGE_DEVICE_NETWORK_COVERAGE = 4; // 0x4
    field public static final int NETWORK_TYPE_IWLAN = 2; // 0x2
    field public static final int NETWORK_TYPE_LTE = 1; // 0x1
    field public static final int NETWORK_TYPE_NR = 3; // 0x3
  }
  public abstract class InCallService extends android.app.Service {
    method @Deprecated public android.telecom.Phone getPhone();
    method @Deprecated public void onPhoneCreated(android.telecom.Phone);
+9 −0
Original line number Diff line number Diff line
@@ -2274,6 +2274,15 @@
    <permission android:name="android.permission.BIND_PHONE_ACCOUNT_SUGGESTION_SERVICE"
        android:protectionLevel="signature" />

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

    <!-- Must be required by a {@link android.telecom.CallRedirectionService},
         to ensure that only the system can bind to it.
         <p>Protection level: signature|privileged
+22 −0
Original line number Diff line number Diff line
/*
 * Copyright 2021, 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;

/**
 * {@hide}
 */
parcelable BluetoothCallQualityReport;
Loading