Fix Android build issues and gRPC LB policy

* New build.yaml changes and get rid of custom changes.
* By default excludes Census LB alone.
* Android fixes for logging purposes.
* Reduces overall binary/dep size because of the LB changes.

R=gcasto@chromium.org, xyzzyz@chromium.org

Review URL: https://codereview.chromium.org/2440763002 .
diff --git a/BUILD.gn b/BUILD.gn
index d223f13..eeeb7fa 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -3,6 +3,11 @@
 # Please look at the templates directory instead.
 # This file can be regenerated from the template by running
 # tools/buildgen/generate_projects.sh
+if (is_android) {
+  import("//build/config/android/config.gni")
+  import("//build/config/android/rules.gni")
+}
+
 config("grpc_config") {
   include_dirs = [
     ".",
@@ -18,6 +23,14 @@
     # https://crbug.com/593874
     "GRPC_CXX0X_NO_THREAD",
   ]
+  
+  cflags_c = [
+    "-std=c99"
+  ]
+  
+  if (is_android) {
+    libs = [ "log" ] # For __android_log_write
+  }  
 }
 
 
@@ -54,20 +67,17 @@
     "include/grpc/support/tls_msvc.h",
     "include/grpc/support/tls_pthread.h",
     "include/grpc/support/useful.h",
-    "include/grpc/impl/codegen/alloc.h",
     "include/grpc/impl/codegen/atm.h",
     "include/grpc/impl/codegen/atm_gcc_atomic.h",
     "include/grpc/impl/codegen/atm_gcc_sync.h",
     "include/grpc/impl/codegen/atm_windows.h",
-    "include/grpc/impl/codegen/log.h",
+    "include/grpc/impl/codegen/gpr_types.h",
     "include/grpc/impl/codegen/port_platform.h",
     "include/grpc/impl/codegen/slice.h",
-    "include/grpc/impl/codegen/slice_buffer.h",
     "include/grpc/impl/codegen/sync.h",
     "include/grpc/impl/codegen/sync_generic.h",
     "include/grpc/impl/codegen/sync_posix.h",
     "include/grpc/impl/codegen/sync_windows.h",
-    "include/grpc/impl/codegen/time.h",
     "src/core/lib/profiling/timers.h",
     "src/core/lib/support/backoff.h",
     "src/core/lib/support/block_annotate.h",
@@ -151,38 +161,35 @@
     "include/grpc/grpc_posix.h",
     "include/grpc/grpc_security_constants.h",
     "include/grpc/status.h",
-    "include/grpc/impl/codegen/byte_buffer.h",
     "include/grpc/impl/codegen/byte_buffer_reader.h",
     "include/grpc/impl/codegen/compression_types.h",
     "include/grpc/impl/codegen/connectivity_state.h",
     "include/grpc/impl/codegen/grpc_types.h",
     "include/grpc/impl/codegen/propagation_bits.h",
     "include/grpc/impl/codegen/status.h",
-    "include/grpc/impl/codegen/alloc.h",
     "include/grpc/impl/codegen/atm.h",
     "include/grpc/impl/codegen/atm_gcc_atomic.h",
     "include/grpc/impl/codegen/atm_gcc_sync.h",
     "include/grpc/impl/codegen/atm_windows.h",
-    "include/grpc/impl/codegen/log.h",
+    "include/grpc/impl/codegen/gpr_types.h",
     "include/grpc/impl/codegen/port_platform.h",
     "include/grpc/impl/codegen/slice.h",
-    "include/grpc/impl/codegen/slice_buffer.h",
     "include/grpc/impl/codegen/sync.h",
     "include/grpc/impl/codegen/sync_generic.h",
     "include/grpc/impl/codegen/sync_posix.h",
     "include/grpc/impl/codegen/sync_windows.h",
-    "include/grpc/impl/codegen/time.h",
     "include/grpc/grpc_security.h",
-    "include/grpc/census.h",
     "src/core/lib/channel/channel_args.h",
     "src/core/lib/channel/channel_stack.h",
     "src/core/lib/channel/channel_stack_builder.h",
     "src/core/lib/channel/compress_filter.h",
     "src/core/lib/channel/connected_channel.h",
     "src/core/lib/channel/context.h",
+    "src/core/lib/channel/deadline_filter.h",
     "src/core/lib/channel/handshaker.h",
     "src/core/lib/channel/http_client_filter.h",
     "src/core/lib/channel/http_server_filter.h",
