Loading src/com/android/server/telecom/CallLogManager.java +3 −1 Original line number Diff line number Diff line Loading @@ -146,11 +146,13 @@ public final class CallLogManager extends CallsManagerListenerBase { // 2) It is a conference call // 3) Call was not explicitly canceled // 4) Call is not an external call // 5) Call is not a self-managed call if (isNewlyDisconnected && (oldState != CallState.SELECT_PHONE_ACCOUNT && !call.isConference() && !isCallCanceled) && !call.isExternalCall()) { !call.isExternalCall() && !call.isSelfManaged()) { int type; if (!call.isIncoming()) { type = Calls.OUTGOING_TYPE; Loading src/com/android/server/telecom/CallsManager.java +25 −0 Original line number Diff line number Diff line Loading @@ -81,6 +81,8 @@ import java.util.Objects; import java.util.Optional; import java.util.Set; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; import java.util.stream.Collectors; import java.util.stream.IntStream; import java.util.stream.Stream; Loading Loading @@ -121,6 +123,7 @@ public class CallsManager extends Call.ListenerBase private static final String TAG = "CallsManager"; private static final int HANDLER_WAIT_TIMEOUT = 10000; private static final int MAXIMUM_LIVE_CALLS = 1; private static final int MAXIMUM_HOLD_CALLS = 1; private static final int MAXIMUM_RINGING_CALLS = 1; Loading Loading @@ -2325,6 +2328,28 @@ public class CallsManager extends Call.ListenerBase } } /** * Blocks execution until all Telecom handlers have completed their current work. */ public void waitOnHandlers() { CountDownLatch mainHandlerLatch = new CountDownLatch(3); mHandler.post(() -> { mainHandlerLatch.countDown(); }); mCallAudioManager.getCallAudioModeStateMachine().getHandler().post(() -> { mainHandlerLatch.countDown(); }); mCallAudioManager.getCallAudioRouteStateMachine().getHandler().post(() -> { mainHandlerLatch.countDown(); }); try { mainHandlerLatch.await(HANDLER_WAIT_TIMEOUT, TimeUnit.MILLISECONDS); } catch (InterruptedException e) { Log.w(this, "waitOnHandlers: interrupted %s", e); } } /** * Dumps the state of the {@link CallsManager}. * Loading src/com/android/server/telecom/TelecomServiceImpl.java +34 −1 Original line number Diff line number Diff line Loading @@ -354,6 +354,15 @@ public class TelecomServiceImpl { account.getAccountHandle().getComponentName().getPackageName()); if (account.hasCapabilities(PhoneAccount.CAPABILITY_SELF_MANAGED)) { enforceRegisterSelfManaged(); if (account.hasCapabilities(PhoneAccount.CAPABILITY_CALL_PROVIDER) || account.hasCapabilities( PhoneAccount.CAPABILITY_CONNECTION_MANAGER) || account.hasCapabilities( PhoneAccount.CAPABILITY_SIM_SUBSCRIPTION)) { throw new SecurityException("Self-managed ConnectionServices " + "cannot also be call capable, connection managers, or " + "SIM accounts."); } } if (account.hasCapabilities(PhoneAccount.CAPABILITY_SIM_SUBSCRIPTION)) { enforceRegisterSimSubscriptionPermission(); Loading Loading @@ -1243,6 +1252,30 @@ public class TelecomServiceImpl { Log.endSession(); } } /** * Blocks until all Telecom handlers have completed their current work. * * See {@link com.android.commands.telecom.Telecom}. */ @Override public void waitOnHandlers() { try { Log.startSession("TSI.wOH"); enforceModifyPermission(); synchronized (mLock) { long token = Binder.clearCallingIdentity(); try { Log.i(this, "waitOnHandlers"); mCallsManager.waitOnHandlers(); } finally { Binder.restoreCallingIdentity(token); } } } finally { Log.endSession(); } } }; private Context mContext; Loading Loading @@ -1474,7 +1507,7 @@ public class TelecomServiceImpl { if (phoneAccountHandle != null) { PhoneAccount phoneAccount = mPhoneAccountRegistrar.getPhoneAccountUnchecked( phoneAccountHandle); return phoneAccount.isSelfManaged(); return phoneAccount != null && phoneAccount.isSelfManaged(); } return false; } Loading Loading
src/com/android/server/telecom/CallLogManager.java +3 −1 Original line number Diff line number Diff line Loading @@ -146,11 +146,13 @@ public final class CallLogManager extends CallsManagerListenerBase { // 2) It is a conference call // 3) Call was not explicitly canceled // 4) Call is not an external call // 5) Call is not a self-managed call if (isNewlyDisconnected && (oldState != CallState.SELECT_PHONE_ACCOUNT && !call.isConference() && !isCallCanceled) && !call.isExternalCall()) { !call.isExternalCall() && !call.isSelfManaged()) { int type; if (!call.isIncoming()) { type = Calls.OUTGOING_TYPE; Loading
src/com/android/server/telecom/CallsManager.java +25 −0 Original line number Diff line number Diff line Loading @@ -81,6 +81,8 @@ import java.util.Objects; import java.util.Optional; import java.util.Set; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; import java.util.stream.Collectors; import java.util.stream.IntStream; import java.util.stream.Stream; Loading Loading @@ -121,6 +123,7 @@ public class CallsManager extends Call.ListenerBase private static final String TAG = "CallsManager"; private static final int HANDLER_WAIT_TIMEOUT = 10000; private static final int MAXIMUM_LIVE_CALLS = 1; private static final int MAXIMUM_HOLD_CALLS = 1; private static final int MAXIMUM_RINGING_CALLS = 1; Loading Loading @@ -2325,6 +2328,28 @@ public class CallsManager extends Call.ListenerBase } } /** * Blocks execution until all Telecom handlers have completed their current work. */ public void waitOnHandlers() { CountDownLatch mainHandlerLatch = new CountDownLatch(3); mHandler.post(() -> { mainHandlerLatch.countDown(); }); mCallAudioManager.getCallAudioModeStateMachine().getHandler().post(() -> { mainHandlerLatch.countDown(); }); mCallAudioManager.getCallAudioRouteStateMachine().getHandler().post(() -> { mainHandlerLatch.countDown(); }); try { mainHandlerLatch.await(HANDLER_WAIT_TIMEOUT, TimeUnit.MILLISECONDS); } catch (InterruptedException e) { Log.w(this, "waitOnHandlers: interrupted %s", e); } } /** * Dumps the state of the {@link CallsManager}. * Loading
src/com/android/server/telecom/TelecomServiceImpl.java +34 −1 Original line number Diff line number Diff line Loading @@ -354,6 +354,15 @@ public class TelecomServiceImpl { account.getAccountHandle().getComponentName().getPackageName()); if (account.hasCapabilities(PhoneAccount.CAPABILITY_SELF_MANAGED)) { enforceRegisterSelfManaged(); if (account.hasCapabilities(PhoneAccount.CAPABILITY_CALL_PROVIDER) || account.hasCapabilities( PhoneAccount.CAPABILITY_CONNECTION_MANAGER) || account.hasCapabilities( PhoneAccount.CAPABILITY_SIM_SUBSCRIPTION)) { throw new SecurityException("Self-managed ConnectionServices " + "cannot also be call capable, connection managers, or " + "SIM accounts."); } } if (account.hasCapabilities(PhoneAccount.CAPABILITY_SIM_SUBSCRIPTION)) { enforceRegisterSimSubscriptionPermission(); Loading Loading @@ -1243,6 +1252,30 @@ public class TelecomServiceImpl { Log.endSession(); } } /** * Blocks until all Telecom handlers have completed their current work. * * See {@link com.android.commands.telecom.Telecom}. */ @Override public void waitOnHandlers() { try { Log.startSession("TSI.wOH"); enforceModifyPermission(); synchronized (mLock) { long token = Binder.clearCallingIdentity(); try { Log.i(this, "waitOnHandlers"); mCallsManager.waitOnHandlers(); } finally { Binder.restoreCallingIdentity(token); } } } finally { Log.endSession(); } } }; private Context mContext; Loading Loading @@ -1474,7 +1507,7 @@ public class TelecomServiceImpl { if (phoneAccountHandle != null) { PhoneAccount phoneAccount = mPhoneAccountRegistrar.getPhoneAccountUnchecked( phoneAccountHandle); return phoneAccount.isSelfManaged(); return phoneAccount != null && phoneAccount.isSelfManaged(); } return false; } Loading