summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Garnes <matt@cyngn.com>2015-03-26 12:25:10 -0700
committerMatt Garnes <matt@cyngn.com>2015-03-26 12:25:10 -0700
commit9492da9394de1cea33160dfd3dc7d44de4bf3852 (patch)
treec9964c7623878655cd37a5db0ae7b9ddca2dc6cb
parente0fa4b84f6dba2d330c96dab3e20a81f514cf259 (diff)
parent2a709e4698328496eae107055ae3ef2c4e0f605f (diff)
downloadandroid_packages_apps_InCallUI-9492da9394de1cea33160dfd3dc7d44de4bf3852.tar.gz
android_packages_apps_InCallUI-9492da9394de1cea33160dfd3dc7d44de4bf3852.tar.bz2
android_packages_apps_InCallUI-9492da9394de1cea33160dfd3dc7d44de4bf3852.zip
Merge remote-tracking branch 'caf/LA.BR.1.2.3_1' into caf/cm-12.1
Conflicts: src/com/android/incallui/CallCardFragment.java Change-Id: I623ae46380499db280c4584fb83d1b33f4dc3bfd
-rw-r--r--res/values/customize.xml3
-rw-r--r--res/values/strings.xml3
-rwxr-xr-xsrc/com/android/incallui/AnswerPresenter.java14
-rw-r--r--src/com/android/incallui/Call.java10
-rw-r--r--src/com/android/incallui/CallButtonFragment.java6
-rw-r--r--src/com/android/incallui/CallButtonPresenter.java2
-rw-r--r--src/com/android/incallui/CallCardFragment.java4
-rw-r--r--src/com/android/incallui/CallCardPresenter.java8
-rw-r--r--src/com/android/incallui/CallList.java38
-rw-r--r--src/com/android/incallui/CallerInfoAsyncQuery.java2
-rw-r--r--src/com/android/incallui/InCallActivity.java56
-rw-r--r--src/com/android/incallui/RcsRichScreen.java104
-rw-r--r--src/com/android/incallui/SelectPhoneAccountDialogFragment.java10
-rw-r--r--src/com/android/incallui/StatusBarNotifier.java14
14 files changed, 164 insertions, 110 deletions
diff --git a/res/values/customize.xml b/res/values/customize.xml
index fe8ef53b..06adaef1 100644
--- a/res/values/customize.xml
+++ b/res/values/customize.xml
@@ -41,4 +41,7 @@ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-->
<bool name="def_incallui_clearcode_enabled">false</bool>
+ <!-- On user confirmation, activity is launched to disable apm.
+ Below config is used for the same -->
+ <bool name="config_telephony_enable_apm_setting_launch">false</bool>
</resources>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 08d881f7..2e86499f 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -650,4 +650,7 @@
<string name="call_state_disconnecting">Disconnecting</string>
<string name="call_state_disconnected">Disconnected</string>
<string name="dial_conference_call_error">Cannot create a 4G conference call, because the 4G network is not available.</string>
+
+ <string name="apm_turn_on_confirmation">"Flight mode is on. Would you like to turn off flight mode?"</string>
+ <string name="cancel">Cancel</string>
</resources>
diff --git a/src/com/android/incallui/AnswerPresenter.java b/src/com/android/incallui/AnswerPresenter.java
index 9aa70a4e..b0ca155c 100755
--- a/src/com/android/incallui/AnswerPresenter.java
+++ b/src/com/android/incallui/AnswerPresenter.java
@@ -50,7 +50,7 @@ public class AnswerPresenter extends Presenter<AnswerPresenter.AnswerUi>
processVideoUpgradeRequestCall(call);
}
for (int i = 0; i < CallList.PHONE_COUNT; i++) {
- long[] subId = CallList.getInstance().getSubId(i);
+ int[] subId = CallList.getInstance().getSubId(i);
call = calls.getCallWithState(Call.State.INCOMING, 0, subId[0]);
if (call == null) {
call = calls.getCallWithState(Call.State.CALL_WAITING, 0, subId[0]);
@@ -94,7 +94,7 @@ public class AnswerPresenter extends Presenter<AnswerPresenter.AnswerUi>
@Override
public void onIncomingCall(Call call) {
- long subId = call.getSubId();
+ int subId = call.getSubId();
int phoneId = CallList.getInstance().getPhoneId(subId);
// TODO: Ui is being destroyed when the fragment detaches. Need clean up step to stop
// getting updates here.
@@ -144,7 +144,7 @@ public class AnswerPresenter extends Presenter<AnswerPresenter.AnswerUi>
}
private void processIncomingCall(Call call) {
- long subId = call.getSubId();
+ int subId = call.getSubId();
int phoneId = CallList.getInstance().getPhoneId(subId);
mCallId[phoneId] = call.getId();
mCall[phoneId] = call;
@@ -175,7 +175,7 @@ public class AnswerPresenter extends Presenter<AnswerPresenter.AnswerUi>
}
Log.d(this, " processVideoUpgradeRequestCall show glowpad");
- long subId = call.getSubId();
+ int subId = call.getSubId();
int phoneId = CallList.getInstance().getPhoneId(subId);
mCallId[phoneId] = call.getId();
mCall[phoneId] = call;
@@ -219,7 +219,7 @@ public class AnswerPresenter extends Presenter<AnswerPresenter.AnswerUi>
public void onCallChanged(Call call) {
Log.d(this, "onCallStateChange() " + call + " " + this);
if (call.getState() != Call.State.INCOMING) {
- long subId = call.getSubId();
+ int subId = call.getSubId();
int phoneId = CallList.getInstance().getPhoneId(subId);
boolean isUpgradePending = isVideoUpgradePending(call);
@@ -254,7 +254,7 @@ public class AnswerPresenter extends Presenter<AnswerPresenter.AnswerUi>
private int getActivePhoneId() {
int phoneId = -1;
if (CallList.getInstance().isDsdaEnabled()) {
- long subId = CallList.getInstance().getActiveSubscription();
+ int subId = CallList.getInstance().getActiveSubscription();
phoneId = CallList.getInstance().getPhoneId(subId);
} else {
for (int i = 0; i < mCall.length; i++) {
@@ -380,7 +380,7 @@ public class AnswerPresenter extends Presenter<AnswerPresenter.AnswerUi>
}
@Override
- public void onActiveSubChanged(long subId) {
+ public void onActiveSubChanged(int subId) {
final CallList calls = CallList.getInstance();
final Call call = calls.getIncomingCall();
int phoneId = CallList.getInstance().getPhoneId(subId);
diff --git a/src/com/android/incallui/Call.java b/src/com/android/incallui/Call.java
index 94b92da9..654161ab 100644
--- a/src/com/android/incallui/Call.java
+++ b/src/com/android/incallui/Call.java
@@ -399,11 +399,11 @@ public final class Call {
mTelecommCall.getConferenceableCalls();
boolean hasConfenceableCall = false;
if (!conferenceableCalls.isEmpty()){
- long subId = getSubId();
+ int subId = getSubId();
for (android.telecom.Call call : conferenceableCalls) {
PhoneAccountHandle phHandle = call.getDetails().getAccountHandle();
if (phHandle != null) {
- if((Long.parseLong(phHandle.getId())) == subId) {
+ if((Integer.parseInt(phHandle.getId())) == subId) {
hasConfenceableCall = true;
break;
}
@@ -470,19 +470,19 @@ public final class Call {
return mTelecommCall.getDetails().getAccountHandle();
}
- public long getSubId() {
+ public int getSubId() {
PhoneAccountHandle ph = getAccountHandle();
if (ph != null) {
try {
if (ph.getId() != null ) {
- return Long.parseLong(getAccountHandle().getId());
+ return Integer.parseInt(getAccountHandle().getId());
}
} catch (NumberFormatException e) {
Log.w(this,"sub Id is Not a Number Exce:" + e);
}
return SubscriptionManager.getDefaultVoiceSubId();
} else {
- return SubscriptionManager.INVALID_SUB_ID;
+ return SubscriptionManager.INVALID_SUBSCRIPTION_ID;
}
}
diff --git a/src/com/android/incallui/CallButtonFragment.java b/src/com/android/incallui/CallButtonFragment.java
index 45948410..87b658f4 100644
--- a/src/com/android/incallui/CallButtonFragment.java
+++ b/src/com/android/incallui/CallButtonFragment.java
@@ -178,6 +178,7 @@ public class CallButtonFragment
}
case R.id.mergeButton:
getPresenter().mergeClicked();
+ mMergeButton.setEnabled(false);
break;
case R.id.holdButton: {
final ImageButton button = (ImageButton) view;
@@ -326,6 +327,11 @@ public class CallButtonFragment
@Override
public void showMergeButton(boolean show) {
mMergeButton.setVisibility(show ? View.VISIBLE : View.GONE);
+
+ // If the merge button was disabled, re-enable it when hiding it.
+ if (!show) {
+ mMergeButton.setEnabled(true);
+ }
}
@Override
diff --git a/src/com/android/incallui/CallButtonPresenter.java b/src/com/android/incallui/CallButtonPresenter.java
index c0f282ba..7d8f3449 100644
--- a/src/com/android/incallui/CallButtonPresenter.java
+++ b/src/com/android/incallui/CallButtonPresenter.java
@@ -554,7 +554,7 @@ public class CallButtonPresenter extends Presenter<CallButtonPresenter.CallButto
}
@Override
- public void onActiveSubChanged(long subId) {
+ public void onActiveSubChanged(int subId) {
InCallState state = InCallPresenter.getInstance()
.getPotentialStateFromCallList(CallList.getInstance());
diff --git a/src/com/android/incallui/CallCardFragment.java b/src/com/android/incallui/CallCardFragment.java
index 7e147e2c..717094cf 100644
--- a/src/com/android/incallui/CallCardFragment.java
+++ b/src/com/android/incallui/CallCardFragment.java
@@ -601,7 +601,7 @@ public class CallCardFragment extends BaseFragment<CallCardPresenter, CallCardPr
setPrimaryLabel(label);
showCallTypeLabel(isSipCall, isForwarded);
- if(isRcsAvailable()){
+ if (mRcsRichScreen != null && isRcsAvailable()) {
String rcsnumber = null;
if(!nameIsNumber){
rcsnumber = number;
@@ -671,7 +671,7 @@ public class CallCardFragment extends BaseFragment<CallCardPresenter, CallCardPr
return;
}
// update Rcs RichScreen by call state
- if (isRcsAvailable()) {
+ if (mRcsRichScreen != null && isRcsAvailable()) {
mRcsRichScreen.updateRichScreenByCallState(state,videoState);
}
diff --git a/src/com/android/incallui/CallCardPresenter.java b/src/com/android/incallui/CallCardPresenter.java
index 3b24399a..b152eb51 100644
--- a/src/com/android/incallui/CallCardPresenter.java
+++ b/src/com/android/incallui/CallCardPresenter.java
@@ -577,7 +577,7 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi>
return number;
}
- private boolean isCDMAPhone(long subscription) {
+ private boolean isCDMAPhone(int subscription) {
boolean isCDMA = false;
int phoneType = TelephonyManager.getDefault().isMultiSimEnabled()
? TelephonyManager.getDefault().getCurrentPhoneType(subscription)
@@ -588,7 +588,7 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi>
return isCDMA;
}
- private boolean isRoaming(long subscription) {
+ private boolean isRoaming(int subscription) {
if (TelephonyManager.getDefault().isMultiSimEnabled()) {
return TelephonyManager.getDefault().isNetworkRoaming(subscription);
} else {
@@ -672,7 +672,7 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi>
// accounts pick icon from phone account and display on UI
if (account != null && (getTelecomManager().hasMultipleCallCapableAccounts()
|| (CallList.PHONE_COUNT > 1))) {
- return account.getIcon(mContext);
+ return account.createIconDrawable(mContext);
}
return null;
}
@@ -878,7 +878,7 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi>
boolean isManageConferenceVisible();
}
- public long getActiveSubscription() {
+ public int getActiveSubscription() {
return SubscriptionManager.getDefaultSubId();
}
diff --git a/src/com/android/incallui/CallList.java b/src/com/android/incallui/CallList.java
index e9217b4a..fe79b817 100644
--- a/src/com/android/incallui/CallList.java
+++ b/src/com/android/incallui/CallList.java
@@ -68,7 +68,7 @@ public class CallList implements InCallPhoneListener {
.newHashMap();
private Phone mPhone;
- private long mSubId = SubscriptionManager.INVALID_SUB_ID;
+ private int mSubId = SubscriptionManager.INVALID_SUBSCRIPTION_ID;
private final ArrayList<ActiveSubChangeListener> mActiveSubChangeListeners =
Lists.newArrayList();
@@ -125,11 +125,11 @@ public class CallList implements InCallPhoneListener {
mPhone = null;
}
- int getPhoneId(long subId) {
+ int getPhoneId(int subId) {
return SubscriptionManager.getPhoneId(subId);
}
- long[] getSubId(int phoneId) {
+ int[] getSubId(int phoneId) {
return SubscriptionManager.getSubId(phoneId);
}
@@ -155,7 +155,7 @@ public class CallList implements InCallPhoneListener {
// Update active subscription from call object. it will be set by
// Telecomm service for incoming call and whenever active sub changes.
if (call.mIsActiveSub) {
- long sub = call.getSubId();
+ int sub = call.getSubId();
Log.d(this, "onIncoming - sub:" + sub + " mSubId:" + mSubId);
if (sub != mSubId) {
setActiveSubscription(sub);
@@ -185,7 +185,7 @@ public class CallList implements InCallPhoneListener {
PhoneAccountHandle ph = call.getAccountHandle();
Log.d(this, "onUpdate - " + call + " ph:" + ph);
if (call.mIsActiveSub && ph != null && (!ph.getId().equals("E"))) {
- long sub = call.getSubId();
+ int sub = call.getSubId();
Log.i(this, "onUpdate - sub:" + sub + " mSubId:" + mSubId);
if(sub != mSubId) {
setActiveSubscription(sub);
@@ -400,7 +400,7 @@ public class CallList implements InCallPhoneListener {
*/
public Call getCallWithState(int state, int positionToFind) {
if (state != Call.State.PRE_DIAL_WAIT && getActiveSubscription()
- != SubscriptionManager.INVALID_SUB_ID && isDsdaEnabled()) {
+ != SubscriptionManager.INVALID_SUBSCRIPTION_ID && isDsdaEnabled()) {
return getCallWithState(state, positionToFind, getActiveSubscription());
}
@@ -562,7 +562,7 @@ public class CallList implements InCallPhoneListener {
if (!hasAnyLiveCall()) {
// update to Telecomm service that no active sub
TelecomAdapter.getInstance().switchToOtherActiveSub(null, false);
- mSubId = SubscriptionManager.INVALID_SUB_ID;
+ mSubId = SubscriptionManager.INVALID_SUBSCRIPTION_ID;
}
}
@@ -648,14 +648,14 @@ public class CallList implements InCallPhoneListener {
/**
* Called when active subscription changes.
*/
- public void onActiveSubChanged(long activeSub) {
+ public void onActiveSubChanged(int activeSub) {
Log.i(this, "onActiveSubChanged = " + activeSub);
if (hasAnyLiveCall(activeSub)) {
setActiveSubscription(activeSub);
}
}
- public long getActiveSubscription() {
+ public int getActiveSubscription() {
return mSubId;
}
@@ -663,7 +663,7 @@ public class CallList implements InCallPhoneListener {
* Called to update the latest active subscription id, and also it
* notifies the registred clients about subscription change information.
*/
- public void setActiveSubscription(long subId) {
+ public void setActiveSubscription(int subId) {
if (subId != mSubId) {
Log.i(this, "setActiveSubscription, old = " + mSubId + " new = " + subId);
mSubId = subId;
@@ -675,11 +675,11 @@ public class CallList implements InCallPhoneListener {
/**
* Returns true, if any voice call in ACTIVE on the provided subscription.
*/
- public boolean hasAnyLiveCall(long subId) {
+ public boolean hasAnyLiveCall(int subId) {
for (Call call : mCallById.values()) {
PhoneAccountHandle ph = call.getAccountHandle();
try {
- if (!isCallDead(call) && ph != null && (Long.parseLong(ph.getId()) == subId)) {
+ if (!isCallDead(call) && ph != null && (Integer.parseInt(ph.getId()) == subId)) {
Log.i(this, "hasAnyLiveCall sub = " + subId);
return true;
}
@@ -712,11 +712,11 @@ public class CallList implements InCallPhoneListener {
* @param retainLch whether to retain the LCH state of the other active sub
*/
public boolean switchToOtherActiveSub(boolean retainLch) {
- long activeSub = getActiveSubscription();
+ int activeSub = getActiveSubscription();
boolean subSwitched = false;
for (int i = 0; i < PHONE_COUNT; i++) {
- long[] subId = getSubId(i);
+ int[] subId = getSubId(i);
if ((subId[0] != activeSub) && hasAnyLiveCall(subId[0])) {
Log.i(this, "switchToOtherActiveSub, subId = " + subId[0] +
" retainLch = " + retainLch);
@@ -734,7 +734,7 @@ public class CallList implements InCallPhoneListener {
* Method to check if there is any live call in a sub other than the one supplied.
* @param currentSub The subscription to exclude while checking for active calls.
*/
- public boolean isAnyOtherSubActive(long currentSub) {
+ public boolean isAnyOtherSubActive(int currentSub) {
boolean result = false;
if(!isDsdaEnabled()) {
return false;
@@ -742,7 +742,7 @@ public class CallList implements InCallPhoneListener {
for (int phoneId = 0; phoneId < PHONE_COUNT;
phoneId++) {
- long[] subId = getSubId(phoneId);
+ int[] subId = getSubId(phoneId);
if ((subId[0] != currentSub) && hasAnyLiveCall(subId[0])) {
Log.d(this, "Live call found on another sub = " + subId[0]);
@@ -757,7 +757,7 @@ public class CallList implements InCallPhoneListener {
* Returns the [position]th call which belongs to provided subscription and
* found in the call map with the specified state.
*/
- public Call getCallWithState(int state, int positionToFind, long subId) {
+ public Call getCallWithState(int state, int positionToFind, int subId) {
Call retval = null;
int position = 0;
for (Call call : mCallById.values()) {
@@ -769,7 +769,7 @@ public class CallList implements InCallPhoneListener {
List<android.telecom.Call> children = call.getTelecommCall().getChildren();
android.telecom.Call child = children.get(0);
PhoneAccountHandle childph = child.getDetails().getAccountHandle();
- if (Long.parseLong(childph.getId()) == subId) {
+ if (Integer.parseInt(childph.getId()) == subId) {
Log.d(this,"getCallWithState:retval = "+call);
retval = call;
break;
@@ -800,6 +800,6 @@ public class CallList implements InCallPhoneListener {
}
public interface ActiveSubChangeListener {
- public void onActiveSubChanged(long subId);
+ public void onActiveSubChanged(int subId);
}
}
diff --git a/src/com/android/incallui/CallerInfoAsyncQuery.java b/src/com/android/incallui/CallerInfoAsyncQuery.java
index dec1de88..8c5abe05 100644
--- a/src/com/android/incallui/CallerInfoAsyncQuery.java
+++ b/src/com/android/incallui/CallerInfoAsyncQuery.java
@@ -363,7 +363,7 @@ public class CallerInfoAsyncQuery {
cw.cookie = cookie;
cw.number = info.phoneNumber;
- long subId = SubscriptionManager.getDefaultVoiceSubId();
+ int subId = SubscriptionManager.getDefaultVoiceSubId();
Call call = (Call) cookie;
if (call != null) {
subId = call.getSubId();
diff --git a/src/com/android/incallui/InCallActivity.java b/src/com/android/incallui/InCallActivity.java
index c9656e80..db34da4c 100644
--- a/src/com/android/incallui/InCallActivity.java
+++ b/src/com/android/incallui/InCallActivity.java
@@ -36,6 +36,7 @@ import android.graphics.Point;
import android.net.Uri;
import android.os.Bundle;
import android.os.UserHandle;
+import android.provider.Settings;
import android.telecom.DisconnectCause;
import android.telecom.PhoneAccount;
import android.telecom.PhoneAccountHandle;
@@ -769,12 +770,59 @@ public class InCallActivity extends Activity {
&& (code == DisconnectCause.ERROR || code == DisconnectCause.RESTRICTED)) {
if (isConferenceDialString(call.getNumber())){
showErrorDialog(getString(R.string.dial_conference_call_error));
- }else{
- showErrorDialog(disconnectCause.getDescription());
+ } else {
+ final Context context = getApplicationContext();
+ if (context.getResources()
+ .getBoolean(R.bool.config_telephony_enable_apm_setting_launch)) {
+ int airplaneMode = Settings.Global.getInt(
+ context.getContentResolver(),
+ Settings.Global.AIRPLANE_MODE_ON, 0);
+ Log.d(this, "config_telephony_enable_apm_launch_dialog is true & APM = "
+ + airplaneMode);
+ if (airplaneMode == 1) {
+ dismissPendingDialogs();
+ launchApmConfirmationDialog();
+ }
+ } else {
+ showErrorDialog(disconnectCause.getDescription());
+ }
}
}
}
+ /*
+ * This function handles launching of the airplane mode screen after
+ * user confirms in the dialog
+ */
+ private void launchApmConfirmationDialog() {
+ Log.d(this, "launchApmConfirmationDialog");
+ mDialog = new AlertDialog.Builder(this)
+ .setMessage(R.string.apm_turn_on_confirmation)
+ .setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface dialog, int which) {
+ Log.d(this, "User confirmed to start APM Activity");
+ Intent apmLaunchIntent =
+ new Intent(android.provider.Settings.ACTION_AIRPLANE_MODE_SETTINGS);
+ apmLaunchIntent.addCategory(Intent.CATEGORY_DEFAULT);
+ apmLaunchIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+ startActivity(apmLaunchIntent);
+ Log.d(this, "apmLaunchIntent = " + apmLaunchIntent);
+ onDialogDismissed();
+ }})
+ .setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface dialog, int which) {
+ onDialogDismissed();
+ }})
+ .setOnCancelListener(new DialogInterface.OnCancelListener() {
+ @Override
+ public void onCancel(DialogInterface dialog) {
+ onDialogDismissed();
+ }}).create();
+ mDialog.show();
+ }
+
private boolean isConferenceDialString(String number) {
String[] participantsArr = number.split(";");
if ((participantsArr != null) && (participantsArr.length > 1)) {
@@ -906,7 +954,7 @@ public class InCallActivity extends Activity {
ActionBar bar = getActionBar();
for (int i = 0; i < phoneCount; i++) {
- long[] subId = CallList.getInstance().getSubId(i);
+ int[] subId = CallList.getInstance().getSubId(i);
if (subId != null && CallList.getInstance().hasAnyLiveCall(subId[0])) {
if (!mDsdaTabAdd[i]) {
addDsdaTab(i);
@@ -974,7 +1022,7 @@ public class InCallActivity extends Activity {
//setting active subscription automatically when call on one sub
//ends and it's corresponding tab is removed.For such cases active
//subscription will be set by InCallPresenter.attemptFinishActivity.
- long[] subId = CallList.getInstance().getSubId(mPhoneId);
+ int[] subId = CallList.getInstance().getSubId(mPhoneId);
if (tabCount != TAB_COUNT_ONE && CallList.getInstance().hasAnyLiveCall(subId[0])
&& (CallList.getInstance().getActiveSubscription() != subId[0])) {
Log.i(this, "Switch to other active sub: " + subId[0]);
diff --git a/src/com/android/incallui/RcsRichScreen.java b/src/com/android/incallui/RcsRichScreen.java
index 2afef43c..f7ae857a 100644
--- a/src/com/android/incallui/RcsRichScreen.java
+++ b/src/com/android/incallui/RcsRichScreen.java
@@ -222,65 +222,57 @@ public class RcsRichScreen {
msurface.setVisibility(View.GONE);
mGifMovieView.setVisibility(View.GONE);
missdnAddress.setVisibility(View.GONE);
- new Thread() {
- @Override
- public void run() {
- if (null != result.getGreeting()
- && !TextUtils.isEmpty(result.getGreeting())) {
- mGreeting.setVisibility(View.VISIBLE);
- StringBuilder greetingString = new StringBuilder();
- greetingString.append(mContext.getResources().getString(
- R.string.rcs_greeting_string));
- greetingString.append(result.getGreeting());
- mGreeting.setText(greetingString.toString());
- }
- if (null != result.getMissdnAddress()
- && !TextUtils.isEmpty(result.getMissdnAddress())) {
- missdnAddress.setVisibility(View.VISIBLE);
- StringBuilder missdnAddressString = new StringBuilder();
- missdnAddressString.append(mContext.getResources().getString(
- R.string.rcs_missdnaddress_string));
- missdnAddressString.append(result.getMissdnAddress());
- missdnAddress.setText(missdnAddressString.toString());
- } else {
- missdnAddress.setVisibility(View.GONE);
- try {
- Log.i(TAG, "getRichScreenApi.DownloadHomeLocRules"
- + RcsApiManager.getRichScreenApi());
- RcsApiManager.getRichScreenApi().downloadHomeLocRules(
- mPhoneEevnt);
- } catch (Exception e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
- String sorceType = result.getSourceType();
- switch (Integer.valueOf(sorceType)) {
- case RCS_STATIC_IMAGE: {
+ if (!TextUtils.isEmpty(result.getGreeting())) {
+ mGreeting.setVisibility(View.VISIBLE);
+ StringBuilder greetingString = new StringBuilder();
+ greetingString.append(mContext.getResources().getString(
+ R.string.rcs_greeting_string));
+ greetingString.append(result.getGreeting());
+ mGreeting.setText(greetingString.toString());
+ }
+ if (!TextUtils.isEmpty(result.getMissdnAddress())) {
+ missdnAddress.setVisibility(View.VISIBLE);
+ StringBuilder missdnAddressString = new StringBuilder();
+ missdnAddressString.append(mContext.getResources().getString(
+ R.string.rcs_missdnaddress_string));
+ missdnAddressString.append(result.getMissdnAddress());
+ missdnAddress.setText(missdnAddressString.toString());
+ } else {
+ missdnAddress.setVisibility(View.GONE);
+ try {
+ Log.i(TAG, "getRichScreenApi.DownloadHomeLocRules"
+ + RcsApiManager.getRichScreenApi());
+ RcsApiManager.getRichScreenApi().downloadHomeLocRules(
+ mPhoneEevnt);
+ } catch (Exception e) {
+ Log.w(TAG,e);
+ }
+ }
+ String sorceType = result.getSourceType();
+ switch (Integer.valueOf(sorceType)) {
+ case RCS_STATIC_IMAGE: {
- mRcsPhoto.setVisibility(View.VISIBLE);
- Bitmap bitmap = BitmapFactory
- .decodeFile(result.getLocalSourceUrl());
- mRcsPhoto.setImageBitmap(bitmap);
+ mRcsPhoto.setVisibility(View.VISIBLE);
+ Bitmap bitmap = BitmapFactory
+ .decodeFile(result.getLocalSourceUrl());
+ mRcsPhoto.setImageBitmap(bitmap);
- }
- break;
- case RCS_VIRTUAL_IMAGE: {
- mGifMovieView.setVisibility(View.VISIBLE);
- mGifMovieView.setMovieResource(result.getLocalSourceUrl());
- }
- break;
- case RCS_VIDEO: {
- msurface.setVisibility(View.VISIBLE);
- videoPath = result.getLocalSourceUrl();
- }
- break;
- default:
- mRcsPhoto.setVisibility(View.VISIBLE);
- break;
- }
}
- }.start();
+ break;
+ case RCS_VIRTUAL_IMAGE: {
+ mGifMovieView.setVisibility(View.VISIBLE);
+ mGifMovieView.setMovieResource(result.getLocalSourceUrl());
+ }
+ break;
+ case RCS_VIDEO: {
+ msurface.setVisibility(View.VISIBLE);
+ videoPath = result.getLocalSourceUrl();
+ }
+ break;
+ default:
+ mRcsPhoto.setVisibility(View.VISIBLE);
+ break;
+ }
}
public String getPhoneEventForRichScreen(int state, int videoState) {
diff --git a/src/com/android/incallui/SelectPhoneAccountDialogFragment.java b/src/com/android/incallui/SelectPhoneAccountDialogFragment.java
index 4fba17ae..96008a0e 100644
--- a/src/com/android/incallui/SelectPhoneAccountDialogFragment.java
+++ b/src/com/android/incallui/SelectPhoneAccountDialogFragment.java
@@ -118,7 +118,7 @@ public class SelectPhoneAccountDialogFragment extends DialogFragment {
return false;
}
String number = TelephonyManager.getDefault().getVoiceMailNumber(
- Long.parseLong(account.getId()));
+ Integer.parseInt(account.getId()));
if (!TextUtils.isEmpty(number)) {
return true;
}
@@ -139,7 +139,7 @@ public class SelectPhoneAccountDialogFragment extends DialogFragment {
if (TelephonyManager.getDefault().isMultiSimEnabled()) {
intent.setClassName("com.android.phone",
"com.android.phone.MSimCallFeaturesSubSetting");
- intent.putExtra(PhoneConstants.SUBSCRIPTION_KEY, Long.parseLong(account.getId()));
+ intent.putExtra(PhoneConstants.SUBSCRIPTION_KEY, Integer.parseInt(account.getId()));
} else {
intent.setClassName("com.android.phone",
"com.android.phone.CallFeaturesSetting");
@@ -227,12 +227,12 @@ public class SelectPhoneAccountDialogFragment extends DialogFragment {
PhoneAccountHandle accountHandle = getItem(position);
PhoneAccount account = mTelecomManager.getPhoneAccount(accountHandle);
if (MoreContactUtils.shouldShowOperator(mContext)) {
- Long subId = Long.parseLong(accountHandle.getId());
+ int subId = Integer.parseInt(accountHandle.getId());
holder.textView.setText(MoreContactUtils.getNetworkSpnName(mContext, subId));
} else {
holder.textView.setText(account.getLabel());
}
- holder.imageView.setImageDrawable(account.getIcon(mContext));
+ holder.imageView.setImageDrawable(account.createIconDrawable(mContext));
return rowView;
}
@@ -249,4 +249,4 @@ public class SelectPhoneAccountDialogFragment extends DialogFragment {
}
super.onPause();
}
-} \ No newline at end of file
+}
diff --git a/src/com/android/incallui/StatusBarNotifier.java b/src/com/android/incallui/StatusBarNotifier.java
index 965a573e..6042a9b9 100644
--- a/src/com/android/incallui/StatusBarNotifier.java
+++ b/src/com/android/incallui/StatusBarNotifier.java
@@ -31,7 +31,7 @@ import android.os.Handler;
import android.os.Message;
import android.telecom.PhoneAccount;
import android.telecom.PhoneCapabilities;
-import android.telephony.SubInfoRecord;
+import android.telephony.SubscriptionInfo;
import android.telephony.SubscriptionManager;
import android.telephony.TelephonyManager;
import android.text.TextUtils;
@@ -279,9 +279,10 @@ public class StatusBarNotifier implements InCallPresenter.InCallStateListener {
// set the content
String contentText = mContext.getString(contentResId);
if (TelephonyManager.getDefault().isMultiSimEnabled()) {
- SubInfoRecord info = SubscriptionManager.getSubInfoForSubscriber(call.getSubId());
+ SubscriptionInfo info =
+ SubscriptionManager.from(mContext).getActiveSubscriptionInfo(call.getSubId());
if (info != null) {
- contentText += " (" + info.displayName + ")";
+ contentText += " (" + info.getDisplayName().toString() + ")";
}
}
/*
@@ -307,10 +308,11 @@ public class StatusBarNotifier implements InCallPresenter.InCallStateListener {
builder.setColor(mContext.getResources().getColor(R.color.dialer_theme_color));
if (TelephonyManager.getDefault().isMultiSimEnabled()) {
- final long subId = call.getSubId();
- SubInfoRecord subInfoRecord = SubscriptionManager.getSubInfoForSubscriber(subId);
+ final int subId = call.getSubId();
+ SubscriptionInfo subInfoRecord =
+ SubscriptionManager.from(mContext).getActiveSubscriptionInfo(subId);
if (subInfoRecord != null) {
- String displayName = subInfoRecord.displayName;
+ String displayName = subInfoRecord.getDisplayName().toString();
builder.setContentTitle(displayName);
builder.setContentText(contentTitle);
builder.setSubText(mContext.getString(contentResId));