+    "src/core/lib/channel/message_size_filter.h",
     "src/core/lib/compression/algorithm_metadata.h",
     "src/core/lib/compression/message_compress.h",
     "src/core/lib/debug/trace.h",
@@ -227,10 +234,10 @@
     "src/core/lib/iomgr/timer_heap.h",
     "src/core/lib/iomgr/udp_server.h",
     "src/core/lib/iomgr/unix_sockets_posix.h",
+    "src/core/lib/iomgr/wakeup_fd_cv.h",
     "src/core/lib/iomgr/wakeup_fd_pipe.h",
     "src/core/lib/iomgr/wakeup_fd_posix.h",
     "src/core/lib/iomgr/workqueue.h",
-    "src/core/lib/iomgr/workqueue_posix.h",
     "src/core/lib/iomgr/workqueue_windows.h",
     "src/core/lib/json/json.h",
     "src/core/lib/json/json_common.h",
@@ -303,6 +310,7 @@
     "src/core/ext/client_config/client_channel.h",
     "src/core/ext/client_config/client_channel_factory.h",
     "src/core/ext/client_config/connector.h",
+    "src/core/ext/client_config/http_connect_handshaker.h",
     "src/core/ext/client_config/initial_connect_string.h",
     "src/core/ext/client_config/lb_policy.h",
     "src/core/ext/client_config/lb_policy_factory.h",
@@ -323,9 +331,11 @@
     "src/core/lib/channel/channel_stack_builder.c",
     "src/core/lib/channel/compress_filter.c",
     "src/core/lib/channel/connected_channel.c",
+    "src/core/lib/channel/deadline_filter.c",
     "src/core/lib/channel/handshaker.c",
     "src/core/lib/channel/http_client_filter.c",
     "src/core/lib/channel/http_server_filter.c",
+    "src/core/lib/channel/message_size_filter.c",
     "src/core/lib/compression/compression.c",
     "src/core/lib/compression/message_compress.c",
     "src/core/lib/debug/trace.c",
@@ -372,11 +382,11 @@
     "src/core/lib/iomgr/udp_server.c",
     "src/core/lib/iomgr/unix_sockets_posix.c",
     "src/core/lib/iomgr/unix_sockets_posix_noop.c",
+    "src/core/lib/iomgr/wakeup_fd_cv.c",
     "src/core/lib/iomgr/wakeup_fd_eventfd.c",
     "src/core/lib/iomgr/wakeup_fd_nospecial.c",
     "src/core/lib/iomgr/wakeup_fd_pipe.c",
     "src/core/lib/iomgr/wakeup_fd_posix.c",
-    "src/core/lib/iomgr/workqueue_posix.c",
     "src/core/lib/iomgr/workqueue_windows.c",
     "src/core/lib/json/json.c",
     "src/core/lib/json/json_reader.c",
@@ -466,6 +476,7 @@
     "src/core/ext/client_config/client_config_plugin.c",
     "src/core/ext/client_config/connector.c",
     "src/core/ext/client_config/default_initial_connect_string.c",
+    "src/core/ext/client_config/http_connect_handshaker.c",
     "src/core/ext/client_config/initial_connect_string.c",
     "src/core/ext/client_config/lb_policy.c",
     "src/core/ext/client_config/lb_policy_factory.c",
@@ -515,27 +526,23 @@
     "include/grpc/grpc_posix.h",
     "include/grpc/grpc_security_constants.h",
     "include/grpc/status.h",
-    "include/grpc/impl/codegen/byte_buffer.h",
     "include/grpc/impl/codegen/byte_buffer_reader.h",
     "include/grpc/impl/codegen/compression_types.h",
     "include/grpc/impl/codegen/connectivity_state.h",
     "include/grpc/impl/codegen/grpc_types.h",
     "include/grpc/impl/codegen/propagation_bits.h",
     "include/grpc/impl/codegen/status.h",
-    "include/grpc/impl/codegen/alloc.h",
     "include/grpc/impl/codegen/atm.h",
     "include/grpc/impl/codegen/atm_gcc_atomic.h",
     "include/grpc/impl/codegen/atm_gcc_sync.h",
     "include/grpc/impl/codegen/atm_windows.h",
-    "include/grpc/impl/codegen/log.h",
+    "include/grpc/impl/codegen/gpr_types.h",
     "include/grpc/impl/codegen/port_platform.h",
     "include/grpc/impl/codegen/slice.h",
