Move NXP JNI and DeviceHost implementation into separate dir.

Preparation for the new NCI stack. The idea is to
build either the NXP or the NCI stack, triggered
by a makefile switch. To that end, move the
DeviceHost and JNI implementations in their own
directory, so we can build them only if needed.

Change-Id: I8579ec30ceb1908e4cd180cfbd10224aa4bddb8d
diff --git a/Android.mk b/Android.mk
index a041854..2cdfc68 100644
--- a/Android.mk
+++ b/Android.mk
@@ -6,6 +6,14 @@
 LOCAL_SRC_FILES := \
         $(call all-java-files-under, src)
 
+ifeq ($(NFC_USE_NCI_STACK), true)
+    LOCAL_SRC_FILES += \
+        $(call all-java-files-under, nci)
+else
+    LOCAL_SRC_FILES += \
+        $(call all-java-files-under, nxp)
+endif
+
 LOCAL_PACKAGE_NAME := Nfc
 LOCAL_CERTIFICATE := platform
 
diff --git a/nxp/Android.mk b/nxp/Android.mk
new file mode 100644
index 0000000..34f4385
--- /dev/null
+++ b/nxp/Android.mk
@@ -0,0 +1,3 @@
+LOCAL_PATH:= $(call my-dir)
+
+include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/jni/Android.mk b/nxp/jni/Android.mk
similarity index 100%
rename from jni/Android.mk
rename to nxp/jni/Android.mk
diff --git a/jni/com_android_nfc.cpp b/nxp/jni/com_android_nfc.cpp
similarity index 100%
rename from jni/com_android_nfc.cpp
rename to nxp/jni/com_android_nfc.cpp
diff --git a/jni/com_android_nfc.h b/nxp/jni/com_android_nfc.h
similarity index 100%
rename from jni/com_android_nfc.h
rename to nxp/jni/com_android_nfc.h
diff --git a/jni/com_android_nfc_NativeLlcpConnectionlessSocket.cpp b/nxp/jni/com_android_nfc_NativeLlcpConnectionlessSocket.cpp
similarity index 100%
rename from jni/com_android_nfc_NativeLlcpConnectionlessSocket.cpp
rename to nxp/jni/com_android_nfc_NativeLlcpConnectionlessSocket.cpp
diff --git a/jni/com_android_nfc_NativeLlcpServiceSocket.cpp b/nxp/jni/com_android_nfc_NativeLlcpServiceSocket.cpp
similarity index 100%
rename from jni/com_android_nfc_NativeLlcpServiceSocket.cpp
rename to nxp/jni/com_android_nfc_NativeLlcpServiceSocket.cpp
diff --git a/jni/com_android_nfc_NativeLlcpSocket.cpp b/nxp/jni/com_android_nfc_NativeLlcpSocket.cpp
similarity index 100%
rename from jni/com_android_nfc_NativeLlcpSocket.cpp
rename to nxp/jni/com_android_nfc_NativeLlcpSocket.cpp
diff --git a/jni/com_android_nfc_NativeNfcManager.cpp b/nxp/jni/com_android_nfc_NativeNfcManager.cpp
similarity index 100%
rename from jni/com_android_nfc_NativeNfcManager.cpp
rename to nxp/jni/com_android_nfc_NativeNfcManager.cpp
diff --git a/jni/com_android_nfc_NativeNfcSecureElement.cpp b/nxp/jni/com_android_nfc_NativeNfcSecureElement.cpp
similarity index 100%
rename from jni/com_android_nfc_NativeNfcSecureElement.cpp
rename to nxp/jni/com_android_nfc_NativeNfcSecureElement.cpp
diff --git a/jni/com_android_nfc_NativeNfcTag.cpp b/nxp/jni/com_android_nfc_NativeNfcTag.cpp
similarity index 100%
rename from jni/com_android_nfc_NativeNfcTag.cpp
rename to nxp/jni/com_android_nfc_NativeNfcTag.cpp
diff --git a/jni/com_android_nfc_NativeP2pDevice.cpp b/nxp/jni/com_android_nfc_NativeP2pDevice.cpp
similarity index 100%
rename from jni/com_android_nfc_NativeP2pDevice.cpp
rename to nxp/jni/com_android_nfc_NativeP2pDevice.cpp
diff --git a/jni/com_android_nfc_list.cpp b/nxp/jni/com_android_nfc_list.cpp
similarity index 100%
rename from jni/com_android_nfc_list.cpp
rename to nxp/jni/com_android_nfc_list.cpp
diff --git a/jni/com_android_nfc_list.h b/nxp/jni/com_android_nfc_list.h
similarity index 100%
rename from jni/com_android_nfc_list.h
rename to nxp/jni/com_android_nfc_list.h
diff --git a/src/com/android/nfc/nxp/NativeLlcpConnectionlessSocket.java b/nxp/src/com/android/nfc/dhimpl/NativeLlcpConnectionlessSocket.java
similarity index 97%
rename from src/com/android/nfc/nxp/NativeLlcpConnectionlessSocket.java
rename to nxp/src/com/android/nfc/dhimpl/NativeLlcpConnectionlessSocket.java
index c9d3b5d..db78496 100755
--- a/src/com/android/nfc/nxp/NativeLlcpConnectionlessSocket.java
+++ b/nxp/src/com/android/nfc/dhimpl/NativeLlcpConnectionlessSocket.java
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package com.android.nfc.nxp;
+package com.android.nfc.dhimpl;
 
 import com.android.nfc.DeviceHost;
 import com.android.nfc.LlcpPacket;
