diff options
author | Sandeep Gutta <sangutta@codeaurora.org> | 2015-02-21 22:18:34 +0530 |
---|---|---|
committer | Natiq Ahmed <mnatiq@codeaurora.org> | 2015-03-10 23:44:11 +0530 |
commit | 1bebee89ef76022d6cb6627edf3da93f29705082 (patch) | |
tree | 0312677399371771f6279a288397da3182ecad48 | |
parent | 840c6f834d21a4ba6a7d8c4d6696abf19e2cac33 (diff) | |
download | android_packages_apps_Dialer-1bebee89ef76022d6cb6627edf3da93f29705082.tar.gz android_packages_apps_Dialer-1bebee89ef76022d6cb6627edf3da93f29705082.tar.bz2 android_packages_apps_Dialer-1bebee89ef76022d6cb6627edf3da93f29705082.zip |
Dialer: Fix compilation errors
Change-Id: Id4d48ade8b2cc2bd96e04ac573d5972d21d1361b
14 files changed, 39 insertions, 45 deletions
diff --git a/src/com/android/dialer/CallDetailActivity.java b/src/com/android/dialer/CallDetailActivity.java index 7e9ca4cc2..8bc8f5167 100644 --- a/src/com/android/dialer/CallDetailActivity.java +++ b/src/com/android/dialer/CallDetailActivity.java @@ -433,7 +433,7 @@ public class CallDetailActivity extends AnalyticsActivity implements ProximitySe final int numberPresentation = firstDetails.numberPresentation; final Uri contactUri = firstDetails.contactUri; final Uri photoUri = firstDetails.photoUri; - final long subId = firstDetails.accountId; + final int subId = firstDetails.accountId; // Set the details header, based on the first phone call. mCallDetailHeader.updateViews(firstDetails); @@ -516,9 +516,9 @@ public class CallDetailActivity extends AnalyticsActivity implements ProximitySe callCursor.getString(ACCOUNT_COMPONENT_NAME), callCursor.getString(ACCOUNT_ID))); String accId = callCursor.getString(ACCOUNT_ID); - long subId = SubscriptionManager.DEFAULT_SUB_ID; + int subId = SubscriptionManager.DEFAULT_SUBSCRIPTION_ID; if (accId!=null && !accId.equals("E") && !accId.toLowerCase().contains("sip")) { - subId = Long.parseLong(accId); + subId = Integer.parseInt(accId); } if (TextUtils.isEmpty(countryIso)) { diff --git a/src/com/android/dialer/CallDetailHeader.java b/src/com/android/dialer/CallDetailHeader.java index 7db8783c8..8d3f21d1a 100644 --- a/src/com/android/dialer/CallDetailHeader.java +++ b/src/com/android/dialer/CallDetailHeader.java @@ -88,7 +88,7 @@ public class CallDetailHeader { Uri getPhotoUri(); CharSequence getAccountLabel(); CharSequence getGeocode(); - long getAccountId(); + int getAccountId(); } public CallDetailHeader(Activity activity, PhoneNumberDisplayHelper phoneNumberHelper) { @@ -108,7 +108,7 @@ public class CallDetailHeader { public void updateViews(Data data) { // Cache the details about the phone number. final PhoneNumberUtilsWrapper phoneUtils = new PhoneNumberUtilsWrapper(); - final long accountId = data.getAccountId(); + final int accountId = data.getAccountId(); final CharSequence dataName = data.getName(); final CharSequence dataNumber = data.getNumber(); final CharSequence dataAccount = data.getAccountLabel(); diff --git a/src/com/android/dialer/PhoneCallDetails.java b/src/com/android/dialer/PhoneCallDetails.java index 2f916e066..a556c9551 100755 --- a/src/com/android/dialer/PhoneCallDetails.java +++ b/src/com/android/dialer/PhoneCallDetails.java @@ -78,7 +78,7 @@ public class PhoneCallDetails implements CallDetailHeader.Data { /** * The account id associated with the call. */ - public final long accountId; + public final int accountId; /** * Features applicable to this call. */ @@ -131,7 +131,7 @@ 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, String operator) { + int features, Long dataUsage, String transcription, int 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, @@ -156,7 +156,7 @@ public class PhoneCallDetails implements CallDetailHeader.Data { 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) { + Long dataUsage, String transcription, int durationType, int accountId) { this(number, numberPresentation, formattedNumber, countryIso, geocode, callTypes, date, duration, name, numberType, numberLabel, contactUri, photoUri, sourceType, accountLabel, accountIcon, features, dataUsage, transcription, durationType, @@ -169,7 +169,7 @@ public class PhoneCallDetails implements CallDetailHeader.Data { 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) { + String transcription, int durationType, int accountId, String operator) { this.number = number; this.numberPresentation = numberPresentation; this.formattedNumber = formattedNumber; @@ -235,7 +235,7 @@ public class PhoneCallDetails implements CallDetailHeader.Data { return geocode; } @Override - public long getAccountId() { + public int getAccountId() { return accountId; } } diff --git a/src/com/android/dialer/SpecialCharSequenceMgr.java b/src/com/android/dialer/SpecialCharSequenceMgr.java index d4c0a0ef7..fe5de8cd3 100644 --- a/src/com/android/dialer/SpecialCharSequenceMgr.java +++ b/src/com/android/dialer/SpecialCharSequenceMgr.java @@ -271,7 +271,7 @@ public class SpecialCharSequenceMgr { sc.progressDialog.show(); // run the query. - long subId = SubscriptionManager.getDefaultVoiceSubId(); + int subId = SubscriptionManager.from(context).getDefaultVoiceSubId(); Uri uri = Uri.parse("content://icc/adn/subId/" + subId); handler.startQuery(ADN_QUERY_TOKEN, sc, uri, new String[]{ADN_PHONE_NUMBER_COLUMN_NAME}, null, null, null); @@ -291,7 +291,7 @@ public class SpecialCharSequenceMgr { static boolean handlePinEntry(Context context, String input) { if ((input.startsWith("**04") || input.startsWith("**05")) && input.endsWith("#")) { - long subId = SubscriptionManager.getDefaultVoiceSubId(); + int subId = SubscriptionManager.getDefaultVoiceSubId(); try { return ITelephony.Stub.asInterface(ServiceManager.getService( Context.TELEPHONY_SERVICE)).handlePinMmiForSubscriber(subId, input); @@ -308,7 +308,7 @@ public class SpecialCharSequenceMgr { (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE); if (telephonyManager != null && input.equals(MMI_IMEI_DISPLAY)) { int phoneType; - long subId = SubscriptionManager.getDefaultVoiceSubId(); + int subId = SubscriptionManager.getDefaultVoiceSubId(); phoneType = telephonyManager.getCurrentPhoneType(subId); if (telephonyManager.isMultiSimEnabled()) { return handleMSimIMEIDisplay(context, telephonyManager); @@ -336,7 +336,7 @@ public class SpecialCharSequenceMgr { if (i != 0) { deviceIds.append("\n"); } - long[] subIds = SubscriptionManager.getSubId(i); + int[] subIds = SubscriptionManager.getSubId(i); int phoneType = telephonyManager.getCurrentPhoneType(subIds[0]); if (phoneType != TelephonyManager.PHONE_TYPE_GSM && phoneType != TelephonyManager.PHONE_TYPE_CDMA) { @@ -379,7 +379,7 @@ public class SpecialCharSequenceMgr { private static void showIMEIPanel(Context context, boolean useSystemWindow, TelephonyManager telephonyManager) { String imeiStr = null; - long subId = SubscriptionManager.getDefaultVoiceSubId(); + int subId = SubscriptionManager.getDefaultVoiceSubId(); int slotId = SubscriptionManager.getSlotId(subId); imeiStr = telephonyManager.getDeviceId(slotId); @@ -394,7 +394,7 @@ public class SpecialCharSequenceMgr { private static void showMEIDPanel(Context context, boolean useSystemWindow, TelephonyManager telephonyManager) { String meidStr = null; - long subId = SubscriptionManager.getDefaultVoiceSubId(); + int subId = SubscriptionManager.getDefaultVoiceSubId(); int slotId = SubscriptionManager.getSlotId(subId); meidStr = telephonyManager.getDeviceId(slotId); diff --git a/src/com/android/dialer/SpeedDialListActivity.java b/src/com/android/dialer/SpeedDialListActivity.java index 8156955c7..d481bbab9 100755 --- a/src/com/android/dialer/SpeedDialListActivity.java +++ b/src/com/android/dialer/SpeedDialListActivity.java @@ -287,7 +287,7 @@ public class SpeedDialListActivity extends ListActivity implements if (position == 0) { Intent intent = new Intent(ACTION_ADD_VOICEMAIL); if (TelephonyManager.getDefault().getPhoneCount() > 1) { - long sub = SubscriptionManager.getDefaultVoiceSubId(); + int sub = SubscriptionManager.getDefaultVoiceSubId(); intent.setClassName("com.android.phone", "com.android.phone.MSimCallFeaturesSubSetting"); intent.putExtra(PhoneConstants.SUBSCRIPTION_KEY, sub); @@ -340,7 +340,7 @@ public class SpeedDialListActivity extends ListActivity implements @Override public void onClick(DialogInterface dialog, int which) { Intent intent = new Intent(ACTION_ADD_VOICEMAIL); - long sub = Long.parseLong(accounts[which].getId()); + int sub = Integer.parseInt(accounts[which].getId()); intent.setClassName("com.android.phone", "com.android.phone.MSimCallFeaturesSubSetting"); intent.putExtra(SUBSCRIPTION_KEY, sub); diff --git a/src/com/android/dialer/calllog/CallLogAdapter.java b/src/com/android/dialer/calllog/CallLogAdapter.java index dd9ddfe5f..65e149a47 100755 --- a/src/com/android/dialer/calllog/CallLogAdapter.java +++ b/src/com/android/dialer/calllog/CallLogAdapter.java @@ -346,9 +346,9 @@ public class CallLogAdapter extends GroupingListAdapter views.rowId = rowId; String accId = c.getString(CallLogQuery.ACCOUNT_ID); - long subId = SubscriptionManager.DEFAULT_SUB_ID; + int subId = SubscriptionManager.DEFAULT_SUBSCRIPTION_ID; if (accId!= null && !accId.equals("E") && !accId.toLowerCase().contains("sip")) { - subId = Long.parseLong(accId); + subId = Integer.parseInt(accId); } // For entries in the call log, check if the day group has changed and display a header diff --git a/src/com/android/dialer/calllog/CallLogQueryHandler.java b/src/com/android/dialer/calllog/CallLogQueryHandler.java index ba4581fcf..60e4c247d 100755 --- a/src/com/android/dialer/calllog/CallLogQueryHandler.java +++ b/src/com/android/dialer/calllog/CallLogQueryHandler.java @@ -205,7 +205,7 @@ public class CallLogQueryHandler extends NoNullCursorAsyncQueryHandler { } if (slotId > CALL_SUB_ALL) { - long[] subId = SubscriptionManager.getSubId(slotId); + int[] subId = SubscriptionManager.getSubId(slotId); if (subId != null && subId.length >= 1) { if (where.length() > 0) { where.append(" AND "); diff --git a/src/com/android/dialer/calllog/PhoneAccountUtils.java b/src/com/android/dialer/calllog/PhoneAccountUtils.java index d716aee49..11c1b178e 100644 --- a/src/com/android/dialer/calllog/PhoneAccountUtils.java +++ b/src/com/android/dialer/calllog/PhoneAccountUtils.java @@ -48,7 +48,7 @@ public class PhoneAccountUtils { if (account == null) { return null; } - return account.getIcon(context); + return account.createIconDrawable(context); } /** diff --git a/src/com/android/dialer/calllog/PhoneNumberDisplayHelper.java b/src/com/android/dialer/calllog/PhoneNumberDisplayHelper.java index fbea6c7ad..0d5e08935 100644 --- a/src/com/android/dialer/calllog/PhoneNumberDisplayHelper.java +++ b/src/com/android/dialer/calllog/PhoneNumberDisplayHelper.java @@ -18,7 +18,6 @@ package com.android.dialer.calllog; import android.content.res.Resources; import android.provider.CallLog.Calls; -import android.telephony.SubscriptionManager; import android.text.TextUtils; import android.util.Log; @@ -41,7 +40,7 @@ public class PhoneNumberDisplayHelper { mResources = resources; } - /* package */ CharSequence getDisplayName(long subId, CharSequence number, int presentation) { + /* package */ CharSequence getDisplayName(int subId, CharSequence number, int presentation) { if (presentation == Calls.PRESENTATION_UNKNOWN) { return mResources.getString(R.string.unknown); } @@ -66,7 +65,7 @@ public class PhoneNumberDisplayHelper { * @param number the number to display * @param formattedNumber the formatted number if available, may be null */ - public CharSequence getDisplayNumber(long subId, CharSequence number, + public CharSequence getDisplayNumber(int subId, CharSequence number, int presentation, CharSequence formattedNumber) { final CharSequence displayName = getDisplayName(subId, number, presentation); if (!TextUtils.isEmpty(displayName)) { diff --git a/src/com/android/dialer/calllog/PhoneNumberUtilsWrapper.java b/src/com/android/dialer/calllog/PhoneNumberUtilsWrapper.java index c2b537bba..5f7c79448 100644 --- a/src/com/android/dialer/calllog/PhoneNumberUtilsWrapper.java +++ b/src/com/android/dialer/calllog/PhoneNumberUtilsWrapper.java @@ -59,7 +59,7 @@ public class PhoneNumberUtilsWrapper { * Returns true if the given number is the number of the configured voicemail of the subId. * To be able to mock-out this, it is not a static method. */ - public boolean isVoicemailNumber(long subId, CharSequence number) { + public boolean isVoicemailNumber(int subId, CharSequence number) { return number!= null && PhoneNumberUtils.isVoiceMailNumber(subId, number.toString()); } diff --git a/src/com/android/dialer/callstats/CallStatsDetails.java b/src/com/android/dialer/callstats/CallStatsDetails.java index c082989bd..46e67ee65 100644 --- a/src/com/android/dialer/callstats/CallStatsDetails.java +++ b/src/com/android/dialer/callstats/CallStatsDetails.java @@ -31,7 +31,7 @@ import com.android.dialer.calllog.ContactInfo; */ public class CallStatsDetails implements CallDetailHeader.Data, Parcelable { public final String number; - public final long accountId; + public final int accountId; public final int numberPresentation; public String formattedNumber; public final String countryIso; @@ -50,7 +50,7 @@ public class CallStatsDetails implements CallDetailHeader.Data, Parcelable { public int missedCount; public int blacklistCount; - public CallStatsDetails(CharSequence number, long accountId, int numberPresentation, + public CallStatsDetails(CharSequence number, int accountId, int numberPresentation, ContactInfo info, String countryIso, String geocode, long date) { this.number = number != null ? number.toString() : null; this.accountId = accountId; @@ -107,7 +107,7 @@ public class CallStatsDetails implements CallDetailHeader.Data, Parcelable { return geocode; } @Override - public long getAccountId() { + public int getAccountId() { return accountId; } @@ -214,7 +214,7 @@ public class CallStatsDetails implements CallDetailHeader.Data, Parcelable { @Override public void writeToParcel(Parcel out, int flags) { out.writeString(number); - out.writeLong(accountId); + out.writeInt(accountId); out.writeInt(numberPresentation); out.writeString(formattedNumber); out.writeString(countryIso); @@ -247,7 +247,7 @@ public class CallStatsDetails implements CallDetailHeader.Data, Parcelable { private CallStatsDetails (Parcel in) { number = in.readString(); - accountId = in.readLong(); + accountId = in.readInt(); numberPresentation = in.readInt(); formattedNumber = in.readString(); countryIso = in.readString(); diff --git a/src/com/android/dialer/callstats/CallStatsQueryHandler.java b/src/com/android/dialer/callstats/CallStatsQueryHandler.java index 6c17f6388..0cbedfed5 100644 --- a/src/com/android/dialer/callstats/CallStatsQueryHandler.java +++ b/src/com/android/dialer/callstats/CallStatsQueryHandler.java @@ -125,13 +125,13 @@ public class CallStatsQueryHandler extends AsyncQueryHandler { selectionArgs.add(String.valueOf(to)); } if (slotId > CALL_SUB_ALL) { - long[] subId = SubscriptionManager.getSubId(slotId); + int[] subId = SubscriptionManager.getSubId(slotId); if (subId != null && subId.length >= 1) { if (selection.length() > 0) { selection.append(" AND "); } selection.append(String.format("(%s = ?)", Calls.PHONE_ACCOUNT_ID)); - selectionArgs.add(Long.toString(subId[0])); + selectionArgs.add(Integer.toString(subId[0])); } } @@ -181,7 +181,7 @@ public class CallStatsQueryHandler extends AsyncQueryHandler { if (pending == null || !CallUtil.phoneNumbersEqual(pending.number.toString(), number)) { final long date = cursor.getLong(CallStatsQuery.DATE); final int numberPresentation = cursor.getInt(CallStatsQuery.NUMBER_PRESENTATION); - final long accountId = cursor.getLong(CallStatsQuery.PHONE_ACCOUNT_ID); + final int accountId = cursor.getInt(CallStatsQuery.PHONE_ACCOUNT_ID); final String countryIso = cursor.getString(CallStatsQuery.COUNTRY_ISO); final String geocode = cursor.getString(CallStatsQuery.GEOCODED_LOCATION); final ContactInfo info = getContactInfoFromCallStats(cursor); diff --git a/src/com/android/dialer/dialpad/DialpadFragment.java b/src/com/android/dialer/dialpad/DialpadFragment.java index 76ab82fed..8c93309d8 100755 --- a/src/com/android/dialer/dialpad/DialpadFragment.java +++ b/src/com/android/dialer/dialpad/DialpadFragment.java @@ -714,7 +714,7 @@ public class DialpadFragment extends AnalyticsFragment if (SubscriptionManager.isVoicePromptEnabled()) { mOperator.setVisibility(View.GONE); } else { - long subId = SubscriptionManager.getDefaultVoiceSubId(); + int subId = SubscriptionManager.getDefaultVoiceSubId(); mOperator.setVisibility(View.VISIBLE); mOperator.setText(MoreContactUtils.getNetworkSpnName(mContext, subId)); } @@ -1178,7 +1178,7 @@ public class DialpadFragment extends AnalyticsFragment private void ipCallBySlot(int slotId) { String prefix = MoreContactUtils.getIPCallPrefix(mContext, slotId); if (!TextUtils.isEmpty(prefix)) { - long[] subId = SubscriptionManager.getSubId(slotId); + int[] subId = SubscriptionManager.getSubId(slotId); if (subId != null && subId.length >= 1) { ComponentName serviceName = new ComponentName("com.android.phone", @@ -1803,7 +1803,7 @@ public class DialpadFragment extends AnalyticsFragment //return hasVMNumber(); return true; } else { - long subId = SubscriptionManager.getDefaultVoiceSubId(); + int subId = SubscriptionManager.getDefaultVoiceSubId(); try { return !TextUtils.isEmpty(getTelephonyManager().getVoiceMailNumber(subId)); } catch (SecurityException se) { @@ -1819,7 +1819,7 @@ public class DialpadFragment extends AnalyticsFragment int phoneCount = getTelephonyManager().getPhoneCount(); for (int i = 0; i < phoneCount; i++) { try { - long[] subId = SubscriptionManager.getSubId(i); + int[] subId = SubscriptionManager.getSubId(i); hasVMNum = getTelephonyManager().getVoiceMailNumber(subId[0]) != null; } catch (SecurityException se) { // Possibly no READ_PHONE_STATE privilege. @@ -1845,7 +1845,7 @@ public class DialpadFragment extends AnalyticsFragment // go to voicemail setting screen to set its number. Intent intent = new Intent(ACTION_ADD_VOICEMAIL); if (getTelephonyManager().isMultiSimEnabled()) { - long subId = SubscriptionManager.getDefaultVoiceSubId(); + int subId = SubscriptionManager.getDefaultVoiceSubId(); intent.setClassName("com.android.phone", "com.android.phone.MSimCallFeaturesSubSetting"); intent.putExtra(SUBSCRIPTION_KEY, subId); @@ -2038,7 +2038,7 @@ public class DialpadFragment extends AnalyticsFragment } private PhoneStateListener getPhoneStateListener(int phoneId) { - long[] subId = SubscriptionManager.getSubId(phoneId); + int[] subId = SubscriptionManager.getSubId(phoneId); if (subId == null) { return null; diff --git a/tests/src/com/android/dialer/interactions/PhoneNumberInteractionTest.java b/tests/src/com/android/dialer/interactions/PhoneNumberInteractionTest.java index 8d4b01f67..b821c17c3 100644 --- a/tests/src/com/android/dialer/interactions/PhoneNumberInteractionTest.java +++ b/tests/src/com/android/dialer/interactions/PhoneNumberInteractionTest.java @@ -48,11 +48,6 @@ import java.util.List; @SmallTest public class PhoneNumberInteractionTest extends InstrumentationTestCase { - static { - // AsyncTask class needs to be initialized on the main thread. - AsyncTask.init(); - } - private final static class TestPhoneNumberInteraction extends PhoneNumberInteraction { private ArrayList<PhoneItem> mPhoneList; |