-    "include/grpc/impl/codegen/slice_buffer.h",
     "include/grpc/impl/codegen/sync.h",
     "include/grpc/impl/codegen/sync_generic.h",
     "include/grpc/impl/codegen/sync_posix.h",
     "include/grpc/impl/codegen/sync_windows.h",
-    "include/grpc/impl/codegen/time.h",
     "include/grpc/grpc_cronet.h",
     "include/grpc/grpc_security.h",
     "src/core/lib/channel/channel_args.h",
@@ -544,9 +551,11 @@
     "src/core/lib/channel/compress_filter.h",
     "src/core/lib/channel/connected_channel.h",
     "src/core/lib/channel/context.h",
+    "src/core/lib/channel/deadline_filter.h",
     "src/core/lib/channel/handshaker.h",
     "src/core/lib/channel/http_client_filter.h",
     "src/core/lib/channel/http_server_filter.h",
+    "src/core/lib/channel/message_size_filter.h",
     "src/core/lib/compression/algorithm_metadata.h",
     "src/core/lib/compression/message_compress.h",
     "src/core/lib/debug/trace.h",
@@ -591,10 +600,10 @@
     "src/core/lib/iomgr/timer_heap.h",
     "src/core/lib/iomgr/udp_server.h",
     "src/core/lib/iomgr/unix_sockets_posix.h",
+    "src/core/lib/iomgr/wakeup_fd_cv.h",
     "src/core/lib/iomgr/wakeup_fd_pipe.h",
     "src/core/lib/iomgr/wakeup_fd_posix.h",
     "src/core/lib/iomgr/workqueue.h",
-    "src/core/lib/iomgr/workqueue_posix.h",
     "src/core/lib/iomgr/workqueue_windows.h",
     "src/core/lib/json/json.h",
     "src/core/lib/json/json_common.h",
@@ -644,6 +653,7 @@
     "src/core/ext/client_config/client_channel.h",
     "src/core/ext/client_config/client_channel_factory.h",
     "src/core/ext/client_config/connector.h",
+    "src/core/ext/client_config/http_connect_handshaker.h",
     "src/core/ext/client_config/initial_connect_string.h",
     "src/core/ext/client_config/lb_policy.h",
     "src/core/ext/client_config/lb_policy_factory.h",
@@ -686,9 +696,11 @@
     "src/core/lib/channel/channel_stack_builder.c",
     "src/core/lib/channel/compress_filter.c",
     "src/core/lib/channel/connected_channel.c",
+    "src/core/lib/channel/deadline_filter.c",
     "src/core/lib/channel/handshaker.c",
     "src/core/lib/channel/http_client_filter.c",
     "src/core/lib/channel/http_server_filter.c",
+    "src/core/lib/channel/message_size_filter.c",
     "src/core/lib/compression/compression.c",
     "src/core/lib/compression/message_compress.c",
     "src/core/lib/debug/trace.c",
@@ -735,11 +747,11 @@
     "src/core/lib/iomgr/udp_server.c",
     "src/core/lib/iomgr/unix_sockets_posix.c",
     "src/core/lib/iomgr/unix_sockets_posix_noop.c",
+    "src/core/lib/iomgr/wakeup_fd_cv.c",
     "src/core/lib/iomgr/wakeup_fd_eventfd.c",
     "src/core/lib/iomgr/wakeup_fd_nospecial.c",
     "src/core/lib/iomgr/wakeup_fd_pipe.c",
     "src/core/lib/iomgr/wakeup_fd_posix.c",
-    "src/core/lib/iomgr/workqueue_posix.c",
     "src/core/lib/iomgr/workqueue_windows.c",
     "src/core/lib/json/json.c",
     "src/core/lib/json/json_reader.c",
@@ -803,6 +815,7 @@
     "src/core/ext/client_config/client_config_plugin.c",
     "src/core/ext/client_config/connector.c",
     "src/core/ext/client_config/default_initial_connect_string.c",
+    "src/core/ext/client_config/http_connect_handshaker.c",
     "src/core/ext/client_config/initial_connect_string.c",
     "src/core/ext/client_config/lb_policy.c",
     "src/core/ext/client_config/lb_policy_factory.c",
@@ -869,37 +882,34 @@
     "include/grpc/grpc_posix.h",
     "include/grpc/grpc_security_constants.h",
     "include/grpc/status.h",
