Build for Android.

Add Android.mk files to build webservd and libwebserv, patch
the source to not use libminijail when __BRILLO__ is
defined, and update copyright information.

Also add pre-generated D-Bus bindings into a gen/ directory
to use until code generation is working.

Bug: 22828211
Change-Id: Ib6d06789c1a5a27b8ee4f85d5723b46973c1ddaa
diff --git a/libwebserv/Android.mk b/libwebserv/Android.mk
new file mode 100644
index 0000000..396015f
--- /dev/null
+++ b/libwebserv/Android.mk
@@ -0,0 +1,35 @@
+#
+# Copyright 2015 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+LOCAL_PATH := $(my-dir)
+
+# libwebserv shared library
+# ========================================================
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := libwebserv
+LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
+# TODO: Add dbus_bindings/org.chromium.WebServer.RequestHandler.dbus.xml once
+# code generation is working.
+LOCAL_SRC_FILES := \
+    protocol_handler.cc \
+    request.cc \
+    request_handler_callback.cc \
+    response.cc \
+    server.cc \
+
+$(eval $(webservd_common))
+include $(BUILD_SHARED_LIBRARY)
diff --git a/libwebserv/_empty.cc b/libwebserv/_empty.cc
index def2420..31ef18a 100644
--- a/libwebserv/_empty.cc
+++ b/libwebserv/_empty.cc
@@ -1,6 +1,16 @@
-// Copyright 2015 The Chromium OS Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
+// Copyright 2015 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
 
 // This file is left empty deliberately to work around some dependency
 // generation in GYP. In GYP for custom actions to run properly, the 'sources'
diff --git a/libwebserv/export.h b/libwebserv/export.h
index f2c5394..ff68423 100644
--- a/libwebserv/export.h
+++ b/libwebserv/export.h
@@ -1,6 +1,16 @@
-// Copyright 2014 The Chromium OS Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
+// Copyright 2015 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
 
 #ifndef WEBSERVER_LIBWEBSERV_EXPORT_H_
 #define WEBSERVER_LIBWEBSERV_EXPORT_H_
diff --git a/libwebserv/libwebserv_testrunner.cc b/libwebserv/libwebserv_testrunner.cc
index 4e89dbb..46268e5 100644
--- a/libwebserv/libwebserv_testrunner.cc
+++ b/libwebserv/libwebserv_testrunner.cc
@@ -1,6 +1,16 @@
-// Copyright 2014 The Chromium OS Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
+// Copyright 2015 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
 
 #include <base/at_exit.h>
 #include <gtest/gtest.h>
diff --git a/libwebserv/preinstall.sh b/libwebserv/preinstall.sh
index 51ee83b..7600707 100755
--- a/libwebserv/preinstall.sh
+++ b/libwebserv/preinstall.sh
@@ -1,7 +1,18 @@
 #!/bin/bash
-# Copyright 2014 The Chromium OS Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
+#
+# Copyright 2015 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
 
 set -e
 
diff --git a/libwebserv/protocol_handler.cc b/libwebserv/protocol_handler.cc
index 53514be..7897c76 100644
--- a/libwebserv/protocol_handler.cc
+++ b/libwebserv/protocol_handler.cc
@@ -1,6 +1,16 @@
-// Copyright 2014 The Chromium OS Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
+// Copyright 2015 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
 
 #include "libwebserv/protocol_handler.h"
 
diff --git a/libwebserv/protocol_handler.h b/libwebserv/protocol_handler.h
index f6543cc..648f0ff 100644
--- a/libwebserv/protocol_handler.h
+++ b/libwebserv/protocol_handler.h
@@ -1,6 +1,16 @@
-// Copyright 2015 The Chromium OS Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
+// Copyright 2015 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
 
 #ifndef WEBSERVER_LIBWEBSERV_PROTOCOL_HANDLER_H_
 #define WEBSERVER_LIBWEBSERV_PROTOCOL_HANDLER_H_
