Snap for 4620899 from 2ce9e1544377e36cd9a03a9d7aa809911aa735a3 to pi-release

Change-Id: If6d375d9186833abc4442e6b3467f690bd96feb3
diff --git a/Android.bp b/Android.bp
new file mode 100644
index 0000000..0428c01
--- /dev/null
+++ b/Android.bp
@@ -0,0 +1,41 @@
+// Copyright 2010 Google Inc. All rights reserved.
+//
+// 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.
+
+filegroup {
+    name: "opt-net-voip-srcs",
+    srcs: [
+        "src/java/android/net/**/*.java",
+    ],
+}
+
+filegroup {
+    name: "opt-net-voip-htmls",
+    srcs: [
+        "src/java/android/net/**/*.html",
+    ],
+}
+
+java_library {
+    name: "voip-common",
+    srcs: [
+        "src/java/**/*.java",
+        "src/java/**/I*.aidl",
+    ],
+    aidl: {
+        local_include_dirs: [
+            "src/java",
+        ],
+    },
+    required: ["librtp_jni"],
+}
diff --git a/Android.mk b/Android.mk
deleted file mode 100644
index 35eaad2..0000000
--- a/Android.mk
+++ /dev/null
@@ -1,36 +0,0 @@
-# Copyright (C) 2011 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 := $(call my-dir)
-
-include $(CLEAR_VARS)
-
-LOCAL_AIDL_INCLUDES := $(LOCAL_PATH)/src/java
-LOCAL_SRC_FILES := $(call all-java-files-under, src/java) \
-	$(call all-Iaidl-files-under, src/java) \
-	$(call all-logtags-files-under, src/java)
-
-#LOCAL_JAVA_LIBRARIES := telephony-common
-LOCAL_JNI_SHARED_LIBRARIES := librtp_jni 
-LOCAL_REQUIRED_MODULES := librtp_jni
-
-LOCAL_MODULE_TAGS := optional
-LOCAL_MODULE := voip-common
-
-include $(BUILD_JAVA_LIBRARY)
-
-# Include subdirectory makefiles
-# ============================================================
-include $(call all-makefiles-under,$(LOCAL_PATH)/src/jni)
-
diff --git a/src/jni/rtp/Android.bp b/src/jni/rtp/Android.bp
new file mode 100644
index 0000000..bdd5071
--- /dev/null
+++ b/src/jni/rtp/Android.bp
@@ -0,0 +1,54 @@
+// Copyright 2010 Google Inc. All rights reserved.
+//
+// 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.
+
+cc_library_shared {
+    name: "librtp_jni",
+    srcs: [
+        "AudioCodec.cpp",
+        "AudioGroup.cpp",
+        "EchoSuppressor.cpp",
+        "RtpStream.cpp",
+        "util.cpp",
+        "rtp_jni.cpp",
+
+        "AmrCodec.cpp",
+        "G711Codec.cpp",
+        "GsmCodec.cpp",
+    ],
+    shared_libs: [
+        "libnativehelper",
+        "libcutils",
+        "libutils",
+        "liblog",
+        "libaudioclient",
+        "libstagefright_amrnb_common",
+    ],
+    static_libs: [
+        "libgsm",
+        "libstagefright_amrnbdec",
+        "libstagefright_amrnbenc",
+    ],
+    include_dirs: [
+        "frameworks/av/media/libstagefright/codecs/amrnb/enc/src",
+        "frameworks/av/media/libstagefright/codecs/amrnb/dec/src",
+    ],
+    cflags: [
+        "-fvisibility=hidden",
+        "-Wall",
+        "-Wextra",
+        //getInput() is deprecated but we want to continue to track the usage of it elsewhere
+        "-Wno-deprecated-declarations",
+        "-Werror",
+    ],
+}
diff --git a/src/jni/rtp/Android.mk b/src/jni/rtp/Android.mk
deleted file mode 100644
index b564f1b..0000000
--- a/src/jni/rtp/Android.mk
+++ /dev/null
@@ -1,58 +0,0 @@
-#
-# Copyright (C) 2010 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 := $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := librtp_jni
-
-LOCAL_SRC_FILES := \
-	AudioCodec.cpp \
-	AudioGroup.cpp \
-	EchoSuppressor.cpp \
-	RtpStream.cpp \
-	util.cpp \
-	rtp_jni.cpp
-
-LOCAL_SRC_FILES += \
-	AmrCodec.cpp \
-	G711Codec.cpp \
-	GsmCodec.cpp
-
-LOCAL_SHARED_LIBRARIES := \
-	libnativehelper \
-	libcutils \
-	libutils \
-	liblog \
-	libaudioclient \
-	libstagefright_amrnb_common
-
-LOCAL_STATIC_LIBRARIES := libgsm libstagefright_amrnbdec libstagefright_amrnbenc
-
-LOCAL_C_INCLUDES += \
-	$(JNI_H_INCLUDE) \
-	external/libgsm/inc \
-	frameworks/av/media/libstagefright/codecs/amrnb/common/include \
-	frameworks/av/media/libstagefright/codecs/amrnb/common/ \
-	frameworks/av/media/libstagefright/codecs/amrnb/enc/include \
-	frameworks/av/media/libstagefright/codecs/amrnb/enc/src \
-	frameworks/av/media/libstagefright/codecs/amrnb/dec/include \
-	frameworks/av/media/libstagefright/codecs/amrnb/dec/src
-
-# getInput() is deprecated but we want to continue to track the usage of it elsewhere
-LOCAL_CFLAGS += -fvisibility=hidden -Wall -Wextra -Wno-deprecated-declarations -Werror
-
-include $(BUILD_SHARED_LIBRARY)