-    "include/grpc/impl/codegen/byte_buffer.h",
     "include/grpc/impl/codegen/byte_buffer_reader.h",
     "include/grpc/impl/codegen/compression_types.h",
     "include/grpc/impl/codegen/connectivity_state.h",
     "include/grpc/impl/codegen/grpc_types.h",
     "include/grpc/impl/codegen/propagation_bits.h",
     "include/grpc/impl/codegen/status.h",
-    "include/grpc/impl/codegen/alloc.h",
     "include/grpc/impl/codegen/atm.h",
     "include/grpc/impl/codegen/atm_gcc_atomic.h",
     "include/grpc/impl/codegen/atm_gcc_sync.h",
     "include/grpc/impl/codegen/atm_windows.h",
-    "include/grpc/impl/codegen/log.h",
+    "include/grpc/impl/codegen/gpr_types.h",
     "include/grpc/impl/codegen/port_platform.h",
     "include/grpc/impl/codegen/slice.h",
-    "include/grpc/impl/codegen/slice_buffer.h",
     "include/grpc/impl/codegen/sync.h",
     "include/grpc/impl/codegen/sync_generic.h",
     "include/grpc/impl/codegen/sync_posix.h",
     "include/grpc/impl/codegen/sync_windows.h",
-    "include/grpc/impl/codegen/time.h",
-    "include/grpc/census.h",
     "src/core/lib/channel/channel_args.h",
     "src/core/lib/channel/channel_stack.h",
     "src/core/lib/channel/channel_stack_builder.h",
     "src/core/lib/channel/compress_filter.h",
     "src/core/lib/channel/connected_channel.h",
     "src/core/lib/channel/context.h",
+    "src/core/lib/channel/deadline_filter.h",
     "src/core/lib/channel/handshaker.h",
     "src/core/lib/channel/http_client_filter.h",
     "src/core/lib/channel/http_server_filter.h",
+    "src/core/lib/channel/message_size_filter.h",
     "src/core/lib/compression/algorithm_metadata.h",
     "src/core/lib/compression/message_compress.h",
     "src/core/lib/debug/trace.h",
@@ -944,10 +954,10 @@
     "src/core/lib/iomgr/timer_heap.h",
     "src/core/lib/iomgr/udp_server.h",
     "src/core/lib/iomgr/unix_sockets_posix.h",
+    "src/core/lib/iomgr/wakeup_fd_cv.h",
     "src/core/lib/iomgr/wakeup_fd_pipe.h",
     "src/core/lib/iomgr/wakeup_fd_posix.h",
     "src/core/lib/iomgr/workqueue.h",
-    "src/core/lib/iomgr/workqueue_posix.h",
     "src/core/lib/iomgr/workqueue_windows.h",
     "src/core/lib/json/json.h",
     "src/core/lib/json/json_common.h",
@@ -996,6 +1006,7 @@
     "src/core/ext/client_config/client_channel.h",
     "src/core/ext/client_config/client_channel_factory.h",
     "src/core/ext/client_config/connector.h",
+    "src/core/ext/client_config/http_connect_handshaker.h",
     "src/core/ext/client_config/initial_connect_string.h",
     "src/core/ext/client_config/lb_policy.h",
     "src/core/ext/client_config/lb_policy_factory.h",
@@ -1017,9 +1028,11 @@
     "src/core/lib/channel/channel_stack_builder.c",
     "src/core/lib/channel/compress_filter.c",
     "src/core/lib/channel/connected_channel.c",
+    "src/core/lib/channel/deadline_filter.c",
     "src/core/lib/channel/handshaker.c",
     "src/core/lib/channel/http_client_filter.c",
     "src/core/lib/channel/http_server_filter.c",
+    "src/core/lib/channel/message_size_filter.c",
     "src/core/lib/compression/compression.c",
     "src/core/lib/compression/message_compress.c",
     "src/core/lib/debug/trace.c",
@@ -1066,11 +1079,11 @@
     "src/core/lib/iomgr/udp_server.c",
     "src/core/lib/iomgr/unix_sockets_posix.c",
     "src/core/lib/iomgr/unix_sockets_posix_noop.c",
+    "src/core/lib/iomgr/wakeup_fd_cv.c",
     "src/core/lib/iomgr/wakeup_fd_eventfd.c",
     "src/core/lib/iomgr/wakeup_fd_nospecial.c",
     "src/core/lib/iomgr/wakeup_fd_pipe.c",
     "src/core/lib/iomgr/wakeup_fd_posix.c",
