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

Commit 3650f2c5 authored by Madhav's avatar Madhav
Browse files

Update isEmergencyNumber() feature flag dependency

Given that isEmergencyNumber() functionality is utilized by both calling
and
messaging modules, and messaging can be enabled without calling, the
function's access control should be based on FEATURE_TELEPHONY_CALLING
or FEATURE_TELEPHONY_MESSAGING.

Bug: 395178686
Flag: EXEMPT bug fix
Test: atest CtsTelephonyTestCases --no-bazel-mode
Change-Id: I7967ce12e817a35e7b5f57058232bc100bd16023
parent 75dd4b65
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -15618,9 +15618,13 @@ public class TelephonyManager {
     * SIM card(s), Android database, modem, network or defaults; {@code false} otherwise.
     * @throws IllegalStateException if the Telephony process is not currently available.
     * @throws UnsupportedOperationException If the device does not have
     *          {@link PackageManager#FEATURE_TELEPHONY_CALLING}.
     *          {@link PackageManager#FEATURE_TELEPHONY_CALLING} or
     *          {@link PackageManager#FEATURE_TELEPHONY_MESSAGING}.
     */
    @RequiresFeature(PackageManager.FEATURE_TELEPHONY_CALLING)
    @RequiresFeature(anyOf = {
        PackageManager.FEATURE_TELEPHONY_CALLING,
        PackageManager.FEATURE_TELEPHONY_MESSAGING
    })
    public boolean isEmergencyNumber(@NonNull String number) {
        try {
            ITelephony telephony = getITelephony();