diff options
author | Eric Erfanian <erfanian@google.com> | 2017-05-03 23:10:39 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2017-05-03 23:10:39 +0000 |
commit | d67f1627521b174f12e0c247f154c7c93c5e408e (patch) | |
tree | 1a45d60921e293c6088efeaf4d9c408456f3e0e2 /java/com/android/dialer/calldetails/CallDetailsActivity.java | |
parent | 010981b798fbc6b8e6a00c3ea507f00c3e77c371 (diff) | |
parent | 8369df095a73a77b3715f8ae7ba06089cebca4ce (diff) |
This change reflects the Dialer V10 RC00 branch.
am: 8369df095a
Change-Id: I6820870feb74cba010ac3039e4da41325b3005f9
Diffstat (limited to 'java/com/android/dialer/calldetails/CallDetailsActivity.java')
-rw-r--r-- | java/com/android/dialer/calldetails/CallDetailsActivity.java | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/java/com/android/dialer/calldetails/CallDetailsActivity.java b/java/com/android/dialer/calldetails/CallDetailsActivity.java index 757c6eed2..41d176562 100644 --- a/java/com/android/dialer/calldetails/CallDetailsActivity.java +++ b/java/com/android/dialer/calldetails/CallDetailsActivity.java @@ -29,14 +29,14 @@ import android.support.v7.widget.RecyclerView; import android.support.v7.widget.Toolbar; import android.support.v7.widget.Toolbar.OnMenuItemClickListener; import android.view.MenuItem; -import com.android.dialer.callcomposer.nano.CallComposerContact; -import com.android.dialer.calldetails.nano.CallDetailsEntries; -import com.android.dialer.calldetails.nano.CallDetailsEntries.CallDetailsEntry; +import com.android.dialer.callcomposer.CallComposerContact; +import com.android.dialer.calldetails.CallDetailsEntries.CallDetailsEntry; 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.android.dialer.logging.nano.DialerImpression; -import com.android.dialer.protos.ProtoParsers; +import com.google.protobuf.InvalidProtocolBufferException; +import java.util.List; /** Displays the details of a specific call log entry. */ public class CallDetailsActivity extends AppCompatActivity implements OnMenuItemClickListener { @@ -45,7 +45,7 @@ public class CallDetailsActivity extends AppCompatActivity implements OnMenuItem private static final String EXTRA_CONTACT = "contact"; private static final String TASK_DELETE = "task_delete"; - private CallDetailsEntry[] entries; + private List<CallDetailsEntry> entries; public static Intent newInstance( Context context, @NonNull CallDetailsEntries details, @NonNull CallComposerContact contact) { @@ -53,8 +53,8 @@ public class CallDetailsActivity extends AppCompatActivity implements OnMenuItem Assert.isNotNull(contact); Intent intent = new Intent(context, CallDetailsActivity.class); - ProtoParsers.put(intent, EXTRA_CONTACT, contact); - ProtoParsers.put(intent, EXTRA_CALL_DETAILS_ENTRIES, details); + intent.putExtra(EXTRA_CONTACT, contact.toByteArray()); + intent.putExtra(EXTRA_CALL_DETAILS_ENTRIES, details.toByteArray()); return intent; } @@ -77,12 +77,15 @@ public class CallDetailsActivity extends AppCompatActivity implements OnMenuItem private void onHandleIntent(Intent intent) { Bundle arguments = intent.getExtras(); - CallComposerContact contact = - ProtoParsers.getFromInstanceState(arguments, EXTRA_CONTACT, new CallComposerContact()); - entries = - ProtoParsers.getFromInstanceState( - arguments, EXTRA_CALL_DETAILS_ENTRIES, new CallDetailsEntries()) - .entries; + 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()); + } RecyclerView recyclerView = (RecyclerView) findViewById(R.id.recycler_view); recyclerView.setLayoutManager(new LinearLayoutManager(this)); recyclerView.setAdapter(new CallDetailsAdapter(this, contact, entries)); @@ -110,7 +113,7 @@ public class CallDetailsActivity extends AppCompatActivity implements OnMenuItem if (callIds.length() != 0) { callIds.append(","); } - callIds.append(entry.callId); + callIds.append(entry.getCallId()); } this.callIds = callIds.toString(); } |