-    "src/core/lib/iomgr/workqueue_posix.c",
     "src/core/lib/iomgr/workqueue_windows.c",
     "src/core/lib/json/json.c",
     "src/core/lib/json/json_reader.c",
@@ -1134,6 +1147,7 @@
     "src/core/ext/client_config/client_config_plugin.c",
     "src/core/ext/client_config/connector.c",
     "src/core/ext/client_config/default_initial_connect_string.c",
+    "src/core/ext/client_config/http_connect_handshaker.c",
     "src/core/ext/client_config/initial_connect_string.c",
     "src/core/ext/client_config/lb_policy.c",
     "src/core/ext/client_config/lb_policy_factory.c",
@@ -1241,6 +1255,7 @@
     "include/grpc++/impl/codegen/service_type.h",
     "include/grpc++/impl/codegen/status.h",
     "include/grpc++/impl/codegen/status_code_enum.h",
+    "include/grpc++/impl/codegen/status_helper.h",
     "include/grpc++/impl/codegen/string_ref.h",
     "include/grpc++/impl/codegen/stub_options.h",
     "include/grpc++/impl/codegen/sync.h",
@@ -1248,27 +1263,23 @@
     "include/grpc++/impl/codegen/sync_no_cxx11.h",
     "include/grpc++/impl/codegen/sync_stream.h",
     "include/grpc++/impl/codegen/time.h",
-    "include/grpc/impl/codegen/byte_buffer.h",
     "include/grpc/impl/codegen/byte_buffer_reader.h",
     "include/grpc/impl/codegen/compression_types.h",
     "include/grpc/impl/codegen/connectivity_state.h",
     "include/grpc/impl/codegen/grpc_types.h",
     "include/grpc/impl/codegen/propagation_bits.h",
     "include/grpc/impl/codegen/status.h",
-    "include/grpc/impl/codegen/alloc.h",
     "include/grpc/impl/codegen/atm.h",
     "include/grpc/impl/codegen/atm_gcc_atomic.h",
     "include/grpc/impl/codegen/atm_gcc_sync.h",
     "include/grpc/impl/codegen/atm_windows.h",
-    "include/grpc/impl/codegen/log.h",
+    "include/grpc/impl/codegen/gpr_types.h",
     "include/grpc/impl/codegen/port_platform.h",
     "include/grpc/impl/codegen/slice.h",
-    "include/grpc/impl/codegen/slice_buffer.h",
     "include/grpc/impl/codegen/sync.h",
     "include/grpc/impl/codegen/sync_generic.h",
     "include/grpc/impl/codegen/sync_posix.h",
     "include/grpc/impl/codegen/sync_windows.h",
-    "include/grpc/impl/codegen/time.h",
     "include/grpc++/impl/codegen/core_codegen.h",
     "src/cpp/client/secure_credentials.h",
     "src/cpp/common/secure_auth_context.h",
@@ -1400,6 +1411,7 @@
     "include/grpc++/impl/codegen/service_type.h",
     "include/grpc++/impl/codegen/status.h",
     "include/grpc++/impl/codegen/status_code_enum.h",
+    "include/grpc++/impl/codegen/status_helper.h",
     "include/grpc++/impl/codegen/string_ref.h",
     "include/grpc++/impl/codegen/stub_options.h",
     "include/grpc++/impl/codegen/sync.h",
@@ -1407,27 +1419,23 @@
     "include/grpc++/impl/codegen/sync_no_cxx11.h",
     "include/grpc++/impl/codegen/sync_stream.h",
     "include/grpc++/impl/codegen/time.h",
-    "include/grpc/impl/codegen/byte_buffer.h",
     "include/grpc/impl/codegen/byte_buffer_reader.h",
     "include/grpc/impl/codegen/compression_types.h",
     "include/grpc/impl/codegen/connectivity_state.h",
     "include/grpc/impl/codegen/grpc_types.h",
     "include/grpc/impl/codegen/propagation_bits.h",
     "include/grpc/impl/codegen/status.h",
-    "include/grpc/impl/codegen/alloc.h",
     "include/grpc/impl/codegen/atm.h",
     "include/grpc/impl/codegen/atm_gcc_atomic.h",
     "include/grpc/impl/codegen/atm_gcc_sync.h",
     "include/grpc/impl/codegen/atm_windows.h",
