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

Commit 690a9775 authored by Matt Garnes's avatar Matt Garnes
Browse files

Merge remote-tracking branch 'caf/LA.BR.1.2.3_1' into caf/cm-12.1

parents a2595ad8 a1ba4c6b
Loading
Loading
Loading
Loading
+32 −28
Original line number Diff line number Diff line
@@ -18,7 +18,7 @@
        xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
        package="com.android.server.telecom"
        coreApp="true"
        android:sharedUserId="android.uid.phone">
        android:sharedUserId="android.uid.system">

    <!-- Prevents the activity manager from delaying any activity-start
         requests by this package, including requests immediately after
@@ -27,6 +27,7 @@
    <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
    <uses-permission android:name="android.permission.CALL_PRIVILEGED" />
    <uses-permission android:name="android.permission.MANAGE_USERS" />
    <uses-permission android:name="android.permission.INTERACT_ACROSS_USERS" />
    <uses-permission android:name="android.permission.INTERACT_ACROSS_USERS_FULL" />
    <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
    <uses-permission android:name="android.permission.READ_CALL_LOG" />
@@ -38,18 +39,6 @@
    <uses-permission android:name="android.permission.MODIFY_PHONE_STATE" />
    <uses-permission android:name="android.permission.BROADCAST_CALLLOG_INFO" />

    <!-- Protects the ability to register any PhoneAccount with a capability flags of either
         PhoneAccount#CAPABILITY_CALL_PROVIDER or PhoneAccount#CAPABILITY_SIM_SUBSCRIPTION. -->
    <permission
            android:name="com.android.server.telecom.permission.REGISTER_PROVIDER_OR_SUBSCRIPTION"
            android:label="Register CALL_PROVIDER or SIM_SUBSCRIPTION PhoneAccount"
            android:protectionLevel="signature"/>

    <permission
            android:name="com.android.server.telecom.permission.REGISTER_CONNECTION_MANAGER"
            android:label="Register CONNECTION_MANAGER PhoneAccount"
            android:protectionLevel="signature"/>

    <permission
            android:name="android.permission.BROADCAST_CALLLOG_INFO"
            android:label="Broadcast the call type/duration information"
@@ -64,12 +53,11 @@
         can check for incompatible APIs. -->
    <uses-sdk android:minSdkVersion="19" />

    <application android:name="TelecomApp"
            android:persistent="true"
            android:label="@string/telecommAppLabel"
    <application android:label="@string/telecommAppLabel"
            android:icon="@mipmap/ic_launcher_phone"
            android:allowBackup="false"
            android:supportsRtl="true">
            android:supportsRtl="true"
            android:process="system">

        <!-- CALL vs CALL_PRIVILEGED vs CALL_EMERGENCY
             We have three different intents through which a call can be initiated each with its
@@ -90,9 +78,8 @@
        <activity android:name="CallActivity"
                android:theme="@style/Theme.Telecomm.Transparent"
                android:permission="android.permission.CALL_PHONE"
                android:configChanges="orientation|screenSize|keyboardHidden"
                android:screenOrientation="nosensor"
                android:excludeFromRecents="true">
                android:excludeFromRecents="true"
                android:process=":ui">
            <!-- CALL action intent filters for the various ways of initiating an outgoing call. -->
            <intent-filter>
                <action android:name="android.intent.action.CALL" />
@@ -128,7 +115,8 @@
             the system from processing this intent (b/8871505). -->
        <activity-alias android:name="PrivilegedCallActivity"
                android:targetActivity="CallActivity"
                android:permission="android.permission.CALL_PRIVILEGED">
                android:permission="android.permission.CALL_PRIVILEGED"
                android:process=":ui">
            <intent-filter android:priority="1000">
                <action android:name="android.intent.action.CALL_PRIVILEGED" />
                <category android:name="android.intent.category.DEFAULT" />
