diff options
author | Dean Harding <deanh@google.com> | 2018-03-22 14:51:08 -0700 |
---|---|---|
committer | Dean Harding <deanh@google.com> | 2018-03-22 14:53:52 -0700 |
commit | 84de8322790e2279f7c15f498bc1d027c04355c7 (patch) | |
tree | ece0e2f1c404238b5f41793298f1d1a5772ad465 /tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink | |
parent | ebeea53780b1afe4a1bf765758a28ab8d6766fb3 (diff) | |
download | Car-84de8322790e2279f7c15f498bc1d027c04355c7.tar.gz |
Make kitchen sink send a bundle, and log it from the sample cluster.
The actual data is dummy, but this at least verifies that it's all
hooked up.
Change-Id: Ib9d8dcf422a1b5834fd30147c0199a43d29e6bfd
Fixes: 74813746
Test: Build and run kitchen sink
Diffstat (limited to 'tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink')
-rw-r--r-- | tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/cluster/InstrumentClusterFragment.java | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/cluster/InstrumentClusterFragment.java b/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/cluster/InstrumentClusterFragment.java index 121855d57e..748ea68f72 100644 --- a/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/cluster/InstrumentClusterFragment.java +++ b/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/cluster/InstrumentClusterFragment.java @@ -83,7 +83,7 @@ public class InstrumentClusterFragment extends Fragment { View view = inflater.inflate(R.layout.instrument_cluster, container, false); view.findViewById(R.id.cluster_start_button).setOnClickListener(v -> initCluster()); - view.findViewById(R.id.cluster_turn_left_button).setOnClickListener(v -> turnLeft()); + view.findViewById(R.id.cluster_turn_left_button).setOnClickListener(v -> sendTurn()); view.findViewById(R.id.cluster_start_activity).setOnClickListener(v -> startNavActivity()); return view; @@ -121,8 +121,15 @@ public class InstrumentClusterFragment extends Fragment { } } - private void turnLeft() { - // TODO(deanh): re-implement this using sendEvent() + private void sendTurn() { + // TODO(deanh): Make this actually meaningful. + Bundle bundle = new Bundle(); + bundle.putString("someName", "someValue time=" + System.currentTimeMillis()); + try { + mCarNavigationStatusManager.sendEvent(1, bundle); + } catch(CarNotConnectedException e) { + Log.e(TAG, "Failed to send turn information.", e); + } } private void initCluster() { |