-    "include/grpc/impl/codegen/log.h",
+    "include/grpc/impl/codegen/gpr_types.h",
     "include/grpc/impl/codegen/port_platform.h",
     "include/grpc/impl/codegen/slice.h",
-    "include/grpc/impl/codegen/slice_buffer.h",
     "include/grpc/impl/codegen/sync.h",
     "include/grpc/impl/codegen/sync_generic.h",
     "include/grpc/impl/codegen/sync_posix.h",
     "include/grpc/impl/codegen/sync_windows.h",
-    "include/grpc/impl/codegen/time.h",
     "src/cpp/client/create_channel_internal.h",
     "src/cpp/common/channel_filter.h",
     "src/cpp/server/dynamic_thread_pool.h",
@@ -1493,6 +1501,8 @@
     "src/compiler/node_generator_helpers.h",
     "src/compiler/objective_c_generator.h",
     "src/compiler/objective_c_generator_helpers.h",
+    "src/compiler/php_generator.h",
+    "src/compiler/php_generator_helpers.h",
     "src/compiler/python_generator.h",
     "src/compiler/ruby_generator.h",
     "src/compiler/ruby_generator_helpers-inl.h",
@@ -1502,6 +1512,7 @@
     "src/compiler/csharp_generator.cc",
     "src/compiler/node_generator.cc",
     "src/compiler/objective_c_generator.cc",
+    "src/compiler/php_generator.cc",
     "src/compiler/python_generator.cc",
     "src/compiler/ruby_generator.cc",
   ]
diff --git a/OWNERS b/OWNERS
index 1a39024..76dd74d 100644
--- a/OWNERS
+++ b/OWNERS
@@ -1,3 +1,5 @@
 xyzzyz@chromium.org
 gcasto@chromium.org
 maniscalco@chromium.org
+perumaal@chromium.org
+
diff --git a/build.yaml b/build.yaml
index f35382b..98bc7cb 100644
--- a/build.yaml
+++ b/build.yaml
@@ -846,14 +846,12 @@
   - grpc_transport_chttp2_client_secure
   - grpc_transport_chttp2_server_insecure
   - grpc_transport_chttp2_client_insecure
-  - grpc_lb_policy_grpclb
   - grpc_lb_policy_pick_first
   - grpc_lb_policy_round_robin
   - grpc_resolver_dns_native
   - grpc_resolver_sockaddr
   - grpc_load_reporting
   - grpc_secure
-  - census
   generate_plugin_registry: true
   secure: true
   vs_packages:
@@ -944,10 +942,8 @@
   - grpc_resolver_dns_native
   - grpc_resolver_sockaddr
   - grpc_load_reporting
-  - grpc_lb_policy_grpclb
   - grpc_lb_policy_pick_first
   - grpc_lb_policy_round_robin
-  - census
   generate_plugin_registry: true
   secure: false
   vs_project_guid: '{46CEDFFF-9692-456A-AA24-38B5D6BCF4C5}'
diff --git a/src/core/plugin_registry/grpc_plugin_registry.c b/src/core/plugin_registry/grpc_plugin_registry.c
index 7a7a9ce..f968bf4 100644
--- a/src/core/plugin_registry/grpc_plugin_registry.c
+++ b/src/core/plugin_registry/grpc_plugin_registry.c
@@ -37,8 +37,6 @@
 extern void grpc_chttp2_plugin_shutdown(void);
 extern void grpc_client_config_init(void);
 extern void grpc_client_config_shutdown(void);
-extern void grpc_lb_policy_grpclb_init(void);
-extern void grpc_lb_policy_grpclb_shutdown(void);
 extern void grpc_lb_policy_pick_first_init(void);
 extern void grpc_lb_policy_pick_first_shutdown(void);
 extern void grpc_lb_policy_round_robin_init(void);
@@ -49,16 +47,12 @@
 extern void grpc_resolver_sockaddr_shutdown(void);
 extern void grpc_load_reporting_plugin_init(void);
 extern void grpc_load_reporting_plugin_shutdown(void);
