stub respects the persistency of a connection

- explicit api to open a conventional hal
- camera hal crash fix
- add init api to the camera hal spec
- compiler generated code checks whether a target api is actually set.

Change-Id: I553ddd2363a4530e3c6f748357364ce1fed98a0a
diff --git a/sysfuzzer/vtscompiler/code_gen/CodeGenBase.cpp b/sysfuzzer/vtscompiler/code_gen/CodeGenBase.cpp
index 285b141..b6c3373 100644
--- a/sysfuzzer/vtscompiler/code_gen/CodeGenBase.cpp
+++ b/sysfuzzer/vtscompiler/code_gen/CodeGenBase.cpp
@@ -143,14 +143,14 @@
 
 
 void CodeGenBase::GenerateCodeToStartMeasurement(std::stringstream& ss) {
-  ss << "VtsMeasurement vts_measurement;" << endl;
-  ss << "vts_measurement.Start();" << endl;
+  ss << "    VtsMeasurement vts_measurement;" << endl;
+  ss << "    vts_measurement.Start();" << endl;
 }
 
 
 void CodeGenBase::GenerateCodeToStopMeasurement(std::stringstream& ss) {
-  ss << "vector<float>* measured = vts_measurement.Stop();" << endl;
-  ss << "cout << \"time \" << (*measured)[0] << endl;" << endl;
+  ss << "    vector<float>* measured = vts_measurement.Stop();" << endl;
+  ss << "    cout << \"time \" << (*measured)[0] << endl;" << endl;
 }
 
 }  // namespace vts