diff options
author | Eric Erfanian <erfanian@google.com> | 2017-05-05 15:23:13 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2017-05-05 15:23:13 +0000 |
commit | 300a8683b9c28424fb0f0c571a0abe128c461f69 (patch) | |
tree | 3a325b0effac02fbd228b8ddf2f96589e5df72cd /java/com/android/dialer/calldetails/CallDetailsActivity.java | |
parent | d67f1627521b174f12e0c247f154c7c93c5e408e (diff) | |
parent | 10b34a5ebf12e97ecba0caf3c8e30b476b038a96 (diff) |
Update Dialer to V10 RC16
am: 10b34a5ebf
Change-Id: Iea3e96ccdeaf1fa796ceca702cace82ca20f298c
Diffstat (limited to 'java/com/android/dialer/calldetails/CallDetailsActivity.java')
-rw-r--r-- | java/com/android/dialer/calldetails/CallDetailsActivity.java | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/java/com/android/dialer/calldetails/CallDetailsActivity.java b/java/com/android/dialer/calldetails/CallDetailsActivity.java index 41d176562..7eab951fa 100644 --- a/java/com/android/dialer/calldetails/CallDetailsActivity.java +++ b/java/com/android/dialer/calldetails/CallDetailsActivity.java @@ -35,7 +35,7 @@ import com.android.dialer.common.Assert; import com.android.dialer.common.concurrent.AsyncTaskExecutors; import com.android.dialer.logging.DialerImpression; import com.android.dialer.logging.Logger; -import com.google.protobuf.InvalidProtocolBufferException; +import com.android.dialer.protos.ProtoParsers; import java.util.List; /** Displays the details of a specific call log entry. */ @@ -53,8 +53,8 @@ public class CallDetailsActivity extends AppCompatActivity implements OnMenuItem Assert.isNotNull(contact); Intent intent = new Intent(context, CallDetailsActivity.class); - intent.putExtra(EXTRA_CONTACT, contact.toByteArray()); - intent.putExtra(EXTRA_CALL_DETAILS_ENTRIES, details.toByteArray()); + ProtoParsers.put(intent, EXTRA_CONTACT, contact); + ProtoParsers.put(intent, EXTRA_CALL_DETAILS_ENTRIES, details); return intent; } @@ -76,16 +76,13 @@ public class CallDetailsActivity extends AppCompatActivity implements OnMenuItem } private void onHandleIntent(Intent intent) { - Bundle arguments = intent.getExtras(); - CallComposerContact contact = CallComposerContact.getDefaultInstance(); - try { - contact = CallComposerContact.parseFrom(arguments.getByteArray(EXTRA_CONTACT)); - entries = - CallDetailsEntries.parseFrom(arguments.getByteArray(EXTRA_CALL_DETAILS_ENTRIES)) - .getEntriesList(); - } catch (InvalidProtocolBufferException e) { - throw Assert.createIllegalStateFailException(e.toString()); - } + CallComposerContact contact = + ProtoParsers.getTrusted(intent, EXTRA_CONTACT, CallComposerContact.getDefaultInstance()); + entries = + ProtoParsers.getTrusted( + intent, EXTRA_CALL_DETAILS_ENTRIES, CallDetailsEntries.getDefaultInstance()) + .getEntriesList(); + RecyclerView recyclerView = (RecyclerView) findViewById(R.id.recycler_view); recyclerView.setLayoutManager(new LinearLayoutManager(this)); recyclerView.setAdapter(new CallDetailsAdapter(this, contact, entries)); |