-extern void census_grpc_plugin_init(void);
-extern void census_grpc_plugin_shutdown(void);
 
 void grpc_register_built_in_plugins(void) {
   grpc_register_plugin(grpc_chttp2_plugin_init,
                        grpc_chttp2_plugin_shutdown);
   grpc_register_plugin(grpc_client_config_init,
                        grpc_client_config_shutdown);
-  grpc_register_plugin(grpc_lb_policy_grpclb_init,
-                       grpc_lb_policy_grpclb_shutdown);
   grpc_register_plugin(grpc_lb_policy_pick_first_init,
                        grpc_lb_policy_pick_first_shutdown);
   grpc_register_plugin(grpc_lb_policy_round_robin_init,
@@ -69,6 +63,4 @@
                        grpc_resolver_sockaddr_shutdown);
   grpc_register_plugin(grpc_load_reporting_plugin_init,
                        grpc_load_reporting_plugin_shutdown);
-  grpc_register_plugin(census_grpc_plugin_init,
-                       census_grpc_plugin_shutdown);
 }
diff --git a/src/core/plugin_registry/grpc_unsecure_plugin_registry.c b/src/core/plugin_registry/grpc_unsecure_plugin_registry.c
index fe238b7..beeaefb 100644
--- a/src/core/plugin_registry/grpc_unsecure_plugin_registry.c
+++ b/src/core/plugin_registry/grpc_unsecure_plugin_registry.c
@@ -43,14 +43,10 @@
 extern void grpc_resolver_sockaddr_shutdown(void);
 extern void grpc_load_reporting_plugin_init(void);
 extern void grpc_load_reporting_plugin_shutdown(void);
-extern void grpc_lb_policy_grpclb_init(void);
-extern void grpc_lb_policy_grpclb_shutdown(void);
 extern void grpc_lb_policy_pick_first_init(void);
 extern void grpc_lb_policy_pick_first_shutdown(void);
 extern void grpc_lb_policy_round_robin_init(void);
 extern void grpc_lb_policy_round_robin_shutdown(void);
-extern void census_grpc_plugin_init(void);
-extern void census_grpc_plugin_shutdown(void);
 
 void grpc_register_built_in_plugins(void) {
   grpc_register_plugin(grpc_chttp2_plugin_init,
@@ -63,16 +59,8 @@
                        grpc_resolver_sockaddr_shutdown);
   grpc_register_plugin(grpc_load_reporting_plugin_init,
                        grpc_load_reporting_plugin_shutdown);
-  // The following lines are commented out in Chromium so that we don't
-  // introduce dependency on nanopb.
-  // grpc_register_plugin(grpc_lb_policy_grpclb_init,
-  //                      grpc_lb_policy_grpclb_shutdown);
   grpc_register_plugin(grpc_lb_policy_pick_first_init,
                        grpc_lb_policy_pick_first_shutdown);
   grpc_register_plugin(grpc_lb_policy_round_robin_init,
                        grpc_lb_policy_round_robin_shutdown);
-  // The following lines are commented out in Chromium so that we don't
-  // introduce dependency on nanopb.
-  // grpc_register_plugin(census_grpc_plugin_init,
-  //                      census_grpc_plugin_shutdown);
 }
diff --git a/templates/BUILD.gn.template b/templates/BUILD.gn.template
index 81678ea..71607a2 100644
--- a/templates/BUILD.gn.template
+++ b/templates/BUILD.gn.template
@@ -5,6 +5,11 @@
   # Please look at the templates directory instead.
   # This file can be regenerated from the template by running
   # tools/buildgen/generate_projects.sh
+  if (is_android) {
+    import("//build/config/android/config.gni")
+    import("//build/config/android/rules.gni")
+  }
+  
   config("grpc_config") {
     include_dirs = [
       ".",
@@ -20,6 +25,14 @@
       # https://crbug.com/593874
       "GRPC_CXX0X_NO_THREAD",
     ]
+    
+    cflags_c = [
+      "-std=c99"
+    ]
+    
+    if (is_android) {
+      libs = [ "log" ] # For __android_log_write
+    }  
   }
 
   <%!
diff --git a/test/core/surface/public_headers_must_be_c89.c b/test/core/surface/public_headers_must_be_c89.c
index 53bdf61..9c4e70f 100644
--- a/test/core/surface/public_headers_must_be_c89.c
+++ b/test/core/surface/public_headers_must_be_c89.c
@@ -33,7 +33,6 @@
 
 #include <grpc/byte_buffer.h>
 #include <grpc/byte_buffer_reader.h>
-#include <grpc/census.h>
 #include <grpc/compression.h>
 #include <grpc/grpc.h>
 #include <grpc/grpc_security.h>