[Service][VD] Add webapis.getCameraInfo() 90/284090/2
authorChunling Ye <chunling.ye@samsung.com>
Wed, 9 Nov 2022 11:19:41 +0000 (19:19 +0800)
committerChunling Ye <chunling.ye@samsung.com>
Fri, 11 Nov 2022 03:22:04 +0000 (11:22 +0800)
This provides TV CameraInfo for DeviceHome service.

Related chromium-efl patch:
https://review.tizen.org/gerrit/284089/

Change-Id: Ic3414502fdf7f52d41fd626665177d9b71414a10
Signed-off-by: Chunling Ye <chunling.ye@samsung.com>
wrt_app/service/device_api_router.ts

index 16cfa9e..0edc1c0 100644 (file)
@@ -71,6 +71,17 @@ export class DeviceAPIRouter {
         return { images: 'no' };
       }
     }
+    global.webapis.getCameraInfo = () => {
+      try {
+        if (wrt.tv)
+          return wrt.tv.getCameraInfo();
+        else
+          throw 'This API is only for TV profile';
+      } catch(e) {
+        console.debug(`wrt.tv.getCameraInfo() failed, ${e}`);
+        return '{}';
+      }
+    }
     global.webapis.getProfile = () => {
       if (wrt.tv) return 'TV';
       else if (wrt.da) return 'DA';
@@ -110,6 +121,7 @@ export class DeviceAPIRouter {
     Object.defineProperties(global.webapis, {
       getAppIdsByMetadata: { writable: false, enumerable: true },
       getCallerAppId: { writable: false, enumerable: true },
+      getCameraInfo: { writable: false, enumerable: true },
       getPackageId: { writable: false, enumerable: true },
       getPreviewData: { writable: false, enumerable: true },
       getProfile: { writable: false, enumerable: true },