diff --git a/src/com/android/nfc/nxp/NativeLlcpServiceSocket.java b/nxp/src/com/android/nfc/dhimpl/NativeLlcpServiceSocket.java
similarity index 97%
rename from src/com/android/nfc/nxp/NativeLlcpServiceSocket.java
rename to nxp/src/com/android/nfc/dhimpl/NativeLlcpServiceSocket.java
index 531afd8..3a7e57f 100755
--- a/src/com/android/nfc/nxp/NativeLlcpServiceSocket.java
+++ b/nxp/src/com/android/nfc/dhimpl/NativeLlcpServiceSocket.java
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package com.android.nfc.nxp;
+package com.android.nfc.dhimpl;
 
 import com.android.nfc.DeviceHost;
 import com.android.nfc.DeviceHost.LlcpSocket;
diff --git a/src/com/android/nfc/nxp/NativeLlcpSocket.java b/nxp/src/com/android/nfc/dhimpl/NativeLlcpSocket.java
similarity index 98%
rename from src/com/android/nfc/nxp/NativeLlcpSocket.java
rename to nxp/src/com/android/nfc/dhimpl/NativeLlcpSocket.java
index a337d35..69506c5 100755
--- a/src/com/android/nfc/nxp/NativeLlcpSocket.java
+++ b/nxp/src/com/android/nfc/dhimpl/NativeLlcpSocket.java
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package com.android.nfc.nxp;
+package com.android.nfc.dhimpl;
 
 import com.android.nfc.DeviceHost;
 
diff --git a/src/com/android/nfc/nxp/NativeNfcManager.java b/nxp/src/com/android/nfc/dhimpl/NativeNfcManager.java
similarity index 99%
rename from src/com/android/nfc/nxp/NativeNfcManager.java
rename to nxp/src/com/android/nfc/dhimpl/NativeNfcManager.java
index 4bd8c24..f969627 100755
--- a/src/com/android/nfc/nxp/NativeNfcManager.java
+++ b/nxp/src/com/android/nfc/dhimpl/NativeNfcManager.java
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package com.android.nfc.nxp;
+package com.android.nfc.dhimpl;
 
 import com.android.nfc.DeviceHost;
 import com.android.nfc.LlcpException;
diff --git a/src/com/android/nfc/nxp/NativeNfcSecureElement.java b/nxp/src/com/android/nfc/dhimpl/NativeNfcSecureElement.java
similarity index 97%
rename from src/com/android/nfc/nxp/NativeNfcSecureElement.java
rename to nxp/src/com/android/nfc/dhimpl/NativeNfcSecureElement.java
index 88f9b9d..e2d91ec 100755
--- a/src/com/android/nfc/nxp/NativeNfcSecureElement.java
+++ b/nxp/src/com/android/nfc/dhimpl/NativeNfcSecureElement.java
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package com.android.nfc.nxp;
+package com.android.nfc.dhimpl;
 
 import android.content.Context;
 import android.content.SharedPreferences;
diff --git a/src/com/android/nfc/nxp/NativeNfcTag.java b/nxp/src/com/android/nfc/dhimpl/NativeNfcTag.java
similarity index 99%
rename from src/com/android/nfc/nxp/NativeNfcTag.java
rename to nxp/src/com/android/nfc/dhimpl/NativeNfcTag.java
index 8996dfb..eddde94 100755
--- a/src/com/android/nfc/nxp/NativeNfcTag.java
+++ b/nxp/src/com/android/nfc/dhimpl/NativeNfcTag.java
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package com.android.nfc.nxp;
+package com.android.nfc.dhimpl;
 
 import com.android.nfc.DeviceHost.TagEndpoint;
 
diff --git a/src/com/android/nfc/nxp/NativeP2pDevice.java b/nxp/src/com/android/nfc/dhimpl/NativeP2pDevice.java
similarity index 97%
rename from src/com/android/nfc/nxp/NativeP2pDevice.java
rename to nxp/src/com/android/nfc/dhimpl/NativeP2pDevice.java
index 7c7db41..094f46a 100755
--- a/src/com/android/nfc/nxp/NativeP2pDevice.java
+++ b/nxp/src/com/android/nfc/dhimpl/NativeP2pDevice.java
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package com.android.nfc.nxp;
+package com.android.nfc.dhimpl;
 
 import com.android.nfc.DeviceHost.NfcDepEndpoint;
 
diff --git a/src/com/android/nfc/NfcService.java b/src/com/android/nfc/NfcService.java
index 602b25d..3e7a6b5 100755
--- a/src/com/android/nfc/NfcService.java
+++ b/src/com/android/nfc/NfcService.java
@@ -23,8 +23,8 @@
 import com.android.nfc.DeviceHost.NfcDepEndpoint;
 import com.android.nfc.DeviceHost.TagEndpoint;
 import com.android.nfc.handover.HandoverManager;
-import com.android.nfc.nxp.NativeNfcManager;
-import com.android.nfc.nxp.NativeNfcSecureElement;
+import com.android.nfc.dhimpl.NativeNfcManager;
+import com.android.nfc.dhimpl.NativeNfcSecureElement;
 
 import android.app.Application;
 import android.app.KeyguardManager;