diff options
author | Matt Garnes <matt@cyngn.com> | 2015-02-23 11:29:11 -0800 |
---|---|---|
committer | Matt Garnes <matt@cyngn.com> | 2015-02-23 11:29:11 -0800 |
commit | 3af2123e67a2750722ec39fc955a8f40e62fabb9 (patch) | |
tree | 69d9616661cbb9235ebbc07e7f364296aa39a656 | |
parent | f3e3f26fd30437414b1aa2ef58e26f6734f5ba22 (diff) | |
parent | 1c36531233b458f9ad156da60ed926c00c074769 (diff) | |
download | android_packages_apps_Dialer-caf/cm-12.0.tar.gz android_packages_apps_Dialer-caf/cm-12.0.tar.bz2 android_packages_apps_Dialer-caf/cm-12.0.zip |
Merge CAF branch 'LA.BR.1.2.1_rb2.18' into caf/cm-12.0.caf/cm-12.0
-rw-r--r-- | res/layout-land/dialpad_fragment.xml | 11 | ||||
-rw-r--r-- | res/layout/add_speed_dial_dialog.xml | 95 | ||||
-rw-r--r-- | res/layout/call_log_list_item.xml | 11 | ||||
-rw-r--r-- | res/layout/dialpad_fragment.xml | 10 | ||||
-rw-r--r-- | res/values-zh-rCN/cm_strings.xml | 17 | ||||
-rw-r--r-- | res/values-zh-rCN/strings.xml | 6 | ||||
-rwxr-xr-x | res/values/donottranslate_config.xml | 2 | ||||
-rw-r--r-- | res/values/strings.xml | 6 | ||||
-rwxr-xr-x | src/com/android/dialer/PhoneCallDetails.java | 23 | ||||
-rw-r--r-- | src/com/android/dialer/PhoneCallDetailsHelper.java | 12 | ||||
-rw-r--r-- | src/com/android/dialer/PhoneCallDetailsViews.java | 6 | ||||
-rwxr-xr-x | src/com/android/dialer/SpeedDialListActivity.java | 84 | ||||
-rwxr-xr-x | src/com/android/dialer/calllog/CallLogAdapter.java | 7 | ||||
-rw-r--r-- | src/com/android/dialer/calllog/CallLogQuery.java | 6 | ||||
-rwxr-xr-x | src/com/android/dialer/dialpad/DialpadFragment.java | 18 |
15 files changed, 302 insertions, 12 deletions
diff --git a/res/layout-land/dialpad_fragment.xml b/res/layout-land/dialpad_fragment.xml index 680c2d770..7cfd07008 100644 --- a/res/layout-land/dialpad_fragment.xml +++ b/res/layout-land/dialpad_fragment.xml @@ -81,6 +81,17 @@ </FrameLayout> + <TextView + android:id="@+id/dialpad_floating_operator" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_above="@id/dialpad_floating_action_button_margin_bottom" + android:layout_toRightOf="@+id/dialpad_floating_action_button_container" + android:textColor="?attr/call_log_secondary_text_color" + android:textSize="12sp" + android:singleLine="true" + android:visibility="gone" /> + </RelativeLayout> </LinearLayout> diff --git a/res/layout/add_speed_dial_dialog.xml b/res/layout/add_speed_dial_dialog.xml new file mode 100644 index 000000000..c10108293 --- /dev/null +++ b/res/layout/add_speed_dial_dialog.xml @@ -0,0 +1,95 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + * Copyright (c) 2015, The Linux Foundation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of The Linux Foundation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +--> + +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:orientation="vertical"> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="0dip" + android:layout_weight="1.0" + android:gravity="center_vertical" + android:baselineAligned="false" + android:paddingStart="10dip" + android:paddingEnd="10dip"> + + <EditText + android:id="@+id/edit_container" + android:layout_width="0dip" + android:layout_height="wrap_content" + android:layout_weight="1.0" + android:orientation="vertical" + android:hint="@string/input_number" + android:inputType="phone" + android:singleLine="true" /> + + <ImageButton + android:id="@+id/select_contact" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:padding="10dip" + android:src="@drawable/ic_contacts_holo_dark" /> + </LinearLayout> + + <View + android:background="?android:dividerHorizontal" + android:layout_width="fill_parent" + android:layout_height="1dip" /> + + <LinearLayout + android:orientation="horizontal" + android:layout_width="fill_parent" + android:layout_height="wrap_content" > + + <Button + android:id="@+id/btn_cancel" + android:focusable="true" + android:layout_width="0dip" + android:layout_height="wrap_content" + android:layout_weight="1.0" + android:text="@string/speed_dial_cancel" + style="?android:attr/buttonBarButtonStyle" /> + + <View + android:background="?android:dividerHorizontal" + android:layout_width="1dip" + android:layout_height="fill_parent" /> + + <Button + android:id="@+id/btn_complete" + android:layout_width="0dip" + android:layout_height="wrap_content" + android:layout_weight="1.0" + android:text="@string/speed_dial_ok" + style="?android:attr/buttonBarButtonStyle" /> + </LinearLayout> +</LinearLayout> diff --git a/res/layout/call_log_list_item.xml b/res/layout/call_log_list_item.xml index 761f35201..12376271c 100644 --- a/res/layout/call_log_list_item.xml +++ b/res/layout/call_log_list_item.xml @@ -121,8 +121,19 @@ android:layout_gravity="center_vertical" android:tint="?attr/call_log_secondary_text_color" android:scaleType="centerInside" + android:visibility="gone" /> <TextView + android:id="@+id/operator" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginRight="@dimen/call_log_icon_margin" + android:layout_gravity="center_vertical" + android:textColor="?attr/call_log_secondary_text_color" + android:textSize="12sp" + android:singleLine="true" + android:visibility="gone" /> + <TextView android:id="@+id/call_location_and_date" android:layout_width="wrap_content" android:layout_height="wrap_content" diff --git a/res/layout/dialpad_fragment.xml b/res/layout/dialpad_fragment.xml index 21cb58654..5748f5de1 100644 --- a/res/layout/dialpad_fragment.xml +++ b/res/layout/dialpad_fragment.xml @@ -73,4 +73,14 @@ </FrameLayout> + <TextView + android:id="@+id/dialpad_floating_operator" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_below="@id/dialpad_floating_action_button_container" + android:layout_centerHorizontal="true" + android:textColor="?attr/call_log_secondary_text_color" + android:textSize="12sp" + android:singleLine="true" + android:visibility="gone" /> </view> diff --git a/res/values-zh-rCN/cm_strings.xml b/res/values-zh-rCN/cm_strings.xml index aea68f9c8..ecaf6facd 100644 --- a/res/values-zh-rCN/cm_strings.xml +++ b/res/values-zh-rCN/cm_strings.xml @@ -73,4 +73,21 @@ <string name="speed_dial_settings">快速拨号设置</string> <string name="lookup_settings_description">未知号码查询</string> <string name="call_stats_reset_filter">重置时间范围</string> + <plurals name="hour"> + <item quantity="one">1 小时</item> + <item quantity="other">%d 小时</item> + </plurals> + <plurals name="minute"> + <item quantity="one">1 分钟</item> + <item quantity="other">%d 分钟</item> + </plurals> + <plurals name="second"> + <item quantity="one">1 秒</item> + <item quantity="other">%d 秒</item> + </plurals> + + <plurals name="call"> + <item quantity="one">1 个电话</item> + <item quantity="other">%d 个电话</item> + </plurals> </resources> diff --git a/res/values-zh-rCN/strings.xml b/res/values-zh-rCN/strings.xml index 96a2200e7..a16b0553c 100644 --- a/res/values-zh-rCN/strings.xml +++ b/res/values-zh-rCN/strings.xml @@ -1,5 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <!-- + ~ Copyright (C) 2013-2015 The Linux Foundation. All Rights Reserved. + ~ Not a Contribution. ~ Copyright (C) 2012 The Android Open Source Project ~ ~ Licensed under the Apache License, Version 2.0 (the "License"); @@ -226,4 +228,8 @@ <string name="firewall_number_in_white">"该号码已在白名单中"</string> <string name="firewall_save_success">保存成功</string> <string name="firewall_add_blacklist_wring">如果将该号码加入黑名单,你将不会再收到该号码的消息和来电</string> + <string name="set_speed_dial">快速拨号设置</string> + <string name="input_number">"输入号码"</string> + <string name="speed_dial_cancel">"取消"</string> + <string name="speed_dial_ok">"确定"</string> </resources> diff --git a/res/values/donottranslate_config.xml b/res/values/donottranslate_config.xml index 7b2d5aebe..2378f02e4 100755 --- a/res/values/donottranslate_config.xml +++ b/res/values/donottranslate_config.xml @@ -44,6 +44,8 @@ <bool name="config_incoming_call_show_one_way_video_options">true</bool> + <bool name="config_conference_call_show_participant_status">false</bool> + <bool name="mark_emergency_call_in_call_log">false</bool> </resources> diff --git a/res/values/strings.xml b/res/values/strings.xml index 875c2d96d..1b217779c 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -1,5 +1,7 @@ <?xml version="1.0" encoding="utf-8"?> <!-- + ~ Copyright (C) 2013-2015 The Linux Foundation. All Rights Reserved. + ~ Not a Contribution. ~ Copyright (C) 2012 The Android Open Source Project ~ ~ Licensed under the Apache License, Version 2.0 (the "License"); @@ -847,4 +849,8 @@ <string name="firewall_save_success">Saved successfully</string> <string name="firewall_add_blacklist_wring">if you add this number to blacklsit, you will not receive the messages and calls from it</string> + <string name="set_speed_dial">Speed dial settings</string> + <string name="input_number">Input Number</string> + <string name="speed_dial_cancel">Cancel</string> + <string name="speed_dial_ok">OK</string> </resources> diff --git a/src/com/android/dialer/PhoneCallDetails.java b/src/com/android/dialer/PhoneCallDetails.java index 50b610b84..2f916e066 100755 --- a/src/com/android/dialer/PhoneCallDetails.java +++ b/src/com/android/dialer/PhoneCallDetails.java @@ -96,6 +96,10 @@ public class PhoneCallDetails implements CallDetailHeader.Data { */ public final int durationType; /** + * The operator for this call. + */ + public final String operator; + /** * Default phone Id */ public final static int DEFAULT_PHONE_ID = 0; @@ -127,10 +131,11 @@ public class PhoneCallDetails implements CallDetailHeader.Data { public PhoneCallDetails(CharSequence number, int numberPresentation, CharSequence formattedNumber, String countryIso, String geocode, int[] callTypes, long date, long duration, String accountLabel, Drawable accountIcon, - int features, Long dataUsage, String transcription, long accountId) { + int features, Long dataUsage, String transcription, long accountId, String operator) { this(number, numberPresentation, formattedNumber, countryIso, geocode, callTypes, date, duration, "", 0, "", null, null, 0, accountLabel, accountIcon, - features, dataUsage, transcription, Calls.DURATION_TYPE_ACTIVE, accountId); + features, dataUsage, transcription, Calls.DURATION_TYPE_ACTIVE, accountId, + operator); } public PhoneCallDetails(CharSequence number, int numberPresentation, @@ -152,6 +157,19 @@ public class PhoneCallDetails implements CallDetailHeader.Data { int numberType, CharSequence numberLabel, Uri contactUri, Uri photoUri, int sourceType, String accountLabel, Drawable accountIcon, int features, Long dataUsage, String transcription, int durationType, long accountId) { + this(number, numberPresentation, formattedNumber, countryIso, geocode, callTypes, date, + duration, name, numberType, numberLabel, contactUri, photoUri, sourceType, + accountLabel, accountIcon, features, dataUsage, transcription, durationType, + accountId, null); + } + + /** Create the details for a call with a number associated with a contact. */ + public PhoneCallDetails(CharSequence number, int numberPresentation, + CharSequence formattedNumber, String countryIso, String geocode, + int[] callTypes, long date, long duration, CharSequence name, + int numberType, CharSequence numberLabel, Uri contactUri, Uri photoUri, int sourceType, + String accountLabel, Drawable accountIcon, int features, Long dataUsage, + String transcription, int durationType, long accountId, String operator) { this.number = number; this.numberPresentation = numberPresentation; this.formattedNumber = formattedNumber; @@ -173,6 +191,7 @@ public class PhoneCallDetails implements CallDetailHeader.Data { this.transcription = transcription; this.durationType = durationType; this.accountId = accountId; + this.operator = operator; } @Override diff --git a/src/com/android/dialer/PhoneCallDetailsHelper.java b/src/com/android/dialer/PhoneCallDetailsHelper.java index 34bd1c7a3..f6ae7da41 100644 --- a/src/com/android/dialer/PhoneCallDetailsHelper.java +++ b/src/com/android/dialer/PhoneCallDetailsHelper.java @@ -31,6 +31,7 @@ import android.view.View; import android.widget.TextView; import com.android.contacts.common.CallUtil; +import com.android.contacts.common.MoreContactUtils; import com.android.contacts.common.testing.NeededForTesting; import com.android.contacts.common.util.PhoneNumberHelper; import com.android.dialer.calllog.CallTypeHelper; @@ -115,8 +116,15 @@ public class PhoneCallDetailsHelper { // set the account icon if it exists if (details.accountIcon != null) { - views.callAccountIcon.setVisibility(View.VISIBLE); - views.callAccountIcon.setImageDrawable(details.accountIcon); + if (MoreContactUtils.shouldShowOperator(mResources)) { + views.operator.setVisibility(View.VISIBLE); + views.operator.setText(details.operator); + views.callAccountIcon.setVisibility(View.GONE); + } else { + views.operator.setVisibility(View.GONE); + views.callAccountIcon.setVisibility(View.VISIBLE); + views.callAccountIcon.setImageDrawable(details.accountIcon); + } } else { views.callAccountIcon.setVisibility(View.GONE); } diff --git a/src/com/android/dialer/PhoneCallDetailsViews.java b/src/com/android/dialer/PhoneCallDetailsViews.java index 67babc1f7..72c00ea29 100644 --- a/src/com/android/dialer/PhoneCallDetailsViews.java +++ b/src/com/android/dialer/PhoneCallDetailsViews.java @@ -31,16 +31,18 @@ public final class PhoneCallDetailsViews { public final View callTypeView; public final CallTypeIconsView callTypeIcons; public final ImageView callAccountIcon; + public final TextView operator; public final TextView callLocationAndDate; public final TextView voicemailTranscriptionView; private PhoneCallDetailsViews(TextView nameView, View callTypeView, - CallTypeIconsView callTypeIcons, ImageView callAccountIcon, + CallTypeIconsView callTypeIcons, ImageView callAccountIcon, TextView operator, TextView callLocationAndDate, TextView voicemailTranscriptionView) { this.nameView = nameView; this.callTypeView = callTypeView; this.callTypeIcons = callTypeIcons; this.callAccountIcon = callAccountIcon; + this.operator = operator; this.callLocationAndDate = callLocationAndDate; this.voicemailTranscriptionView = voicemailTranscriptionView; } @@ -57,6 +59,7 @@ public final class PhoneCallDetailsViews { view.findViewById(R.id.call_type), (CallTypeIconsView) view.findViewById(R.id.call_type_icons), (ImageView) view.findViewById(R.id.call_account_icon), + (TextView) view.findViewById(R.id.operator), (TextView) view.findViewById(R.id.call_location_and_date), (TextView) view.findViewById(R.id.voicemail_transcription)); } @@ -68,6 +71,7 @@ public final class PhoneCallDetailsViews { new CallTypeIconsView(context), new ImageView(context), new TextView(context), + new TextView(context), new TextView(context)); } } diff --git a/src/com/android/dialer/SpeedDialListActivity.java b/src/com/android/dialer/SpeedDialListActivity.java index 1db524d9c..8156955c7 100755 --- a/src/com/android/dialer/SpeedDialListActivity.java +++ b/src/com/android/dialer/SpeedDialListActivity.java @@ -41,6 +41,7 @@ import android.database.Cursor; import android.net.Uri; import android.os.Bundle; import android.provider.ContactsContract; +import android.provider.ContactsContract.CommonDataKinds.Phone; import android.provider.Settings; import android.telecom.PhoneAccountHandle; import android.telecom.TelecomManager; @@ -54,6 +55,9 @@ import android.view.View; import android.view.ViewGroup; import android.widget.AdapterView; import android.widget.BaseAdapter; +import android.widget.Button; +import android.widget.EditText; +import android.widget.ImageButton; import android.widget.ListView; import android.widget.PopupMenu; import android.widget.QuickContactBadge; @@ -62,6 +66,8 @@ import android.widget.TextView; import com.android.contacts.common.ContactPhotoManager; import com.android.contacts.common.ContactPhotoManager.DefaultImageRequest; import com.android.internal.telephony.PhoneConstants; +import com.google.common.base.FinalizablePhantomReference; + import static com.android.internal.telephony.PhoneConstants.SUBSCRIPTION_KEY; import java.util.List; @@ -112,6 +118,9 @@ public class SpeedDialListActivity extends ListActivity implements private int mPickNumber; private int mInitialPickNumber; private SpeedDialAdapter mAdapter; + private AlertDialog mAddSpeedDialDialog; + private EditText mEditNumber; + private Button mCompleteButton; private static final int PICK_CONTACT_RESULT = 0; @@ -202,6 +211,77 @@ public class SpeedDialListActivity extends ListActivity implements return record; } + private void showAddSpeedDialDialog(final int number) { + mPickNumber = number; + AlertDialog.Builder builder = new AlertDialog.Builder(this); + builder.setTitle(R.string.set_speed_dial); + View contentView = LayoutInflater.from(this).inflate( + R.layout.add_speed_dial_dialog, null); + builder.setView(contentView); + ImageButton pickContacts = (ImageButton) contentView + .findViewById(R.id.select_contact); + pickContacts.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + pickContact(number); + dismissDialog(); + } + }); + mEditNumber = (EditText) contentView.findViewById(R.id.edit_container); + if (null != mRecords.get(number)) { + mEditNumber.setText(SpeedDialUtils.getNumber(this, number)); + } + Button cancelButton = (Button) contentView + .findViewById(R.id.btn_cancel); + cancelButton.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + dismissDialog(); + } + }); + mCompleteButton = (Button) contentView.findViewById(R.id.btn_complete); + mCompleteButton.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + if (mEditNumber.getText().toString().isEmpty()) { + dismissDialog(); + return; + } + saveSpeedDial(); + dismissDialog(); + } + }); + mAddSpeedDialDialog = builder.create(); + mAddSpeedDialDialog.show(); + } + + private void saveSpeedDial() { + String number = mEditNumber.getText().toString(); + Record record = null; + if (number != null) { + Uri uri = Uri.withAppendedPath( + ContactsContract.PhoneLookup.CONTENT_FILTER_URI, + Uri.encode(number)); + record = getRecordFromQuery(uri, LOOKUP_PROJECTION); + if (record == null) { + record = new Record(number); + record.normalizedNumber = number; + } + } + if (record != null) { + SpeedDialUtils.saveNumber(this, mPickNumber, + record.normalizedNumber); + mRecords.put(mPickNumber, record); + mAdapter.notifyDataSetChanged(); + } + } + + private void dismissDialog() { + if (null != mAddSpeedDialDialog && mAddSpeedDialDialog.isShowing()) { + mAddSpeedDialDialog.dismiss(); + } + } + @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { if (position == 0) { @@ -224,7 +304,7 @@ public class SpeedDialListActivity extends ListActivity implements int number = position + 1; final Record record = mRecords.get(number); if (record == null) { - pickContact(number); + showAddSpeedDialDialog(number); } else { PopupMenu pm = new PopupMenu(this, view); pm.getMenu().add(number, MENU_REPLACE, 0, R.string.speed_dial_replace); @@ -312,7 +392,7 @@ public class SpeedDialListActivity extends ListActivity implements switch (item.getItemId()) { case MENU_REPLACE: - pickContact(number); + showAddSpeedDialDialog(number); return true; case MENU_DELETE: mRecords.put(number, null); diff --git a/src/com/android/dialer/calllog/CallLogAdapter.java b/src/com/android/dialer/calllog/CallLogAdapter.java index db688cce5..dd9ddfe5f 100755 --- a/src/com/android/dialer/calllog/CallLogAdapter.java +++ b/src/com/android/dialer/calllog/CallLogAdapter.java @@ -419,6 +419,7 @@ public class CallLogAdapter extends GroupingListAdapter final int sourceType = info.sourceType; final int features = getCallFeatures(c, count); final String transcription = c.getString(CallLogQuery.TRANSCRIPTION); + final String operator = c.getString(CallLogQuery.OPERATOR); Long dataUsage = null; if (!c.isNull(CallLogQuery.DATA_USAGE)) { dataUsage = c.getLong(CallLogQuery.DATA_USAGE); @@ -448,18 +449,18 @@ public class CallLogAdapter extends GroupingListAdapter details = new PhoneCallDetails(number, numberPresentation, formattedNumber, countryIso, geocode, callTypes, date, duration, emergencyName, 0, "", null, null, 0, null, accountIcon, features, - dataUsage, transcription, Calls.DURATION_TYPE_ACTIVE, subId); + dataUsage, transcription, Calls.DURATION_TYPE_ACTIVE, subId, operator); } else { details = new PhoneCallDetails(number, numberPresentation, formattedNumber, countryIso, geocode, callTypes, date, duration, - null, accountIcon, features, dataUsage, transcription, subId); + null, accountIcon, features, dataUsage, transcription, subId, operator); } } else { details = new PhoneCallDetails(number, numberPresentation, formattedNumber, countryIso, geocode, callTypes, date, duration, name, ntype, label, lookupUri, photoUri, sourceType, null, accountIcon, features, dataUsage, transcription, - Calls.DURATION_TYPE_ACTIVE, subId); + Calls.DURATION_TYPE_ACTIVE, subId, operator); } mCallLogViewsHelper.setPhoneCallDetails(mContext, views, details); diff --git a/src/com/android/dialer/calllog/CallLogQuery.java b/src/com/android/dialer/calllog/CallLogQuery.java index 0ae4cda33..32622c97f 100644 --- a/src/com/android/dialer/calllog/CallLogQuery.java +++ b/src/com/android/dialer/calllog/CallLogQuery.java @@ -22,6 +22,8 @@ import android.provider.CallLog.Calls; * The query for the call log table. */ public final class CallLogQuery { + private static final String CALLS_OPERATOR = "operator"; + public static final String[] _PROJECTION = new String[] { Calls._ID, // 0 Calls.NUMBER, // 1 @@ -45,7 +47,8 @@ public final class CallLogQuery { Calls.PHONE_ACCOUNT_ID, // 19 Calls.FEATURES, // 20 Calls.DATA_USAGE, // 21 - Calls.TRANSCRIPTION // 22 + Calls.TRANSCRIPTION, // 22 + CALLS_OPERATOR // 23 }; public static final int ID = 0; @@ -71,4 +74,5 @@ public final class CallLogQuery { public static final int FEATURES = 20; public static final int DATA_USAGE = 21; public static final int TRANSCRIPTION = 22; + public static final int OPERATOR = 23; } diff --git a/src/com/android/dialer/dialpad/DialpadFragment.java b/src/com/android/dialer/dialpad/DialpadFragment.java index 45c399483..814a521d4 100755 --- a/src/com/android/dialer/dialpad/DialpadFragment.java +++ b/src/com/android/dialer/dialpad/DialpadFragment.java @@ -210,6 +210,7 @@ public class DialpadFragment extends AnalyticsFragment private ListView mDialpadChooser; private DialpadChooserAdapter mDialpadChooserAdapter; + private TextView mOperator; /** * Regular expression prohibiting manual phone call. Can be empty, which means "no rule". @@ -420,6 +421,8 @@ public class DialpadFragment extends AnalyticsFragment mFloatingActionButtonController = new FloatingActionButtonController(getActivity(), floatingActionButtonContainer, floatingActionButton); + mOperator = (TextView)fragmentView.findViewById(R.id.dialpad_floating_operator); + return fragmentView; } @@ -705,6 +708,20 @@ public class DialpadFragment extends AnalyticsFragment mOverflowMenuButton.setOnTouchListener(mOverflowPopupMenu.getDragToOpenListener()); mOverflowMenuButton.setOnClickListener(this); mOverflowMenuButton.setVisibility(isDigitsEmpty() ? View.INVISIBLE : View.VISIBLE); + + if (getTelephonyManager().isMultiSimEnabled() && + MoreContactUtils.shouldShowOperator(mContext)) { + if (SubscriptionManager.isVoicePromptEnabled()) { + mOperator.setVisibility(View.GONE); + } else { + long subId = SubscriptionManager.getDefaultVoiceSubId(); + mOperator.setVisibility(View.VISIBLE); + mOperator.setText(MoreContactUtils.getNetworkSpnName(mContext, subId)); + } + } else { + mOperator.setVisibility(View.GONE); + } + } @Override @@ -1995,7 +2012,6 @@ public class DialpadFragment extends AnalyticsFragment public void onClick(DialogInterface dialog, int which) { // go to speed dial setting screen to set speed dial number. Intent intent = new Intent(getActivity(), SpeedDialListActivity.class); - intent.putExtra(SpeedDialListActivity.EXTRA_INITIAL_PICK_NUMBER, number); startActivity(intent); } }) |