@@ -162,7 +150,8 @@
             that scheme be removed from this activity? -->
        <activity-alias android:name="EmergencyCallActivity"
                android:targetActivity="CallActivity"
                android:permission="android.permission.CALL_PRIVILEGED">
                android:permission="android.permission.CALL_PRIVILEGED"
                android:process=":ui">
            <intent-filter android:priority="1000">
                <action android:name="android.intent.action.CALL_EMERGENCY" />
                <category android:name="android.intent.category.DEFAULT" />
@@ -196,7 +185,8 @@
            </intent-filter>
        </activity-alias>

        <receiver android:name="TelecomBroadcastReceiver" android:exported="false">
        <receiver android:name="TelecomBroadcastReceiver" android:exported="false"
                android:process="system">
            <intent-filter>
                <action android:name="com.android.server.telecom.ACTION_CALL_BACK_FROM_NOTIFICATION" />
                <action android:name="com.android.server.telecom.ACTION_CALL_BACK_FROM_NOTIFICATION" />
@@ -208,7 +198,8 @@
            </intent-filter>
        </receiver>

        <receiver android:name="PhoneAccountBroadcastReceiver">
        <receiver android:name="PhoneAccountBroadcastReceiver"
                android:process="system">
            <intent-filter>
                <action android:name="android.intent.action.PACKAGE_FULLY_REMOVED" />
                <data android:scheme="package" />
@@ -217,7 +208,8 @@

        <activity android:name=".RespondViaSmsSettings$Settings"
                  android:label="@string/respond_via_sms_setting_title"
                  android:configChanges="orientation|screenSize|keyboardHidden">
                  android:configChanges="orientation|screenSize|keyboardHidden"
                  android:process=":ui">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
            </intent-filter>
@@ -227,15 +219,19 @@
                android:configChanges="orientation|screenSize|keyboardHidden"
                android:excludeFromRecents="true"
                android:launchMode="singleInstance"
                android:theme="@style/Theme.Telecomm.Transparent">
                android:theme="@style/Theme.Telecomm.Transparent"
                android:process=":ui">
        </activity>

        <receiver android:name=".CallReceiver"
            android:exported="false">
                android:exported="true"
                android:permission="android.permission.MODIFY_PHONE_STATE"
                android:process="system">
        </receiver>

        <service android:name="BluetoothPhoneService"
                android:singleUser="true">
                android:singleUser="true"
                android:process="system">
            <intent-filter>
                <action android:name="android.bluetooth.IBluetoothHeadsetPhone" />
            </intent-filter>
@@ -244,5 +240,13 @@
            android:theme="@style/Theme.Telecomm.Transparent"
            android:excludeFromRecents="true"/>

        <service android:name=".TelecomService"
                android:singleUser="true"
                android:process="system">
            <intent-filter>
                <action android:name="android.telecom.ITelecomService" />
            </intent-filter>
        </service>

    </application>
</manifest>
+0 −1
Original line number Diff line number Diff line
@@ -129,7 +129,6 @@ public class AccountSelection extends Activity {
            PhoneAccountHandle accountHandle = getItem(position);
            PhoneAccount account = mTelecomManager.getPhoneAccount(accountHandle);
            textView.setText(account.getLabel());
            imageView.setImageDrawable(account.getIcon(mContext));
            return rowView;
        }

+54 −51

File changed.

Preview size limit exceeded, changes collapsed.

