Loading Android.mk +1 −3 Original line number Diff line number Diff line Loading @@ -64,9 +64,7 @@ LOCAL_PRIVILEGED_MODULE := true LOCAL_PROGUARD_FLAG_FILES := proguard.flags $(incallui_dir)/proguard.flags # Uncomment the following line to build against the current SDK # This is required for building an unbundled app. LOCAL_SDK_VERSION := system_current LOCAL_SDK_VERSION := current include $(BUILD_PACKAGE) Loading InCallUI/src/com/android/incallui/Call.java +9 −99 Original line number Diff line number Diff line Loading @@ -19,9 +19,9 @@ package com.android.incallui; import android.content.Context; import android.hardware.camera2.CameraCharacteristics; import android.net.Uri; import android.os.Build; import android.os.Bundle; import android.os.Trace; import android.telecom.Call.Details; import android.telecom.Connection; import android.telecom.DisconnectCause; import android.telecom.GatewayInfo; Loading @@ -37,8 +37,6 @@ import com.android.contacts.common.compat.SdkVersionOverride; import com.android.contacts.common.compat.telecom.TelecomManagerCompat; import com.android.contacts.common.testing.NeededForTesting; import com.android.dialer.util.IntentUtil; import com.android.incallui.compat.telecom.DetailsCompat; import com.android.incallui.compat.telecom.VideoProfileCompat; import com.android.incallui.util.TelecomCallUtil; import java.util.ArrayList; Loading Loading @@ -291,18 +289,8 @@ public class Call { private static final String ID_PREFIX = Call.class.getSimpleName() + "_"; private static int sIdCounter = 0; private Object mTelecomCallCallback = newTelecomCallCallback(); private Object newTelecomCallCallback() { if (SdkVersionOverride.getSdkVersion(Build.VERSION_CODES.M) >= Build.VERSION_CODES.M) { return newMarshmallowTelecomCallCallback(); } return newLollipopTelecomCallCallback(); } private Object newMarshmallowTelecomCallCallback() { Log.i(this, "Using an android.telecom.Call$Callback"); return new android.telecom.Call.Callback() { private final android.telecom.Call.Callback mTelecomCallCallback = new android.telecom.Call.Callback() { @Override public void onStateChanged(android.telecom.Call call, int newState) { Log.d(this, "TelecomCallCallback onStateChanged call=" + call + " newState=" Loading Loading @@ -368,80 +356,6 @@ public class Call { update(); } }; } private Object newLollipopTelecomCallCallback() { // This code only runs for Google Experience phones on the pre-M sdk since only the system // dialer can invoke the InCallUI code. This allows us to safely use the // android.telecom.Call.Listener interface Log.i(this, "Using an android.telecom.Call$Listener"); return new android.telecom.Call.Listener() { @Override public void onStateChanged(android.telecom.Call call, int newState) { Log.d(this, "TelecomCallCallback onStateChanged call=" + call + " newState=" + newState); update(); } @Override public void onParentChanged(android.telecom.Call call, android.telecom.Call newParent) { Log.d(this, "TelecomCallCallback onParentChanged call=" + call + " newParent=" + newParent); update(); } @Override public void onChildrenChanged(android.telecom.Call call, List<android.telecom.Call> children) { update(); } @Override public void onDetailsChanged(android.telecom.Call call, android.telecom.Call.Details details) { Log.d(this, "TelecomCallCallback onStateChanged call=" + call + " details=" + details); update(); } @Override public void onCannedTextResponsesLoaded(android.telecom.Call call, List<String> cannedTextResponses) { Log.d(this, "TelecomCallCallback onStateChanged call=" + call + " cannedTextResponses=" + cannedTextResponses); update(); } @Override public void onPostDialWait(android.telecom.Call call, String remainingPostDialSequence) { Log.d(this, "TelecomCallCallback onStateChanged call=" + call + " remainingPostDialSequence=" + remainingPostDialSequence); update(); } @Override public void onVideoCallChanged(android.telecom.Call call, VideoCall videoCall) { Log.d(this, "TelecomCallCallback onStateChanged call=" + call + " videoCall=" + videoCall); update(); } @Override public void onCallDestroyed(android.telecom.Call call) { Log.d(this, "TelecomCallCallback onStateChanged call=" + call); call.removeListener(this); } @Override public void onConferenceableCallsChanged(android.telecom.Call call, List<android.telecom.Call> conferenceableCalls) { update(); } }; } private android.telecom.Call mTelecomCall; private boolean mIsEmergencyCall; Loading Loading @@ -491,11 +405,7 @@ public class Call { updateFromTelecomCall(); if (SdkVersionOverride.getSdkVersion(Build.VERSION_CODES.M) >= Build.VERSION_CODES.M) { mTelecomCall.registerCallback((android.telecom.Call.Callback) mTelecomCallCallback); } else { mTelecomCall.addListener((android.telecom.Call.Listener) mTelecomCallCallback); } mTelecomCall.registerCallback(mTelecomCallCallback); mTimeAddedMs = System.currentTimeMillis(); } Loading Loading @@ -750,7 +660,7 @@ public class Call { } public Bundle getIntentExtras() { return DetailsCompat.getIntentExtras(mTelecomCall.getDetails()); return mTelecomCall.getDetails().getIntentExtras(); } public Bundle getExtras() { Loading Loading @@ -824,7 +734,7 @@ public class Call { } public boolean hasProperty(int property) { return DetailsCompat.hasProperty(mTelecomCall.getDetails(), property); return mTelecomCall.getDetails().hasProperty(property); } /** Gets the time when the call first became active. */ Loading Loading @@ -989,11 +899,11 @@ public class Call { "videoState:%s, mSessionModificationState:%d, VideoSettings:%s]", mId, State.toString(getState()), DetailsCompat.capabilitiesToString(mTelecomCall.getDetails().getCallCapabilities()), Details.capabilitiesToString(mTelecomCall.getDetails().getCallCapabilities()), mChildCallIds, getParentId(), this.mTelecomCall.getConferenceableCalls(), VideoProfileCompat.videoStateToString(mTelecomCall.getDetails().getVideoState()), VideoProfile.videoStateToString(mTelecomCall.getDetails().getVideoState()), mSessionModificationState, getVideoSettings()); } Loading InCallUI/src/com/android/incallui/CallButtonPresenter.java +1 −1 Original line number Diff line number Diff line Loading @@ -380,7 +380,7 @@ public class CallButtonPresenter extends Presenter<CallButtonPresenter.CallButto && call.can(android.telecom.Call.Details.CAPABILITY_HOLD); final boolean isCallOnHold = call.getState() == Call.State.ONHOLD; final boolean showAddCall = TelecomAdapter.getInstance().canAddCall(call) final boolean showAddCall = TelecomAdapter.getInstance().canAddCall() && UserManagerCompat.isUserUnlocked(ui.getContext()); final boolean showMerge = call.can( android.telecom.Call.Details.CAPABILITY_MERGE_CONFERENCE); Loading InCallUI/src/com/android/incallui/CallCardPresenter.java +3 −4 Original line number Diff line number Diff line Loading @@ -53,7 +53,6 @@ import com.android.incallui.InCallPresenter.InCallEventListener; import com.android.incallui.InCallPresenter.InCallState; import com.android.incallui.InCallPresenter.InCallStateListener; import com.android.incallui.InCallPresenter.IncomingCallListener; import com.android.incallui.compat.telecom.DetailsCompat; import com.android.incalluibind.ObjectFactory; import java.lang.ref.WeakReference; Loading Loading @@ -345,7 +344,7 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi> updatePrimaryCallState(); if (call.can(Details.CAPABILITY_MANAGE_CONFERENCE) != DetailsCompat.can(details, Details.CAPABILITY_MANAGE_CONFERENCE)) { details.can(Details.CAPABILITY_MANAGE_CONFERENCE)) { maybeShowManageConferenceCallButton(); } } Loading Loading @@ -1112,8 +1111,8 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi> } private static boolean hasCallSubject(Call call) { return !TextUtils.isEmpty(DetailsCompat.getIntentExtras( call.getTelecomCall().getDetails()).getString(TelecomManager.EXTRA_CALL_SUBJECT)); return !TextUtils.isEmpty(call.getTelecomCall().getDetails().getIntentExtras() .getString(TelecomManager.EXTRA_CALL_SUBJECT)); } public interface CallCardUi extends Ui { Loading InCallUI/src/com/android/incallui/ConferenceParticipantListAdapter.java +2 −4 Original line number Diff line number Diff line Loading @@ -38,7 +38,6 @@ import com.android.contacts.common.compat.PhoneNumberUtilsCompat; import com.android.contacts.common.preference.ContactsPreferences; import com.android.contacts.common.util.ContactDisplayUtils; import com.android.incallui.ContactInfoCache.ContactCacheEntry; import com.android.incallui.compat.telecom.DetailsCompat; import java.lang.ref.WeakReference; import java.util.ArrayList; Loading Loading @@ -356,10 +355,9 @@ public class ConferenceParticipantListAdapter extends BaseAdapter { new ContactLookupCallback(this)); } boolean thisRowCanSeparate = mParentCanSeparate && DetailsCompat.can( call.getTelecomCall().getDetails(), boolean thisRowCanSeparate = mParentCanSeparate && call.getTelecomCall().getDetails().can( android.telecom.Call.Details.CAPABILITY_SEPARATE_FROM_CONFERENCE); boolean thisRowCanDisconnect = DetailsCompat.can(call.getTelecomCall().getDetails(), boolean thisRowCanDisconnect = call.getTelecomCall().getDetails().can( android.telecom.Call.Details.CAPABILITY_DISCONNECT_FROM_CONFERENCE); setCallerInfoForRow(result, contactCache.namePrimary, Loading Loading
Android.mk +1 −3 Original line number Diff line number Diff line Loading @@ -64,9 +64,7 @@ LOCAL_PRIVILEGED_MODULE := true LOCAL_PROGUARD_FLAG_FILES := proguard.flags $(incallui_dir)/proguard.flags # Uncomment the following line to build against the current SDK # This is required for building an unbundled app. LOCAL_SDK_VERSION := system_current LOCAL_SDK_VERSION := current include $(BUILD_PACKAGE) Loading
InCallUI/src/com/android/incallui/Call.java +9 −99 Original line number Diff line number Diff line Loading @@ -19,9 +19,9 @@ package com.android.incallui; import android.content.Context; import android.hardware.camera2.CameraCharacteristics; import android.net.Uri; import android.os.Build; import android.os.Bundle; import android.os.Trace; import android.telecom.Call.Details; import android.telecom.Connection; import android.telecom.DisconnectCause; import android.telecom.GatewayInfo; Loading @@ -37,8 +37,6 @@ import com.android.contacts.common.compat.SdkVersionOverride; import com.android.contacts.common.compat.telecom.TelecomManagerCompat; import com.android.contacts.common.testing.NeededForTesting; import com.android.dialer.util.IntentUtil; import com.android.incallui.compat.telecom.DetailsCompat; import com.android.incallui.compat.telecom.VideoProfileCompat; import com.android.incallui.util.TelecomCallUtil; import java.util.ArrayList; Loading Loading @@ -291,18 +289,8 @@ public class Call { private static final String ID_PREFIX = Call.class.getSimpleName() + "_"; private static int sIdCounter = 0; private Object mTelecomCallCallback = newTelecomCallCallback(); private Object newTelecomCallCallback() { if (SdkVersionOverride.getSdkVersion(Build.VERSION_CODES.M) >= Build.VERSION_CODES.M) { return newMarshmallowTelecomCallCallback(); } return newLollipopTelecomCallCallback(); } private Object newMarshmallowTelecomCallCallback() { Log.i(this, "Using an android.telecom.Call$Callback"); return new android.telecom.Call.Callback() { private final android.telecom.Call.Callback mTelecomCallCallback = new android.telecom.Call.Callback() { @Override public void onStateChanged(android.telecom.Call call, int newState) { Log.d(this, "TelecomCallCallback onStateChanged call=" + call + " newState=" Loading Loading @@ -368,80 +356,6 @@ public class Call { update(); } }; } private Object newLollipopTelecomCallCallback() { // This code only runs for Google Experience phones on the pre-M sdk since only the system // dialer can invoke the InCallUI code. This allows us to safely use the // android.telecom.Call.Listener interface Log.i(this, "Using an android.telecom.Call$Listener"); return new android.telecom.Call.Listener() { @Override public void onStateChanged(android.telecom.Call call, int newState) { Log.d(this, "TelecomCallCallback onStateChanged call=" + call + " newState=" + newState); update(); } @Override public void onParentChanged(android.telecom.Call call, android.telecom.Call newParent) { Log.d(this, "TelecomCallCallback onParentChanged call=" + call + " newParent=" + newParent); update(); } @Override public void onChildrenChanged(android.telecom.Call call, List<android.telecom.Call> children) { update(); } @Override public void onDetailsChanged(android.telecom.Call call, android.telecom.Call.Details details) { Log.d(this, "TelecomCallCallback onStateChanged call=" + call + " details=" + details); update(); } @Override public void onCannedTextResponsesLoaded(android.telecom.Call call, List<String> cannedTextResponses) { Log.d(this, "TelecomCallCallback onStateChanged call=" + call + " cannedTextResponses=" + cannedTextResponses); update(); } @Override public void onPostDialWait(android.telecom.Call call, String remainingPostDialSequence) { Log.d(this, "TelecomCallCallback onStateChanged call=" + call + " remainingPostDialSequence=" + remainingPostDialSequence); update(); } @Override public void onVideoCallChanged(android.telecom.Call call, VideoCall videoCall) { Log.d(this, "TelecomCallCallback onStateChanged call=" + call + " videoCall=" + videoCall); update(); } @Override public void onCallDestroyed(android.telecom.Call call) { Log.d(this, "TelecomCallCallback onStateChanged call=" + call); call.removeListener(this); } @Override public void onConferenceableCallsChanged(android.telecom.Call call, List<android.telecom.Call> conferenceableCalls) { update(); } }; } private android.telecom.Call mTelecomCall; private boolean mIsEmergencyCall; Loading Loading @@ -491,11 +405,7 @@ public class Call { updateFromTelecomCall(); if (SdkVersionOverride.getSdkVersion(Build.VERSION_CODES.M) >= Build.VERSION_CODES.M) { mTelecomCall.registerCallback((android.telecom.Call.Callback) mTelecomCallCallback); } else { mTelecomCall.addListener((android.telecom.Call.Listener) mTelecomCallCallback); } mTelecomCall.registerCallback(mTelecomCallCallback); mTimeAddedMs = System.currentTimeMillis(); } Loading Loading @@ -750,7 +660,7 @@ public class Call { } public Bundle getIntentExtras() { return DetailsCompat.getIntentExtras(mTelecomCall.getDetails()); return mTelecomCall.getDetails().getIntentExtras(); } public Bundle getExtras() { Loading Loading @@ -824,7 +734,7 @@ public class Call { } public boolean hasProperty(int property) { return DetailsCompat.hasProperty(mTelecomCall.getDetails(), property); return mTelecomCall.getDetails().hasProperty(property); } /** Gets the time when the call first became active. */ Loading Loading @@ -989,11 +899,11 @@ public class Call { "videoState:%s, mSessionModificationState:%d, VideoSettings:%s]", mId, State.toString(getState()), DetailsCompat.capabilitiesToString(mTelecomCall.getDetails().getCallCapabilities()), Details.capabilitiesToString(mTelecomCall.getDetails().getCallCapabilities()), mChildCallIds, getParentId(), this.mTelecomCall.getConferenceableCalls(), VideoProfileCompat.videoStateToString(mTelecomCall.getDetails().getVideoState()), VideoProfile.videoStateToString(mTelecomCall.getDetails().getVideoState()), mSessionModificationState, getVideoSettings()); } Loading
InCallUI/src/com/android/incallui/CallButtonPresenter.java +1 −1 Original line number Diff line number Diff line Loading @@ -380,7 +380,7 @@ public class CallButtonPresenter extends Presenter<CallButtonPresenter.CallButto && call.can(android.telecom.Call.Details.CAPABILITY_HOLD); final boolean isCallOnHold = call.getState() == Call.State.ONHOLD; final boolean showAddCall = TelecomAdapter.getInstance().canAddCall(call) final boolean showAddCall = TelecomAdapter.getInstance().canAddCall() && UserManagerCompat.isUserUnlocked(ui.getContext()); final boolean showMerge = call.can( android.telecom.Call.Details.CAPABILITY_MERGE_CONFERENCE); Loading
InCallUI/src/com/android/incallui/CallCardPresenter.java +3 −4 Original line number Diff line number Diff line Loading @@ -53,7 +53,6 @@ import com.android.incallui.InCallPresenter.InCallEventListener; import com.android.incallui.InCallPresenter.InCallState; import com.android.incallui.InCallPresenter.InCallStateListener; import com.android.incallui.InCallPresenter.IncomingCallListener; import com.android.incallui.compat.telecom.DetailsCompat; import com.android.incalluibind.ObjectFactory; import java.lang.ref.WeakReference; Loading Loading @@ -345,7 +344,7 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi> updatePrimaryCallState(); if (call.can(Details.CAPABILITY_MANAGE_CONFERENCE) != DetailsCompat.can(details, Details.CAPABILITY_MANAGE_CONFERENCE)) { details.can(Details.CAPABILITY_MANAGE_CONFERENCE)) { maybeShowManageConferenceCallButton(); } } Loading Loading @@ -1112,8 +1111,8 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi> } private static boolean hasCallSubject(Call call) { return !TextUtils.isEmpty(DetailsCompat.getIntentExtras( call.getTelecomCall().getDetails()).getString(TelecomManager.EXTRA_CALL_SUBJECT)); return !TextUtils.isEmpty(call.getTelecomCall().getDetails().getIntentExtras() .getString(TelecomManager.EXTRA_CALL_SUBJECT)); } public interface CallCardUi extends Ui { Loading
InCallUI/src/com/android/incallui/ConferenceParticipantListAdapter.java +2 −4 Original line number Diff line number Diff line Loading @@ -38,7 +38,6 @@ import com.android.contacts.common.compat.PhoneNumberUtilsCompat; import com.android.contacts.common.preference.ContactsPreferences; import com.android.contacts.common.util.ContactDisplayUtils; import com.android.incallui.ContactInfoCache.ContactCacheEntry; import com.android.incallui.compat.telecom.DetailsCompat; import java.lang.ref.WeakReference; import java.util.ArrayList; Loading Loading @@ -356,10 +355,9 @@ public class ConferenceParticipantListAdapter extends BaseAdapter { new ContactLookupCallback(this)); } boolean thisRowCanSeparate = mParentCanSeparate && DetailsCompat.can( call.getTelecomCall().getDetails(), boolean thisRowCanSeparate = mParentCanSeparate && call.getTelecomCall().getDetails().can( android.telecom.Call.Details.CAPABILITY_SEPARATE_FROM_CONFERENCE); boolean thisRowCanDisconnect = DetailsCompat.can(call.getTelecomCall().getDetails(), boolean thisRowCanDisconnect = call.getTelecomCall().getDetails().can( android.telecom.Call.Details.CAPABILITY_DISCONNECT_FROM_CONFERENCE); setCallerInfoForRow(result, contactCache.namePrimary, Loading