Loading AndroidManifest.xml +14 −2 Original line number Diff line number Diff line Loading @@ -178,8 +178,20 @@ </intent-filter> </activity-alias> <!-- Note: Broadcast receivers are now set up in TelecomApp as a step in the transition to running under the system process. --> <receiver android:name="TelecomBroadcastReceiver" android:exported="false"> <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" /> <action android:name="com.android.server.telecom.ACTION_SEND_SMS_FROM_NOTIFICATION" /> </intent-filter> </receiver> <receiver android:name="PhoneAccountBroadcastReceiver"> <intent-filter> <action android:name="android.intent.action.PACKAGE_FULLY_REMOVED" /> <data android:scheme="package" /> </intent-filter> </receiver> <activity android:name=".RespondViaSmsSettings$Settings" android:label="@string/respond_via_sms_setting_title" Loading src/com/android/server/telecom/PhoneAccountBroadcastReceiver.java +1 −11 Original line number Diff line number Diff line Loading @@ -35,16 +35,6 @@ import java.lang.String; * the enabled state of the accounts is retained. */ public class PhoneAccountBroadcastReceiver extends BroadcastReceiver { /** * The {@link PhoneAccountRegistrar}. */ private final PhoneAccountRegistrar mPhoneAccountRegistrar; public PhoneAccountBroadcastReceiver(PhoneAccountRegistrar phoneAccountRegistrar) { mPhoneAccountRegistrar = phoneAccountRegistrar; } /** * Receives the intents the class is configured to received. * Loading @@ -71,6 +61,6 @@ public class PhoneAccountBroadcastReceiver extends BroadcastReceiver { * @param packageName The name of the removed package. */ private void handlePackageRemoved(Context context, String packageName) { mPhoneAccountRegistrar.clearAccounts(packageName); CallsManager.getInstance().getPhoneAccountRegistrar().clearAccounts(packageName); } } src/com/android/server/telecom/TelecomApp.java +0 −26 Original line number Diff line number Diff line Loading @@ -27,7 +27,6 @@ import android.os.ServiceManager; * Top-level Application class for Telecom. */ public final class TelecomApp extends Application { /** * The Telecom service implementation. */ Loading @@ -49,16 +48,6 @@ public final class TelecomApp extends Application { */ private CallsManager mCallsManager; /** * The Telecom broadcast receiver. */ private TelecomBroadcastReceiver mTelecomBroadcastReceiver; /** * The {@link android.telecom.PhoneAccount} broadcast receiver. */ private PhoneAccountBroadcastReceiver mPhoneAccountBroadcastReceiver; /** {@inheritDoc} */ @Override public void onCreate() { Loading @@ -78,21 +67,6 @@ public final class TelecomApp extends Application { mTelecomService = new TelecomServiceImpl(mMissedCallNotifier, mPhoneAccountRegistrar, mCallsManager, this); ServiceManager.addService(Context.TELECOM_SERVICE, mTelecomService); mPhoneAccountBroadcastReceiver = new PhoneAccountBroadcastReceiver( mPhoneAccountRegistrar); mTelecomBroadcastReceiver = new TelecomBroadcastReceiver(mMissedCallNotifier); // Setup broadcast listener for telecom intents. IntentFilter telecomFilter = new IntentFilter(); telecomFilter.addAction(TelecomBroadcastReceiver.ACTION_CALL_BACK_FROM_NOTIFICATION); telecomFilter.addAction(TelecomBroadcastReceiver.ACTION_CALL_BACK_FROM_NOTIFICATION); telecomFilter.addAction(TelecomBroadcastReceiver.ACTION_SEND_SMS_FROM_NOTIFICATION); registerReceiver(mTelecomBroadcastReceiver, telecomFilter); IntentFilter phoneAccountFilter = new IntentFilter(); phoneAccountFilter.addAction(Intent.ACTION_PACKAGE_FULLY_REMOVED); phoneAccountFilter.addDataScheme("package"); registerReceiver(mPhoneAccountBroadcastReceiver, phoneAccountFilter); } } Loading src/com/android/server/telecom/TelecomBroadcastReceiver.java +5 −10 Original line number Diff line number Diff line Loading @@ -38,13 +38,6 @@ public final class TelecomBroadcastReceiver extends BroadcastReceiver { static final String ACTION_CLEAR_MISSED_CALLS = "com.android.server.telecom.ACTION_CLEAR_MISSED_CALLS"; /** The missed call notifier. */ private final MissedCallNotifier mMissedCallNotifier; public TelecomBroadcastReceiver(MissedCallNotifier missedCallNotifier) { mMissedCallNotifier = missedCallNotifier; } /** {@inheritDoc} */ @Override public void onReceive(Context context, Intent intent) { Loading @@ -52,11 +45,13 @@ public final class TelecomBroadcastReceiver extends BroadcastReceiver { Log.v(this, "Action received: %s.", action); MissedCallNotifier missedCallNotifier = CallsManager.getInstance().getMissedCallNotifier(); // Send an SMS from the missed call notification. if (ACTION_SEND_SMS_FROM_NOTIFICATION.equals(action)) { // Close the notification shade and the notification itself. closeSystemDialogs(context); mMissedCallNotifier.clearMissedCalls(); missedCallNotifier.clearMissedCalls(); Intent callIntent = new Intent(Intent.ACTION_SENDTO, intent.getData()); callIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); Loading @@ -66,7 +61,7 @@ public final class TelecomBroadcastReceiver extends BroadcastReceiver { } else if (ACTION_CALL_BACK_FROM_NOTIFICATION.equals(action)) { // Close the notification shade and the notification itself. closeSystemDialogs(context); mMissedCallNotifier.clearMissedCalls(); missedCallNotifier.clearMissedCalls(); Intent callIntent = new Intent(Intent.ACTION_CALL_PRIVILEGED, intent.getData()); callIntent.setFlags( Loading @@ -75,7 +70,7 @@ public final class TelecomBroadcastReceiver extends BroadcastReceiver { // Clear the missed call notification and call log entries. } else if (ACTION_CLEAR_MISSED_CALLS.equals(action)) { mMissedCallNotifier.clearMissedCalls(); missedCallNotifier.clearMissedCalls(); } } Loading Loading
AndroidManifest.xml +14 −2 Original line number Diff line number Diff line Loading @@ -178,8 +178,20 @@ </intent-filter> </activity-alias> <!-- Note: Broadcast receivers are now set up in TelecomApp as a step in the transition to running under the system process. --> <receiver android:name="TelecomBroadcastReceiver" android:exported="false"> <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" /> <action android:name="com.android.server.telecom.ACTION_SEND_SMS_FROM_NOTIFICATION" /> </intent-filter> </receiver> <receiver android:name="PhoneAccountBroadcastReceiver"> <intent-filter> <action android:name="android.intent.action.PACKAGE_FULLY_REMOVED" /> <data android:scheme="package" /> </intent-filter> </receiver> <activity android:name=".RespondViaSmsSettings$Settings" android:label="@string/respond_via_sms_setting_title" Loading
src/com/android/server/telecom/PhoneAccountBroadcastReceiver.java +1 −11 Original line number Diff line number Diff line Loading @@ -35,16 +35,6 @@ import java.lang.String; * the enabled state of the accounts is retained. */ public class PhoneAccountBroadcastReceiver extends BroadcastReceiver { /** * The {@link PhoneAccountRegistrar}. */ private final PhoneAccountRegistrar mPhoneAccountRegistrar; public PhoneAccountBroadcastReceiver(PhoneAccountRegistrar phoneAccountRegistrar) { mPhoneAccountRegistrar = phoneAccountRegistrar; } /** * Receives the intents the class is configured to received. * Loading @@ -71,6 +61,6 @@ public class PhoneAccountBroadcastReceiver extends BroadcastReceiver { * @param packageName The name of the removed package. */ private void handlePackageRemoved(Context context, String packageName) { mPhoneAccountRegistrar.clearAccounts(packageName); CallsManager.getInstance().getPhoneAccountRegistrar().clearAccounts(packageName); } }
src/com/android/server/telecom/TelecomApp.java +0 −26 Original line number Diff line number Diff line Loading @@ -27,7 +27,6 @@ import android.os.ServiceManager; * Top-level Application class for Telecom. */ public final class TelecomApp extends Application { /** * The Telecom service implementation. */ Loading @@ -49,16 +48,6 @@ public final class TelecomApp extends Application { */ private CallsManager mCallsManager; /** * The Telecom broadcast receiver. */ private TelecomBroadcastReceiver mTelecomBroadcastReceiver; /** * The {@link android.telecom.PhoneAccount} broadcast receiver. */ private PhoneAccountBroadcastReceiver mPhoneAccountBroadcastReceiver; /** {@inheritDoc} */ @Override public void onCreate() { Loading @@ -78,21 +67,6 @@ public final class TelecomApp extends Application { mTelecomService = new TelecomServiceImpl(mMissedCallNotifier, mPhoneAccountRegistrar, mCallsManager, this); ServiceManager.addService(Context.TELECOM_SERVICE, mTelecomService); mPhoneAccountBroadcastReceiver = new PhoneAccountBroadcastReceiver( mPhoneAccountRegistrar); mTelecomBroadcastReceiver = new TelecomBroadcastReceiver(mMissedCallNotifier); // Setup broadcast listener for telecom intents. IntentFilter telecomFilter = new IntentFilter(); telecomFilter.addAction(TelecomBroadcastReceiver.ACTION_CALL_BACK_FROM_NOTIFICATION); telecomFilter.addAction(TelecomBroadcastReceiver.ACTION_CALL_BACK_FROM_NOTIFICATION); telecomFilter.addAction(TelecomBroadcastReceiver.ACTION_SEND_SMS_FROM_NOTIFICATION); registerReceiver(mTelecomBroadcastReceiver, telecomFilter); IntentFilter phoneAccountFilter = new IntentFilter(); phoneAccountFilter.addAction(Intent.ACTION_PACKAGE_FULLY_REMOVED); phoneAccountFilter.addDataScheme("package"); registerReceiver(mPhoneAccountBroadcastReceiver, phoneAccountFilter); } } Loading
src/com/android/server/telecom/TelecomBroadcastReceiver.java +5 −10 Original line number Diff line number Diff line Loading @@ -38,13 +38,6 @@ public final class TelecomBroadcastReceiver extends BroadcastReceiver { static final String ACTION_CLEAR_MISSED_CALLS = "com.android.server.telecom.ACTION_CLEAR_MISSED_CALLS"; /** The missed call notifier. */ private final MissedCallNotifier mMissedCallNotifier; public TelecomBroadcastReceiver(MissedCallNotifier missedCallNotifier) { mMissedCallNotifier = missedCallNotifier; } /** {@inheritDoc} */ @Override public void onReceive(Context context, Intent intent) { Loading @@ -52,11 +45,13 @@ public final class TelecomBroadcastReceiver extends BroadcastReceiver { Log.v(this, "Action received: %s.", action); MissedCallNotifier missedCallNotifier = CallsManager.getInstance().getMissedCallNotifier(); // Send an SMS from the missed call notification. if (ACTION_SEND_SMS_FROM_NOTIFICATION.equals(action)) { // Close the notification shade and the notification itself. closeSystemDialogs(context); mMissedCallNotifier.clearMissedCalls(); missedCallNotifier.clearMissedCalls(); Intent callIntent = new Intent(Intent.ACTION_SENDTO, intent.getData()); callIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); Loading @@ -66,7 +61,7 @@ public final class TelecomBroadcastReceiver extends BroadcastReceiver { } else if (ACTION_CALL_BACK_FROM_NOTIFICATION.equals(action)) { // Close the notification shade and the notification itself. closeSystemDialogs(context); mMissedCallNotifier.clearMissedCalls(); missedCallNotifier.clearMissedCalls(); Intent callIntent = new Intent(Intent.ACTION_CALL_PRIVILEGED, intent.getData()); callIntent.setFlags( Loading @@ -75,7 +70,7 @@ public final class TelecomBroadcastReceiver extends BroadcastReceiver { // Clear the missed call notification and call log entries. } else if (ACTION_CLEAR_MISSED_CALLS.equals(action)) { mMissedCallNotifier.clearMissedCalls(); missedCallNotifier.clearMissedCalls(); } } Loading