Fix issues in Tuner Service implementation

This CL fixes the following bugs:
1. Missing Tuner HAL version check API
2. hidl_array init issue when converting ip settings
3. Missing handling the aidl service binding error

Test: atest android.media.tv.tuner.cts
Bug: 159067322
Change-Id: Ib43cedccb062e7849b5133e03c74c58c9e082437
diff --git a/services/tuner/TunerService.h b/services/tuner/TunerService.h
index ce085cb..cc65b39 100644
--- a/services/tuner/TunerService.h
+++ b/services/tuner/TunerService.h
@@ -69,6 +69,10 @@
 
 namespace android {
 
+const static int TUNER_HAL_VERSION_UNKNOWN = 0;
+const static int TUNER_HAL_VERSION_1_0 = 1 << 16;
+const static int TUNER_HAL_VERSION_1_1 = (1 << 16) | 1;
+
 typedef enum {
     FRONTEND,
     LNB,
@@ -93,7 +97,7 @@
 
 public:
     static char const *getServiceName() { return "media.tuner"; }
-    static void instantiate();
+    static binder_status_t instantiate();
     TunerService();
     virtual ~TunerService();
 
@@ -110,6 +114,7 @@
     Status openDescrambler(int32_t descramblerHandle,
             std::shared_ptr<ITunerDescrambler>* _aidl_return) override;
     Status updateTunerResources() override;
+    Status getTunerHalVersion(int* _aidl_return) override;
 
     // TODO: create a map between resource id and handles.
     static int getResourceIdFromHandle(int resourceHandle, int /*type*/) {
@@ -141,6 +146,8 @@
 
     shared_ptr<ITunerResourceManager> mTunerResourceManager;
     int mResourceRequestCount = 0;
+
+    int mTunerVersion = TUNER_HAL_VERSION_UNKNOWN;
 };
 
 } // namespace android