Loading src/com/android/server/telecom/CallsManager.java +4 −0 Original line number Diff line number Diff line Loading @@ -2048,6 +2048,10 @@ public class CallsManager extends Call.ListenerBase } } public TelecomSystem.SyncRoot getLock() { return mLock; } private void reloadMissedCallsOfUser(UserHandle userHandle) { mMissedCallNotifier.reloadFromDatabase( mLock, this, mContactsAsyncHelper, mCallerInfoAsyncQueryFactory, userHandle); Loading src/com/android/server/telecom/NewOutgoingCallIntentBroadcaster.java +55 −56 Original line number Diff line number Diff line Loading @@ -55,9 +55,6 @@ import com.android.internal.annotations.VisibleForTesting; */ @VisibleForTesting public class NewOutgoingCallIntentBroadcaster { private static final String EXTRA_ACTUAL_NUMBER_TO_DIAL = "android.telecom.extra.ACTUAL_NUMBER_TO_DIAL"; /** * Legacy string constants used to retrieve gateway provider extras from intents. These still * need to be copied from the source call intent to the destination intent in order to Loading @@ -67,14 +64,13 @@ public class NewOutgoingCallIntentBroadcaster { public static final String EXTRA_GATEWAY_PROVIDER_PACKAGE = "com.android.phone.extra.GATEWAY_PROVIDER_PACKAGE"; public static final String EXTRA_GATEWAY_URI = "com.android.phone.extra.GATEWAY_URI"; public static final String EXTRA_GATEWAY_ORIGINAL_URI = "com.android.phone.extra.GATEWAY_ORIGINAL_URI"; private final CallsManager mCallsManager; private final Call mCall; private final Intent mIntent; private final Context mContext; private final PhoneNumberUtilsAdapter mPhoneNumberUtilsAdapter; private final TelecomSystem.SyncRoot mLock; /* * Whether or not the outgoing call intent originated from the default phone application. If Loading @@ -92,6 +88,7 @@ public class NewOutgoingCallIntentBroadcaster { mIntent = intent; mPhoneNumberUtilsAdapter = phoneNumberUtilsAdapter; mIsDefaultOrSystemPhoneApp = isDefaultPhoneApp; mLock = mCallsManager.getLock(); } /** Loading @@ -105,10 +102,11 @@ public class NewOutgoingCallIntentBroadcaster { try { Log.startSession("NOCBIR.oR"); Trace.beginSection("onReceiveNewOutgoingCallBroadcast"); synchronized (mLock) { Log.v(this, "onReceive: %s", intent); // Once the NEW_OUTGOING_CALL broadcast is finished, the resultData is used as the // actual number to call. (If null, no call will be placed.) // Once the NEW_OUTGOING_CALL broadcast is finished, the resultData is // used as the actual number to call. (If null, no call will be placed.) String resultNumber = getResultData(); Log.i(this, "Received new-outgoing-call-broadcast for %s with data %s", mCall, Log.pii(resultNumber)); Loading @@ -133,8 +131,8 @@ public class NewOutgoingCallIntentBroadcaster { // If this call is already disconnected then we have nothing more to do. if (mCall.isDisconnected()) { Log.w(this, "Call has already been disconnected, ignore the broadcast Call %s", mCall); Log.w(this, "Call has already been disconnected," + " ignore the broadcast Call %s", mCall); return; } Loading @@ -146,10 +144,11 @@ public class NewOutgoingCallIntentBroadcaster { Uri originalUri = mIntent.getData(); if (originalUri.getSchemeSpecificPart().equals(resultNumber)) { Log.v(this, "Call number unmodified after new outgoing call intent broadcast."); Log.v(this, "Call number unmodified after" + " new outgoing call intent broadcast."); } else { Log.v(this, "Retrieved modified handle after outgoing call intent broadcast: " + "Original: %s, Modified: %s", Log.v(this, "Retrieved modified handle after outgoing call intent" + " broadcast: Original: %s, Modified: %s", Log.pii(originalUri), Log.pii(resultHandleUri)); } Loading @@ -157,11 +156,11 @@ public class NewOutgoingCallIntentBroadcaster { GatewayInfo gatewayInfo = getGateWayInfoFromIntent(intent, resultHandleUri); mCall.setNewOutgoingCallIntentBroadcastIsDone(); mCallsManager.placeOutgoingCall(mCall, resultHandleUri, gatewayInfo, mIntent.getBooleanExtra(TelecomManager.EXTRA_START_CALL_WITH_SPEAKERPHONE, false), mIntent.getBooleanExtra( TelecomManager.EXTRA_START_CALL_WITH_SPEAKERPHONE, false), mIntent.getIntExtra(TelecomManager.EXTRA_START_CALL_WITH_VIDEO_STATE, VideoProfile.STATE_AUDIO_ONLY)); } } finally { Trace.endSection(); Log.endSession(); Loading tests/src/com/android/server/telecom/tests/NewOutgoingCallIntentBroadcasterTest.java +2 −0 Original line number Diff line number Diff line Loading @@ -38,6 +38,7 @@ import com.android.server.telecom.CallsManager; import com.android.server.telecom.NewOutgoingCallIntentBroadcaster; import com.android.server.telecom.PhoneNumberUtilsAdapter; import com.android.server.telecom.PhoneNumberUtilsAdapterImpl; import com.android.server.telecom.TelecomSystem; import org.mockito.ArgumentCaptor; import org.mockito.Mock; Loading Loading @@ -77,6 +78,7 @@ public class NewOutgoingCallIntentBroadcasterTest extends TelecomTestCase { mContext = mComponentContextFixture.getTestDouble().getApplicationContext(); mPhoneNumberUtilsAdapterSpy = spy(new PhoneNumberUtilsAdapterImpl()); when(mCall.getInitiatingUser()).thenReturn(UserHandle.CURRENT); when(mCallsManager.getLock()).thenReturn(new TelecomSystem.SyncRoot() { }); } @SmallTest Loading Loading
src/com/android/server/telecom/CallsManager.java +4 −0 Original line number Diff line number Diff line Loading @@ -2048,6 +2048,10 @@ public class CallsManager extends Call.ListenerBase } } public TelecomSystem.SyncRoot getLock() { return mLock; } private void reloadMissedCallsOfUser(UserHandle userHandle) { mMissedCallNotifier.reloadFromDatabase( mLock, this, mContactsAsyncHelper, mCallerInfoAsyncQueryFactory, userHandle); Loading
src/com/android/server/telecom/NewOutgoingCallIntentBroadcaster.java +55 −56 Original line number Diff line number Diff line Loading @@ -55,9 +55,6 @@ import com.android.internal.annotations.VisibleForTesting; */ @VisibleForTesting public class NewOutgoingCallIntentBroadcaster { private static final String EXTRA_ACTUAL_NUMBER_TO_DIAL = "android.telecom.extra.ACTUAL_NUMBER_TO_DIAL"; /** * Legacy string constants used to retrieve gateway provider extras from intents. These still * need to be copied from the source call intent to the destination intent in order to Loading @@ -67,14 +64,13 @@ public class NewOutgoingCallIntentBroadcaster { public static final String EXTRA_GATEWAY_PROVIDER_PACKAGE = "com.android.phone.extra.GATEWAY_PROVIDER_PACKAGE"; public static final String EXTRA_GATEWAY_URI = "com.android.phone.extra.GATEWAY_URI"; public static final String EXTRA_GATEWAY_ORIGINAL_URI = "com.android.phone.extra.GATEWAY_ORIGINAL_URI"; private final CallsManager mCallsManager; private final Call mCall; private final Intent mIntent; private final Context mContext; private final PhoneNumberUtilsAdapter mPhoneNumberUtilsAdapter; private final TelecomSystem.SyncRoot mLock; /* * Whether or not the outgoing call intent originated from the default phone application. If Loading @@ -92,6 +88,7 @@ public class NewOutgoingCallIntentBroadcaster { mIntent = intent; mPhoneNumberUtilsAdapter = phoneNumberUtilsAdapter; mIsDefaultOrSystemPhoneApp = isDefaultPhoneApp; mLock = mCallsManager.getLock(); } /** Loading @@ -105,10 +102,11 @@ public class NewOutgoingCallIntentBroadcaster { try { Log.startSession("NOCBIR.oR"); Trace.beginSection("onReceiveNewOutgoingCallBroadcast"); synchronized (mLock) { Log.v(this, "onReceive: %s", intent); // Once the NEW_OUTGOING_CALL broadcast is finished, the resultData is used as the // actual number to call. (If null, no call will be placed.) // Once the NEW_OUTGOING_CALL broadcast is finished, the resultData is // used as the actual number to call. (If null, no call will be placed.) String resultNumber = getResultData(); Log.i(this, "Received new-outgoing-call-broadcast for %s with data %s", mCall, Log.pii(resultNumber)); Loading @@ -133,8 +131,8 @@ public class NewOutgoingCallIntentBroadcaster { // If this call is already disconnected then we have nothing more to do. if (mCall.isDisconnected()) { Log.w(this, "Call has already been disconnected, ignore the broadcast Call %s", mCall); Log.w(this, "Call has already been disconnected," + " ignore the broadcast Call %s", mCall); return; } Loading @@ -146,10 +144,11 @@ public class NewOutgoingCallIntentBroadcaster { Uri originalUri = mIntent.getData(); if (originalUri.getSchemeSpecificPart().equals(resultNumber)) { Log.v(this, "Call number unmodified after new outgoing call intent broadcast."); Log.v(this, "Call number unmodified after" + " new outgoing call intent broadcast."); } else { Log.v(this, "Retrieved modified handle after outgoing call intent broadcast: " + "Original: %s, Modified: %s", Log.v(this, "Retrieved modified handle after outgoing call intent" + " broadcast: Original: %s, Modified: %s", Log.pii(originalUri), Log.pii(resultHandleUri)); } Loading @@ -157,11 +156,11 @@ public class NewOutgoingCallIntentBroadcaster { GatewayInfo gatewayInfo = getGateWayInfoFromIntent(intent, resultHandleUri); mCall.setNewOutgoingCallIntentBroadcastIsDone(); mCallsManager.placeOutgoingCall(mCall, resultHandleUri, gatewayInfo, mIntent.getBooleanExtra(TelecomManager.EXTRA_START_CALL_WITH_SPEAKERPHONE, false), mIntent.getBooleanExtra( TelecomManager.EXTRA_START_CALL_WITH_SPEAKERPHONE, false), mIntent.getIntExtra(TelecomManager.EXTRA_START_CALL_WITH_VIDEO_STATE, VideoProfile.STATE_AUDIO_ONLY)); } } finally { Trace.endSection(); Log.endSession(); Loading
tests/src/com/android/server/telecom/tests/NewOutgoingCallIntentBroadcasterTest.java +2 −0 Original line number Diff line number Diff line Loading @@ -38,6 +38,7 @@ import com.android.server.telecom.CallsManager; import com.android.server.telecom.NewOutgoingCallIntentBroadcaster; import com.android.server.telecom.PhoneNumberUtilsAdapter; import com.android.server.telecom.PhoneNumberUtilsAdapterImpl; import com.android.server.telecom.TelecomSystem; import org.mockito.ArgumentCaptor; import org.mockito.Mock; Loading Loading @@ -77,6 +78,7 @@ public class NewOutgoingCallIntentBroadcasterTest extends TelecomTestCase { mContext = mComponentContextFixture.getTestDouble().getApplicationContext(); mPhoneNumberUtilsAdapterSpy = spy(new PhoneNumberUtilsAdapterImpl()); when(mCall.getInitiatingUser()).thenReturn(UserHandle.CURRENT); when(mCallsManager.getLock()).thenReturn(new TelecomSystem.SyncRoot() { }); } @SmallTest Loading