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

Commit be3c5432 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Correctly determine emergency role availability."

parents aa775d6c b092882d
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -35,6 +35,7 @@
    <uses-permission android:name="android.permission.APPROVE_INCIDENT_REPORTS" />
    <uses-permission android:name="android.permission.READ_DEVICE_CONFIG" />
    <uses-permission android:name="android.permission.OPEN_ACCESSIBILITY_DETAILS_SETTINGS" />
    <uses-permission android:name="android.permission.READ_PRIVILEGED_PHONE_STATE" />

    <uses-sdk android:minSdkVersion="28" android:targetSdkVersion="28" />

+1 −3
Original line number Diff line number Diff line
@@ -41,10 +41,8 @@ public class EmergencyRoleBehavior implements RoleBehavior {
    @Override
    public boolean isAvailableAsUser(@NonNull Role role, @NonNull UserHandle user,
            @NonNull Context context) {
        // TODO: STOPSHIP: Also TelephonyManager.EMERGENCY_ASSISTANCE_ENABLED, and a boolean
        //  constant to disable UI by default.
        TelephonyManager telephonyManager = context.getSystemService(TelephonyManager.class);
        return telephonyManager.isVoiceCapable();
        return telephonyManager.isEmergencyAssistanceEnabled() && telephonyManager.isVoiceCapable();
    }

    @Nullable