Loading AndroidManifest.xml +24 −13 Original line number Diff line number Diff line Loading @@ -19,7 +19,7 @@ package="com.android.server.telecom" android:debuggable="true" 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 Loading @@ -28,6 +28,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" /> Loading @@ -53,8 +54,7 @@ can check for incompatible APIs. --> <uses-sdk android:minSdkVersion="19" /> <application android:name="TelecomApp" android:persistent="true" <application android:persistent="true" android:label="@string/telecommAppLabel" android:icon="@mipmap/ic_launcher_phone" android:allowBackup="false" Loading @@ -79,7 +79,8 @@ <activity android:name="CallActivity" android:theme="@style/Theme.Telecomm.Transparent" android:permission="android.permission.CALL_PHONE" 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" /> Loading Loading @@ -115,7 +116,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" /> Loading Loading @@ -149,7 +151,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" /> Loading @@ -174,7 +177,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" /> Loading @@ -182,7 +186,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" /> Loading @@ -192,7 +197,8 @@ <activity android:name=".RespondViaSmsSettings$Settings" android:label="@string/respond_via_sms_setting_title" android:configChanges="orientation|screenSize|keyboardHidden" android:theme="@style/Theme.Telecom.DialerSettings"> android:theme="@style/Theme.Telecom.DialerSettings" android:process=":ui"> <intent-filter> <action android:name="android.intent.action.MAIN" /> </intent-filter> Loading @@ -202,22 +208,27 @@ 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> </service> <service android:name=".TelecomService" android:singleUser="true"> android:singleUser="true" android:process="system"> <intent-filter> <android android:name="android.telecom.ITelecomService" /> </intent-filter> Loading src/com/android/server/telecom/CallActivity.java +0 −1 Original line number Diff line number Diff line Loading @@ -123,7 +123,6 @@ public class CallActivity extends Activity { } intent.putExtra(CallReceiver.KEY_IS_DEFAULT_DIALER, isDefaultDialer()); sendBroadcastToReceiver(intent); } Loading src/com/android/server/telecom/CallsManager.java +3 −3 Original line number Diff line number Diff line Loading @@ -77,7 +77,7 @@ public final class CallsManager extends Call.ListenerBase { /** * Singleton instance of the {@link CallsManager}, initialized from {@link TelecomService}. */ private static CallsManager INSTANCE = null; private static CallsManager sInstance = null; private static final String TAG = "CallsManager"; Loading Loading @@ -138,7 +138,7 @@ public final class CallsManager extends Call.ListenerBase { /** Singleton accessor. */ static CallsManager getInstance() { return INSTANCE; return sInstance; } /** Loading @@ -147,7 +147,7 @@ public final class CallsManager extends Call.ListenerBase { * @param instance The instance to set. */ static void initialize(CallsManager instance) { INSTANCE = instance; sInstance = instance; } /** Loading src/com/android/server/telecom/TelecomApp.javadeleted 100644 → 0 +0 −83 Original line number Diff line number Diff line /* * Copyright (C) 2014 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. */ package com.android.server.telecom; import android.app.Application; import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.content.ServiceConnection; import android.os.IBinder; import android.os.ServiceManager; import android.os.UserHandle; /** * Top-level Application class for Telecom. */ public final class TelecomApp extends Application { /** * Used to bind to the telecom service. Once created, the telecom service will start the telecom * global state. */ private class TelecomServiceConnection implements ServiceConnection { /** {@inheritDoc} */ @Override public void onServiceConnected(ComponentName name, IBinder service) { Log.i(this, "onServiceConnected: %s", name); ServiceManager.addService(Context.TELECOM_SERVICE, service); } /** {@inheritDoc} */ @Override public void onServiceDisconnected(ComponentName name) { Log.i(this, "onDisconnected: %s", name); bindToService(); } } private ServiceConnection mServiceConnection; /** {@inheritDoc} */ @Override public void onCreate() { super.onCreate(); if (UserHandle.myUserId() == UserHandle.USER_OWNER) { bindToService(); } } private void bindToService() { if (mServiceConnection != null) { unbindService(mServiceConnection); mServiceConnection = null; } ComponentName componentName = new ComponentName(this, TelecomService.class); Intent intent = new Intent(TelecomService.SERVICE_INTERFACE); intent.setComponent(componentName); int bindFlags = Context.BIND_AUTO_CREATE | Context.BIND_IMPORTANT; Log.i(this, "binding to TelecomService."); ServiceConnection serviceConnection = new TelecomServiceConnection(); if (bindServiceAsUser(intent, serviceConnection, bindFlags, UserHandle.OWNER)) { mServiceConnection = serviceConnection; Log.i(this, "TelecomService binding successful"); } else { Log.e(this, null, "Failed to bind to TelecomService."); } } } src/com/android/server/telecom/TelecomGlobals.java +1 −0 Original line number Diff line number Diff line Loading @@ -87,6 +87,7 @@ public final class TelecomGlobals { mCallsManager = new CallsManager(mContext, mMissedCallNotifier, mPhoneAccountRegistrar); CallsManager.initialize(mCallsManager); Log.i(this, "CallsManager initialized"); // Start the BluetoothPhoneService BluetoothPhoneService.start(mContext); Loading Loading
AndroidManifest.xml +24 −13 Original line number Diff line number Diff line Loading @@ -19,7 +19,7 @@ package="com.android.server.telecom" android:debuggable="true" 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 Loading @@ -28,6 +28,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" /> Loading @@ -53,8 +54,7 @@ can check for incompatible APIs. --> <uses-sdk android:minSdkVersion="19" /> <application android:name="TelecomApp" android:persistent="true" <application android:persistent="true" android:label="@string/telecommAppLabel" android:icon="@mipmap/ic_launcher_phone" android:allowBackup="false" Loading @@ -79,7 +79,8 @@ <activity android:name="CallActivity" android:theme="@style/Theme.Telecomm.Transparent" android:permission="android.permission.CALL_PHONE" 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" /> Loading Loading @@ -115,7 +116,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" /> Loading Loading @@ -149,7 +151,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" /> Loading @@ -174,7 +177,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" /> Loading @@ -182,7 +186,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" /> Loading @@ -192,7 +197,8 @@ <activity android:name=".RespondViaSmsSettings$Settings" android:label="@string/respond_via_sms_setting_title" android:configChanges="orientation|screenSize|keyboardHidden" android:theme="@style/Theme.Telecom.DialerSettings"> android:theme="@style/Theme.Telecom.DialerSettings" android:process=":ui"> <intent-filter> <action android:name="android.intent.action.MAIN" /> </intent-filter> Loading @@ -202,22 +208,27 @@ 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> </service> <service android:name=".TelecomService" android:singleUser="true"> android:singleUser="true" android:process="system"> <intent-filter> <android android:name="android.telecom.ITelecomService" /> </intent-filter> Loading
src/com/android/server/telecom/CallActivity.java +0 −1 Original line number Diff line number Diff line Loading @@ -123,7 +123,6 @@ public class CallActivity extends Activity { } intent.putExtra(CallReceiver.KEY_IS_DEFAULT_DIALER, isDefaultDialer()); sendBroadcastToReceiver(intent); } Loading
src/com/android/server/telecom/CallsManager.java +3 −3 Original line number Diff line number Diff line Loading @@ -77,7 +77,7 @@ public final class CallsManager extends Call.ListenerBase { /** * Singleton instance of the {@link CallsManager}, initialized from {@link TelecomService}. */ private static CallsManager INSTANCE = null; private static CallsManager sInstance = null; private static final String TAG = "CallsManager"; Loading Loading @@ -138,7 +138,7 @@ public final class CallsManager extends Call.ListenerBase { /** Singleton accessor. */ static CallsManager getInstance() { return INSTANCE; return sInstance; } /** Loading @@ -147,7 +147,7 @@ public final class CallsManager extends Call.ListenerBase { * @param instance The instance to set. */ static void initialize(CallsManager instance) { INSTANCE = instance; sInstance = instance; } /** Loading
src/com/android/server/telecom/TelecomApp.javadeleted 100644 → 0 +0 −83 Original line number Diff line number Diff line /* * Copyright (C) 2014 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. */ package com.android.server.telecom; import android.app.Application; import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.content.ServiceConnection; import android.os.IBinder; import android.os.ServiceManager; import android.os.UserHandle; /** * Top-level Application class for Telecom. */ public final class TelecomApp extends Application { /** * Used to bind to the telecom service. Once created, the telecom service will start the telecom * global state. */ private class TelecomServiceConnection implements ServiceConnection { /** {@inheritDoc} */ @Override public void onServiceConnected(ComponentName name, IBinder service) { Log.i(this, "onServiceConnected: %s", name); ServiceManager.addService(Context.TELECOM_SERVICE, service); } /** {@inheritDoc} */ @Override public void onServiceDisconnected(ComponentName name) { Log.i(this, "onDisconnected: %s", name); bindToService(); } } private ServiceConnection mServiceConnection; /** {@inheritDoc} */ @Override public void onCreate() { super.onCreate(); if (UserHandle.myUserId() == UserHandle.USER_OWNER) { bindToService(); } } private void bindToService() { if (mServiceConnection != null) { unbindService(mServiceConnection); mServiceConnection = null; } ComponentName componentName = new ComponentName(this, TelecomService.class); Intent intent = new Intent(TelecomService.SERVICE_INTERFACE); intent.setComponent(componentName); int bindFlags = Context.BIND_AUTO_CREATE | Context.BIND_IMPORTANT; Log.i(this, "binding to TelecomService."); ServiceConnection serviceConnection = new TelecomServiceConnection(); if (bindServiceAsUser(intent, serviceConnection, bindFlags, UserHandle.OWNER)) { mServiceConnection = serviceConnection; Log.i(this, "TelecomService binding successful"); } else { Log.e(this, null, "Failed to bind to TelecomService."); } } }
src/com/android/server/telecom/TelecomGlobals.java +1 −0 Original line number Diff line number Diff line Loading @@ -87,6 +87,7 @@ public final class TelecomGlobals { mCallsManager = new CallsManager(mContext, mMissedCallNotifier, mPhoneAccountRegistrar); CallsManager.initialize(mCallsManager); Log.i(this, "CallsManager initialized"); // Start the BluetoothPhoneService BluetoothPhoneService.start(mContext); Loading