Loading src/com/android/server/telecom/TelecomApp.java +31 −40 Original line number Diff line number Diff line Loading @@ -28,9 +28,6 @@ import android.os.ServiceManager; */ public final class TelecomApp extends Application { /** Singleton instance of TelecomApp. */ private static TelecomApp sInstance; /** * The Telecom service implementation. */ Loading Loading @@ -58,16 +55,18 @@ public final class TelecomApp extends Application { private TelecomBroadcastReceiver mTelecomBroadcastReceiver; /** * The {@link android.telecomm.PhoneAccount} broadcast receiver. * The {@link android.telecom.PhoneAccount} broadcast receiver. */ private PhoneAccountBroadcastReceiver mPhoneAccountBroadcastReceiver; /** {@inheritDoc} */ @Override public void onCreate() { @Override public void onCreate() { super.onCreate(); sInstance = this; // Note: This style of initialization mimics what will be performed once Telecom is moved if (UserHandle.myUserId() == UserHandle.USER_OWNER) { // Note: This style of initialization mimics what will be performed once Telecom is // moved // to run in the system service. The emphasis is on ensuring that initialization of all // telecom classes happens in one place without relying on Singleton initialization. mMissedCallNotifier = new MissedCallNotifier(this); Loading @@ -79,12 +78,10 @@ public final class TelecomApp extends Application { mTelecomService = new TelecomServiceImpl(mMissedCallNotifier, mPhoneAccountRegistrar, mCallsManager, this); ServiceManager.addService(Context.TELECOM_SERVICE, mTelecomService); mPhoneAccountBroadcastReceiver = new PhoneAccountBroadcastReceiver(mPhoneAccountRegistrar); mPhoneAccountBroadcastReceiver = new PhoneAccountBroadcastReceiver( mPhoneAccountRegistrar); mTelecomBroadcastReceiver = new TelecomBroadcastReceiver(mMissedCallNotifier); if (UserHandle.myUserId() == UserHandle.USER_OWNER) { //TelecomServiceImpl.init(mMissedCallNotifier, mPhoneAccountRegistrar); } // Setup broadcast listener for telecom intents. IntentFilter telecomFilter = new IntentFilter(); telecomFilter.addAction(TelecomBroadcastReceiver.ACTION_CALL_BACK_FROM_NOTIFICATION); Loading @@ -97,12 +94,6 @@ public final class TelecomApp extends Application { phoneAccountFilter.addDataScheme("package"); registerReceiver(mPhoneAccountBroadcastReceiver, phoneAccountFilter); } public static TelecomApp getInstance() { if (null == sInstance) { throw new IllegalStateException("No TelecomApp running."); } return sInstance; } MissedCallNotifier getMissedCallNotifier() { Loading Loading
src/com/android/server/telecom/TelecomApp.java +31 −40 Original line number Diff line number Diff line Loading @@ -28,9 +28,6 @@ import android.os.ServiceManager; */ public final class TelecomApp extends Application { /** Singleton instance of TelecomApp. */ private static TelecomApp sInstance; /** * The Telecom service implementation. */ Loading Loading @@ -58,16 +55,18 @@ public final class TelecomApp extends Application { private TelecomBroadcastReceiver mTelecomBroadcastReceiver; /** * The {@link android.telecomm.PhoneAccount} broadcast receiver. * The {@link android.telecom.PhoneAccount} broadcast receiver. */ private PhoneAccountBroadcastReceiver mPhoneAccountBroadcastReceiver; /** {@inheritDoc} */ @Override public void onCreate() { @Override public void onCreate() { super.onCreate(); sInstance = this; // Note: This style of initialization mimics what will be performed once Telecom is moved if (UserHandle.myUserId() == UserHandle.USER_OWNER) { // Note: This style of initialization mimics what will be performed once Telecom is // moved // to run in the system service. The emphasis is on ensuring that initialization of all // telecom classes happens in one place without relying on Singleton initialization. mMissedCallNotifier = new MissedCallNotifier(this); Loading @@ -79,12 +78,10 @@ public final class TelecomApp extends Application { mTelecomService = new TelecomServiceImpl(mMissedCallNotifier, mPhoneAccountRegistrar, mCallsManager, this); ServiceManager.addService(Context.TELECOM_SERVICE, mTelecomService); mPhoneAccountBroadcastReceiver = new PhoneAccountBroadcastReceiver(mPhoneAccountRegistrar); mPhoneAccountBroadcastReceiver = new PhoneAccountBroadcastReceiver( mPhoneAccountRegistrar); mTelecomBroadcastReceiver = new TelecomBroadcastReceiver(mMissedCallNotifier); if (UserHandle.myUserId() == UserHandle.USER_OWNER) { //TelecomServiceImpl.init(mMissedCallNotifier, mPhoneAccountRegistrar); } // Setup broadcast listener for telecom intents. IntentFilter telecomFilter = new IntentFilter(); telecomFilter.addAction(TelecomBroadcastReceiver.ACTION_CALL_BACK_FROM_NOTIFICATION); Loading @@ -97,12 +94,6 @@ public final class TelecomApp extends Application { phoneAccountFilter.addDataScheme("package"); registerReceiver(mPhoneAccountBroadcastReceiver, phoneAccountFilter); } public static TelecomApp getInstance() { if (null == sInstance) { throw new IllegalStateException("No TelecomApp running."); } return sInstance; } MissedCallNotifier getMissedCallNotifier() { Loading