diff --git a/libwebserv/request.cc b/libwebserv/request.cc
index b51aa94..cb0fa1b 100644
--- a/libwebserv/request.cc
+++ b/libwebserv/request.cc
@@ -1,6 +1,16 @@
-// Copyright 2014 The Chromium OS Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
+// Copyright 2015 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
 
 #include <libwebserv/request.h>
 
diff --git a/libwebserv/request.h b/libwebserv/request.h
index 894546b..4ffbb7c 100644
--- a/libwebserv/request.h
+++ b/libwebserv/request.h
@@ -1,6 +1,16 @@
-// Copyright 2014 The Chromium OS Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
+// Copyright 2015 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
 
 #ifndef WEBSERVER_LIBWEBSERV_REQUEST_H_
 #define WEBSERVER_LIBWEBSERV_REQUEST_H_
diff --git a/libwebserv/request_handler_callback.cc b/libwebserv/request_handler_callback.cc
index 4989a8e..7606ecc 100644
--- a/libwebserv/request_handler_callback.cc
+++ b/libwebserv/request_handler_callback.cc
@@ -1,6 +1,16 @@
-// Copyright 2014 The Chromium OS Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
+// Copyright 2015 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
 
 #include <libwebserv/request_handler_callback.h>
 
diff --git a/libwebserv/request_handler_callback.h b/libwebserv/request_handler_callback.h
index 6b191bc..ab1ad6a 100644
--- a/libwebserv/request_handler_callback.h
+++ b/libwebserv/request_handler_callback.h
@@ -1,6 +1,16 @@
-// Copyright 2014 The Chromium OS Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
+// Copyright 2015 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
 
 #ifndef WEBSERVER_LIBWEBSERV_REQUEST_HANDLER_CALLBACK_H_
 #define WEBSERVER_LIBWEBSERV_REQUEST_HANDLER_CALLBACK_H_
diff --git a/libwebserv/request_handler_interface.h b/libwebserv/request_handler_interface.h
index a373680..c9ce115 100644
--- a/libwebserv/request_handler_interface.h
+++ b/libwebserv/request_handler_interface.h
@@ -1,6 +1,16 @@
-// Copyright 2014 The Chromium OS Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
+// Copyright 2015 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
 
 #ifndef WEBSERVER_LIBWEBSERV_REQUEST_HANDLER_INTERFACE_H_
 #define WEBSERVER_LIBWEBSERV_REQUEST_HANDLER_INTERFACE_H_
diff --git a/libwebserv/response.cc b/libwebserv/response.cc
index 57b4cd7..8fc49f7 100644
--- a/libwebserv/response.cc
+++ b/libwebserv/response.cc
@@ -1,6 +1,16 @@
-// Copyright 2014 The Chromium OS Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
+// Copyright 2015 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
 
 #include <libwebserv/response.h>
 
diff --git a/libwebserv/response.h b/libwebserv/response.h
index 616264d..f3f2adf 100644
--- a/libwebserv/response.h
+++ b/libwebserv/response.h
@@ -1,6 +1,16 @@
-// Copyright 2014 The Chromium OS Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
+// Copyright 2015 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
 
 #ifndef WEBSERVER_LIBWEBSERV_RESPONSE_H_
 #define WEBSERVER_LIBWEBSERV_RESPONSE_H_
diff --git a/libwebserv/server.cc b/libwebserv/server.cc
index 408852e..113be20 100644
--- a/libwebserv/server.cc
+++ b/libwebserv/server.cc
@@ -1,6 +1,16 @@
-// Copyright 2014 The Chromium OS Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
+// Copyright 2015 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
 
 #include <libwebserv/server.h>
 
diff --git a/libwebserv/server.h b/libwebserv/server.h
index bb45204..70e5dcd 100644
--- a/libwebserv/server.h
+++ b/libwebserv/server.h
@@ -1,6 +1,16 @@
-// Copyright 2014 The Chromium OS Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
+// Copyright 2015 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
 
 #ifndef WEBSERVER_LIBWEBSERV_SERVER_H_
 #define WEBSERVER_LIBWEBSERV_SERVER_H_