+49 −18
Original line number Diff line number Diff line
@@ -30,7 +30,6 @@ import android.telecom.GatewayInfo;
import android.telecom.ParcelableConnection;
import android.telecom.PhoneAccount;
import android.telecom.PhoneAccountHandle;
import android.telecom.PhoneCapabilities;
import android.telecom.Response;
import android.telecom.StatusHints;
import android.telecom.TelecomManager;
@@ -74,7 +73,7 @@ final class Call implements CreateConnectionResponse {
        void onFailedUnknownCall(Call call);
        void onRingbackRequested(Call call, boolean ringbackRequested);
        void onPostDialWait(Call call, String remaining);
        void onCallCapabilitiesChanged(Call call);
        void onConnectionCapabilitiesChanged(Call call);
        void onCallPropertiesChanged(Call call);
        void onParentChanged(Call call);
        void onChildrenChanged(Call call);
@@ -111,7 +110,7 @@ final class Call implements CreateConnectionResponse {
        @Override
        public void onPostDialWait(Call call, String remaining) {}
        @Override
        public void onCallCapabilitiesChanged(Call call) {}
        public void onConnectionCapabilitiesChanged(Call call) {}
        @Override
        public void onCallPropertiesChanged(Call call) {}
        @Override
@@ -279,7 +278,7 @@ final class Call implements CreateConnectionResponse {
    /** Whether direct-to-voicemail query is pending. */
    private boolean mDirectToVoicemailQueryPending;

    private int mCallCapabilities;
    private int mConnectionCapabilities;
    private int mCallProperties;

    private boolean mIsConference = false;
@@ -349,6 +348,37 @@ final class Call implements CreateConnectionResponse {
        maybeLoadCannedSmsResponses();
    }

     /**
     * Persists the specified parameters and initializes the new instance.
     *
     * @param context The context.
     * @param repository The connection service repository.
     * @param handle The handle to dial.
     * @param gatewayInfo Gateway information to use for the call.
     * @param connectionManagerPhoneAccountHandle Account to use for the service managing the call.
     *         This account must be one that was registered with the
     *         {@link PhoneAccount#CAPABILITY_CONNECTION_MANAGER} flag.
     * @param targetPhoneAccountHandle Account information to use for the call. This account must be
     *         one that was registered with the {@link PhoneAccount#CAPABILITY_CALL_PROVIDER} flag.
     * @param isIncoming True if this is an incoming call.
     * @param connectTimeMillis The connection time of the call.
     */
    Call(
            Context context,
            ConnectionServiceRepository repository,
            Uri handle,
            GatewayInfo gatewayInfo,
            PhoneAccountHandle connectionManagerPhoneAccountHandle,
            PhoneAccountHandle targetPhoneAccountHandle,
            boolean isIncoming,
            boolean isConference,
            long oldConnectTimeMillis) {
        this(context, repository, handle, gatewayInfo, connectionManagerPhoneAccountHandle,
                targetPhoneAccountHandle, isIncoming, isConference);

        mConnectTimeMillis = oldConnectTimeMillis;
    }

    void addListener(Listener listener) {
        mListeners.add(listener);
    }
@@ -375,7 +405,7 @@ final class Call implements CreateConnectionResponse {
                getVideoState(),
                getChildCalls().size(),
                getParentCall() != null,
                PhoneCapabilities.toString(getCallCapabilities()),
                Connection.capabilitiesToString(getConnectionCapabilities()),
                mIsActiveSub,
                mTargetPhoneAccountHandle,
                getCallSubstate());
@@ -588,20 +618,21 @@ final class Call implements CreateConnectionResponse {
        mConnectTimeMillis = connectTimeMillis;
    }

    int getCallCapabilities() {
        return mCallCapabilities;
    int getConnectionCapabilities() {
        return mConnectionCapabilities;
    }

    void setCallCapabilities(int callCapabilities) {
        setCallCapabilities(callCapabilities, false /* forceUpdate */);
    void setConnectionCapabilities(int connectionCapabilities) {
        setConnectionCapabilities(connectionCapabilities, false /* forceUpdate */);
    }

    void setCallCapabilities(int callCapabilities, boolean forceUpdate) {
        Log.v(this, "setCallCapabilities: %s", PhoneCapabilities.toString(callCapabilities));
        if (forceUpdate || mCallCapabilities != callCapabilities) {
           mCallCapabilities = callCapabilities;
    void setConnectionCapabilities(int connectionCapabilities, boolean forceUpdate) {
        Log.v(this, "setConnectionCapabilities: %s", Connection.capabilitiesToString(
                connectionCapabilities));
        if (forceUpdate || mConnectionCapabilities != connectionCapabilities) {
           mConnectionCapabilities = connectionCapabilities;
            for (Listener l : mListeners) {
                l.onCallCapabilitiesChanged(this);
                l.onConnectionCapabilitiesChanged(this);
            }
        }
    }
@@ -723,7 +754,7 @@ final class Call implements CreateConnectionResponse {
        setHandle(connection.getHandle(), connection.getHandlePresentation());
        setCallerDisplayName(
                connection.getCallerDisplayName(), connection.getCallerDisplayNamePresentation());
        setCallCapabilities(connection.getCapabilities());
        setConnectionCapabilities(connection.getConnectionCapabilities());
        setCallProperties(connection.getProperties());
        setVideoProvider(connection.getVideoProvider());
        setVideoState(connection.getVideoState());
@@ -1007,7 +1038,7 @@ final class Call implements CreateConnectionResponse {
    void mergeConference() {
        if (mConnectionService == null) {
            Log.w(this, "merging conference calls without a connection service.");
        } else if (can(PhoneCapabilities.MERGE_CONFERENCE)) {
        } else if (can(Connection.CAPABILITY_MERGE_CONFERENCE)) {
            mConnectionService.mergeConference(this);
            mWasConferencePreviouslyMerged = true;
        }
@@ -1016,7 +1047,7 @@ final class Call implements CreateConnectionResponse {
    void swapConference() {
        if (mConnectionService == null) {
            Log.w(this, "swapping conference calls without a connection service.");
        } else if (can(PhoneCapabilities.SWAP_CONFERENCE)) {
        } else if (can(Connection.CAPABILITY_SWAP_CONFERENCE)) {
            mConnectionService.swapConference(this);
            switch (mChildCalls.size()) {
                case 1:
@@ -1074,7 +1105,7 @@ final class Call implements CreateConnectionResponse {
    }

    boolean can(int capability) {
        return (mCallCapabilities & capability) == capability;
        return (mConnectionCapabilities & capability) == capability;
    }

    private void addChildCall(Call call) {
+2 −29
Original line number Diff line number Diff line
@@ -90,26 +90,7 @@ public class CallActivity extends Activity {
        if (Intent.ACTION_CALL.equals(action) ||
                Intent.ACTION_CALL_PRIVILEGED.equals(action) ||
                Intent.ACTION_CALL_EMERGENCY.equals(action)) {
        boolean isAddParticipant = intent.getBooleanExtra(
                TelephonyProperties.ADD_PARTICIPANT_KEY, false);
        Log.d(this, "isAddparticipant = "+isAddParticipant);
        if (isAddParticipant) {
            String number = PhoneNumberUtils.getNumberFromIntent(intent, this);
            boolean isConferenceUri = intent.getBooleanExtra(
                    TelephonyProperties.EXTRA_DIAL_CONFERENCE_URI, false);
            if (!isConferenceUri) {
                number = PhoneNumberUtils.stripSeparators(number);
            }
            CallsManager callsManager = CallsManager.getInstance();
            if (callsManager != null) {
                callsManager.addParticipant(number);
                callsManager.getInCallController().bringToForeground(false);
            } else {
                Log.w(this, "CallsManager is null, can't process add Participant");
            }
        } else {
            processOutgoingCallIntent(intent);
        }
        } else if (TelecomManager.ACTION_INCOMING_CALL.equals(action)) {
            processIncomingCallIntent(intent);
        }
@@ -189,12 +170,8 @@ public class CallActivity extends Activity {

        intent.putExtra(CallReceiver.KEY_IS_DEFAULT_DIALER, isDefaultDialer());

        if (UserHandle.myUserId() == UserHandle.USER_OWNER) {
            CallReceiver.processOutgoingCallIntent(getApplicationContext(), intent);
        } else {
        sendBroadcastToReceiver(intent, false /* isIncoming */);
    }
    }

    private boolean isTtyModeEnabled() {
        return (android.provider.Settings.Secure.getInt(
@@ -204,12 +181,8 @@ public class CallActivity extends Activity {
    }

    private void processIncomingCallIntent(Intent intent) {
        if (UserHandle.myUserId() == UserHandle.USER_OWNER) {
            CallReceiver.processIncomingCallIntent(intent);
        } else {
        sendBroadcastToReceiver(intent, true /* isIncoming */);
    }
    }

    private boolean isDefaultDialer() {
        final String packageName = getCallingPackage();
Loading