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

Commit 2abf4b7a authored by Pranav Madapurmath's avatar Pranav Madapurmath
Browse files

TelephonyRegistryManager API review changes

In formalizing notifyCallStateChangedForAllSubscriptions and
notifyOutgoingEmergencyCall as proper system APIs in Telephony, API
council has provided additional feedback to expand the docs for the
notifyOutgoingEmergencyCall (who's being notified) as well as backing
the API with a permission requirement.

From other feedback, TelephonyRegistryManager has been promoted as a
SystemService in order to help indicate how to obtain an instance of
this class. The subId field in notifyOutgoingEmergencyCall has also been
expanded to be subscriptionId.

Bug: 321265373
Bug: 321800124
Bug: 311773409
Test: m
Change-Id: I7a192bf11f88d823fa6463550cc6df0d5c78807c
parent 2ce52b3f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -14958,7 +14958,7 @@ package android.telephony {
  @FlaggedApi("com.android.server.telecom.flags.telecom_resolve_hidden_dependencies") public class TelephonyRegistryManager {
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void notifyCallStateChangedForAllSubscriptions(int, @Nullable String);
    method public void notifyOutgoingEmergencyCall(int, int, @NonNull android.telephony.emergency.EmergencyNumber);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void notifyOutgoingEmergencyCall(int, int, @NonNull android.telephony.emergency.EmergencyNumber);
  }
  public final class ThermalMitigationRequest implements android.os.Parcelable {
+19 −6
Original line number Diff line number Diff line
@@ -19,12 +19,15 @@ import android.annotation.CallbackExecutor;
import android.annotation.FlaggedApi;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.RequiresFeature;
import android.annotation.RequiresPermission;
import android.annotation.SystemApi;
import android.annotation.SystemService;
import android.compat.Compatibility;
import android.compat.annotation.ChangeId;
import android.compat.annotation.EnabledAfter;
import android.content.Context;
import android.content.pm.PackageManager;
import android.os.Binder;
import android.os.Build;
import android.os.RemoteException;
@@ -72,9 +75,15 @@ import java.util.stream.Collectors;
 * Limit API access to only carrier apps with certain permissions or apps running on
 * privileged UID.
 *
 * TelephonyRegistryManager is intended for use on devices that implement
 * {@link android.content.pm.PackageManager#FEATURE_TELEPHONY FEATURE_TELEPHONY}. On devices
 * that do not implement this feature, the behavior is not reliable.
 *
 * @hide
 */
@SystemApi
@SystemService(Context.TELEPHONY_REGISTRY_SERVICE)
@RequiresFeature(PackageManager.FEATURE_TELEPHONY)
@FlaggedApi(Flags.FLAG_TELECOM_RESOLVE_HIDDEN_DEPENDENCIES)
public class TelephonyRegistryManager {

@@ -387,10 +396,11 @@ public class TelephonyRegistryManager {
    }

    /**
     * Notify call state changed on all subscriptions.
     * Notify call state changed on all subscriptions, excluding over-the-top VOIP calls (otherwise
     * known as self-managed calls in the Android Platform).
     *
     * @param state latest call state. e.g, offhook, ringing
     * @param incomingNumber incoming phone number.
     * @param incomingNumber incoming phone number or null in the case for OTT VOIP calls
     * @hide
     */
    @SystemApi
@@ -625,17 +635,20 @@ public class TelephonyRegistryManager {
    }

    /**
     * Notify outgoing emergency call.
     * Notify outgoing emergency call to all applications that have registered a listener
     * ({@link PhoneStateListener}) or a callback ({@link TelephonyCallback}) to monitor changes in
     * telephony states.
     * @param simSlotIndex Sender phone ID.
     * @param subId Sender subscription ID.
     * @param subscriptionId Sender subscription ID.
     * @param emergencyNumber Emergency number.
     * @hide
     */
    @SystemApi
    public void notifyOutgoingEmergencyCall(int simSlotIndex, int subId,
    @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE)
    public void notifyOutgoingEmergencyCall(int simSlotIndex, int subscriptionId,
            @NonNull EmergencyNumber emergencyNumber) {
        try {
            sRegistry.notifyOutgoingEmergencyCall(simSlotIndex, subId, emergencyNumber);
            sRegistry.notifyOutgoingEmergencyCall(simSlotIndex, subscriptionId, emergencyNumber);
        } catch (RemoteException ex) {
            // system process is dead
            throw ex.rethrowFromSystemServer();