diff options
author | Treehugger Robot <treehugger-gerrit@google.com> | 2018-01-26 22:26:29 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2018-01-26 22:26:29 +0000 |
commit | e5f1e62682bec9f7bfa019b1820328fe98fa45bf (patch) | |
tree | 5e53c4dd5bbfcde694c8a177473d2e0c0f5edb65 /java/com/android/dialer/main/impl/MainActivity.java | |
parent | f0d56cafa4c8284cd83f23e08877f6a5cf0c5fac (diff) | |
parent | 351cbcf3aed969db9b03fbcfc941cf3e086b0720 (diff) |
Merge changes If1ecc3b4,Ied1b369d,I4e492279,I30a4b7fe
* changes:
Disable phone icon for unknown numbers in NUI Voicemail
Pressing dial with an empty dialpad now queries the last number in NUI.
Disable seekbar user seeking
Add voice search to NUI.
Diffstat (limited to 'java/com/android/dialer/main/impl/MainActivity.java')
-rw-r--r-- | java/com/android/dialer/main/impl/MainActivity.java | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/java/com/android/dialer/main/impl/MainActivity.java b/java/com/android/dialer/main/impl/MainActivity.java index 168589f13..3edf6c6af 100644 --- a/java/com/android/dialer/main/impl/MainActivity.java +++ b/java/com/android/dialer/main/impl/MainActivity.java @@ -20,6 +20,7 @@ import android.content.Context; import android.content.Intent; import android.net.Uri; import android.os.Bundle; +import android.provider.CallLog.Calls; import android.provider.ContactsContract.QuickContact; import android.support.design.widget.FloatingActionButton; import android.support.v4.app.FragmentTransaction; @@ -27,7 +28,9 @@ import android.support.v7.app.AppCompatActivity; import android.widget.ImageView; import com.android.dialer.calllog.ui.NewCallLogFragment; import com.android.dialer.common.LogUtil; +import com.android.dialer.common.concurrent.DialerExecutorComponent; import com.android.dialer.compat.CompatUtils; +import com.android.dialer.constants.ActivityRequestCodes; import com.android.dialer.contactsfragment.ContactsFragment; import com.android.dialer.contactsfragment.ContactsFragment.Header; import com.android.dialer.contactsfragment.ContactsFragment.OnContactSelectedListener; @@ -117,6 +120,16 @@ public final class MainActivity extends AppCompatActivity } @Override + protected void onActivityResult(int requestCode, int resultCode, Intent data) { + super.onActivityResult(requestCode, resultCode, data); + if (requestCode == ActivityRequestCodes.DIALTACTS_VOICE_SEARCH) { + searchController.onVoiceResults(resultCode, data); + } else { + LogUtil.e("MainActivity.onActivityResult", "Unknown request code: " + requestCode); + } + } + + @Override public void onContactSelected(ImageView photo, Uri contactUri, long contactId) { // TODO(calderwoodra): Add impression logging QuickContact.showQuickContact( @@ -130,7 +143,13 @@ public final class MainActivity extends AppCompatActivity @Override // DialpadListener public void getLastOutgoingCall(LastOutgoingCallCallback callback) { - // TODO(calderwoodra): migrate CallLogAsync class outside of dialer/app and call it here. + DialerExecutorComponent.get(this) + .dialerExecutorFactory() + .createUiTaskBuilder( + getFragmentManager(), "Query last phone number", Calls::getLastOutgoingCall) + .onSuccess(output -> callback.lastOutgoingCall(output)) + .build() + .executeParallel(this); } @Override // DialpadListener |