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

Commit 3424c02e authored by Hung-ying Tyan's avatar Hung-ying Tyan
Browse files

Add software features for SIP and VOIP

and block SipService creation and SIP API if the feature is not available.

Change-Id: Icf780af1ac20dda4d8180cea3e5b20e21a8350bc
parent a2511da9
Loading
Loading
Loading
Loading
+22 −0
Original line number Diff line number Diff line
@@ -49119,6 +49119,28 @@
 visibility="public"
>
</field>
<field name="FEATURE_SIP"
 type="java.lang.String"
 transient="false"
 volatile="false"
 value="&quot;android.software.sip&quot;"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="FEATURE_SIP_VOIP"
 type="java.lang.String"
 transient="false"
 volatile="false"
 value="&quot;android.software.sip.voip&quot;"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="FEATURE_TELEPHONY"
 type="java.lang.String"
 transient="false"
+15 −1
Original line number Diff line number Diff line
@@ -761,6 +761,20 @@ public abstract class PackageManager {
    @SdkConstant(SdkConstantType.FEATURE)
    public static final String FEATURE_TELEPHONY_GSM = "android.hardware.telephony.gsm";

    /**
     * Feature for {@link #getSystemAvailableFeatures} and
     * {@link #hasSystemFeature}: The SIP API is enabled on the device.
     */
    @SdkConstant(SdkConstantType.FEATURE)
    public static final String FEATURE_SIP = "android.software.sip";

    /**
     * Feature for {@link #getSystemAvailableFeatures} and
     * {@link #hasSystemFeature}: The device supports SIP-based VOIP.
     */
    @SdkConstant(SdkConstantType.FEATURE)
    public static final String FEATURE_SIP_VOIP = "android.software.sip.voip";

    /**
     * Feature for {@link #getSystemAvailableFeatures} and
     * {@link #hasSystemFeature}: The device's display has a touch screen.
+21 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2009 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.
-->

<!-- This is the standard set of features for devices that support SIP-based VoIP. -->
<permissions>
    <feature name="android.software.sip" />
    <feature name="android.software.sip.voip" />
</permissions>
+20 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2009 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.
-->

<!-- This is the standard set of features for devices that support the SIP API. -->
<permissions>
    <feature name="android.software.sip" />
</permissions>
+6 −3
Original line number Diff line number Diff line
@@ -418,10 +418,13 @@ class ServerThread extends Thread {
            }

            try {
                SipService sipService = SipService.create(context);
                if (sipService != null) {
                    Slog.i(TAG, "Sip Service");
                ServiceManager.addService("sip", new SipService(context));
                    ServiceManager.addService("sip", sipService);
                }
            } catch (Throwable e) {
                Slog.e(TAG, "Failure starting DiskStats Service", e);
                Slog.e(TAG, "Failure starting SIP Service", e);
            }
        }

Loading