diff options
Diffstat (limited to 'java/com/android/dialer/app')
3 files changed, 11 insertions, 13 deletions
diff --git a/java/com/android/dialer/app/DialtactsActivity.java b/java/com/android/dialer/app/DialtactsActivity.java index 7e62065ee..a8b75bba7 100644 --- a/java/com/android/dialer/app/DialtactsActivity.java +++ b/java/com/android/dialer/app/DialtactsActivity.java @@ -97,6 +97,7 @@ import com.android.dialer.callintent.CallSpecificAppData; import com.android.dialer.common.Assert; import com.android.dialer.common.LogUtil; import com.android.dialer.configprovider.ConfigProviderBindings; +import com.android.dialer.constants.ActivityRequestCodes; import com.android.dialer.database.Database; import com.android.dialer.database.DialerDatabaseHelper; import com.android.dialer.interactions.PhoneNumberInteraction; @@ -172,11 +173,6 @@ public class DialtactsActivity extends TransactionSafeActivity /** Just for backward compatibility. Should behave as same as {@link Intent#ACTION_DIAL}. */ private static final String ACTION_TOUCH_DIALER = "com.android.phone.action.TOUCH_DIALER"; - private static final int ACTIVITY_REQUEST_CODE_VOICE_SEARCH = 1; - public static final int ACTIVITY_REQUEST_CODE_CALL_COMPOSE = 2; - public static final int ACTIVITY_REQUEST_CODE_LIGHTBRINGER = 3; - public static final int ACTIVITY_REQUEST_CODE_CALL_DETAILS = 4; - private static final int FAB_SCALE_IN_DELAY_MS = 300; /** @@ -723,7 +719,7 @@ public class DialtactsActivity extends TransactionSafeActivity try { startActivityForResult( new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH), - ACTIVITY_REQUEST_CODE_VOICE_SEARCH); + ActivityRequestCodes.DIALTACTS_VOICE_SEARCH); } catch (ActivityNotFoundException e) { Toast.makeText( DialtactsActivity.this, R.string.voice_search_not_available, Toast.LENGTH_SHORT) @@ -769,7 +765,7 @@ public class DialtactsActivity extends TransactionSafeActivity "requestCode:%d, resultCode:%d", requestCode, resultCode); - if (requestCode == ACTIVITY_REQUEST_CODE_VOICE_SEARCH) { + if (requestCode == ActivityRequestCodes.DIALTACTS_VOICE_SEARCH) { if (resultCode == RESULT_OK) { final ArrayList<String> matches = data.getStringArrayListExtra(RecognizerIntent.EXTRA_RESULTS); @@ -781,7 +777,7 @@ public class DialtactsActivity extends TransactionSafeActivity } else { LogUtil.e("DialtactsActivity.onActivityResult", "voice search failed"); } - } else if (requestCode == ACTIVITY_REQUEST_CODE_CALL_COMPOSE) { + } else if (requestCode == ActivityRequestCodes.DIALTACTS_CALL_COMPOSER) { if (resultCode == RESULT_FIRST_USER) { LogUtil.i( "DialtactsActivity.onActivityResult", "returned from call composer, error occurred"); @@ -793,7 +789,7 @@ public class DialtactsActivity extends TransactionSafeActivity } else { LogUtil.i("DialtactsActivity.onActivityResult", "returned from call composer, no error"); } - } else if (requestCode == ACTIVITY_REQUEST_CODE_CALL_DETAILS) { + } else if (requestCode == ActivityRequestCodes.DIALTACTS_CALL_DETAILS) { if (resultCode == RESULT_OK && data != null && data.getBooleanExtra(CallDetailsActivity.EXTRA_HAS_ENRICHED_CALL_DATA, false)) { diff --git a/java/com/android/dialer/app/calllog/CallLogActivity.java b/java/com/android/dialer/app/calllog/CallLogActivity.java index c9e655d17..1bb894c59 100644 --- a/java/com/android/dialer/app/calllog/CallLogActivity.java +++ b/java/com/android/dialer/app/calllog/CallLogActivity.java @@ -33,6 +33,7 @@ import com.android.contacts.common.list.ViewPagerTabs; import com.android.dialer.app.DialtactsActivity; import com.android.dialer.app.R; import com.android.dialer.calldetails.CallDetailsActivity; +import com.android.dialer.constants.ActivityRequestCodes; import com.android.dialer.database.CallLogQueryHandler; import com.android.dialer.logging.Logger; import com.android.dialer.logging.ScreenEvent; @@ -234,7 +235,7 @@ public class CallLogActivity extends TransactionSafeActivity @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { - if (requestCode == DialtactsActivity.ACTIVITY_REQUEST_CODE_CALL_DETAILS) { + if (requestCode == ActivityRequestCodes.DIALTACTS_CALL_DETAILS) { if (resultCode == RESULT_OK && data != null && data.getBooleanExtra(CallDetailsActivity.EXTRA_HAS_ENRICHED_CALL_DATA, false)) { diff --git a/java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java b/java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java index f7ea63c90..745f8b665 100644 --- a/java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java +++ b/java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java @@ -69,6 +69,7 @@ import com.android.dialer.common.Assert; import com.android.dialer.common.LogUtil; import com.android.dialer.compat.CompatUtils; import com.android.dialer.configprovider.ConfigProviderBindings; +import com.android.dialer.constants.ActivityRequestCodes; import com.android.dialer.contactphoto.ContactPhotoManager; import com.android.dialer.dialercontact.DialerContact; import com.android.dialer.dialercontact.SimDetails; @@ -867,7 +868,7 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder Activity activity = (Activity) mContext; activity.startActivityForResult( CallComposerActivity.newIntent(activity, buildContact()), - DialtactsActivity.ACTIVITY_REQUEST_CODE_CALL_COMPOSE); + ActivityRequestCodes.DIALTACTS_CALL_COMPOSER); } else if (view.getId() == R.id.share_voicemail) { Logger.get(mContext).logImpression(DialerImpression.Type.VVM_SHARE_PRESSED); mVoicemailPlaybackPresenter.shareVoicemail(); @@ -895,7 +896,7 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder } else if (CallDetailsActivity.isLaunchIntent(intent)) { PerformanceReport.recordClick(UiAction.Type.OPEN_CALL_DETAIL); ((Activity) mContext) - .startActivityForResult(intent, DialtactsActivity.ACTIVITY_REQUEST_CODE_CALL_DETAILS); + .startActivityForResult(intent, ActivityRequestCodes.DIALTACTS_CALL_DETAILS); } else { if (Intent.ACTION_CALL.equals(intent.getAction()) && intent.getIntExtra(TelecomManager.EXTRA_START_CALL_WITH_VIDEO_STATE, -1) @@ -911,7 +912,7 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder private void startLightbringerActivity(Intent intent) { try { Activity activity = (Activity) mContext; - activity.startActivityForResult(intent, DialtactsActivity.ACTIVITY_REQUEST_CODE_LIGHTBRINGER); + activity.startActivityForResult(intent, ActivityRequestCodes.DIALTACTS_LIGHTBRINGER); } catch (ActivityNotFoundException e) { Toast.makeText(mContext, R.string.activity_not_available, Toast.LENGTH_SHORT).show(); } |