From 9d4f3b20793a007b4489547aa40fc1049d0d8fef Mon Sep 17 00:00:00 2001 From: Chiao Cheng Date: Wed, 5 Sep 2012 16:00:16 -0700 Subject: Moving resources from Contacts to Dialer. - Also moving some shared utilities. Bug: 6993891 Change-Id: I5fa18d26e4f5423f4d3f3450b8f3e3dacbfb947a --- src/com/android/dialer/CallDetailActivity.java | 12 ++++++------ src/com/android/dialer/DialtactsActivity.java | 6 +++--- src/com/android/dialer/NonPhoneActivity.java | 4 ++-- src/com/android/dialer/calllog/CallLogFragment.java | 10 +++++----- src/com/android/dialer/calllog/IntentProvider.java | 4 ++-- src/com/android/dialer/dialpad/DialpadFragment.java | 10 +++++----- 6 files changed, 23 insertions(+), 23 deletions(-) (limited to 'src') diff --git a/src/com/android/dialer/CallDetailActivity.java b/src/com/android/dialer/CallDetailActivity.java index cb1437d4a..56d4f9ccb 100644 --- a/src/com/android/dialer/CallDetailActivity.java +++ b/src/com/android/dialer/CallDetailActivity.java @@ -51,12 +51,12 @@ import android.widget.ListView; import android.widget.TextView; import android.widget.Toast; +import com.android.contacts.common.CallUtil; import com.android.contacts.ContactPhotoManager; import com.android.contacts.ContactsUtils; import com.android.contacts.R; import com.android.contacts.format.FormatUtils; -import com.android.contacts.util.ClipboardUtils; -import com.android.contacts.util.Constants; +import com.android.contacts.common.ClipboardUtils; import com.android.dialer.BackScrollManager.ScrollableHeader; import com.android.dialer.calllog.CallDetailHistoryAdapter; import com.android.dialer.calllog.CallTypeHelper; @@ -371,8 +371,8 @@ public class CallDetailActivity extends Activity implements ProximitySensorAware TelephonyManager tm = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE); if (tm.getCallState() == TelephonyManager.CALL_STATE_IDLE) { - startActivity(ContactsUtils.getCallIntent( - Uri.fromParts(Constants.SCHEME_TEL, mNumber, null))); + startActivity(CallUtil.getCallIntent( + Uri.fromParts(CallUtil.SCHEME_TEL, mNumber, null))); return true; } } @@ -513,7 +513,7 @@ public class CallDetailActivity extends Activity implements ProximitySensorAware ViewEntry entry = new ViewEntry( getString(R.string.menu_callNumber, FormatUtils.forceLeftToRight(displayNumber)), - ContactsUtils.getCallIntent(mNumber), + CallUtil.getCallIntent(mNumber), getString(R.string.description_call, nameOrNumber)); // Only show a label if the number is shown and it is not a SIP address. @@ -820,7 +820,7 @@ public class CallDetailActivity extends Activity implements ProximitySensorAware } public void onMenuEditNumberBeforeCall(MenuItem menuItem) { - startActivity(new Intent(Intent.ACTION_DIAL, ContactsUtils.getCallUri(mNumber))); + startActivity(new Intent(Intent.ACTION_DIAL, CallUtil.getCallUri(mNumber))); } public void onMenuTrashVoicemail(MenuItem menuItem) { diff --git a/src/com/android/dialer/DialtactsActivity.java b/src/com/android/dialer/DialtactsActivity.java index 841db1c90..c49e05b31 100644 --- a/src/com/android/dialer/DialtactsActivity.java +++ b/src/com/android/dialer/DialtactsActivity.java @@ -56,6 +56,7 @@ import android.widget.SearchView; import android.widget.SearchView.OnCloseListener; import android.widget.SearchView.OnQueryTextListener; +import com.android.contacts.common.CallUtil; import com.android.contacts.ContactsUtils; import com.android.contacts.R; import com.android.contacts.activities.TransactionSafeActivity; @@ -66,7 +67,6 @@ import com.android.contacts.list.ContactListItemView; import com.android.contacts.list.OnPhoneNumberPickerActionListener; import com.android.contacts.list.PhoneNumberPickerFragment; import com.android.contacts.util.AccountFilterUtil; -import com.android.contacts.util.Constants; import com.android.dialer.calllog.CallLogFragment; import com.android.dialer.dialpad.DialpadFragment; import com.android.dialer.list.PhoneFavoriteFragment; @@ -852,7 +852,7 @@ public class DialtactsActivity extends TransactionSafeActivity } if (Intent.ACTION_VIEW.equals(action)) { final Uri data = intent.getData(); - if (data != null && Constants.SCHEME_TEL.equals(data.getScheme())) { + if (data != null && CallUtil.SCHEME_TEL.equals(data.getScheme())) { return true; } } @@ -926,7 +926,7 @@ public class DialtactsActivity extends TransactionSafeActivity @Override public void onCallNumberDirectly(String phoneNumber) { - Intent intent = ContactsUtils.getCallIntent(phoneNumber, getCallOrigin()); + Intent intent = CallUtil.getCallIntent(phoneNumber, getCallOrigin()); startActivity(intent); } }; diff --git a/src/com/android/dialer/NonPhoneActivity.java b/src/com/android/dialer/NonPhoneActivity.java index c7a744e4a..101bd58ea 100644 --- a/src/com/android/dialer/NonPhoneActivity.java +++ b/src/com/android/dialer/NonPhoneActivity.java @@ -29,9 +29,9 @@ import android.provider.ContactsContract.Contacts; import android.provider.ContactsContract.Intents.Insert; import android.text.TextUtils; +import com.android.contacts.common.CallUtil; import com.android.contacts.ContactsActivity; import com.android.contacts.R; -import com.android.contacts.util.Constants; /** * Activity that intercepts DIAL and VIEW intents for phone numbers for devices that can not @@ -62,7 +62,7 @@ public class NonPhoneActivity extends ContactsActivity { final Uri data = getIntent().getData(); if (data == null) return null; final String scheme = data.getScheme(); - if (!Constants.SCHEME_TEL.equals(scheme)) return null; + if (!CallUtil.SCHEME_TEL.equals(scheme)) return null; return getIntent().getData().getSchemeSpecificPart(); } diff --git a/src/com/android/dialer/calllog/CallLogFragment.java b/src/com/android/dialer/calllog/CallLogFragment.java index 83ed830ad..1aa96fd6d 100644 --- a/src/com/android/dialer/calllog/CallLogFragment.java +++ b/src/com/android/dialer/calllog/CallLogFragment.java @@ -46,9 +46,9 @@ import android.widget.ListView; import android.widget.TextView; import com.android.common.io.MoreCloseables; +import com.android.contacts.common.CallUtil; import com.android.contacts.ContactsUtils; import com.android.contacts.R; -import com.android.contacts.util.Constants; import com.android.dialer.util.EmptyLoader; import com.android.dialer.voicemail.VoicemailStatusHelper; import com.android.dialer.voicemail.VoicemailStatusHelper.StatusMessage; @@ -444,8 +444,8 @@ public class CallLogFragment extends ListFragment Intent intent; // If "number" is really a SIP address, construct a sip: URI. if (PhoneNumberUtils.isUriNumber(number)) { - intent = ContactsUtils.getCallIntent( - Uri.fromParts(Constants.SCHEME_SIP, number, null)); + intent = CallUtil.getCallIntent( + Uri.fromParts(CallUtil.SCHEME_SIP, number, null)); } else { // We're calling a regular PSTN phone number. // Construct a tel: URI, but do some other possible cleanup first. @@ -457,8 +457,8 @@ public class CallLogFragment extends ListFragment String countryIso = cursor.getString(CallLogQuery.COUNTRY_ISO); number = mAdapter.getBetterNumberFromContacts(number, countryIso); } - intent = ContactsUtils.getCallIntent( - Uri.fromParts(Constants.SCHEME_TEL, number, null)); + intent = CallUtil.getCallIntent( + Uri.fromParts(CallUtil.SCHEME_TEL, number, null)); } intent.setFlags( Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS); diff --git a/src/com/android/dialer/calllog/IntentProvider.java b/src/com/android/dialer/calllog/IntentProvider.java index 859487a26..6fc8933f9 100644 --- a/src/com/android/dialer/calllog/IntentProvider.java +++ b/src/com/android/dialer/calllog/IntentProvider.java @@ -23,7 +23,7 @@ import android.database.Cursor; import android.net.Uri; import android.provider.CallLog.Calls; -import com.android.contacts.ContactsUtils; +import com.android.contacts.common.CallUtil; import com.android.dialer.CallDetailActivity; /** @@ -38,7 +38,7 @@ public abstract class IntentProvider { return new IntentProvider() { @Override public Intent getIntent(Context context) { - return ContactsUtils.getCallIntent(number); + return CallUtil.getCallIntent(number); } }; } diff --git a/src/com/android/dialer/dialpad/DialpadFragment.java b/src/com/android/dialer/dialpad/DialpadFragment.java index 77b7c070d..7aa5a9ef4 100644 --- a/src/com/android/dialer/dialpad/DialpadFragment.java +++ b/src/com/android/dialer/dialpad/DialpadFragment.java @@ -67,9 +67,9 @@ import android.widget.ListView; import android.widget.PopupMenu; import android.widget.TextView; +import com.android.contacts.common.CallUtil; import com.android.contacts.ContactsUtils; import com.android.contacts.R; -import com.android.contacts.util.Constants; import com.android.contacts.util.PhoneNumberFormatter; import com.android.contacts.util.StopWatch; import com.android.dialer.DialtactsActivity; @@ -344,7 +344,7 @@ public class DialpadFragment extends Fragment if (Intent.ACTION_DIAL.equals(action) || Intent.ACTION_VIEW.equals(action)) { Uri uri = intent.getData(); if (uri != null) { - if (Constants.SCHEME_TEL.equals(uri.getScheme())) { + if (CallUtil.SCHEME_TEL.equals(uri.getScheme())) { // Put the requested number into the input area String data = uri.getSchemeSpecificPart(); // Remember it is filled via Intent. @@ -1094,9 +1094,9 @@ public class DialpadFragment extends Fragment // Clear the digits just in case. mDigits.getText().clear(); } else { - final Intent intent = ContactsUtils.getCallIntent(number, + final Intent intent = CallUtil.getCallIntent(number, (getActivity() instanceof DialtactsActivity ? - ((DialtactsActivity)getActivity()).getCallOrigin() : null)); + ((DialtactsActivity) getActivity()).getCallOrigin() : null)); startActivity(intent); mClearDigitsOnStop = true; getActivity().finish(); @@ -1622,7 +1622,7 @@ public class DialpadFragment extends Fragment } private Intent newFlashIntent() { - final Intent intent = ContactsUtils.getCallIntent(EMPTY_NUMBER); + final Intent intent = CallUtil.getCallIntent(EMPTY_NUMBER); intent.putExtra(EXTRA_SEND_EMPTY_FLASH, true); return intent; } -- cgit v1.2.3