Revert "Pass whether the local device is an atv device to the na..."

Revert "Check whether local device is an ATV device to determine..."

Revert "Pass in extra param as signature of bluetooth init metho..."

Revert submission 12287594-bt-gatt-tv-fix

Reason for revert: Regression in pairing some BLE devices (b/162903202)
Reverted Changes:
If923f2abc:Pass in extra param as signature of bluetooth init...
I6d06f5996:Check whether local device is an ATV device to det...
Ib7575ff3d:Pass whether the local device is an atv device to ...

Bug: 157038281
Test: Manual
Change-Id: I0c1057d890edc69a26959240da3536d7ad63e149
(cherry picked from commit 92116d4dda6a27639b041f495c83f8295223ebc4)
diff --git a/jni/com_android_bluetooth_btservice_AdapterService.cpp b/jni/com_android_bluetooth_btservice_AdapterService.cpp
index 3e4d272..462f195 100644
--- a/jni/com_android_bluetooth_btservice_AdapterService.cpp
+++ b/jni/com_android_bluetooth_btservice_AdapterService.cpp
@@ -680,8 +680,7 @@
 }
 
 static bool initNative(JNIEnv* env, jobject obj, jboolean isGuest,
-                       jboolean isNiapMode, int configCompareResult,
-                       jboolean isAtvDevice) {
+                       jboolean isNiapMode, int configCompareResult) {
   ALOGV("%s", __func__);
 
   android_bluetooth_UidTraffic.clazz =
@@ -697,8 +696,7 @@
 
   int ret = sBluetoothInterface->init(
       &sBluetoothCallbacks, isGuest == JNI_TRUE ? 1 : 0,
-      isNiapMode == JNI_TRUE ? 1 : 0, configCompareResult,
-      isAtvDevice == JNI_TRUE ? 1 : 0);
+      isNiapMode == JNI_TRUE ? 1 : 0, configCompareResult);
   if (ret != BT_STATUS_SUCCESS) {
     ALOGE("Error while setting the callbacks: %d\n", ret);
     sBluetoothInterface = NULL;
@@ -1311,7 +1309,7 @@
 static JNINativeMethod sMethods[] = {
     /* name, signature, funcPtr */
     {"classInitNative", "()V", (void*)classInitNative},
-    {"initNative", "(ZZIZ)Z", (void*)initNative},
+    {"initNative", "(ZZI)Z", (void*)initNative},
     {"cleanupNative", "()V", (void*)cleanupNative},
     {"enableNative", "()Z", (void*)enableNative},
     {"disableNative", "()Z", (void*)disableNative},
diff --git a/src/com/android/bluetooth/btservice/AdapterService.java b/src/com/android/bluetooth/btservice/AdapterService.java
index 6c5a7e6..a5bf8e0 100644
--- a/src/com/android/bluetooth/btservice/AdapterService.java
+++ b/src/com/android/bluetooth/btservice/AdapterService.java
@@ -441,11 +441,7 @@
         mBluetoothKeystoreService = new BluetoothKeystoreService(isNiapMode());
         mBluetoothKeystoreService.start();
         int configCompareResult = mBluetoothKeystoreService.getCompareResult();
-
-        // Android TV doesn't show consent dialogs for just works and encryption only le pairing
-        boolean isAtvDevice = getApplicationContext().getPackageManager().hasSystemFeature(
-                PackageManager.FEATURE_LEANBACK_ONLY);
-        initNative(isGuest(), isNiapMode(), configCompareResult, isAtvDevice);
+        initNative(isGuest(), isNiapMode(), configCompareResult);
         mNativeAvailable = true;
         mCallbacks = new RemoteCallbackList<IBluetoothCallback>();
         mAppOps = getSystemService(AppOpsManager.class);
@@ -3084,7 +3080,7 @@
     static native void classInitNative();
 
     native boolean initNative(boolean startRestricted, boolean isNiapMode,
-            int configCompareResult, boolean isAtvDevice);
+            int configCompareResult);
 
     native void cleanupNative();
 
diff --git a/tests/unit/src/com/android/bluetooth/btservice/AdapterServiceTest.java b/tests/unit/src/com/android/bluetooth/btservice/AdapterServiceTest.java
index b82e554..a7282f5 100644
--- a/tests/unit/src/com/android/bluetooth/btservice/AdapterServiceTest.java
+++ b/tests/unit/src/com/android/bluetooth/btservice/AdapterServiceTest.java
@@ -108,7 +108,7 @@
         Assert.assertNotNull(Looper.myLooper());
         AdapterService adapterService = new AdapterService();
         adapterService.initNative(false /* is_restricted */, false /* is_niap_mode */,
-                0 /* config_compare_result */, false);
+                0 /* config_compare_result */);
         adapterService.cleanupNative();
         HashMap<String, HashMap<String, String>> adapterConfig = TestUtils.readAdapterConfig();
         Assert.assertNotNull(adapterConfig);
diff --git a/tests/unit/src/com/android/bluetooth/btservice/ProfileServiceTest.java b/tests/unit/src/com/android/bluetooth/btservice/ProfileServiceTest.java
index 4648e1f..05a9100 100644
--- a/tests/unit/src/com/android/bluetooth/btservice/ProfileServiceTest.java
+++ b/tests/unit/src/com/android/bluetooth/btservice/ProfileServiceTest.java
@@ -97,7 +97,7 @@
         mProfiles = Config.getSupportedProfiles();
 
         mMockAdapterService.initNative(false /* is_restricted */, false /* is_niap_mode */,
-                0 /* config_compare_result */, false);
+                0 /* config_compare_result */);
 
         TestUtils.setAdapterService(mMockAdapterService);