diff --git a/accelerator-home-ui/package-lock.json b/accelerator-home-ui/package-lock.json index d1bab8e6..38ca97a1 100644 --- a/accelerator-home-ui/package-lock.json +++ b/accelerator-home-ui/package-lock.json @@ -9,8 +9,6 @@ "version": "1.0.0", "license": "ISC", "dependencies": { - "@firebolt-js/manage-sdk": "1.1.0", - "@firebolt-js/sdk": "0.15.0", "@hendt/xml2json": "^1.0.3", "@lightningjs/sdk": "^4.8.1", "@lightningjs/ui": "^1.3.7", @@ -21,7 +19,7 @@ "devDependencies": { "@babel/core": "^7.21.5", "babel-eslint": "^10.0.3", - "esbuild": "^0.17.18", + "esbuild": "^0.28.1", "eslint": "^8.39.0", "eslint-config-prettier": "^8.8.0", "eslint-plugin-prettier": "^4.2.1", @@ -30,58 +28,48 @@ "prettier": "^2.8.8" } }, - "node_modules/@ampproject/remapping": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.3.0.tgz", - "integrity": "sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==", - "dev": true, - "dependencies": { - "@jridgewell/gen-mapping": "^0.3.5", - "@jridgewell/trace-mapping": "^0.3.24" - }, - "engines": { - "node": ">=6.0.0" - } - }, "node_modules/@babel/code-frame": { - "version": "7.26.2", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.26.2.tgz", - "integrity": "sha512-RJlIHRueQgwWitWgF8OdFYGZX328Ax5BCemNGlqHfplnRT9ESi8JkFlvaVYbS+UubVY6dpv87Fs2u5M29iNFVQ==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.29.7.tgz", + "integrity": "sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/helper-validator-identifier": "^7.25.9", + "@babel/helper-validator-identifier": "^7.29.7", "js-tokens": "^4.0.0", - "picocolors": "^1.0.0" + "picocolors": "^1.1.1" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/compat-data": { - "version": "7.26.5", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.26.5.tgz", - "integrity": "sha512-XvcZi1KWf88RVbF9wn8MN6tYFloU5qX8KjuF3E1PVBmJ9eypXfs4GRiJwLuTZL0iSnJUKn1BFPa5BPZZJyFzPg==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.29.7.tgz", + "integrity": "sha512-locTkQyKvwIEgBzVrn8693ebc97F2U8ZHjbXwDXJ5Fn2TCpNwTlKcaKLkdHop5c/icOFE7qt7Q9JC5hnKNa6Gg==", "dev": true, + "license": "MIT", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/core": { - "version": "7.26.0", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.26.0.tgz", - "integrity": "sha512-i1SLeK+DzNnQ3LL/CswPCa/E5u4lh1k6IAEphON8F+cXt0t9euTshDru0q7/IqMa1PMPz5RnHuHscF8/ZJsStg==", - "dev": true, - "dependencies": { - "@ampproject/remapping": "^2.2.0", - "@babel/code-frame": "^7.26.0", - "@babel/generator": "^7.26.0", - "@babel/helper-compilation-targets": "^7.25.9", - "@babel/helper-module-transforms": "^7.26.0", - "@babel/helpers": "^7.26.0", - "@babel/parser": "^7.26.0", - "@babel/template": "^7.25.9", - "@babel/traverse": "^7.25.9", - "@babel/types": "^7.26.0", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.29.7.tgz", + "integrity": "sha512-RgHBCvtjbOK2gXSNBNIkNoEc9qoVEtau3hj8gEqKQuL3HZAibKarWFEI3Lfm6EYKkLalOh8eSrj9b+ch9H/VBA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.29.7", + "@babel/generator": "^7.29.7", + "@babel/helper-compilation-targets": "^7.29.7", + "@babel/helper-module-transforms": "^7.29.7", + "@babel/helpers": "^7.29.7", + "@babel/parser": "^7.29.7", + "@babel/template": "^7.29.7", + "@babel/traverse": "^7.29.7", + "@babel/types": "^7.29.7", + "@jridgewell/remapping": "^2.3.5", "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", @@ -97,15 +85,16 @@ } }, "node_modules/@babel/generator": { - "version": "7.26.5", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.26.5.tgz", - "integrity": "sha512-2caSP6fN9I7HOe6nqhtft7V4g7/V/gfDsC3Ag4W7kEzzvRGKqiv0pu0HogPiZ3KaVSoNDhUws6IJjDjpfmYIXw==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.29.7.tgz", + "integrity": "sha512-DkXD5OJQaAQIdZ1bt3UZdEnHAn9Imd3IVBdX03UFe+ony9Ojw5pzr9YVKGDY1jt+Gcn/FnGkNf8r+Vj5NOJWtQ==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/parser": "^7.26.5", - "@babel/types": "^7.26.5", - "@jridgewell/gen-mapping": "^0.3.5", - "@jridgewell/trace-mapping": "^0.3.25", + "@babel/parser": "^7.29.7", + "@babel/types": "^7.29.7", + "@jridgewell/gen-mapping": "^0.3.12", + "@jridgewell/trace-mapping": "^0.3.28", "jsesc": "^3.0.2" }, "engines": { @@ -113,13 +102,14 @@ } }, "node_modules/@babel/helper-compilation-targets": { - "version": "7.26.5", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.26.5.tgz", - "integrity": "sha512-IXuyn5EkouFJscIDuFF5EsiSolseme1s0CZB+QxVugqJLYmKdxI1VfIBOst0SUu4rnk2Z7kqTwmoO1lp3HIfnA==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.29.7.tgz", + "integrity": "sha512-wem6WaBj4NaVYVdNhLPPVacES6ZJ+KBBfSkTMD3YZxbP3rm3Di85tJU5ljaUNhaOynt+Aj0xruhYuzQBt8n71g==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/compat-data": "^7.26.5", - "@babel/helper-validator-option": "^7.25.9", + "@babel/compat-data": "^7.29.7", + "@babel/helper-validator-option": "^7.29.7", "browserslist": "^4.24.0", "lru-cache": "^5.1.1", "semver": "^6.3.1" @@ -128,28 +118,40 @@ "node": ">=6.9.0" } }, + "node_modules/@babel/helper-globals": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-globals/-/helper-globals-7.29.7.tgz", + "integrity": "sha512-3nQVUAtvkKH9zahfWgw96Jc/uFOmjACE1kQz82E2lqWmHBgjzbNlsC22nuQTfahmWeQtTq5nQ/4Nnd2A1wj4zA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, "node_modules/@babel/helper-module-imports": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.25.9.tgz", - "integrity": "sha512-tnUA4RsrmflIM6W6RFTLFSXITtl0wKjgpnLgXyowocVPrbYrLUXSBXDgTs8BlbmIzIdlBySRQjINYs2BAkiLtw==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.29.7.tgz", + "integrity": "sha512-ejHwrQQYcm9xnTivShn2IDOlIzInN34AXskvq9QicvCtEzq1Vzclu/tKF8Jq1Cg8JG2GL6/EmjgsCT7lXepE3g==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/traverse": "^7.25.9", - "@babel/types": "^7.25.9" + "@babel/traverse": "^7.29.7", + "@babel/types": "^7.29.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-module-transforms": { - "version": "7.26.0", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.26.0.tgz", - "integrity": "sha512-xO+xu6B5K2czEnQye6BHA7DolFFmS3LB7stHZFaOLb1pAwO1HWLS8fXA+eh0A2yIvltPVmx3eNNDBJA2SLHXFw==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.29.7.tgz", + "integrity": "sha512-UPUVSyXbOh627KiCIGQSgwWzGeBKLkaJ9PJEdrngIwMSzxLR4jS4+f1f1jb7VzBbg8nFLaYotvVPFCTqdrmTAg==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/helper-module-imports": "^7.25.9", - "@babel/helper-validator-identifier": "^7.25.9", - "@babel/traverse": "^7.25.9" + "@babel/helper-module-imports": "^7.29.7", + "@babel/helper-validator-identifier": "^7.29.7", + "@babel/traverse": "^7.29.7" }, "engines": { "node": ">=6.9.0" @@ -159,52 +161,57 @@ } }, "node_modules/@babel/helper-string-parser": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.25.9.tgz", - "integrity": "sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.29.7.tgz", + "integrity": "sha512-Pb5ijPrZ89GDH8223L4UP8i6QApWxs04RbPQJTeWDV0/keR2E36MeKnyr6LYmUUvqRRI+Iv87SuF1W6ErINzYw==", "dev": true, + "license": "MIT", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.9.tgz", - "integrity": "sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.29.7.tgz", + "integrity": "sha512-qehxGkRj55h/ff8EMaJ+cYhyaKlHIxqYDn682wQD7RNp9UujOQsHog2uS0r2vzr4pW+sXf90NeeayjcNaX3fFg==", "dev": true, + "license": "MIT", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-validator-option": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.25.9.tgz", - "integrity": "sha512-e/zv1co8pp55dNdEcCynfj9X7nyUKUXoUEwfXqaZt0omVOmDe9oOTdKStH4GmAw6zxMFs50ZayuMfHDKlO7Tfw==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.29.7.tgz", + "integrity": "sha512-N9ZErrD+yW5geCDtBqnOoxmR8+tNKiGuxKlDpuJxfsqpa2dFcexaziGAE/qoHLiDDreVNMupxGmSoNlyvsA3gw==", "dev": true, + "license": "MIT", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helpers": { - "version": "7.26.0", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.26.0.tgz", - "integrity": "sha512-tbhNuIxNcVb21pInl3ZSjksLCvgdZy9KwJ8brv993QtIVKJBBkYXz4q4ZbAv31GdnC+R90np23L5FbEBlthAEw==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.29.7.tgz", + "integrity": "sha512-1k2lAGRMfHTcwuNYcCNUmaUffmQv8KWMfh2iJUUeRlwlwH4FdNG7mfPI10NPfLHJFThE4Tyr4mv7kTNZOiPuBg==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/template": "^7.25.9", - "@babel/types": "^7.26.0" + "@babel/template": "^7.29.7", + "@babel/types": "^7.29.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/parser": { - "version": "7.26.5", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.26.5.tgz", - "integrity": "sha512-SRJ4jYmXRqV1/Xc+TIVG84WjHBXKlxO9sHQnA2Pf12QQEAp1LOh6kDzNHXcUnbH1QI0FDoPPVOt+vyUDucxpaw==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.29.7.tgz", + "integrity": "sha512-hnORnjP/1P/zFEndoeX+n+t1RwWRJiJpM/jO7FW32Kn9r5+sJB2JWOdYo4L6k78j15eCwY3Gm/7364B1EMwtNg==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/types": "^7.26.5" + "@babel/types": "^7.29.7" }, "bin": { "parser": "bin/babel-parser.js" @@ -224,416 +231,502 @@ } }, "node_modules/@babel/runtime": { - "version": "7.26.0", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.26.0.tgz", - "integrity": "sha512-FDSOghenHTiToteC/QRlv2q3DhPZ/oOXTBoirfWNx1Cx3TMVcGWQtMMmQcSvb/JjpNeGzx8Pq/b4fKEJuWm1sw==", - "dependencies": { - "regenerator-runtime": "^0.14.0" - }, + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.29.7.tgz", + "integrity": "sha512-Nq8OhGWiZIZGV6hLHoyAKLLcJihP/xFeBMGJoUrxTX2psI8dCifzLhZISFb+VWS3wFMRDmCGw5R+dOySCqPLhw==", + "license": "MIT", "engines": { "node": ">=6.9.0" } }, - "node_modules/@babel/runtime/node_modules/regenerator-runtime": { - "version": "0.14.1", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz", - "integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==" - }, "node_modules/@babel/template": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.25.9.tgz", - "integrity": "sha512-9DGttpmPvIxBb/2uwpVo3dqJ+O6RooAFOS+lB+xDqoE2PVCE8nfoHMdZLpfCQRLwvohzXISPZcgxt80xLfsuwg==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.29.7.tgz", + "integrity": "sha512-puq+Gf35oI24FeN11LkoUQFqv9uwNeWpxXZi/Ji3rRIoKAzKnxRaZ+Gkj0vKS9ZCiTESfng1N9LyOyXvo+m+Gg==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/code-frame": "^7.25.9", - "@babel/parser": "^7.25.9", - "@babel/types": "^7.25.9" + "@babel/code-frame": "^7.29.7", + "@babel/parser": "^7.29.7", + "@babel/types": "^7.29.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/traverse": { - "version": "7.26.5", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.26.5.tgz", - "integrity": "sha512-rkOSPOw+AXbgtwUga3U4u8RpoK9FEFWBNAlTpcnkLFjL5CT+oyHNuUUC/xx6XefEJ16r38r8Bc/lfp6rYuHeJQ==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.29.7.tgz", + "integrity": "sha512-EhlfNQtZ+NK22w5BM61ciuiq1m58ed33Wr1Xan//ZRTy6hgjnwyCffRYwzsGXdASJSUJ1guZILsErh1eQcl+zw==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/code-frame": "^7.26.2", - "@babel/generator": "^7.26.5", - "@babel/parser": "^7.26.5", - "@babel/template": "^7.25.9", - "@babel/types": "^7.26.5", - "debug": "^4.3.1", - "globals": "^11.1.0" + "@babel/code-frame": "^7.29.7", + "@babel/generator": "^7.29.7", + "@babel/helper-globals": "^7.29.7", + "@babel/parser": "^7.29.7", + "@babel/template": "^7.29.7", + "@babel/types": "^7.29.7", + "debug": "^4.3.1" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/types": { - "version": "7.26.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.26.5.tgz", - "integrity": "sha512-L6mZmwFDK6Cjh1nRCLXpa6no13ZIioJDz7mdkzHv399pThrTa/k0nUlNaenOeh2kWu/iaOQYElEpKPUswUa9Vg==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.29.7.tgz", + "integrity": "sha512-4zBIxpPzowiZpusoFkyGVwakdRJUyuH5PxQ/PrqghfdFWWasvnCdPfQXHrenDai+gyLARulZjZowCOj6fjT4pA==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/helper-string-parser": "^7.25.9", - "@babel/helper-validator-identifier": "^7.25.9" + "@babel/helper-string-parser": "^7.29.7", + "@babel/helper-validator-identifier": "^7.29.7" }, "engines": { "node": ">=6.9.0" } }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.28.1.tgz", + "integrity": "sha512-Svl7tq8k/08+p6CXPpRjQ1fKX+1odH/BQbb48fV6fj3CWHhsoIOoY87w1oHXm0qEpkIK3ZfVgp0hed3XBXzXMQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=18" + } + }, "node_modules/@esbuild/android-arm": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.17.19.tgz", - "integrity": "sha512-rIKddzqhmav7MSmoFCmDIb6e2W57geRsM94gV2l38fzhXMwq7hZoClug9USI2pFRGL06f4IOPHHpFNOkWieR8A==", + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.28.1.tgz", + "integrity": "sha512-0k2F129Xdio1TdJfzJ8sy1Q47vUD2NnwdhiAf7drUN1EBTfPf4hsFCtmMgu/6m8JSzsBrlmVjudMBQqOfG8usQ==", "cpu": [ "arm" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "android" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/android-arm64": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.17.19.tgz", - "integrity": "sha512-KBMWvEZooR7+kzY0BtbTQn0OAYY7CsiydT63pVEaPtVYF0hXbUaOyZog37DKxK7NF3XacBJOpYT4adIJh+avxA==", + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.28.1.tgz", + "integrity": "sha512-34EGEbCIAgosYz6goLcopX6Mo7NyGv9tfwEM2/7Ce2VcVRk568iSvniGWcUXIy7wEDR1wzolcxcriFVrWYcwBg==", "cpu": [ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "android" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/android-x64": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.17.19.tgz", - "integrity": "sha512-uUTTc4xGNDT7YSArp/zbtmbhO0uEEK9/ETW29Wk1thYUJBz3IVnvgEiEwEa9IeLyvnpKrWK64Utw2bgUmDveww==", + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.28.1.tgz", + "integrity": "sha512-dbwY7ltSMDWsRatcRpCnES4F+im88OCUgGZjy52shC7GqHRE/cYlxNbB4Z4UpJswpcc4Qxd2oE/ufM0p61IKng==", "cpu": [ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "android" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/darwin-arm64": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.17.19.tgz", - "integrity": "sha512-80wEoCfF/hFKM6WE1FyBHc9SfUblloAWx6FJkFWTWiCoht9Mc0ARGEM47e67W9rI09YoUxJL68WHfDRYEAvOhg==", + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.28.1.tgz", + "integrity": "sha512-TZbWkQY7kvTAXbXUT7uVACR5cMHsDiSz9z7ZKAX/RTq/WJEk3QyRr0wZpNhBDX+/0CtdqUIJlOiodQcta6tY3Q==", "cpu": [ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "darwin" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/darwin-x64": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.17.19.tgz", - "integrity": "sha512-IJM4JJsLhRYr9xdtLytPLSH9k/oxR3boaUIYiHkAawtwNOXKE8KoU8tMvryogdcT8AU+Bflmh81Xn6Q0vTZbQw==", + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.28.1.tgz", + "integrity": "sha512-zfdzgK9ACBNZLI/CyHTOx81SyNbM6YXn7rxSgX97VjyiPl9W1i4Ka4fgKECEoFCKGpvBj5qArWIGgQjOwkgskQ==", "cpu": [ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "darwin" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/freebsd-arm64": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.17.19.tgz", - "integrity": "sha512-pBwbc7DufluUeGdjSU5Si+P3SoMF5DQ/F/UmTSb8HXO80ZEAJmrykPyzo1IfNbAoaqw48YRpv8shwd1NoI0jcQ==", + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.28.1.tgz", + "integrity": "sha512-wG2EA8ENdEI0qhkSZMjfqrdY+ziCYCPMmtZjjIwOmXFjmyzEHn+UUxk5of+SYsjtfs3VpnlC7QLzSI5hY/rOAw==", "cpu": [ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "freebsd" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/freebsd-x64": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.17.19.tgz", - "integrity": "sha512-4lu+n8Wk0XlajEhbEffdy2xy53dpR06SlzvhGByyg36qJw6Kpfk7cp45DR/62aPH9mtJRmIyrXAS5UWBrJT6TQ==", + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.28.1.tgz", + "integrity": "sha512-i7dZ9vQgnvSCzi/rYCXNgtF/U+eKZNJBzu3eTQbRgHnM7tNSizLOkRFAl3qzVc/Op/u5YkHHa4pf/3DOYHthLQ==", "cpu": [ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "freebsd" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-arm": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.17.19.tgz", - "integrity": "sha512-cdmT3KxjlOQ/gZ2cjfrQOtmhG4HJs6hhvm3mWSRDPtZ/lP5oe8FWceS10JaSJC13GBd4eH/haHnqf7hhGNLerA==", + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.28.1.tgz", + "integrity": "sha512-qVXBOHQS+d5Y722GwJzJUtOLlX7km3CraOaGormF1pDtPd2C/l1SHRPgjLunLGe51Sh5YYWKMFDyV4SxgMQYTQ==", "cpu": [ "arm" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-arm64": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.17.19.tgz", - "integrity": "sha512-ct1Tg3WGwd3P+oZYqic+YZF4snNl2bsnMKRkb3ozHmnM0dGWuxcPTTntAF6bOP0Sp4x0PjSF+4uHQ1xvxfRKqg==", + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.28.1.tgz", + "integrity": "sha512-yHs+0uc8+nvEAfAfxrWQKK5peSNzBc4PegcMO0EJ2hT71uA7vB8Ihg2e77R2P7SG5uYjPbHlLLmve4LLLRCf0g==", "cpu": [ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-ia32": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.17.19.tgz", - "integrity": "sha512-w4IRhSy1VbsNxHRQpeGCHEmibqdTUx61Vc38APcsRbuVgK0OPEnQ0YD39Brymn96mOx48Y2laBQGqgZ0j9w6SQ==", + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.28.1.tgz", + "integrity": "sha512-d1z4ZuP0ajrfz/FhGT4vv278rX8KnPPJx8i5+AtK7TYbx9Le9F1hyzurZpkEyjkGa9dUGhQow4C1NmeGvqxN2w==", "cpu": [ "ia32" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-loong64": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.17.19.tgz", - "integrity": "sha512-2iAngUbBPMq439a+z//gE+9WBldoMp1s5GWsUSgqHLzLJ9WoZLZhpwWuym0u0u/4XmZ3gpHmzV84PonE+9IIdQ==", + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.28.1.tgz", + "integrity": "sha512-M5sRjUVZrkm1OAPR3dlOYzNmN+loZKGVi1VUQGrwuqLcbR6qeAz+famMhjASeH3YVKvZz+zT1jlh/keC3Rj/lg==", "cpu": [ "loong64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-mips64el": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.17.19.tgz", - "integrity": "sha512-LKJltc4LVdMKHsrFe4MGNPp0hqDFA1Wpt3jE1gEyM3nKUvOiO//9PheZZHfYRfYl6AwdTH4aTcXSqBerX0ml4A==", + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.28.1.tgz", + "integrity": "sha512-mRObBZeHh2OxcBFPWE/FjylkRgZdYuiTR3vaTozquCGOH14iP9oN4x4Ge81CoIDYQrXmIxpFumJBu5MtZpnQJQ==", "cpu": [ "mips64el" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-ppc64": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.17.19.tgz", - "integrity": "sha512-/c/DGybs95WXNS8y3Ti/ytqETiW7EU44MEKuCAcpPto3YjQbyK3IQVKfF6nbghD7EcLUGl0NbiL5Rt5DMhn5tg==", + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.28.1.tgz", + "integrity": "sha512-slScBsMAb3GFDcdrCgLwZtPYRoH2H/youv10QiZyRjmsP48fznoveWytSgCI/R0ZcUgpc0ZhIUEx6LHts8yrfQ==", "cpu": [ "ppc64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-riscv64": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.17.19.tgz", - "integrity": "sha512-FC3nUAWhvFoutlhAkgHf8f5HwFWUL6bYdvLc/TTuxKlvLi3+pPzdZiFKSWz/PF30TB1K19SuCxDTI5KcqASJqA==", + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.28.1.tgz", + "integrity": "sha512-kw0owk1o0GFETUJyW0jc0G4Yzs0BHZn0JDZ8JRT088vjJYX777BAs1fDGxAC+q831qOs2DTC96mNsG2opdfyyQ==", "cpu": [ "riscv64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-s390x": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.17.19.tgz", - "integrity": "sha512-IbFsFbxMWLuKEbH+7sTkKzL6NJmG2vRyy6K7JJo55w+8xDk7RElYn6xvXtDW8HCfoKBFK69f3pgBJSUSQPr+4Q==", + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.28.1.tgz", + "integrity": "sha512-/lAIjX8aYFRByhh6L5rYtPEDRqa9de/4V/juOXcta5frjvzXO4/sqEtyytse0g3zZFuWu5cDN0MkLz2qRDD2Ag==", "cpu": [ "s390x" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-x64": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.17.19.tgz", - "integrity": "sha512-68ngA9lg2H6zkZcyp22tsVt38mlhWde8l3eJLWkyLrp4HwMUr3c1s/M2t7+kHIhvMjglIBrFpncX1SzMckomGw==", + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.28.1.tgz", + "integrity": "sha512-u/anNYF2mmVOEDwLtnQ1wOr3EZ9sTNGLWrsYGYwHWzGA3Si84IOkHXlbWTD1NB+9/1lcnweYKO54uhxZydNzfA==", "cpu": [ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-arm64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.28.1.tgz", + "integrity": "sha512-oks0DYbLwWMmaakTsCb+zL4E+aHRVLom9IJZOAthMQEPiQmydXHkziYEsGYRx0uNV/IjEKGAV941JzH02pflqw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" } }, "node_modules/@esbuild/netbsd-x64": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.17.19.tgz", - "integrity": "sha512-CwFq42rXCR8TYIjIfpXCbRX0rp1jo6cPIUPSaWwzbVI4aOfX96OXY8M6KNmtPcg7QjYeDmN+DD0Wp3LaBOLf4Q==", + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.28.1.tgz", + "integrity": "sha512-aeL6lAnN89Hz43Mlh1G8ARasbuoYvSITDEx0tHh5b7jJnHcssqgjy9Yx430GDpmCa6OyrKoS0aNRjKundRizGg==", "cpu": [ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "netbsd" ], "engines": { - "node": ">=12" + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-arm64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.28.1.tgz", + "integrity": "sha512-MEFJe5C3R8pwXdZ5Y21oo6m7ePiS0d9pWucn99O/wvyJZChoIQKrQDxKrGeW8F5+T0okTHesAmDeiHDTIq0V/Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" } }, "node_modules/@esbuild/openbsd-x64": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.17.19.tgz", - "integrity": "sha512-cnq5brJYrSZ2CF6c35eCmviIN3k3RczmHz8eYaVlNasVqsNY+JKohZU5MKmaOI+KkllCdzOKKdPs762VCPC20g==", + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.28.1.tgz", + "integrity": "sha512-i/ZLIOafE0Z8cI/XANJAixoJL/uRAoS2xOA3rb0xN+KK0K177cMAsQYkzHtBrtMXAKuAc7HGgcWiZ/sRC1Nxgw==", "cpu": [ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "openbsd" ], "engines": { - "node": ">=12" + "node": ">=18" + } + }, + "node_modules/@esbuild/openharmony-arm64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.28.1.tgz", + "integrity": "sha512-ge+Z7EXFNt2BO1oAMsVpiQ8EwndV9i1xXerAeTIK7AtPs3bKFXQM7nlRxDSIUIMeueR1CNXxqztLzdNeReKBJg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": ">=18" } }, "node_modules/@esbuild/sunos-x64": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.17.19.tgz", - "integrity": "sha512-vCRT7yP3zX+bKWFeP/zdS6SqdWB8OIpaRq/mbXQxTGHnIxspRtigpkUcDMlSCOejlHowLqII7K2JKevwyRP2rg==", + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.28.1.tgz", + "integrity": "sha512-BEjgtECkL3vY+SaSQ6nzVfiALUeFxpawyp8Jmf5PtYhf1Ug40N1h/hxlhts+f1FvSvarEigdxS3BlSMI2PJLcQ==", "cpu": [ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "sunos" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/win32-arm64": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.17.19.tgz", - "integrity": "sha512-yYx+8jwowUstVdorcMdNlzklLYhPxjniHWFKgRqH7IFlUEa0Umu3KuYplf1HUZZ422e3NU9F4LGb+4O0Kdcaag==", + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.28.1.tgz", + "integrity": "sha512-lCv9eK/H6ZJWbE7bh2nw54CZ9M2nupBxJcTsdk/QQnWkdSjKGuxmmH8/GWrlT1eMmZfn4dGcCjRte397WqfQXA==", "cpu": [ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "win32" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/win32-ia32": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.17.19.tgz", - "integrity": "sha512-eggDKanJszUtCdlVs0RB+h35wNlb5v4TWEkq4vZcmVt5u/HiDZrTXe2bWFQUez3RgNHwx/x4sk5++4NSSicKkw==", + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.28.1.tgz", + "integrity": "sha512-zvb/mB2bSCoJOpoCBgYKKpX6YM6mJBlBUVUtVj41DlZJVEB6/0CKlRYxP5wWl1C1ILiCoAU5wZZ4q1P3qeS6Eg==", "cpu": [ "ia32" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "win32" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/win32-x64": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.17.19.tgz", - "integrity": "sha512-lAhycmKnVOuRYNtRtatQR1LPQf2oYCkRGkSFnseDAKPl8lu5SOsK/e1sXe5a0Pc5kHIHe6P2I/ilntNv2xf3cA==", + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.28.1.tgz", + "integrity": "sha512-bm4Mowrv+GXMlpWX++EcXw/iLyd1o3+bJkC2DkWXYVvgZCqD/bSj9ctZeAMC3cIxgjRVR2Dufaiu4YPxr5gW1A==", "cpu": [ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "win32" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@eslint-community/eslint-utils": { @@ -734,16 +827,6 @@ "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, - "node_modules/@firebolt-js/manage-sdk": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@firebolt-js/manage-sdk/-/manage-sdk-1.1.0.tgz", - "integrity": "sha512-zELL01GeHh4bDqQIoqgIkT+CcQKsD4DmJSLeFklGIAZg2fD5Xl7DW+dQxqKSmlentlbr3+hIArcGvk87RnzCmQ==" - }, - "node_modules/@firebolt-js/sdk": { - "version": "0.15.0", - "resolved": "https://registry.npmjs.org/@firebolt-js/sdk/-/sdk-0.15.0.tgz", - "integrity": "sha512-Eke20md/Goon/HMSwO7pKUF9mj8cI74Bp5+URWphv07JeV+fRLYBY3DX0Pq8Sni7jWYoIVlcndJrXGD+v8zEJA==" - }, "node_modules/@hendt/xml2json": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/@hendt/xml2json/-/xml2json-1.0.3.tgz", @@ -785,17 +868,25 @@ "dev": true }, "node_modules/@jridgewell/gen-mapping": { - "version": "0.3.8", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.8.tgz", - "integrity": "sha512-imAbBGkb+ebQyxKgzv5Hu2nmROxoDOXHh80evxdoXNOrvAnVx7zimzc1Oo5h9RlfV4vPXaE2iM5pOFbvOCClWA==", + "version": "0.3.13", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz", + "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==", "dev": true, + "license": "MIT", "dependencies": { - "@jridgewell/set-array": "^1.2.1", - "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/sourcemap-codec": "^1.5.0", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/remapping": { + "version": "2.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/remapping/-/remapping-2.3.5.tgz", + "integrity": "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", "@jridgewell/trace-mapping": "^0.3.24" - }, - "engines": { - "node": ">=6.0.0" } }, "node_modules/@jridgewell/resolve-uri": { @@ -803,30 +894,24 @@ "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", "dev": true, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@jridgewell/set-array": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", - "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", - "dev": true, + "license": "MIT", "engines": { "node": ">=6.0.0" } }, "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz", - "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==", - "dev": true + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", + "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==", + "dev": true, + "license": "MIT" }, "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.25", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", - "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", + "version": "0.3.31", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz", + "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==", "dev": true, + "license": "MIT", "dependencies": { "@jridgewell/resolve-uri": "^3.1.0", "@jridgewell/sourcemap-codec": "^1.4.14" @@ -946,10 +1031,11 @@ } }, "node_modules/ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "version": "6.15.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.15.0.tgz", + "integrity": "sha512-fgFx7Hfoq60ytK2c7DhnF8jIvzYgOMxfugjLOSMHjLIPgenqa7S7oaagATUq99mV6IYvN2tRmC0wnTYX6iPbMw==", "dev": true, + "license": "MIT", "dependencies": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", @@ -1032,10 +1118,24 @@ "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" }, + "node_modules/baseline-browser-mapping": { + "version": "2.10.43", + "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.10.43.tgz", + "integrity": "sha512-AjYpR78kDWAY3Efj+cDTFH9t9SCoL7OoTp1BOb0mQV7S+6CiLwnWM3FyxhJtdPufDFKzmCSFoUncKjWgJEZTCQ==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "baseline-browser-mapping": "dist/cli.cjs" + }, + "engines": { + "node": ">=6.0.0" + } + }, "node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "version": "1.1.16", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.16.tgz", + "integrity": "sha512-IDw48K2/2kRkg9LdJxurvq3lV3aBgq0REY89duEqFRthjlPdXHKMj7EnQOXVckxzgisinf3nHfrcE2FufFLXMw==", + "license": "MIT", "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -1054,9 +1154,9 @@ } }, "node_modules/browserslist": { - "version": "4.24.4", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.24.4.tgz", - "integrity": "sha512-KDi1Ny1gSePi1vm0q4oxSF8b4DR44GF4BbmS2YdhPLOEqd8pDviZOGH/GsmRwoWJ2+5Lr085X7naowMwKHDG1A==", + "version": "4.28.6", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.28.6.tgz", + "integrity": "sha512-FQBYNK15VMslhLHpA7+n+n1GOlF1kId2xcCg7/j95f24AOF6VDYMNH4mFxF7KuaTdv627faazpOAjFzMrfJOUw==", "dev": true, "funding": [ { @@ -1072,11 +1172,13 @@ "url": "https://github.com/sponsors/ai" } ], + "license": "MIT", "dependencies": { - "caniuse-lite": "^1.0.30001688", - "electron-to-chromium": "^1.5.73", - "node-releases": "^2.0.19", - "update-browserslist-db": "^1.1.1" + "baseline-browser-mapping": "^2.10.42", + "caniuse-lite": "^1.0.30001803", + "electron-to-chromium": "^1.5.389", + "node-releases": "^2.0.51", + "update-browserslist-db": "^1.2.3" }, "bin": { "browserslist": "cli.js" @@ -1095,9 +1197,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001695", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001695.tgz", - "integrity": "sha512-vHyLade6wTgI2u1ec3WQBxv+2BrTERV28UXQu9LO6lZ9pYeMk34vjXFLOxo1A4UBA8XTL4njRQZdno/yYaSmWw==", + "version": "1.0.30001805", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001805.tgz", + "integrity": "sha512-52noaS3DubycKSXaU30TwPGIp+POyQSUVa5jBEq3vkRkY0kjyb3LQgvhU6WGyCcyXqVLWO0Cw0Q6BSdD0kUfVA==", "dev": true, "funding": [ { @@ -1112,7 +1214,8 @@ "type": "github", "url": "https://github.com/sponsors/ai" } - ] + ], + "license": "CC-BY-4.0" }, "node_modules/chalk": { "version": "4.1.2", @@ -1281,10 +1384,11 @@ "dev": true }, "node_modules/electron-to-chromium": { - "version": "1.5.84", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.84.tgz", - "integrity": "sha512-I+DQ8xgafao9Ha6y0qjHHvpZ9OfyA1qKlkHkjywxzniORU2awxyz7f/iVJcULmrF2yrM3nHQf+iDjJtbbexd/g==", - "dev": true + "version": "1.5.389", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.389.tgz", + "integrity": "sha512-cEto7aeOqBfU1D+c5py5pE+ooscKE75JifxLBdFUZsqAxRS6y7kebtxAZvICszSl05gPjYHDTjY+lXpyGvpJbg==", + "dev": true, + "license": "ISC" }, "node_modules/emoji-regex": { "version": "9.2.2", @@ -1293,40 +1397,45 @@ "dev": true }, "node_modules/esbuild": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.17.19.tgz", - "integrity": "sha512-XQ0jAPFkK/u3LcVRcvVHQcTIqD6E2H1fvZMA5dQPSOWb3suUbWbfbRf94pjc0bNzRYLfIrDRQXr7X+LHIm5oHw==", + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.28.1.tgz", + "integrity": "sha512-HrJrvZv5ayxBzPfwphOoNzkzOIIlifzk0KJrGK2c8R4+LKpMtpYLQeUdjnwjWv/LZlkH2laZk+4w78pi99D4Vw==", "dev": true, "hasInstallScript": true, + "license": "MIT", "bin": { "esbuild": "bin/esbuild" }, "engines": { - "node": ">=12" + "node": ">=18" }, "optionalDependencies": { - "@esbuild/android-arm": "0.17.19", - "@esbuild/android-arm64": "0.17.19", - "@esbuild/android-x64": "0.17.19", - "@esbuild/darwin-arm64": "0.17.19", - "@esbuild/darwin-x64": "0.17.19", - "@esbuild/freebsd-arm64": "0.17.19", - "@esbuild/freebsd-x64": "0.17.19", - "@esbuild/linux-arm": "0.17.19", - "@esbuild/linux-arm64": "0.17.19", - "@esbuild/linux-ia32": "0.17.19", - "@esbuild/linux-loong64": "0.17.19", - "@esbuild/linux-mips64el": "0.17.19", - "@esbuild/linux-ppc64": "0.17.19", - "@esbuild/linux-riscv64": "0.17.19", - "@esbuild/linux-s390x": "0.17.19", - "@esbuild/linux-x64": "0.17.19", - "@esbuild/netbsd-x64": "0.17.19", - "@esbuild/openbsd-x64": "0.17.19", - "@esbuild/sunos-x64": "0.17.19", - "@esbuild/win32-arm64": "0.17.19", - "@esbuild/win32-ia32": "0.17.19", - "@esbuild/win32-x64": "0.17.19" + "@esbuild/aix-ppc64": "0.28.1", + "@esbuild/android-arm": "0.28.1", + "@esbuild/android-arm64": "0.28.1", + "@esbuild/android-x64": "0.28.1", + "@esbuild/darwin-arm64": "0.28.1", + "@esbuild/darwin-x64": "0.28.1", + "@esbuild/freebsd-arm64": "0.28.1", + "@esbuild/freebsd-x64": "0.28.1", + "@esbuild/linux-arm": "0.28.1", + "@esbuild/linux-arm64": "0.28.1", + "@esbuild/linux-ia32": "0.28.1", + "@esbuild/linux-loong64": "0.28.1", + "@esbuild/linux-mips64el": "0.28.1", + "@esbuild/linux-ppc64": "0.28.1", + "@esbuild/linux-riscv64": "0.28.1", + "@esbuild/linux-s390x": "0.28.1", + "@esbuild/linux-x64": "0.28.1", + "@esbuild/netbsd-arm64": "0.28.1", + "@esbuild/netbsd-x64": "0.28.1", + "@esbuild/openbsd-arm64": "0.28.1", + "@esbuild/openbsd-x64": "0.28.1", + "@esbuild/openharmony-arm64": "0.28.1", + "@esbuild/sunos-x64": "0.28.1", + "@esbuild/win32-arm64": "0.28.1", + "@esbuild/win32-ia32": "0.28.1", + "@esbuild/win32-x64": "0.28.1" } }, "node_modules/escalade": { @@ -1334,6 +1443,7 @@ "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", "dev": true, + "license": "MIT", "engines": { "node": ">=6" } @@ -1691,10 +1801,11 @@ } }, "node_modules/flatted": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.2.tgz", - "integrity": "sha512-AiwGJM8YcNOaobumgtng+6NHuOqC3A7MixFeDafM3X9cIUM+xUXoS5Vfgf+OihAYe20fxqNM9yPBXJzRtZ/4eA==", - "dev": true + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.4.2.tgz", + "integrity": "sha512-PjDse7RzhcPkIJwy5t7KPWQSZ9cAbzQXcafsetQoD7sOJRQlGikNbx7yZp2OotDnJyrDcbyRq3Ttb18iYOqkxA==", + "dev": true, + "license": "ISC" }, "node_modules/fs.realpath": { "version": "1.0.0", @@ -1762,15 +1873,6 @@ "node": ">=10.13.0" } }, - "node_modules/globals": { - "version": "11.12.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", - "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", - "dev": true, - "engines": { - "node": ">=4" - } - }, "node_modules/graphemer": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", @@ -1968,10 +2070,21 @@ "dev": true }, "node_modules/js-yaml": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", - "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.3.0.tgz", + "integrity": "sha512-1td788aAnnZ5qs7V2QIRl1owjtYpbKt749Y3xauqQgwIIGF/xXWz1wMTEBx5O3LK3lXLVuqXPdPxj2BoFHaW9Q==", "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/puzrin" + }, + { + "type": "github", + "url": "https://github.com/sponsors/nodeca" + } + ], + "license": "MIT", "dependencies": { "argparse": "^2.0.1" }, @@ -2217,6 +2330,7 @@ "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", "dev": true, + "license": "ISC", "dependencies": { "yallist": "^3.0.2" } @@ -2253,9 +2367,10 @@ } }, "node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz", + "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==", + "license": "ISC", "dependencies": { "brace-expansion": "^1.1.7" }, @@ -2276,10 +2391,14 @@ "dev": true }, "node_modules/node-releases": { - "version": "2.0.19", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.19.tgz", - "integrity": "sha512-xxOWJsBKtzAq7DY0J+DTzuz58K8e7sJbdgwkbMWQe8UYB6ekmsQ45q0M/tJDsGaZmbC+l7n57UV8Hl5tHxO9uw==", - "dev": true + "version": "2.0.51", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.51.tgz", + "integrity": "sha512-wRNIrw4DmVLKQlbgOMdkMx27Wrpzes2hh5Jtbi2bjPd+4wJstWIqP5A+lscnqbm0xxmT5Bpg8Lec5ItEBwx6BQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + } }, "node_modules/npm-run-path": { "version": "5.3.0", @@ -2428,10 +2547,11 @@ "dev": true }, "node_modules/picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.2.tgz", + "integrity": "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==", "dev": true, + "license": "MIT", "engines": { "node": ">=8.6" }, @@ -2668,6 +2788,7 @@ "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, + "license": "ISC", "bin": { "semver": "bin/semver.js" } @@ -2906,9 +3027,9 @@ } }, "node_modules/update-browserslist-db": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.2.tgz", - "integrity": "sha512-PPypAm5qvlD7XMZC3BujecnaOxwhrtoFR+Dqkk5Aa/6DssiH0ibKoketaj9w8LP7Bont1rYeoV5plxD7RTEPRg==", + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.2.3.tgz", + "integrity": "sha512-Js0m9cx+qOgDxo0eMiFGEueWztz+d4+M3rGlmKPT+T4IS/jP4ylw3Nwpu6cpTTP8R1MAC1kF4VbdLt3ARf209w==", "dev": true, "funding": [ { @@ -2924,6 +3045,7 @@ "url": "https://github.com/sponsors/ai" } ], + "license": "MIT", "dependencies": { "escalade": "^3.2.0", "picocolors": "^1.1.1" @@ -3040,9 +3162,10 @@ "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" }, "node_modules/ws": { - "version": "7.5.10", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.10.tgz", - "integrity": "sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ==", + "version": "7.5.11", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.11.tgz", + "integrity": "sha512-zS54Oen9bITtp7kp2XM3AydrCIq1D+HwJOuH+c+e4LfpL/lotP5osijd+UoMnxwAam1GN8R4KtLAyIrIcBNpiA==", + "license": "MIT", "engines": { "node": ">=8.3.0" }, @@ -3063,7 +3186,8 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/yaml": { "version": "2.3.1", diff --git a/accelerator-home-ui/package.json b/accelerator-home-ui/package.json index d99d3b14..5f1b52c9 100644 --- a/accelerator-home-ui/package.json +++ b/accelerator-home-ui/package.json @@ -2,8 +2,6 @@ "name": "accelerator-home-ui", "description": "accelerator-home-ui", "dependencies": { - "@firebolt-js/sdk": "0.15.0", - "@firebolt-js/manage-sdk": "1.1.0", "@hendt/xml2json": "^1.0.3", "@lightningjs/sdk": "^4.8.1", "@lightningjs/ui": "^1.3.7", @@ -25,7 +23,7 @@ "devDependencies": { "@babel/core": "^7.21.5", "babel-eslint": "^10.0.3", - "esbuild": "^0.17.18", + "esbuild": "^0.28.1", "eslint": "^8.39.0", "eslint-config-prettier": "^8.8.0", "eslint-plugin-prettier": "^4.2.1", diff --git a/accelerator-home-ui/settings.json b/accelerator-home-ui/settings.json index a0d036b6..6957eab1 100644 --- a/accelerator-home-ui/settings.json +++ b/accelerator-home-ui/settings.json @@ -7,7 +7,7 @@ "debug": false }, "platformSettings": { - "id": "UIv3", + "id": "UIv6", "inspector": false, "path": "./static", "log": true, diff --git a/accelerator-home-ui/src/App.js b/accelerator-home-ui/src/App.js index 55aef49e..db69bae6 100644 --- a/accelerator-home-ui/src/App.js +++ b/accelerator-home-ui/src/App.js @@ -36,20 +36,12 @@ import Keymap from './Config/Keymap'; import Menu from './views/Menu' import Failscreen from './screens/FailScreen'; import FailAndOkScreen from './screens/FailAndOkScreen'; -import { - keyIntercept -} from './keyIntercept/keyIntercept'; import HDMIApi from './api/HDMIApi'; import Volume from './tvOverlay/components/Volume'; import DTVApi from './api/DTVApi'; import TvOverlayScreen from './tvOverlay/TvOverlayScreen'; import ChannelOverlay from './MediaPlayer/ChannelOverlay'; import SettingsOverlay from './overlays/SettingsOverlay'; -import { - AlexaLauncherKeyMap, - PlaybackStateReport, - VolumePayload -} from './Config/AlexaConfig'; import AppCarousel from './overlays/AppCarousel'; import VideoScreen from './screens/Video'; import VideoInfoChange from './overlays/VideoInfoChange/VideoInfoChange.js'; @@ -59,22 +51,7 @@ import { appListInfo } from "./../static/data/AppListInfo.js"; import VoiceApi from './api/VoiceApi.js'; -import AlexaApi from './api/AlexaApi.js'; import AAMPVideoPlayer from './MediaPlayer/AAMPVideoPlayer'; -import FireBoltApi from './api/firebolt/FireBoltApi'; -import PinChallengeProvider from './api/firebolt/provider/PinChallengeProvider'; -import AckChallengeProvider from './api/firebolt/provider/AckChallengeProvider'; -import KeyboardUIProvider from './api/firebolt/provider/KeyboardUIProvider'; -import { - AcknowledgeChallenge, - Keyboard, - PinChallenge -} from '@firebolt-js/manage-sdk' -import { - Localization, - Metrics -} from '@firebolt-js/sdk'; -import RDKShellApis from './api/RDKShellApis.js'; import Miracast from './api/Miracast.js'; import MiracastNotification from './screens/MiracastNotification.js'; import NetworkManager from './api/NetworkManagerAPI.js'; @@ -87,21 +64,17 @@ import RDKWindowManager from './api/RDKWindowManagerApi.js'; import RuntimeManager from './api/RuntimeManagerApi.js'; import AppController from './AppController.js'; -var AlexaAudioplayerActive = false; var thunder = ThunderJS(CONFIG.thunderConfig); var appApi = new AppApi(); var dtvApi = new DTVApi(); var cecApi = new CECApi(); -var xcastApi = new XcastApi(); var voiceApi = new VoiceApi(); var miracast = new Miracast(); var inactivityHelper = new InactivityHelper(); const SLEEP_STATE = 'SLEEPING'; -var powermanagerapi = new PowerManagerApi(); var packageManager = new PackageManager(); export default class App extends Router.App { - constructor(...args) { super(...args); this.INFO = console.info; @@ -153,7 +126,6 @@ export default class App extends Router.App { async _setup() { this.LOG("accelerator-home-ui version: " + JSON.stringify(Settings.get("platform", "version"))); - this.LOG("UI setup selfClientName:" + JSON.stringify(GLOBALS.selfClientName) + ", current topmostApp:" + JSON.stringify(GLOBALS.topmostApp)); Storage.set("ResolutionChangeInProgress", false); Router.startRouter(routes, this); document.onkeydown = e => { @@ -244,7 +216,7 @@ export default class App extends Router.App { static language() { return { file: Utils.asset('language/language-file.json'), - language: ("com.rdkcentral.refui" === GLOBALS.selfclientAppName ? CONFIG.language : Localization.language()) || 'en' + language: ("com.rdkcentral.refui" === GLOBALS.selfclientAppName) ? CONFIG.language : 'en' } } @@ -253,8 +225,7 @@ export default class App extends Router.App { } _captureKey(key) { - this.LOG("Got keycode : " + JSON.stringify(key.keyCode)) - this.LOG("powerState ===>" + JSON.stringify(GLOBALS.powerState)) + this.LOG("PowerState: " + JSON.stringify(GLOBALS.powerState) + " and got keycode: " + JSON.stringify(key.keyCode)) if (GLOBALS.powerState === PowerState.POWER_STATE_DEEP_SLEEP || GLOBALS.powerState === PowerState.POWER_STATE_LIGHT_SLEEP) { if (key.keyCode !== Keymap.Power) { this.LOG("Ignoring non-power key press while device is in sleep state") @@ -270,8 +241,8 @@ export default class App extends Router.App { this.initializeInactivityEngine(); }) .catch(err => { - this.ERR("Error waking device: " + JSON.stringify(err)); - }) + this.ERR("Error waking device: " + JSON.stringify(err)); + }) return true } this.$hideImage(0); @@ -311,7 +282,6 @@ export default class App extends Router.App { } else { Router.navigate("tv-overlay/inputs", false); } - this._moveApptoFront(GLOBALS.selfClientName, true) } else { if (Router.getActiveHash() === "dtvplayer") { Router.focusWidget('TvOverlays'); @@ -326,7 +296,6 @@ export default class App extends Router.App { } else { Router.navigate("tv-overlay/settings", false); } - this._moveApptoFront(GLOBALS.selfClientName, true) } else { if (Router.getActiveHash() === "dtvplayer") { Router.focusWidget('TvOverlays'); @@ -349,13 +318,10 @@ export default class App extends Router.App { if (Router.getActiveHash() === "applauncher") { //if route is applauncher just focus the overlay widget if (Router.getActiveWidget() && Router.getActiveWidget().__ref === "SettingsOverlay") { //currently focused on settings overlay, so hide it Router.focusPage(); - this._moveApptoFront(GLOBALS.topmostApp, true) } else { //launch the settings overlay - this._moveApptoFront(GLOBALS.selfClientName, true) Router.focusWidget('SettingsOverlay'); } } else { //if on some other route while on an application, route to applauncher before launching the settings overlay - this._moveApptoFront(GLOBALS.selfClientName, true) Router.navigate("applauncher"); Router.focusWidget('SettingsOverlay'); } @@ -365,7 +331,8 @@ export default class App extends Router.App { this.jumpToRoute("epg"); //method to exit the current app(if any) and route to home screen return true } else if (key.keyCode == Keymap.Amazon && !Router.isNavigating()) { - return this.launchFeaturedApp("Amazon") + this.launchFeaturedApp("Amazon") + return true } else if (key.keyCode == Keymap.Youtube && !Router.isNavigating()) { console.log("YouTube key pressed, calling launchFeaturedApp"); this.launchFeaturedApp("YouTube") @@ -386,13 +353,10 @@ export default class App extends Router.App { if (Router.getActiveHash() === "applauncher") { //if route is applauncher just focus the overlay widget if (Router.getActiveWidget() && Router.getActiveWidget().__ref === "AppCarousel") { //currently focused on settings overlay, so hide it Router.focusPage(); - this._moveApptoFront(GLOBALS.topmostApp, true) } else { //launch the settings overlay - this._moveApptoFront(GLOBALS.selfClientName, true) Router.focusWidget('AppCarousel'); } } else { //if on some other route while on an application, route to applauncher before launching the settings overlay - this._moveApptoFront(GLOBALS.selfClientName, true) Router.navigate("applauncher"); Router.focusWidget('AppCarousel'); } @@ -497,14 +461,6 @@ export default class App extends Router.App { "Amazon": "n:2", "Prime": "n:2" } - // this._registerFireboltListeners() - - Keyboard.provide('xrn:firebolt:capability:input:keyboard', new KeyboardUIProvider(this)) - this.LOG("Keyboard provider registered") - PinChallenge.provide('xrn:firebolt:capability:usergrant:pinchallenge', new PinChallengeProvider(this)) - this.LOG("PinChallenge provider registered") - AcknowledgeChallenge.provide('xrn:firebolt:capability:usergrant:acknowledgechallenge', new AckChallengeProvider(this)) - this.LOG("Acknowledge challenge provider registered") appApi.deviceType().then(result => { this.LOG("App detected deviceType as:" + JSON.stringify(((result.devicetype != null) ? result.devicetype : "IpTv"))); @@ -549,50 +505,9 @@ export default class App extends Router.App { }).catch(err => { this.ERR("error while enabling displaysettings:" + JSON.stringify(err)); }) - appApi.cobaltStateChangeEvent() thunder.on('Controller.1', 'all', noti => { this.LOG("App controller notification:" + JSON.stringify(noti)) - if ((noti.data.url && noti.data.url.slice(-5) === "#boot") || (noti.data.httpstatus && noti.data.httpstatus != 200 && noti.data.httpstatus != -1)) { // to exit metro apps by pressing back key & to auto exit webapp if httpstatus is not 200 - appApi.exitApp(GLOBALS.topmostApp); - } - // TODO: make the check based on XcastApi.supportedApps() list - if (Object.prototype.hasOwnProperty.call(noti, "callsign") && (noti.callsign.startsWith("YouTube") || noti.callsign.startsWith("Amazon") || noti.callsign.startsWith("Netflix"))) { - let params = { - applicationName: noti.callsign, - state: 'stopped' - }; - switch (noti.data.state) { - case "activated": - case "resumed": - params.state = 'running'; - break; - case "Activation": - case "deactivated": - case "Deactivation": - params.state = 'stopped'; - break; - case "hibernated": - case "suspended": - params.state = 'suspended'; - break; - case "Precondition": - break; - } - if (noti.callsign.startsWith("Amazon")) { - params.applicationName = "AmazonInstantVideo"; - } - this.LOG("App Controller state change to xcast: " + JSON.stringify(params)); - this.xcastApi.setApplicationState(params).then(status => { - if (status == false) { - this.ERR("App xcast setApplicationState failed, trying fallback. error: "); - this.xcastApi.onApplicationStateChanged(params).catch(err => { - this.ERR("App xcast onApplicationStateChanged failed: " + JSON.stringify(err)); - }); - } - }); - params = null; - } if (noti.callsign === "org.rdk.HdmiCecSource") { this.SubscribeToHdmiCecSourcevent(noti.data.state, self.appIdentifiers) } @@ -624,58 +539,7 @@ export default class App extends Router.App { } } }) - this._subscribeToRDKShellNotifications() - appApi.getPluginStatus("Cobalt").then(() => { - /* Loop through YouTube variants and set respective urls. */ - JSON.parse(JSON.stringify(appListInfo)).forEach(appInfo => { - if (Object.prototype.hasOwnProperty.call(appInfo, "applicationType") && appInfo.applicationType.startsWith("YouTube") && Object.prototype.hasOwnProperty.call(appInfo, "uri") && appInfo.uri.length) { - thunder.Controller.clone({ - callsign: "Cobalt", - newcallsign: appInfo.applicationType - }).then(result => { - this.LOG("App Controller.clone Cobalt as " + JSON.stringify(appInfo.applicationType) + " done." + JSON.stringify(result)); - }).catch(err => { - this.ERR("App Controller clone Cobalt for " + JSON.stringify(appInfo.applicationType) + " failed: " + JSON.stringify(err)); - Metrics.error(Metrics.ErrorType.OTHER, "PluginError", `Controller clone Cobalt for ${appInfo.applicationType} failed: ${err}`, false, null) - // TODO: hide YouTube Icon and listing from Menu, AppCarousel, Channel overlay and EPG page. - }) - appApi.getPluginStatus(appInfo.applicationType).then(res => { - if (res[0].state !== "deactivated") { - thunder.Controller.deactivate({ - callsign: appInfo.applicationType - }).catch(err => { - this.ERR("App Controller.deactivate " + JSON.stringify(appInfo.applicationType) + " failed. It may not work." + JSON.stringify(err)); - Metrics.error(Metrics.ErrorType.OTHER, "pluginError", `App Controller.deactivate failed for ${appInfo.applicationType} with ${err}`, false, null) - }) - } - /* Do not change YouTube's configuration as Page-visibility test runs on that. */ - if (res[0].callsign !== "YouTube") { - thunder.call('Controller', `configuration@${appInfo.applicationType}`).then(result => { - /* Ensure appending '?' so that later params can be directly appended. */ - result.url = appInfo.uri + "?"; // Make sure that appListInfo.js has only base url. - thunder.call('Controller', `configuration@${appInfo.applicationType}`, result).then(() => { - Storage.set(appInfo.applicationType + "DefaultURL", appInfo.uri + "?"); // Make sure that appListInfo.js has only base url. - }).catch(err => { - this.ERR("App Controller.configuration@" + JSON.stringify(appInfo.applicationType) + " set failed. It may not work." + JSON.stringify(err)); - Metrics.error(Metrics.ErrorType.OTHER, "pluginError", `App Controller.configuration for ${appInfo.applicationType} set failed. It may not work. ${JSON.stringify(err)}`, false, null) - }) - }).catch(err => { - this.ERR("App Controller.configuration@" + JSON.stringify(appInfo.applicationType) + " get failed. It may not work." + JSON.stringify(err)); - Metrics.error(Metrics.ErrorType.OTHER, "pluginError", `App Controller.configuration@ for ${appInfo.applicationType} failed with ${JSON.stringify(err)}`, false, null) - }) - } else { - /* Just store the plugin configured url as default url and ensure '?' is appended. */ - Storage.set(appInfo.applicationType + "DefaultURL", (res[0].configuration.url.includes('?') ? res[0].configuration.url : res[0].configuration.url + "?")); - } - }).catch(err => { - this.ERR("App getPluginStatus " + JSON.stringify(appInfo.applicationType) + " Error: " + JSON.stringify(err)); - }) - } - }); - }).catch(err => { - this.ERR("App getPluginStatus Cobalt error: " + JSON.stringify(err)); - }) //video info change events begin here--------------------- /******************** RDKUI-341 CHANGES - DEEP SLEEP/LIGHT SLEEP **************************/ this._subscribeToControlNotifications() @@ -918,15 +782,6 @@ export default class App extends Router.App { } SubscribeToNetworkManager() { - thunder.on('org.rdk.NetworkManager', 'onInterfaceStateChange', data => { - console.warn("onInterfaceStateChange:", data); - }); - thunder.on('org.rdk.NetworkManager', 'onAddressChange', data => { - console.warn(" onAddressChange:", data); - }); - thunder.on('org.rdk.NetworkManager', 'onActiveInterfaceChange', data => { - console.warn("onActiveInterfaceChange:", data); - }); thunder.on('org.rdk.NetworkManager', 'onInternetStatusChange', data => { if (data.status === "FULLY_CONNECTED") { GLOBALS.IsConnectedToInternet = true @@ -936,16 +791,6 @@ export default class App extends Router.App { } console.warn("onInternetStatusChange:", data); }); - thunder.on('org.rdk.NetworkManager', 'onAvailableSSIDs', data => { - console.warn(" onAvailableSSIDs:", data); - }); - thunder.on('org.rdk.NetworkManager', 'onWiFiStateChange', data => { - console.warn("onWiFiStateChange:", data); - }); - thunder.on('org.rdk.NetworkManager', 'onWiFiSignalStrengthChange', data => { - console.warn("onWiFiSignalStrengthChange:", data); - }); - } SubscribeToMiracastService() { thunder.on('org.rdk.MiracastService.1', 'onClientConnectionRequest', data => { @@ -954,7 +799,6 @@ export default class App extends Router.App { if (GLOBALS.topmostApp === GLOBALS.selfClientName) { Router.focusWidget("MiracastNotification") } else { - this._moveApptoFront(GLOBALS.selfClientName, true) Router.navigate("applauncher"); Router.focusWidget("MiracastNotification") } @@ -983,7 +827,6 @@ export default class App extends Router.App { }) Router.focusWidget("Fail") } else { - this._moveApptoFront(GLOBALS.selfClientName, true) Router.navigate("applauncher"); this.tag("Fail").notify({ title: Language.translate("Miracast Status"), @@ -1002,21 +845,18 @@ export default class App extends Router.App { if (data.state === "PLAYING") { if (GLOBALS.topmostApp != GLOBALS.selfClientName) { appApi.exitApp(GLOBALS.topmostApp).then(() => { - RDKShellApis.setVisibility(GLOBALS.topmostApp, GLOBALS.topmostApp, false) miracast.updatePlayerState(data.mac, data.state, data.reason_code, data.reason) GLOBALS.topmostApp = "MiracastPlayer" }).catch(err => { this.ERR("exitapp err: " + JSON.stringify(err)) }); } else { - RDKShellApis.setVisibility(GLOBALS.selfClientName, GLOBALS.selfClientName, false) miracast.updatePlayerState(data.mac, data.state, data.reason_code, data.reason) GLOBALS.topmostApp = "MiracastPlayer" } } if (data.state === "STOPPED") { - RDKShellApis.setVisibility(GLOBALS.selfClientName, true) Router.navigate(GLOBALS.LastvisitedRoute); if (data.reason_code != 200) { this.tag("Fail").notify({ @@ -1076,309 +916,6 @@ export default class App extends Router.App { _SubscribeToAppManagerNotifications() { AppController.get().subscribe(thunder); } - _subscribeToRDKShellNotifications() { - thunder.on('org.rdk.RDKShell', 'onApplicationActivated', data => { - this.WARN("[RDKSHELLEVT] onApplicationActivated:" + JSON.stringify(data)); - }); - thunder.on('org.rdk.RDKShell', 'onApplicationConnected', data => { - this.WARN("[RDKSHELLEVT] onApplicationConnected:" + JSON.stringify(data)); - }); - thunder.on('org.rdk.RDKShell', 'onApplicationDisconnected', data => { - this.WARN("[RDKSHELLEVT] onApplicationDisconnected:" + JSON.stringify(data)); - }); - thunder.on('org.rdk.RDKShell', 'onApplicationFirstFrame', data => { - this.WARN("[RDKSHELLEVT] onApplicationFirstFrame:" + JSON.stringify(data)); - }); - thunder.on('org.rdk.RDKShell', 'onApplicationLaunched', data => { - this.WARN("[RDKSHELLEVT] onApplicationLaunched:" + JSON.stringify(data)); - if ((data.client != GLOBALS.selfClientName) && (GLOBALS.topmostApp === GLOBALS.selfClientName)) { - RDKShellApis.setVisibility(GLOBALS.selfClientName, false); - GLOBALS.topmostApp = data.client; - } - }); - thunder.on('org.rdk.RDKShell', 'onApplicationResumed', data => { - this.WARN("[RDKSHELLEVT] onApplicationResumed:" + JSON.stringify(data)); - if ((data.client != GLOBALS.selfClientName) && (GLOBALS.topmostApp === GLOBALS.selfClientName)) { - RDKShellApis.setVisibility(GLOBALS.selfClientName, false); - GLOBALS.topmostApp = data.client; - } - }); - thunder.on('org.rdk.RDKShell', 'onApplicationSuspended', data => { - this.WARN("[RDKSHELLEVT] onApplicationSuspended:" + JSON.stringify(data)); - }); - thunder.on('org.rdk.RDKShell', 'onApplicationTerminated', data => { - this.WARN("[RDKSHELLEVT] onApplicationTerminated:" + JSON.stringify(data)); - if ((data.client != GLOBALS.selfClientName) && (GLOBALS.topmostApp != GLOBALS.selfClientName)) { - appApi.launchResidentApp(GLOBALS.selfClientName, GLOBALS.selfClientName) - } - }); - thunder.on('org.rdk.RDKShell', 'onHibernated', data => { - this.WARN("[RDKSHELLEVT] onHibernated:" + JSON.stringify(data)); - if (data.callsign && data.callsign.startsWith('YouTube')) { - RDKShellApis.removeKeyIntercept({ - "keyCode": 173, - "modifiers": [], - "client": data.callsign - }).then(res => { - this.WARN(JSON.stringify(res)) - }) - RDKShellApis.removeKeyIntercept({ - "keyCode": 174, - "modifiers": [], - "client": data.callsign - }).then(res => { - this.WARN(JSON.stringify(res)) - }) - RDKShellApis.removeKeyIntercept({ - "keyCode": 175, - "modifiers": [], - "client": data.callsign - }).then(res => { - this.WARN(JSON.stringify(res)) - }) - RDKShellApis.removeKeyIntercept({ - "keyCode": 115, - "modifiers": [], - "client": data.callsign - }).then(res => { - this.WARN(JSON.stringify(res)) - }) - } - if (data.success) { - if ((GLOBALS.topmostApp === data.client) && - (GLOBALS.selfClientName === "ResidentApp" || GLOBALS.selfClientName === "FireboltMainApp-refui") && GLOBALS.Miracastclientdevicedetails.state != "PLAYING") { - appApi.launchResidentApp(GLOBALS.selfClientName, GLOBALS.selfClientName) - } - } - }); - thunder.on('org.rdk.RDKShell', 'onRestored', data => { - this.WARN("[RDKSHELLEVT] onRestored:" + JSON.stringify(data)); - if (data.callsign && data.callsign.startsWith('YouTube')) { - RDKShellApis.addKeyIntercepts({ - "intercepts": [{ - "keys": [{ - "keyCode": 173, - "modifiers": [] - }, { - "keyCode": 174, - "modifiers": [] - }, { - "keyCode": 175, - "modifiers": [] - }, { - "keyCode": 115, - "modifiers": [] - }], - "client": data.callsign - }] - }).then(res => { - this.WARN(JSON.stringify(res)) - }) - } - }); - thunder.on('org.rdk.RDKShell', 'onDestroyed', data => { - this.WARN("[RDKSHELLEVT] onDestroyed:" + JSON.stringify(data)); - // No need to handle this when UI is in Firebolt compatible mode. - if (data.client && data.client.startsWith('YouTube')) { - RDKShellApis.removeKeyIntercept({ - "keyCode": 173, - "modifiers": [], - "client": data.client - }).then(res => { - this.WARN(JSON.stringify(res)) - }) - RDKShellApis.removeKeyIntercept({ - "keyCode": 174, - "modifiers": [], - "client": data.client - }).then(res => { - this.WARN(JSON.stringify(res)) - }) - RDKShellApis.removeKeyIntercept({ - "keyCode": 175, - "modifiers": [], - "client": data.client - }).then(res => { - this.WARN(JSON.stringify(res)) - }) - RDKShellApis.removeKeyIntercept({ - "keyCode": 115, - "modifiers": [], - "client": data.callsign - }).then(res => { - this.WARN(JSON.stringify(res)) - }) - } - if ((GLOBALS.topmostApp === data.client) && - (GLOBALS.selfClientName === "ResidentApp" || GLOBALS.selfClientName === "FireboltMainApp-refui") && GLOBALS.Miracastclientdevicedetails.state != "PLAYING") { - appApi.launchResidentApp(GLOBALS.selfClientName, GLOBALS.selfClientName); - } - }); - thunder.on('org.rdk.RDKShell', 'onLaunched', data => { - this.WARN("[RDKSHELLEVT] onLaunched:" + JSON.stringify(data)); - if (GLOBALS.Miracastclientdevicedetails.mac != null && GLOBALS.Miracastclientdevicedetails.name != null) { - miracast.stopRequest(GLOBALS.Miracastclientdevicedetails.mac, GLOBALS.Miracastclientdevicedetails.name, 300) - } - if ((data.launchType === "activate") || (data.launchType === "resume")) { - // Change (Tracked TopMost) UI's visibility to false only for other apps. - if (data.client.startsWith('YouTube')) { - RDKShellApis.addKeyIntercepts({ - "intercepts": [{ - "keys": [{ - "keyCode": 173, - "modifiers": [] - }, { - "keyCode": 174, - "modifiers": [] - }, { - "keyCode": 175, - "modifiers": [] - }, { - "keyCode": 115, - "modifiers": [] - }], - "client": data.client - }] - }).then(res => { - this.WARN(JSON.stringify(res)) - }) - } - if ((data.client != GLOBALS.selfClientName) && - ((GLOBALS.topmostApp === "ResidentApp") || - (GLOBALS.topmostApp === GLOBALS.selfClientName))) { - RDKShellApis.setVisibility(GLOBALS.selfClientName, false); - } - if (((GLOBALS.topmostApp != "ResidentApp") || - (GLOBALS.topmostApp != GLOBALS.selfClientName)) && - (GLOBALS.topmostApp != data.client)) { - appApi.suspendPremiumApp(GLOBALS.topmostApp); - } - // Assuming launch is followed by moveToFront & setFocus - GLOBALS.topmostApp = data.client; - } else if (data.launchType === "suspend") { - // No need to handle this here when UI is in Firebolt compatible mode. - // It will be done at RefUI's 'foreground' event handler. - if (data.client.startsWith('YouTube')) { - RDKShellApis.removeKeyIntercept({ - "keyCode": 173, - "modifiers": [], - "client": data.client - }).then(res => { - this.WARN(JSON.stringify(res)) - }) - RDKShellApis.removeKeyIntercept({ - "keyCode": 174, - "modifiers": [], - "client": data.client - }).then(res => { - this.WARN(JSON.stringify(res)) - }) - RDKShellApis.removeKeyIntercept({ - "keyCode": 175, - "modifiers": [], - "client": data.client - }).then(res => { - this.WARN(JSON.stringify(res)) - }) - RDKShellApis.removeKeyIntercept({ - "keyCode": 115, - "modifiers": [], - "client": data.callsign - }).then(res => { - this.WARN(JSON.stringify(res)) - }) - } - if ((GLOBALS.topmostApp === data.client) && - (GLOBALS.selfClientName === "ResidentApp") && GLOBALS.Miracastclientdevicedetails.state != "PLAYING") { - appApi.launchResidentApp(GLOBALS.selfClientName, GLOBALS.selfClientName); - } - } - }); - thunder.on('org.rdk.RDKShell', 'onSuspended', data => { - this.WARN("[RDKSHELLEVT] onSuspended:" + JSON.stringify(data)); - // No need to handle this here when UI is in Firebolt compatible mode. - if (data.client.startsWith('YouTube')) { - RDKShellApis.removeKeyIntercept({ - "keyCode": 173, - "modifiers": [], - "client": data.client - }).then(res => { - this.WARN(JSON.stringify(res)) - }) - RDKShellApis.removeKeyIntercept({ - "keyCode": 174, - "modifiers": [], - "client": data.client - }).then(res => { - this.WARN(JSON.stringify(res)) - }) - RDKShellApis.removeKeyIntercept({ - "keyCode": 175, - "modifiers": [], - "client": data.client - }).then(res => { - this.WARN(JSON.stringify(res)) - }) - RDKShellApis.removeKeyIntercept({ - "keyCode": 115, - "modifiers": [], - "client": data.callsign - }).then(res => { - this.WARN(JSON.stringify(res)) - }) - } - if ((GLOBALS.topmostApp === data.client) && - (GLOBALS.selfClientName === "ResidentApp" || GLOBALS.selfClientName === "FireboltMainApp-refui") && GLOBALS.Miracastclientdevicedetails.state != "PLAYING") { - appApi.launchResidentApp(GLOBALS.selfClientName, GLOBALS.selfClientName); - } - }); - thunder.on('org.rdk.RDKShell', 'onWillDestroy', data => { - this.WARN("[RDKSHELLEVT] onWillDestroy:" + JSON.stringify(data)); - }); - thunder.on('org.rdk.RDKShell', 'onPluginSuspended', data => { - this.WARN("[RDKSHELLEVT] onPluginSuspended:" + JSON.stringify(data)); - if (data.client.startsWith('YouTube')) { - RDKShellApis.removeKeyIntercept({ - "keyCode": 173, - "modifiers": [], - "client": data.client - }).then(res => { - this.WARN(JSON.stringify(res)) - }) - RDKShellApis.removeKeyIntercept({ - "keyCode": 174, - "modifiers": [], - "client": data.client - }).then(res => { - this.WARN(JSON.stringify(res)) - }) - RDKShellApis.removeKeyIntercept({ - "keyCode": 175, - "modifiers": [], - "client": data.client - }).then(res => { - this.WARN(JSON.stringify(res)) - }) - RDKShellApis.removeKeyIntercept({ - "keyCode": 115, - "modifiers": [], - "client": data.callsign - }).then(res => { - this.WARN(JSON.stringify(res)) - }) - } - if ((GLOBALS.topmostApp === data.client) && - (GLOBALS.selfClientName === "ResidentApp" || GLOBALS.selfClientName === "FireboltMainApp-refui") && GLOBALS.Miracastclientdevicedetails.state != "PLAYING") { - appApi.launchResidentApp(GLOBALS.selfClientName, GLOBALS.selfClientName); - } - }); - thunder.on('org.rdk.RDKShell', 'onBlur', data => { - this.WARN("[RDKSHELLEVT] onBlur:" + JSON.stringify(data)); - }); - thunder.on('org.rdk.RDKShell', 'onFocus', data => { - this.WARN("[RDKSHELLEVT] onFocus:" + JSON.stringify(data)); - }); - } _subscribeToControlNotifications() { thunder.on('org.rdk.tv.ControlSettings.1', 'videoFormatChanged', notification => { this.LOG("videoFormatChangedNotification: " + JSON.stringify(notification)) @@ -1413,18 +950,6 @@ export default class App extends Router.App { thunder.on('Controller', 'statechange', notification => { // get plugin status this.WARN("Controller statechange Notification : " + JSON.stringify(notification)) - if (notification && (notification.callsign.startsWith("YouTube") || notification.callsign === 'Amazon' || notification.callsign === 'LightningApp' || notification.callsign === 'HtmlApp' || notification.callsign === 'Netflix') && (notification.state == 'Deactivation' || notification.state == 'Deactivated')) { - this.LOG(notification.callsign + " status = " + notification.state) - this.LOG(">>notification.callsign: " + notification.callsign + " applicationType: " + GLOBALS.topmostApp); - if (Router.getActiveHash().startsWith("tv-overlay") || Router.getActiveHash().startsWith("overlay") || Router.getActiveHash().startsWith("applauncher")) { //navigate to last visited route when exiting from any app - this.LOG("navigating to lastVisitedRoute") - Router.navigate((GLOBALS.LastvisitedRoute)); - } - if (notification.callsign === GLOBALS.topmostApp) { //only launch residentApp iff notification is from currentApp - this.LOG(notification.callsign + " is in: " + notification.state + " state, and application type in Storage is still: " + GLOBALS.topmostApp + " calling launchResidentApp") - appApi.launchResidentApp(GLOBALS.selfClientName, GLOBALS.selfClientName); - } - } if (notification && (notification.callsign === 'org.rdk.HdmiCecSource' && notification.state === 'Activated')) { this.advanceScreen = Router.activePage() if (typeof this.advanceScreen.performOTPAction === 'function') { @@ -1432,53 +957,6 @@ export default class App extends Router.App { this.advanceScreen.performOTPAction() } } - - if (notification && (notification.callsign.startsWith("YouTube") || notification.callsign === 'Amazon' || notification.callsign === 'LightningApp' || notification.callsign === 'HtmlApp' || notification.callsign === 'Netflix') && notification.state == 'Activated') { - GLOBALS.topmostApp = notification.callsign; //required in case app launch happens using curl command. - if (notification.callsign === 'Netflix') { - appApi.getNetflixESN() - .then(res => { - Storage.set('Netflix_ESN', res) - }) - thunder.on('Netflix', 'notifyeventchange', notification => { - this.LOG("NETFLIX : notifyEventChange notification = " + JSON.stringify(notification)); - if (notification.EventName === "rendered") { - Router.navigate('menu') - if (Storage.get("NFRStatus")) { - thunder.call("Netflix.1", "nfrstatus", { - "params": "enable" - }).then(nr => { - this.LOG("Netflix : nfr enable results in " + JSON.stringify(nr)) - }).catch(nerr => { - this.ERR("Netflix : error while updating nfrstatus " + JSON.stringify(nerr)) - }) - } else { - thunder.call("Netflix.1", "nfrstatus", { - "params": "disable" - }).then(nr => { - this.LOG("Netflix : nfr disable results in " + JSON.stringify(nr)) - }).catch(nerr => { - this.ERR("Netflix : error while updating nfrstatus " + JSON.stringify(nerr)) - }) - } - - RDKShellApis.setVisibility(GLOBALS.selfClientName, false); - } - if (notification.EventName === "requestsuspend") { - this.deactivateChildApp('Netflix') - } - if (notification.EventName === "updated") { - this.LOG("Netflix : xxxxxxxxxxxxxxxxxx Updated Event Trigger xxxxxxxxxxxxxxxxxxxx") - appApi.getNetflixESN() - .then(res => { - Storage.set('Netflix_ESN', res) - }) - } - }) - } else { - RDKShellApis.setFocus(notification.callsign) //required in case app launch happens using curl command. - } - } }); } _subscribeToIOPortNotifications() { @@ -1494,48 +972,10 @@ export default class App extends Router.App { if (GLOBALS.previousapp_onDisplayConnectionChanged !== null) { currentApp = GLOBALS.previousapp_onDisplayConnectionChanged } - if (currentApp === "ResidentApp" && GLOBALS.Setup) { + if (currentApp === GLOBALS._selfclientAppName && GLOBALS.Setup) { Router.navigate(GLOBALS.LastvisitedRoute); } - let launchLocation = Storage.get(currentApp + "LaunchLocation") - this.LOG("App HdcpProfile onDisplayConnectionChanged current app is:" + JSON.stringify(currentApp)) - let params = { - launchLocation: launchLocation, - appIdentifier: self.appIdentifiers[currentApp] - } - if (currentApp.startsWith("YouTube") || currentApp.startsWith("Netflix")) { - params["url"] = Storage.get(currentApp + "DefaultURL"); - appApi.getPluginStatus(currentApp).then(result => { - const isAppSuspendedEnabled = Settings.get("platform", "enableAppSuspended"); - const expectedState = isAppSuspendedEnabled ? ["hibernated", "suspended"] : ["deactivated"]; - if (expectedState.includes(result[0].state)) { - appApi.launchApp(currentApp, params) - .then(() => GLOBALS.previousapp_onDisplayConnectionChanged = null) - .catch(err => { - Router.navigate(GLOBALS.LastvisitedRoute) - this.ERR("Error in launching " + JSON.stringify(currentApp) + " : " + JSON.stringify(err)) - }); - } else { - this.LOG("App HdcpProfile onDisplayConnectionChanged skipping; " + currentApp + " is already: " + JSON.stringify(result[0].state)); - } - }) - } } else { - let currentApp = GLOBALS.topmostApp - if (currentApp.startsWith("YouTube") || currentApp.startsWith("Netflix")) { - appApi.getPluginStatus(currentApp).then(result => { - if (result[0].state !== (Settings.get("platform", "enableAppSuspended") ? "suspended" : "deactivated")) { - appApi.exitApp(currentApp, true) - .then(() => GLOBALS.previousapp_onDisplayConnectionChanged = currentApp) - .catch(err => { - Router.navigate(GLOBALS.LastvisitedRoute) - this.ERR("Error in exit app " + JSON.stringify(currentApp) + " : " + JSON.stringify(err)) - }); - } else { - this.LOG("App HdcpProfile onDsisplayConnectionChanged skipping; " + currentApp + " is already: " + JSON.stringify(result[0].state)); - } - }) - } Storage.set("lastVisitedRoute", Router.getActiveHash()) GLOBALS.LastvisitedRoute = Router.getActiveHash() } @@ -1558,48 +998,11 @@ export default class App extends Router.App { if (GLOBALS.previousapp_onActiveSourceStatusUpdated !== null) { currentApp = GLOBALS.previousapp_onActiveSourceStatusUpdated } - if (currentApp === "ResidentApp" && GLOBALS.Setup) { + if (currentApp === GLOBALS._selfclientAppName && GLOBALS.Setup) { Router.navigate(GLOBALS.LastvisitedRoute); } - let launchLocation = Storage.get(currentApp + "LaunchLocation") this.LOG("current app is " + JSON.stringify(currentApp)) - let params = { - launchLocation: launchLocation, - appIdentifier: appIdentifiers[currentApp] - } - if (currentApp.startsWith("YouTube") || currentApp.startsWith("Netflix")) { - params["url"] = Storage.get(currentApp + "DefaultURL"); - appApi.getPluginStatus(currentApp).then(result => { - const isAppSuspendedEnabled = Settings.get("platform", "enableAppSuspended"); - const expectedState = isAppSuspendedEnabled ? ["hibernated", "suspended"] : ["deactivated"]; - if (expectedState.includes(result[0].state)) { - appApi.launchApp(currentApp, params) - .then(() => GLOBALS.previousapp_onActiveSourceStatusUpdated = null) - .catch(err => { - Router.navigate(GLOBALS.LastvisitedRoute) - this.ERR("Error in launching " + JSON.stringify(currentApp) + " : " + JSON.stringify(err)) - }); - } else { - this.LOG("App HdmiCecSource onActiveSourceStatusUpdated skipping; " + currentApp + " is already:" + JSON.stringify(result[0].state)); - } - }) - } } else { - let currentApp = GLOBALS.topmostApp - if (currentApp.startsWith("YouTube") || currentApp.startsWith("Netflix")) { - appApi.getPluginStatus(currentApp).then(result => { - if (result[0].state !== (Settings.get("platform", "enableAppSuspended") ? "suspended" : "deactivated")) { - appApi.exitApp(currentApp, true) - .then(() => GLOBALS.previousapp_onActiveSourceStatusUpdated = currentApp) - .catch(err => { - Router.navigate(GLOBALS.LastvisitedRoute) - this.ERR("Error in launching " + JSON.stringify(currentApp) + " : " + JSON.stringify(err)) - }); - } else { - this.LOG("App HdmiCecSource onActiveSourceStatusUpdated skipping; " + currentApp + " is already:" + JSON.stringify(result[0].state)); - } - }) - } Storage.set("lastVisitedRoute", Router.getActiveHash()) GLOBALS.LastvisitedRoute = Router.getActiveHash() } @@ -1687,37 +1090,11 @@ export default class App extends Router.App { this._getPowerStateWhileReboot(); }); } - // _registerFireboltListeners() { - // FireBoltApi.get().deviceinfo.gettype() - // FireBoltApi.get().lifecycle.ready() - - // FireBoltApi.get().lifecycle.registerEvent('foreground', value => { - // this.LOG("FireBoltApi[foreground] value:" + JSON.stringify(value) + ", launchResidentApp with:" + JSON.stringify(GLOBALS.selfClientName)); - // // Ripple launches refui with this rdkshell client name. - // GLOBALS.topmostApp = GLOBALS.selfClientName; - // FireBoltApi.get().discovery.launch("refui", { - // "action": "home", - // "context": { - // "source": "device" - // } - // }) - // }) - // FireBoltApi.get().lifecycle.registerEvent('background', value => { - // // Ripple changed app states; it will be a 'FireboltApp' - // GLOBALS.topmostApp = "FireboltApp"; - // this.LOG("FireBoltApi[foreground] value:" + JSON.stringify(value) + ", Updating top app as:" + JSON.stringify(GLOBALS.topmostApp)); - // }) - // FireBoltApi.get().lifecycle.state().then(res => { - // this.LOG("Lifecycle.state result:" + JSON.stringify(res)) - // }); - // } _firstEnable() { this.LOG("App Calling listenToVoiceControl method to activate VoiceControl Plugin") this.listenToVoiceControl(); this._updateLanguageToDefault() - /* Subscribe to Volume status events to report to Alexa. */ - this._subscribeToAlexaNotifications() this.initializeInactivityEngine(); } @@ -1863,220 +1240,21 @@ export default class App extends Router.App { await voiceApi.activate().then(() => { voiceApi.voiceStatus().then(voiceStatusResp => { if (voiceStatusResp.success) { - if (voiceStatusResp.urlPtt.includes("avs://")) { - GLOBALS.AlexaAvsstatus(true) - } - if (voiceStatusResp.ptt.status != "ready" || !voiceStatusResp.urlPtt.includes("avs://")) { - GLOBALS.AlexaAvsstatus(false) - this.ERR("App voiceStatus says PTT/AVS not ready, enabling it."); + if (voiceStatusResp.ptt.status != "ready") { + this.ERR("App voiceStatus says PTT not ready, enabling it."); // TODO: Future -> add option for user to select which Voice service provider. // Then configure VoiceControl plugin for that end point. // TODO: voiceApi.configureVoice() - if (AlexaApi.get().checkAlexaAuthStatus() != "AlexaUserDenied") { - AlexaApi.get().setAlexaAuthStatus("") - voiceApi.configureVoice({ - "enable": true - }).then(() => { - AlexaApi.get().setAlexaAuthStatus("AlexaAuthPending") - }); - } + voiceApi.configureVoice({ "enable": true }) } } }); - - if (AlexaApi.get().checkAlexaAuthStatus() === "AlexaAuthPending") { - /* AVS SDK might be awaiting a ping packet to start. */ - AlexaApi.get().pingAlexaSDK(); - } else if (AlexaApi.get().checkAlexaAuthStatus() === "AlexaHandleError") { - this.LOG("App checkAlexaAuthStatus is AlexaHandleError; enableSmartScreen."); - AlexaApi.get().enableSmartScreen(); - AlexaApi.get().getAlexaDeviceSettings(); - /* Alexa device volume state report. */ - appApi.getConnectedAudioPorts().then(audioport => { - for (let i = 0; i < audioport.connectedAudioPorts.length && !audioport.connectedAudioPorts[i].startsWith("SPDIF"); i++) { - if ( - (GLOBALS.deviceType == "IpTv" && audioport.connectedAudioPorts[i].startsWith("SPEAKER")) || - (GLOBALS.deviceType != "IpTv" && audioport.connectedAudioPorts[i].startsWith("HDMI")) - ) { - appApi.getMuted(audioport.connectedAudioPorts[i]).then(muteRes => { - appApi.getVolumeLevel(audioport.connectedAudioPorts[i]).then(volres => { - AlexaApi.get().reportVolumeState( - (volres.success ? (Number.isInteger(volres.volumeLevel) ? volres.volumeLevel : parseInt(volres.volumeLevel)) : undefined), - (muteRes.success ? muteRes.muted : undefined) - ) - }) - }) - } - } - }) - // Report device language - if (availableLanguageCodes[Language.get()].length) { - AlexaApi.get().updateDeviceLanguageInAlexa(availableLanguageCodes[Language.get()]); - } - // Report device timeZone - if ("ResidentApp" === GLOBALS.selfClientName) { - appApi.getZone().then(timezone => { - this.updateAlexaTimeZone(timezone) - }); - } else { - FireBoltApi.get().localization.getTimeZone().then(timezone => { - this.updateAlexaTimeZone(timezone) - }) - } - } - this.LOG("App VoiceControl check if user has denied ALEXA:" + JSON.stringify(AlexaApi.get().checkAlexaAuthStatus())) - /* Handle VoiceControl Notifications */ this._registerVoiceApiEvents() }).catch(err => { this.ERR("App VoiceControl Plugin activation error: " + JSON.stringify(err)); }) } - updateAlexaTimeZone(updatedTimeZone) { - if (updatedTimeZone.length) { - this.LOG("App: updateDeviceTimeZoneInAlexa with zone:" + JSON.stringify(updatedTimeZone)) - AlexaApi.get().updateDeviceTimeZoneInAlexa(updatedTimeZone); - } else { - this.ERR("App getTimezoneDST returned: " + JSON.stringify(updatedTimeZone)) - } - } - - deactivateChildApp(plugin) { //#needToBeRemoved - switch (plugin) { - case 'WebApp': - appApi.deactivateWeb(); - break; - case 'YouTube': - appApi.suspendPremiumApp("YouTube").then(() => { - this.LOG("YouTube : suspend YouTube request"); - }).catch((err) => { - this.ERR(JSON.stringify(err)); - }); - break; - case 'YouTubeTV': - appApi.suspendPremiumApp("YouTubeTV").then(() => { - this.LOG("YouTubeTV : suspend YouTubeTV request"); - }).catch((err) => { - this.ERR(JSON.stringify(err)); - }); - break; - case 'Lightning': - appApi.deactivateLightning(); - break; - case 'Native': - appApi.killNative(); - break; - case 'Amazon': - appApi.suspendPremiumApp('Amazon').then(res => { - if (res) { - let params = { - applicationName: "AmazonInstantVideo", - state: 'suspended' - }; - this.xcastApi.setApplicationState(params).then(status => { - if (status == false) { - this.ERR("App xcast setApplicationState failed, trying fallback. error: "); - this.xcastApi.onApplicationStateChanged(params).catch(err => { - this.ERR("App xcast onApplicationStateChanged failed: " + JSON.stringify(err)); - }); - } - }); - } - }); - break; - case "Netflix": - appApi.suspendPremiumApp("Netflix").then((res) => { - Router.navigate(GLOBALS.LastvisitedRoute); - this._moveApptoFront(GLOBALS.selfClientName, true) - if (res) { - let params = { - applicationName: "Netflix", - state: "suspended" - }; - this.xcastApi.setApplicationState(params).then(status => { - if (status == false) { - this.ERR("App xcast setApplicationState failed, trying fallback. error: "); - this.xcastApi.onApplicationStateChanged(params).catch(err => { - this.ERR("App xcast onApplicationStateChanged failed: " + JSON.stringify(err)); - }); - } - }); - } - }); - break; - case 'HDMI': - new HDMIApi().stopHDMIInput() - Storage.set("_currentInputMode", {}); - break; - default: - break; - } - } - - $initLaunchPad(url) { - return new Promise((resolve, reject) => { - appApi.getPluginStatus('Netflix') - .then(result => { - this.LOG("netflix plugin status is : " + JSON.stringify(result)); - if (result[0].state === 'deactivated' || result[0].state === 'deactivation') { - Router.navigate('image', { - src: Utils.asset('images/apps/App_Netflix_Splash.png') - }) - if (url) { - appApi.configureApplication('Netflix', url).then(() => { - appApi.launchPremiumApp("Netflix").then(() => { - RDKShellApis.setVisibility(GLOBALS.selfClientName, false); - resolve(true) - }).catch(() => { - reject(false) - }); // ie. org.rdk.RDKShell.launch - }).catch(err => { - this.ERR("Netflix : error while fetching configuration data : " + JSON.stringify(err)); - reject(err) - }) // gets configuration object and sets configuration - } else { - appApi.launchPremiumApp("Netflix").then(() => { - RDKShellApis.setVisibility(GLOBALS.selfClientName, false); - resolve(true) - }).catch(() => { - reject(false) - }); // ie. org.rdk.RDKShell.launch - } - } else { - /* Not in deactivated; could be suspended */ - if (url) { - appApi.launchPremiumApp("Netflix").then(() => { - thunder.call("Netflix", "systemcommand", { - "command": url - }) - .then(() => {}) - .catch(err => { - this.ERR("Netflix : error while sending systemcommand : " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, 'AppError', "Netflix : error while sending systemcommand : " + JSON.stringify(err), false, null) - reject(false); - }); - RDKShellApis.setVisibility(GLOBALS.selfClientName, false); - resolve(true) - }).catch(() => { - reject(false) - }); // ie. org.rdk.RDKShell.launch - } else { - appApi.launchPremiumApp("Netflix").then(res => { - this.LOG("Netflix : launch premium app resulted in " + JSON.stringify(res)); - RDKShellApis.setVisibility(GLOBALS.selfClientName, false); - resolve(true) - }); - } - } - }) - .catch(err => { - this.ERR("Netflix plugin error: " + JSON.stringify(err)); - GLOBALS.topmostApp = GLOBALS.selfClientName; - reject(false) - }) - }) - } - _powerKeyPressed() { appApi.getPowerState().then(res => { this.LOG("getPowerState: " + JSON.stringify(res)); @@ -2107,20 +1285,9 @@ export default class App extends Router.App { } _updateLanguageToDefault() { - if ("FireboltMainApp-refui" === GLOBALS.selfclientAppName) { - FireBoltApi.get().localization.language().then(lang => { - if (lang) { - FireBoltApi.get().localization.language(lang).then(() => { - this.LOG("language " + JSON.stringify(lang) + " set succesfully") - }) - localStorage.setItem('Language', lang) - } - }) - } else { - if (availableLanguageCodes[Language.get()].length) { - appApi.setUILanguage(availableLanguageCodes[Language.get()]) - localStorage.setItem('Language', Language.get()) - } + if (availableLanguageCodes[Language.get()].length) { + appApi.setUILanguage(availableLanguageCodes[Language.get()]) + localStorage.setItem('Language', Language.get()) } } @@ -2170,26 +1337,31 @@ export default class App extends Router.App { }); } - _moveApptoFront(appName, visibility) { - RDKShellApis.moveToFront(appName).then(() => { - RDKShellApis.setVisibility(appName, visibility); - RDKShellApis.setFocus(appName).then(() => {}).catch((err) => { - this.ERR("Error : can't set focus to the " + JSON.stringify(appName) + " " + JSON.stringify(err)); - Metrics.error(Metrics.ErrorType.OTHER, 'APPError', "RDKShell setFocus error" + JSON.stringify(err), false, null) - }); - }); - } - - launchFeaturedApp = (appName) => { + launchFeaturedApp = async (appName) => { console.log("Launching Featured App from AI 2.0: " + appName); - // let params = { - // launchLocation: "dedicatedButton", - // appIdentifier: this.appIdentifiers[appName] - // } - // appApi.launchApp(appName, params).catch(err => { - // this.ERR("Error in launching " + JSON.stringify(appName) + " via dedicated key: " + JSON.stringify(err)) - // }); - AppManager.get().launchApp("com.rdk.app.cobalt2025") + let installedApps; + try { + installedApps = await AppManager.get().getInstalledApps(); + } catch (err) { + this.ERR("Error fetching installed apps: " + JSON.stringify(err)); + return; + } + + const matchedApp = installedApps && installedApps.find(app => + app.appId.toLowerCase().includes(appName.toLowerCase()) + ); + const launchAppId = matchedApp ? matchedApp.appId : ""; + + if (launchAppId === "") { + this.ERR("Featured App not found in getInstalledApps: " + appName); + return; + } + + try { + await AppManager.get().launchApp(launchAppId) + } catch (err) { + this.ERR("Error launching featured app: " + JSON.stringify(err)); + } } /** @@ -2206,38 +1378,8 @@ export default class App extends Router.App { } }) if (this.xcastApps(notification.applicationName)) { - let applicationName = this.xcastApps(notification.applicationName); - let baseUrl = Storage.get(notification.applicationName + "DefaultURL"); - let pairingCode = notification.strPayLoad; - let additionalDataUrl = notification.strAddDataUrl; - let url = `${baseUrl}${pairingCode}&additionalDataUrl=${additionalDataUrl}`; - if (applicationName.startsWith("Netflix")) { - url = `${baseUrl}&dial=${pairingCode}&additionalDataUrl=${additionalDataUrl}` - } - let params = { - url: applicationName.startsWith("YouTube") || applicationName.startsWith("Netflix") ? url : notification.parameters.pluginUrl, - launchLocation: "dial", - appIdentifier: self.appIdentifiers[applicationName] - } - appApi.launchApp(applicationName, params).then(res => { - this.LOG("App onApplicationLaunchRequest: launched " + JSON.stringify(applicationName) + " : " + JSON.stringify(res)); - GLOBALS.topmostApp = applicationName; - // TODO: move to Controller.statuschange event - let params = { - applicationName: notification.applicationName, - state: 'running' - }; - this.xcastApi.setApplicationState(params).then(status => { - if (status == false) { - this.ERR("App xcast setApplicationState failed, trying fallback. error: "); - this.xcastApi.onApplicationStateChanged(params).catch(err => { - this.ERR("App xcast onApplicationStateChanged failed: " + JSON.stringify(err)); - }); - } - }); - }).catch(err => { - this.ERR("App onApplicationLaunchRequest: error " + JSON.stringify(err)) - }) + // FIXME: Implement DIAL launch functionality. + this.WARN("App onApplicationLaunchRequest: not implemented."); } else { this.LOG("App onApplicationLaunchRequest: " + JSON.stringify(notification.applicationName) + " is not supported.") } @@ -2246,12 +1388,8 @@ export default class App extends Router.App { this.xcastApi.registerEvent('onApplicationHideRequest', notification => { this.LOG('App onApplicationHideRequest: ' + JSON.stringify(notification)); if (this.xcastApps(notification.applicationName)) { - let applicationName = this.xcastApps(notification.applicationName); - this.LOG('App onApplicationHideRequest: ' + JSON.stringify(this.xcastApps(notification.applicationName))); - //second argument true means resident app won't be launched the required app will be exited in the background. - //only bring up the resident app when the notification is from the current app(ie app in focus) - this.LOG("App onApplicationHideRequest: exitApp as " + JSON.stringify(applicationName) + "!==" + JSON.stringify(GLOBALS.topmostApp)); - appApi.exitApp(applicationName, applicationName !== GLOBALS.topmostApp); + // FIXME: Implement hide logic for xcast apps if needed. + this.WARN("App onApplicationHideRequest: not implemented."); } else { this.LOG("App onApplicationHideRequest: " + JSON.stringify(notification.applicationName) + " is not supported.") } @@ -2265,19 +1403,8 @@ export default class App extends Router.App { } }) if (this.xcastApps(notification.applicationName)) { - let applicationName = this.xcastApps(notification.applicationName); - let params = { - url: notification.parameters.url, - launchLocation: "dial", - appIdentifier: self.appIdentifiers[applicationName] - } - this.LOG('App onApplicationResumeRequest: launchApp ' + JSON.stringify(applicationName) + " with params: " + JSON.stringify(params)); - appApi.launchApp(applicationName, params).then(res => { - GLOBALS.topmostApp = applicationName; - this.LOG("App onApplicationResumeRequest: launched " + JSON.stringify(applicationName) + " result: " + JSON.stringify(res)); - }).catch(err => { - this.ERR("Error in launching " + JSON.stringify(applicationName) + " on casting resume request: " + JSON.stringify(err)); - }) + // FIXME: Implement DIAL resume functionality. + this.WARN("App onApplicationResumeRequest: not implemented."); } else { this.LOG("App onApplicationResumeRequest: " + JSON.stringify(notification.applicationName) + " is not supported.") } @@ -2286,8 +1413,8 @@ export default class App extends Router.App { this.xcastApi.registerEvent('onApplicationStopRequest', notification => { this.LOG('App onApplicationStopRequest: ' + JSON.stringify(notification)); if (this.xcastApps(notification.applicationName)) { - let applicationName = this.xcastApps(notification.applicationName); - appApi.exitApp(applicationName, true, true); + // FIXME: Implement DIAL stop functionality. + this.WARN("App onApplicationStopRequest: not implemented."); } else { this.LOG("App onApplicationStopRequest: " + JSON.stringify(notification.applicationName) + " is not supported.") } @@ -2296,40 +1423,8 @@ export default class App extends Router.App { this.xcastApi.registerEvent('onApplicationStateRequest', notification => { console.log("App onApplicationStateRequest: " + JSON.stringify(notification)); if (this.xcastApps(notification.applicationName)) { - let applicationName = this.xcastApps(notification.applicationName); - let appState = { - "applicationName": notification.applicationName, - "state": "stopped" - }; - appApi.checkStatus(applicationName).then(result => { - this.LOG("result of xcast app status" + JSON.stringify(result[0].state)) - switch (result[0].state) { - case "activated": - case "resumed": - appState.state = "running"; - break; - case "Activation": - case "deactivated": - case "Deactivation": - case "Precondition": - appState.state = "stopped"; - break; - case "hibernated": - case "suspended": - appState.state = "suspended"; - break; - } - this.xcastApi.setApplicationState(appState).then(status => { - if (status == false) { - this.ERR("App xcast setApplicationState failed, trying fallback. error: "); - this.xcastApi.onApplicationStateChanged(appState).catch(err => { - this.ERR("App xcast onApplicationStateChanged failed: " + JSON.stringify(err)); - }); - } - }); - }).catch(error => { - this.ERR("App onApplicationStateRequest: checkStatus error " + JSON.stringify(error)); - }) + // FIXME: Implement DIAL state functionality. + this.WARN("App onApplicationStateRequest: not implemented."); } else { this.LOG("App onApplicationStateRequest: " + JSON.stringify(notification.applicationName) + " is not supported.") } @@ -2346,12 +1441,6 @@ export default class App extends Router.App { } else return false; } - $mountEventConstructor(fun) { - this.ListenerConstructor = fun; - this.LOG("MountEventConstructor was initialized") - // console.log(`listener constructor was set t0 = ${this.ListenerConstructor}`); - } - $registerUsbMount() { this.disposableListener = this.ListenerConstructor(); this.LOG("Successfully registered the usb Mount") @@ -2469,388 +1558,19 @@ export default class App extends Router.App { } } - _subscribeToAlexaNotifications() { - thunder.on('org.rdk.DisplaySettings', 'connectedAudioPortUpdated', notification => { - this.LOG("App got connectedAudioPortUpdated: " + JSON.stringify(notification)) - // TODO: future -> can be used for volume adjustments ? - }); - thunder.on('org.rdk.DisplaySettings', 'muteStatusChanged', notification => { - if (AlexaApi.get().checkAlexaAuthStatus() !== "AlexaUserDenied") { - AlexaApi.get().reportVolumeState(undefined, notification.muted); - } - }); - thunder.on('org.rdk.DisplaySettings', 'volumeLevelChanged', notification => { - if (AlexaApi.get().checkAlexaAuthStatus() !== "AlexaUserDenied") { - AlexaApi.get().reportVolumeState(notification.volumeLevel, undefined); - } - }); - thunder.on('org.rdk.System', 'onTimeZoneDSTChanged', notification => { - if (AlexaApi.get().checkAlexaAuthStatus() !== "AlexaUserDenied") { - AlexaApi.get().updateDeviceTimeZoneInAlexa(notification.newTimeZone); - } - }); - } - _registerVoiceApiEvents() { let self = this; voiceApi.registerEvent('onServerMessage', notification => { this.LOG('App onServerMessage: ' + JSON.stringify(notification)); - if (Storage.get("appSwitchingInProgress")) { - this.WARN("App is appSwitchingInProgress? " + JSON.stringify(Storage.get("appSwitchingInProgress")) + ", dropping processing the server notification."); - return; - } - if (AlexaApi.get().checkAlexaAuthStatus() !== "AlexaUserDenied") { - if (notification.xr_speech_avs.state_reporter === "authorization_req" || notification.xr_speech_avs.code) { - this.LOG("Alexa Auth URL is " + JSON.stringify(notification.xr_speech_avs.url)) - if (!Router.isNavigating() && !AlexaApi.get().isSmartScreenActiavated() && Router.getActiveHash() === "menu") { - this.LOG("App enableSmartScreen"); - AlexaApi.get().enableSmartScreen(); - } - if ((Router.getActiveHash() === "menu") && (GLOBALS.topmostApp === GLOBALS.selfClientName)) { - if (Router.getActiveHash() != "AlexaLoginScreen" && Router.getActiveHash() != "CodeScreen" && !Router.isNavigating()) { - this.LOG("Routing to Alexa login page") - Router.navigate("AlexaLoginScreen") - } - } - this.LOG("Alexa Auth OTP is " + JSON.stringify(notification.xr_speech_avs.code)) - } else if (notification.xr_speech_avs.state_reporter === "authendication") { - this.LOG("Alexa Auth State is now at " + JSON.stringify(notification.xr_speech_avs.state)) - if (notification.xr_speech_avs.state === "refreshed") { - AlexaApi.get().setAlexaAuthStatus("AlexaHandleError") - Router.navigate("SuccessScreen") - } else if ((notification.xr_speech_avs.state === "uninitialized") || (notification.xr_speech_avs.state === "authorizing")) { - AlexaApi.get().setAlexaAuthStatus("AlexaAuthPending") - } else if ((notification.xr_speech_avs.state === "unrecoverable error") && (GLOBALS.topmostApp === GLOBALS.selfClientName)) { - // Could be AUTH token Timeout; refresh it. - if (GLOBALS.Setup === true) { - Router.navigate("FailureScreen"); - } else { - Storage.set("alexaOTPReset", true); - } - } - } else if (notification.xr_speech_avs.state_reporter === "login" && notification.xr_speech_avs.state === "User request to disable Alexa") { - // https://jira.rdkcentral.com/jira/browse/RDKDEV-746: SDK abstraction layer sends on SKIP button event. - AlexaApi.get().setAlexaAuthStatus("AlexaUserDenied") - } - } - - if ((AlexaApi.get().checkAlexaAuthStatus() === "AlexaHandleError") && (notification.xr_speech_avs.state === "CONNECTING" || - notification.xr_speech_avs.state === "DISCONNECTED")) { // || notification.xr_speech_avs.state === "CONNECTED" - this._handleAlexaError(1) - this.tag("Failscreen1").notify({ - title: 'Alexa State', - msg: notification.xr_speech_avs.state - }) - setTimeout(() => { - this._handleAlexaError(0) - }, 5000); - } - if ((AlexaApi.get().checkAlexaAuthStatus() != "AlexaUserDenied") && notification.xr_speech_avs.state) { - if (notification.xr_speech_avs.state.guiAPL === "ACTIVATED") { - AlexaApi.get().displaySmartScreenOverlay(); - RDKShellApis.setFocus(GLOBALS.topmostApp === "" ? GLOBALS.selfClientName : GLOBALS.topmostApp); - } - if (notification.xr_speech_avs.state.dialogUX === "idle" && notification.xr_speech_avs.state.audio === "stopped") { - this.LOG("App current AlexaAudioplayerActive state:" + JSON.stringify(AlexaAudioplayerActive)); - if (AlexaAudioplayerActive && notification.xr_speech_avs.state.guiManager === "DEACTIVATED" || !AlexaAudioplayerActive) { - AlexaAudioplayerActive = false; - RDKShellApis.setFocus(GLOBALS.topmostApp === "" ? GLOBALS.selfClientName : GLOBALS.topmostApp); - } - } - if (notification.xr_speech_avs.state.dialogUX === "idle" && notification.xr_speech_avs.state.audio === "playing") { - AlexaApi.get().displaySmartScreenOverlay(true) - } else if (notification.xr_speech_avs.state.dialogUX === "listening") { - AlexaApi.get().displaySmartScreenOverlay(); - } else if (notification.xr_speech_avs.state.dialogUX === "speaking") { - AlexaApi.get().displaySmartScreenOverlay(true) - } - if (notification.xr_speech_avs.state_reporter === "dialog") { - // Smartscreen playback state reports - if ((notification.xr_speech_avs.state.dialogUX === "idle") && (notification.xr_speech_avs.state.audio)) { - AlexaApi.get().setAlexaSmartscreenAudioPlaybackState(notification.xr_speech_avs.state.audio); - } - } - } - if (notification.xr_speech_avs.directive && (AlexaApi.get().checkAlexaAuthStatus() != "AlexaUserDenied")) { - const header = notification.xr_speech_avs.directive.header - const payload = notification.xr_speech_avs.directive.payload - /////////Alexa.Launcher START - if (header.namespace === "Alexa.Launcher") { - //Alexa.launcher will handle launching a particular app(exiting might also be there) - if (header.name === "LaunchTarget") { - //Alexa payload will be to "launch" an app - if (AlexaLauncherKeyMap[payload.identifier]) { - let appCallsign = AlexaLauncherKeyMap[payload.identifier].callsign - let appUrl = AlexaLauncherKeyMap[payload.identifier].url //keymap url will be default, if alexa can give a url, it can be used istead - let targetRoute = AlexaLauncherKeyMap[payload.identifier].route - let params = { - url: appUrl, - launchLocation: "alexa", - appIdentifier: self.appIdentifiers[appCallsign] - } - // Send AVS State report: STOP request if "playing" to end the Smartscreen App instance. - if (AlexaApi.get().checkAlexaSmartscreenAudioPlaybackState() == "playing") { - this.LOG("Sending playbackstatereport to Pause: " + JSON.stringify(PlaybackStateReport)) - AlexaApi.get().reportPlaybackState("PAUSED"); - } - this.LOG("Alexa is trying to launch " + JSON.stringify(appCallsign) + " using params: " + JSON.stringify(params)) - if (appCallsign) { //appCallsign is valid means target is an app and it needs to be launched - appApi.launchApp(appCallsign, params).catch(err => { - this.ERR("Alexa.Launcher LaunchTarget Error in launching " + JSON.stringify(appCallsign) + " via Alexa: " + JSON.stringify(err)) - if (err.includes("Netflix")) { - AlexaApi.get().reportErrorState(notification.xr_speech_avs.directive, "INVALID_VALUE", "Unsupported AppID") - } else { - AlexaApi.get().reportErrorState(notification.xr_speech_avs.directive) - } - }); - } else if (targetRoute) { - this.LOG("Alexa.Launcher is trying to route to " + JSON.stringify(targetRoute)) - // exits the app if any and navigates to the specific route. - Storage.set("appSwitchingInProgress", true); - this.jumpToRoute(targetRoute); - GLOBALS.topmostApp = GLOBALS.selfClientName; - Storage.set("appSwitchingInProgress", false); - } - } else { - this.LOG("Alexa.Launcher is trying to launch an unsupported app : " + JSON.stringify(payload)) - AlexaApi.get().reportErrorState(notification.xr_speech_avs.directive) - } - } - } /////////Alexa.Launcher END - else if (header.namespace === "Alexa.RemoteVideoPlayer") { //alexa remote video player will search on youtube for now - this.LOG("Alexa.RemoteVideoPlayer: " + JSON.stringify(header)) - if (header.name === "SearchAndDisplayResults" || header.name === "SearchAndPlay") { - this.LOG("Alexa.RemoteVideoPlayer: SearchAndDisplayResults || SearchAndPlay: " + JSON.stringify(header)) - /* Find if payload contains Destination App */ - if (Object.prototype.hasOwnProperty.call(payload, "entities")) { - let entityId = payload.entities.filter(obj => Object.keys(obj).some(key => Object.prototype.hasOwnProperty.call(obj[key], "ENTITY_ID"))); - if (entityId.length && AlexaLauncherKeyMap[entityId[0].externalIds.ENTITY_ID]) { - /* ENTITY_ID or vsk key found; meaning Target App is there in response. */ - let replacedText = payload.searchText.transcribed.replace(entityId[0].value.toLowerCase(), "").trim(); - let appCallsign = AlexaLauncherKeyMap[entityId[0].externalIds.ENTITY_ID].callsign - //let appUrl = AlexaLauncherKeyMap[entityId[0].externalIds.ENTITY_ID].url - let launchParams = { - url: "", - launchLocation: "alexa", - appIdentifier: self.appIdentifiers[appCallsign] - } - if ("Netflix" === appCallsign) { - launchParams.url = encodeURI(replacedText); - } else if (appCallsign.startsWith("YouTube")) { - launchParams.url = Storage.get(appCallsign + "DefaultURL") + "&va=" + ((header.name === "SearchAndPlay") ? "play" : "search") + "&vq=" + encodeURI(replacedText); - } - this.LOG("Alexa.RemoteVideoPlayer: launchApp " + JSON.stringify(appCallsign) + " with params " + JSON.stringify(launchParams)) - appApi.launchApp(appCallsign, launchParams).then(res => { - this.LOG("Alexa.RemoteVideoPlayer:" + JSON.stringify(appCallsign) + " launched successfully using alexa search: " + JSON.stringify(res)) - }).catch(err => { - this.ERR("Alexa.RemoteVideoPlayer:" + JSON.stringify(appCallsign) + " launch FAILED using alexa search: " + JSON.stringify(err)) - }) - replacedText = null; - appCallsign = null; - launchParams = null; - } else if (!entityId.length && (GLOBALS.topmostApp != GLOBALS.selfClientName)) { - /* give it to current focused app */ - this.WARN("Alexa.RemoteVideoPlayer: " + JSON.stringify(GLOBALS.topmostApp) + " is the focued app; need Voice search integration support to it."); - } else if (!entityId.length && (GLOBALS.topmostApp == GLOBALS.selfClientName)) { - /* Generic global search without a target app; redirect to Youtube as of now. */ - let replacedText = payload.searchText.transcribed.trim(); - let appCallsign = AlexaLauncherKeyMap["amzn1.alexa-ask-target.app.70045"].callsign - let launchParams = { - url: "", - launchLocation: "alexa", - appIdentifier: self.appIdentifiers[appCallsign] - } - launchParams.url = Storage.get(appCallsign + "DefaultURL") + "&va=" + ((header.name === "SearchAndPlay") ? "play" : "search") + "&vq=" + encodeURI(replacedText); - this.LOG("Alexa.RemoteVideoPlayer: global search launchApp " + JSON.stringify(appCallsign) + " with params " + JSON.stringify(launchParams)) - appApi.launchApp(appCallsign, launchParams).then(res => { - this.LOG("Alexa.RemoteVideoPlayer:" + JSON.stringify(appCallsign) + " launched successfully using alexa search: " + JSON.stringify(res)) - }).catch(err => { - this.ERR("Alexa.RemoteVideoPlayer:" + JSON.stringify(appCallsign) + " launch FAILED using alexa search: " + JSON.stringify(err)) - }) - replacedText = null; - appCallsign = null; - launchParams = null; - } else { - /* Possibly an unsupported App. */ - this.WARN("Alexa.RemoteVideoPlayer: got ENTITY_ID " + JSON.stringify(entityId[0]?.externalIds?.ENTITY_ID) + " but no match in AlexaLauncherKeyMap."); - } - } else { - this.WARN("Alexa.RemoteVideoPlayer: payload does not have entities; may not work."); - } - } - } else if (header.namespace === "Alexa.PlaybackController") { - appApi.deeplinkToApp(GLOBALS.topmostApp, header.name, "alexa", header.namespace); - AlexaApi.get().reportPlaybackState(header.name); - } else if (header.namespace === "Alexa.SeekController") { - if (Router.getActiveHash() === "player" || Router.getActiveHash() === "usb/player") { - let time = notification.xr_speech_avs.directive.payload.deltaPositionMilliseconds / 1000 - this.tag("AAMPVideoPlayer").voiceSeek(time) - } else { - appApi.deeplinkToApp(GLOBALS.topmostApp, payload, "alexa", header.namespace); - } - } else if (header.namespace === "AudioPlayer") { - if (header.name === "Play") { - AlexaApi.get().displaySmartScreenOverlay(true) - AlexaAudioplayerActive = true; - this.LOG("App AudioPlayer: Suspending the current app:'" + JSON.stringify(GLOBALS.topmostApp) + "'"); - if (GLOBALS.topmostApp != GLOBALS.selfClientName) { - appApi.exitApp(GLOBALS.topmostApp); - } - } - } else if (header.namespace === "TemplateRuntime") { - if (header.name === "RenderPlayerInfo") { - AlexaApi.get().displaySmartScreenOverlay(true) - AlexaAudioplayerActive = true; - } - } else if (header.namespace === "Speaker") { - this.LOG("Speaker") - if (header.name === "AdjustVolume") { - VolumePayload.msgPayload.event.header.messageId = header.messageId - appApi.getConnectedAudioPorts().then(audioport => { - for (let i = 0; i < audioport.connectedAudioPorts.length && !audioport.connectedAudioPorts[i].startsWith("SPDIF"); i++) { - if ((GLOBALS.deviceType == "IpTv" && audioport.connectedAudioPorts[i].startsWith("SPEAKER")) || (GLOBALS.deviceType != "IpTv" && audioport.connectedAudioPorts[i].startsWith("HDMI"))) { - appApi.getVolumeLevel(audioport.connectedAudioPorts[i]).then(volres => { - const currentVolume = Number.parseInt(volres.volumeLevel, 10) - const volumeDelta = Number.parseInt(payload.volume, 10) - this.LOG("getVolumeLevel[" + JSON.stringify(audioport.connectedAudioPorts[i]) + "] is:" + JSON.stringify(currentVolume)) - if (Number.isNaN(currentVolume) || Number.isNaN(volumeDelta)) { - this.ERR("AdjustVolume invalid volume value current=" + JSON.stringify(volres.volumeLevel) + " delta=" + JSON.stringify(payload.volume)) - return; - } - let targetVolume = currentVolume + volumeDelta - if (targetVolume < 0) { - targetVolume = 0 - } else if (targetVolume > 100) { - targetVolume = 100 - } - VolumePayload.msgPayload.event.payload.volume = targetVolume - this.LOG("volumepayload" + JSON.stringify(targetVolume)) - appApi.setVolumeLevel(audioport.connectedAudioPorts[i], targetVolume).then(() => { - let volumeIncremented = currentVolume < targetVolume ? true : false - if (volumeIncremented && VolumePayload.msgPayload.event.payload.muted) { - VolumePayload.msgPayload.event.payload.muted = false - } - if (GLOBALS.topmostApp === GLOBALS.selfClientName) { - this.tag("Volume").onVolumeChanged(volumeIncremented); - } else { - if (Router.getActiveHash() === "applauncher") { - this.tag("Volume").onVolumeChanged(volumeIncremented); - } else { - Router.navigate("applauncher"); - this.tag("Volume").onVolumeChanged(volumeIncremented); - } - } - }).catch(err => { - this.ERR('AdjustVolume setVolumeLevel error:' + JSON.stringify(err)) - }); - }).catch(err => { - this.ERR('AdjustVolume getVolumeLevel error:' + JSON.stringify(err)) - }); - } - } - }); - } - if (header.name === "SetVolume") { - VolumePayload.msgPayload.event.header.messageId = header.messageId - const requestedVolume = Number.parseInt(payload.volume, 10) - if (Number.isNaN(requestedVolume)) { - this.ERR("SetVolume invalid payload.volume: " + JSON.stringify(payload.volume)) - return; - } - VolumePayload.msgPayload.event.payload.volume = requestedVolume - this.LOG("adjust volume" + JSON.stringify(VolumePayload)) - this.LOG("checkvolume" + JSON.stringify(VolumePayload.msgPayload.event.payload.volume)) - if (VolumePayload.msgPayload.event.payload.volume > 100) { - VolumePayload.msgPayload.event.payload.volume = 100 - } else if (VolumePayload.msgPayload.event.payload.volume < 0) { - VolumePayload.msgPayload.event.payload.volume = 0 - } - appApi.getConnectedAudioPorts().then(audioport => { - for (let i = 0; i < audioport.connectedAudioPorts.length && !audioport.connectedAudioPorts[i].startsWith("SPDIF"); i++) { - if ((GLOBALS.deviceType == "IpTv" && audioport.connectedAudioPorts[i].startsWith("SPEAKER")) || - (GLOBALS.deviceType != "IpTv" && audioport.connectedAudioPorts[i].startsWith("HDMI"))) { - appApi.getVolumeLevel(audioport.connectedAudioPorts[i]).then(volres => { - const currentVolume = Number.parseInt(volres.volumeLevel, 10) - const volumeIncremented = Number.isNaN(currentVolume) ? false : (currentVolume < VolumePayload.msgPayload.event.payload.volume ? true : false) - if (volumeIncremented && VolumePayload.msgPayload.event.payload.muted) { - VolumePayload.msgPayload.event.payload.muted = false - } - return appApi.setVolumeLevel(audioport.connectedAudioPorts[i], VolumePayload.msgPayload.event.payload.volume).then(() => { - if (GLOBALS.topmostApp === GLOBALS.selfClientName) { - this.tag("Volume").onVolumeChanged(volumeIncremented); - } else { - if (Router.getActiveHash() === "applauncher") { - RDKShellApis.moveToFront(GLOBALS.selfClientName) - RDKShellApis.setVisibility(GLOBALS.selfClientName, true) - this.tag("Volume").onVolumeChanged(volumeIncremented); - } else { - RDKShellApis.moveToFront(GLOBALS.selfClientName) - RDKShellApis.setVisibility(GLOBALS.selfClientName, true) - Router.navigate("applauncher"); - this.tag("Volume").onVolumeChanged(volumeIncremented); - } - } - }) - }).catch(err => { - this.ERR('SetVolume error:' + JSON.stringify(err)) - }); - } - } - }); - } - if (header.name === "SetMute") { - VolumePayload.msgPayload.event.header.messageId = header.messageId - VolumePayload.msgPayload.event.payload.volume = payload.volume - VolumePayload.msgPayload.event.payload.muted = payload.mute - if (GLOBALS.topmostApp === GLOBALS.selfClientName) { - this.tag("Volume").onVolumeMute(payload.mute); - } else { - if (Router.getActiveHash() === "applauncher") { - RDKShellApis.moveToFront(GLOBALS.selfClientName) - RDKShellApis.setVisibility(GLOBALS.selfClientName, true) - this.tag("Volume").onVolumeMute(payload.mute); - } else { - RDKShellApis.moveToFront(GLOBALS.selfClientName) - RDKShellApis.setVisibility(GLOBALS.selfClientName, true) - Router.navigate("applauncher"); - this.tag("Volume").onVolumeMute(payload.mute); - } - } - } - } else if (header.namespace === "ExternalMediaPlayer") { - appApi.deeplinkToApp(GLOBALS.topmostApp, payload, "alexa", header.namespace); - } - } - if ((AlexaApi.get().checkAlexaAuthStatus() != "AlexaUserDenied") && notification.xr_speech_avs.deviceSettings) { - let updatedLanguage = availableLanguageCodes[Language.get()] - if (notification.xr_speech_avs.deviceSettings.currentLocale.toString() != updatedLanguage) { - /* Get Alexa matching Locale String */ - for (let i = 0; i < notification.xr_speech_avs.deviceSettings.supportedLocales.length; i++) { - if (updatedLanguage === notification.xr_speech_avs.deviceSettings.supportedLocales[i].toString()) { - AlexaApi.get().updateDeviceLanguageInAlexa(updatedLanguage) - } - } - } - } }); voiceApi.registerEvent('onSessionBegin', () => { this.$hideImage(0); }); voiceApi.registerEvent('onSessionEnd', notification => { - if (notification.result === "success" && notification.success.transcription === "User request to disable Alexa") { - this.WARN("App VoiceControl.onSessionEnd got disable Alexa.") - AlexaApi.get().resetAVSCredentials() // To avoid Audio Feedback - AlexaApi.get().setAlexaAuthStatus("AlexaUserDenied") // Reset back to disabled as resetAVSCredentials() sets to ErrorHandling. - } + this.WARN("App VoiceControl.onSessionEnd notification: " + JSON.stringify(notification)); }); } - _handleAlexaError(visibility) { - this.tag("Failscreen1").alpha = visibility - this.tag("Widgets").visible = !visibility; - this.tag("Pages").visible = !visibility; - } - jumpToRoute(route) { const targetApp = GLOBALS.topmostApp; if (targetApp != GLOBALS.selfclientAppName) { diff --git a/accelerator-home-ui/src/AppController.js b/accelerator-home-ui/src/AppController.js index 5a4a564e..853988f6 100644 --- a/accelerator-home-ui/src/AppController.js +++ b/accelerator-home-ui/src/AppController.js @@ -66,6 +66,7 @@ export default class AppController { async init() { const mainAppId = GLOBALS.selfclientAppName; + this.LOG('Initializing AppController for mainAppId:', mainAppId); let mainClientId; try { @@ -92,6 +93,7 @@ export default class AppController { this.LOG('selfClientId:', GLOBALS.selfClientId); try { + this.LOG('Adding key intercepts for mainClientId:' + JSON.stringify(this.mainClientId)); await keyIntercept(this.mainClientId); } catch (err) { this.WARN(new ThunderError("RDKWindowManager.addKeyIntercepts()", err).toString()); diff --git a/accelerator-home-ui/src/Config/Config.js b/accelerator-home-ui/src/Config/Config.js index c397b6dd..e397c976 100644 --- a/accelerator-home-ui/src/Config/Config.js +++ b/accelerator-home-ui/src/Config/Config.js @@ -60,7 +60,6 @@ export var CONFIG = { versions: { default: 1, ControlSettings: 2, - 'org.rdk.UsbAccess': 2, 'org.rdk.DisplaySettings': 2, } } @@ -79,23 +78,31 @@ export const GLOBALS = { _Miracastclientdevicedetails:{mac: null,name: null,reason_code: null,state:null}, _previousapp_onActiveSourceStatusUpdated:null, _previousapp_onDisplayConnectionChanged:null, - _constantselfClientName: window.__firebolt && window.__firebolt.endpoint !== undefined ? "FireboltMainApp-refui" : "ResidentApp", - _selfclientId: window.__firebolt && window.__firebolt.endpoint !== undefined ? "FireboltMainApp-refui" : null, _LocalDeviceDiscoveryStatus:false, _EnergySaverMode:false, + _selfclientAppName: 'com.rdkcentral.refui', + _selfClientId: null, + set selfclientAppName(name) + { + this._selfclientAppName = name + }, + get selfclientAppName() + { + return this._selfclientAppName + }, get selfClientName() { - return this._constantselfClientName; + return this._selfclientAppName; }, set selfClientName(value) { - this._constantselfClientName = value; + this._selfclientAppName = value; }, get selfClientId() { - return this._selfclientId; + return this._selfClientId; }, set selfClientId(value) { - this._selfclientId = value; + this._selfClientId = value; }, - _currentTopMostApp: localStorage.getItem('topmostApp') || (window.__firebolt && window.__firebolt.endpoint !== undefined ? "FireboltMainApp-refui" : "ResidentApp"), + _currentTopMostApp: localStorage.getItem('topmostApp') || 'com.rdkcentral.refui', get topmostApp() { return this._currentTopMostApp; }, @@ -221,14 +228,5 @@ export const GLOBALS = { get refreshMyApps() { return this._refreshMyApps - }, - _selfclientAppName: 'com.rdkcentral.refui', - set selfclientAppName(name) - { - this._selfclientAppName = name - }, - get selfclientAppName() - { - return this._selfclientAppName } } diff --git a/accelerator-home-ui/src/MediaPlayer/AAMPVideoPlayer.js b/accelerator-home-ui/src/MediaPlayer/AAMPVideoPlayer.js index 9f18db8e..d73661f6 100644 --- a/accelerator-home-ui/src/MediaPlayer/AAMPVideoPlayer.js +++ b/accelerator-home-ui/src/MediaPlayer/AAMPVideoPlayer.js @@ -20,7 +20,6 @@ import { Lightning, Router } from '@lightningjs/sdk' import LightningPlayerControls from './LightningPlayerControl'; import { CONFIG } from '../Config/Config'; import ChannelOverlay from './ChannelOverlay'; -import {Metrics} from'@firebolt-js/sdk' let player = null let position = null @@ -65,7 +64,6 @@ export default class AAMPVideoPlayer extends Lightning.Component { this.setVideoRect(0, 0, 1920, 1080) } catch (error) { this.ERR('Playback Failed ' + JSON.stringify(error)) - Metrics.error(Metrics.ErrorType.MEDIA,"PlaybackError", "Playback Failed"+JSON.stringify(error), false, null) } } @@ -288,7 +286,6 @@ export default class AAMPVideoPlayer extends Lightning.Component { this.playerState = this.playerStatesEnum.idle } catch (error) { this.ERR('AAMPMediaPlayer is not defined ' + JSON.stringify(error)) - Metrics.error(Metrics.ErrorType.MEDIA,"PlaybackError", "AAMPMediaPlayer is not defined" +JSON.stringify(error), false, null) } } @@ -348,7 +345,6 @@ export default class AAMPVideoPlayer extends Lightning.Component { this.setVideoRect(0, 0, 1920, 1080) } catch (error) { this.ERR('Playback Failed ' + JSON.stringify(error)) - Metrics.error(Metrics.ErrorType.MEDIA,"PlaybackError", "Playback Failed "+JSON.stringify(error), false, null) } } @@ -379,7 +375,6 @@ export default class AAMPVideoPlayer extends Lightning.Component { this.setVideoRect(0, 0, 1920, 1080) } catch (error) { this.ERR('Playback Failed ' + JSON.stringify(error)) - Metrics.error(Metrics.ErrorType.MEDIA,"PlaybackError", 'Playback Failed ' + JSON.stringify(error), false, null) } } } @@ -399,7 +394,6 @@ export default class AAMPVideoPlayer extends Lightning.Component { this.setVideoRect(0, 0, 1920, 1080) } catch (error) { this.ERR('Playback Failed ' + JSON.stringify(error)) - Metrics.error(Metrics.ErrorType.MEDIA,"PlaybackError", 'Playback Failed '+JSON.stringify(error), false, null) } } } diff --git a/accelerator-home-ui/src/MediaPlayer/ChannelOverlay.js b/accelerator-home-ui/src/MediaPlayer/ChannelOverlay.js index 4c594839..23dd21d4 100644 --- a/accelerator-home-ui/src/MediaPlayer/ChannelOverlay.js +++ b/accelerator-home-ui/src/MediaPlayer/ChannelOverlay.js @@ -156,15 +156,8 @@ export default class ChannelOverlay extends Lightning.Component { let focusedChannelIdx = this.tag("Channels").index; let channel = this.options[focusedChannelIdx]; if (channel.dvburi === "OTT") { - let params = { - launchLocation: "epgScreen", - url: channel.url - } - this.appApi.launchApp(channel.callsign, params).then(() => { - this.dtvApi.exitChannel() - }).catch(() => { - this.dtvApi.exitChannel() //to exit previous channel regardless the app launch succeeds or fails - }) + // FIXME: Implement DVB OTT channel launch logic here. + this.WARN("DVB OTT channel launch not implemented."); } else if (channel.dvburi.startsWith("C_")) { if (!Router.isNavigating()) { let playerParams = { diff --git a/accelerator-home-ui/src/api/AlexaApi.js b/accelerator-home-ui/src/api/AlexaApi.js deleted file mode 100644 index cef4dc5f..00000000 --- a/accelerator-home-ui/src/api/AlexaApi.js +++ /dev/null @@ -1,204 +0,0 @@ -/** - * If not stated otherwise in this file or this component's LICENSE - * file the following copyright and licenses apply: - * - * Copyright 2020 RDK Management - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - **/ -import ThunderJS from 'ThunderJS'; -import { Storage } from '@lightningjs/sdk'; -import { AlexaLauncherKeyMap, errorPayload, PlaybackStateReport, VolumePayload, ApplicationStateReporter } from '../Config/AlexaConfig'; -import VoiceApi from './VoiceApi'; -import AppApi from './AppApi'; -import RDKShellApis from './RDKShellApis'; -import { CONFIG } from '../Config/Config'; -import { Metrics } from '@firebolt-js/sdk'; - -const thunder = ThunderJS(CONFIG.thunderConfig) -let instance = null - -export default class AlexaApi extends VoiceApi { - static get() { - if (instance == null) { - instance = new AlexaApi() - } - return instance - } - - constructor() { - super(); - this.INFO = console.info; - this.LOG = console.log; - this.ERR = console.error; - this.WARN = console.warn; - } - - /* Can be used to reduce enableSmartScreen() call */ - isSmartScreenActiavated() { - let appApi = new AppApi(); - appApi.checkStatus('SmartScreen').then(result => { - this.LOG("AlexaAPI: isSmartScreenActiavated result-" + JSON.stringify(result[0].state.toLowerCase())); - switch (result[0].state.toLowerCase()) { - case "resumed": - case "activated": break; - default: - return (false); - } - return true; - }).catch(err => { - this.ERR("AlexaAPI: isSmartScreenActiavated error-" + JSON.stringify(err)); - return (false); - }); - } - - enableSmartScreen() { - thunder.Controller.activate({ callsign: 'SmartScreen' }).then(res => { - this.LOG("AlexaAPI: Activate SmartScreen result: " + JSON.stringify(res)); - }).catch(err => { - this.ERR("AlexaAPI: Activate SmartScreen ERROR!: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "AlexaAPIError", `Thunder Controller AlexaAPI: Activate SmartScreen error with ${err}`, false, null) - }) - } - - disableSmartScreen() { - thunder.Controller.deactivate({ callsign: 'SmartScreen' }).then(res => { - this.LOG("AlexaAPI: Deactivate SmartScreen result: " + JSON.stringify(res)); - }).catch(err => { - this.ERR("AlexaAPI: Deactivate SmartScreen ERROR!: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "AlexaAPIError", "Thunder Controller AlexaAPI: Deactivate SmartScreen error with " + JSON.stringify(err), false, null) - }) - } - - displaySmartScreenOverlay(focused = false, opacity = 100, visible = true) { - RDKShellApis.moveToFront("SmartScreen"); - RDKShellApis.setOpacity("SmartScreen", opacity); - RDKShellApis.setVisibility("SmartScreen", visible); - if (focused) { RDKShellApis.setFocus("SmartScreen") } - } - - reportVolumeState(volumeLevel = undefined, muteStatus = undefined, messageId = undefined) { - if (volumeLevel != undefined) - VolumePayload.msgPayload.event.payload.volume = volumeLevel - if (muteStatus != undefined) - VolumePayload.msgPayload.event.payload.muted = muteStatus - if (messageId != undefined) - VolumePayload.msgPayload.event.header.messageId = messageId - this.LOG("Sending volume statereport to Alexa:" + JSON.stringify(VolumePayload)); - this.sendVoiceMessage(VolumePayload); - } - - updateDeviceLanguageInAlexa(updatedLanguage) { - let updatedLan = [] - updatedLan.push(updatedLanguage) - let payload = { "msgPayload": { "DeviceSettings": "Set Device Settings", "values": { "locale": updatedLan } } } - this.LOG("Sending language statereport to Alexa:" + JSON.stringify(updatedLan)); - this.sendVoiceMessage(payload); - } - - //reportDeviceTimeZone(updatedTimeZone) { - updateDeviceTimeZoneInAlexa(updatedTimeZone) { - this.LOG("updateDeviceTimeZoneInAlexa sending :" + JSON.stringify(updatedTimeZone)) - let payload = { "msgPayload": { "DeviceSettings": "Set Device Settings", "values": { "timezone": updatedTimeZone } } } - this.sendVoiceMessage(payload); - } - - reportErrorState(directive, type = "ENDPOINT_UNREACHABLE", message = "ENDPOINT_UNREACHABLE") { - errorPayload.msgPayload.event.payload.type = type - errorPayload.msgPayload.event.payload.message = message - errorPayload.msgPayload.event.header.correlationToken = directive.header.correlationToken - errorPayload.msgPayload.event.header.payloadVersion = directive.header.payloadVersion - errorPayload.msgPayload.event.endpoint.endpointId = directive.endpoint.endpointId - errorPayload.msgPayload.event.header.messageId = directive.header.messageId - this.LOG("AlexaAPI: reportErrorState payload:" + JSON.stringify(errorPayload)) - this.sendVoiceMessage(errorPayload); - } - - reportPlaybackState(state = "STOPPED") { - PlaybackStateReport.msgPayload.event.header.value = state; - this.LOG("AlexaAPI: reportPlaybackState payload:" + JSON.stringify(PlaybackStateReport)) - this.sendVoiceMessage(PlaybackStateReport); - } - - getAlexaDeviceSettings() { - this.sendVoiceMessage({ "msgPayload": { "DeviceSettings": "Get Device Settings" } }); - } - - pingAlexaSDK() { - /* Temporary fix to wake AVS SDK socket connectivity; this logic will be moved to middleware */ - this.sendVoiceMessage({ "msgPayload": { "KeepAlive": "ping to awake AVS SDK" } }); - } - /** - * Function to send voice message. - */ - resetAVSCredentials() { - return new Promise((resolve) => { - Storage.set("AlexaVoiceAssitantState", "AlexaAuthPending"); - thunder.Controller.activate({ callsign: 'SmartScreen' }).then(() => { - this.LOG("AlexaAPI: resetAVSCredentials activating SmartScreen instance.") - }).catch(err => { - this.ERR("AlexaAPI: resetAVSCredentials activate SmartScreen ERROR!: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "AlexaAPIError", "Thunder Controller AlexaAPI: resetAVSCredentials activating SmartScreen error with " + JSON.stringify(err), false, null) - }) - this.sendVoiceMessage({ "msgPayload": { "event": "ResetAVS" } }).then(result => { - resolve(result) - }).catch(err => { - this.ERR("AlexaAPI: resetAVSCredentials ERROR!: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "AlexaAPIError", "Thunder Controller AlexaAPI: resetAVSCredentials Activate ERROR!: " + JSON.stringify(err), false, null) - resolve(false) - }) - }); - } - - /** - * User can opt out Alexa; could be in Auth state or Some generic Alexa Error after Auth completed. - * Return respective map so that logic can be drawn based on that. - */ - checkAlexaAuthStatus() { - if (Storage.get("AlexaVoiceAssitantState") === undefined || Storage.get("AlexaVoiceAssitantState") === null || Storage.get("AlexaVoiceAssitantState") === "AlexaAuthPending") - return "AlexaAuthPending"; // Do not handle Alexa Related Errors; only Handle its Auth status. - else - return Storage.get("AlexaVoiceAssitantState"); // Return the stored value of AlexaVoiceAssitantState - } - - setAlexaAuthStatus(newState = false) { - Storage.set("AlexaVoiceAssitantState", newState) - if (newState === "AlexaUserDenied") { - this.configureVoice({ "enable": false }); - /* Free up Smartscreen resources */ - thunder.Controller.deactivate({ callsign: 'SmartScreen' }).then(() => { - this.LOG("AlexaAPI: deactivated SmartScreen instance.") - }).catch(err => { - this.ERR("AlexaAPI: deactivate SmartScreen ERROR!: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "AlexaAPIError", "Thunder Controller AlexaAPI: deactivate SmartScreen ERROR: " + JSON.stringify(err), true, null) - }) - } else { - this.configureVoice({ "enable": true }); - } - this.WARN("setAlexaAuthStatus with " + JSON.stringify(newState)) - } - - /** - * To track playback state of Alexa Smartscreen App(AmazonMusic or anything else) - */ - checkAlexaSmartscreenAudioPlaybackState() { - if (Storage.get("AlexaSmartscreenAudioPlaybackState") === null || Storage.get("AlexaSmartscreenAudioPlaybackState") === "null") - return "stopped"; // Assume default state. - else - return Storage.get("AlexaSmartscreenAudioPlaybackState"); - } - setAlexaSmartscreenAudioPlaybackState(newState = false) { - Storage.set("AlexaSmartscreenAudioPlaybackState", newState) - this.LOG("setAlexaSmartscreenAudioPlaybackState with " + JSON.stringify(newState)) - } -} diff --git a/accelerator-home-ui/src/api/AppApi.js b/accelerator-home-ui/src/api/AppApi.js index 47a330d4..245a2f5a 100644 --- a/accelerator-home-ui/src/api/AppApi.js +++ b/accelerator-home-ui/src/api/AppApi.js @@ -22,9 +22,6 @@ import HDMIApi from './HDMIApi'; import NetflixIIDs from "../../static/data/NetflixIIDs.json"; import HomeApi from './HomeApi'; import { availableLanguageCodes, CONFIG, GLOBALS } from '../Config/Config.js'; -import RDKShellApis from './RDKShellApis.js'; -import { Metrics } from '@firebolt-js/sdk'; -import Network from './NetworkApi.js'; import UserSettingsApi from './UserSettingsApi.js'; import PowerManagerApi from './PowerManagerApi.js'; import RDKWindowManager from './RDKWindowManagerApi.js'; @@ -63,7 +60,6 @@ export default class AppApi { }) .catch(err => { this.ERR('AppAPI Cannot fetch time zone', err) - Metrics.error(Metrics.ErrorType.OTHER, "PluginError", "Error in Thunder system getTimeZones" + err, false, null) resolve({}) }) }) @@ -85,7 +81,6 @@ export default class AppApi { }) .catch(err => { this.ERR('AppAPI System plugin getTimeZoneDST failed.' + JSON.stringify(err)); - Metrics.error(Metrics.ErrorType.OTHER, "PluginError", "Error in Thunder system getTimeZoneDST" + JSON.stringify(err), false, null) resolve(undefined) }) }) @@ -100,11 +95,9 @@ export default class AppApi { resolve(result.success) }).catch(err => { this.ERR("AppAPI System plugin setTimeZoneDST failed." + JSON.stringify(err)); - Metrics.error(Metrics.ErrorType.OTHER, "PluginError", "Error in Thunder system setTimeZoneDSt" + JSON.stringify(err), false, null) resolve(false) }) }).catch(err => { - Metrics.error(Metrics.ErrorType.OTHER, "PluginError", "Error in Thunder system setTimeZoneDST " + JSON.stringify(err), false, null) this.ERR("AppAPI activate System failed." + JSON.stringify(err)); }) } @@ -118,7 +111,6 @@ export default class AppApi { }) .catch(err => { this.ERR("AppAPI Controller plugin '" + plugin + "' status check failed."); - Metrics.error(Metrics.ErrorType.OTHER, "PluginError", "Error in Thunder system status " + JSON.stringify(err), false, null) reject(err) }) }) @@ -139,7 +131,6 @@ export default class AppApi { }) .catch(err => { this.ERR("AppAPI DisplaySettings plugin getCurrentResolution failed." + JSON.stringify(err)); - Metrics.error(Metrics.ErrorType.OTHER, "ApiError", "Error in Thunder displaySettings getCurrentResolution " + JSON.stringify(err), false, null) resolve('NA') }); }) @@ -155,7 +146,6 @@ export default class AppApi { }) .catch(err => { this.ERR('AppAPI activate DisplaySettings failed.' + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "ApiError", 'Error while Thunder Controller displaysettings activate ' + JSON.stringify(err), false, null) // change from here on monday }) }); } @@ -171,13 +161,11 @@ export default class AppApi { }) .catch(err => { this.ERR("AppAPI DisplaySettings getSupportedResolutions failed." + JSON.stringify(err)); - Metrics.error(Metrics.ErrorType.OTHER, "ApiError", "Error in Thunder displaySettings getSupportedResolutions " + JSON.stringify(err), false, null) resolve(false) }) }) .catch(err => { this.ERR('AppAPI activate DisplaySettings Error', JSON.stringify(err)); - Metrics.error(Metrics.ErrorType.OTHER, "ApiError", 'Error while Thunder Controller displaysettings activate ' + JSON.stringify(err), false, null) }) }) } @@ -200,13 +188,11 @@ export default class AppApi { }) .catch(err => { this.ERR("AppAPI DisplaySettings setCurrentResolution failed." + JSON.stringify(err)); - Metrics.error(Metrics.ErrorType.OTHER, "ApiError", 'Error in Thunder displaysettings setCurrentResolution ' + JSON.stringify(err), false, null) resolve(false) }) }) .catch(err => { this.ERR('AppAPI activate DisplaySettings Error', JSON.stringify(err)); - Metrics.error(Metrics.ErrorType.OTHER, "ApiError", 'Error while Thunder Controller displaysettings activate ' + JSON.stringify(err), false, null) }) }) } @@ -226,13 +212,11 @@ export default class AppApi { }) .catch(err => { this.ERR("AppAPI HdcpProfile getHDCPStatus failed." + JSON.stringify(err)); - Metrics.error(Metrics.ErrorType.OTHER, "HDCPError", 'Error in Thunder HdcpProfile getHDCPStatus ' + JSON.stringify(err), false, null) resolve(false) }) }) .catch(err => { this.ERR('AppAPI activate HdcpProfile ', JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "HDCPError", 'Error while Thunder Controller HdcpProfile activate ' + JSON.stringify(err), false, null) }) }) } @@ -252,13 +236,11 @@ export default class AppApi { }) .catch(err => { this.ERR("AppAPI DisplaySettings getTvHDRSupport failed." + JSON.stringify(err)); - Metrics.error(Metrics.ErrorType.OTHER, "ApiError", 'Error in Thunder DisplaySettings getTvHDRSupport ' + JSON.stringify(err), false, null) resolve(false) }) }) .catch(err => { this.ERR('AppAPI activate DisplaySettings Error', JSON.stringify(err)); - Metrics.error(Metrics.ErrorType.OTHER, "ApiError", 'Error while Thunder Controller DisplaySettings activate ' + JSON.stringify(err), false, null) }) }) } @@ -278,13 +260,11 @@ export default class AppApi { }) .catch(err => { this.ERR('AppAPI DisplaySettings getSettopHDRSupport failed ', JSON.stringify(err)); - Metrics.error(Metrics.ErrorType.OTHER, "PluginError", 'Error in Thunder DisplaySettings getSettopHDRSupport ' + JSON.stringify(err), false, null) resolve(false) }) }) .catch(err => { this.ERR('AppAPI activate DisplaySettings Error', JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "PluginError", 'Error while Thunder Controller DisplaySettings activate ' + JSON.stringify(err), false, null) }) }) } @@ -304,13 +284,11 @@ export default class AppApi { }) .catch(err => { this.ERR("AppAPI DisplayInfo hdrsetting failed : " + JSON.stringify(err)); - Metrics.error(Metrics.ErrorType.OTHER, "PluginError", 'Error in fetching Thunder DisplayInfo hdrsetting ' + JSON.stringify(err), false, null) resolve(false) }) }) .catch(err => { this.LOG('AppAPI activate DisplayInfo Error', JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "PluginError", 'Error while Thunder Controller DisplayInfo activate ' + JSON.stringify(err), false, null) }) }) } @@ -330,13 +308,11 @@ export default class AppApi { }) .catch(err => { this.ERR("AppAPI OCDM drms failed." + JSON.stringify(err)); - Metrics.error(Metrics.ErrorType.OTHER, "OCDMError", 'Error in fetching Thunder OCDM drms ' + JSON.stringify(err), false, null) resolve(false) }) }) .catch(err => { this.ERR('AppAPI activate OCDM error:', JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "OCDMError", 'Error while Thunder Controller OCDM activate ' + JSON.stringify(err), false, null) }) }) } @@ -353,24 +329,11 @@ export default class AppApi { }) .catch(err => { this.ERR("AppAPI ResidentApp delete cache failed."); - Metrics.error(Metrics.ErrorType.OTHER, "Cache failure", JSON.stringify(err), false, null) resolve(err) }) }) } - async getAvailableTypes() { - return RDKShellApis.getAvailableTypes().then(types => { - // Include NativeApp as well as its not being included from backend. - if (!types.includes("NativeApp")) types.push("NativeApp"); - this.LOG("RDKShell.getAvailableTypes:", JSON.stringify(types)) - resolve(types) - }).catch(err => { - Metrics.error(Metrics.ErrorType.OTHER, "Cache failure", 'Error in fetching Thunder RDKShell getAvailableTypes ' + JSON.stringify(err), false, null) - resolve(false) - }) - } - /** * Function to launch All types of apps. Accepts 2 params. * @param {String} callsign String required callsign of the particular app. @@ -381,369 +344,11 @@ export default class AppApi { * @property {boolean} preventCurrentExit: optional | true will prevent bydefault launch of previous app */ - async launchApp(callsign, args) { - Storage.set("appSwitchingInProgress", true); - const saveAbleRoutes = ["menu", "epg", "apps"] //routing back will happen to only these routes, otherwise it will default to #menu when exiting the app. - const lastVisitedRoute = Router.getActiveHash(); - if (saveAbleRoutes.includes(lastVisitedRoute)) { - Storage.set("lastVisitedRoute", lastVisitedRoute); - GLOBALS.LastvisitedRoute= lastVisitedRoute - } else { - Storage.set("lastVisitedRoute", "menu"); - GLOBALS.LastvisitedRoute="menu" - } - Router.navigate("applauncher"); - this.LOG("AppAPI launchApp called with: " + JSON.stringify(callsign) + JSON.stringify(args)); - if (callsign.startsWith("YouTube")) { - Storage.set(callsign + "LaunchLocation", args.launchLocation) - } - - let url, preventInternetCheck, preventCurrentExit, launchLocation, gracenoteUrl = null; - if (args) { - url = args.url; - preventInternetCheck = args.preventInternetCheck; - preventCurrentExit = args.preventCurrentExit; - launchLocation = args.launchLocation - } - - const launchLocationKeyMapping = { - //currently supported launch locations by the UI and mapping to corresponding reason/keys for IID - "mainView": { "YouTube": "menu", "YouTubeTV": "menu", "Netflix": "App_launched_via_Netflix_Icon_On_The_Apps_Row_On_The_Main_Home_Page" }, - "dedicatedButton": { "YouTube": "remote", "YouTubeTV": "remote", "Netflix": "App_launched_via_Netflix_Button" }, - "appsMenu": { "YouTube": "menu", "YouTubeTV": "menu", "Netflix": "App_launched_via_Netflix_Icon_On_The_Apps_Section" }, - "epgScreen": { "YouTube": "guide", "YouTubeTV": "guide", "Netflix": "App_launched_from_EPG_Grid" }, - "dial": { "YouTube": "dial", "YouTubeTV": "dial", "Netflix": "App_launched_via_DIAL_request" }, - "gracenote": { "YouTube": "launcher", "YouTubeTV": "launcher", "Netflix": "App_launched_via_Netflix_Icon_On_The_Apps_Row_On_The_Main_Home_Page" }, - "alexa": { "YouTube": "voice", "YouTubeTV": "voice", "Netflix": "App_launched_via_Netflix_Icon_On_The_Apps_Row_On_The_Main_Home_Page" }, - }; - if (launchLocation && launchLocationKeyMapping[launchLocation]) { - if (callsign === "Netflix" || callsign.startsWith("YouTube")) { - /* Gracenote provides shortened url which shall only be deeplinked; do not use for activation. */ - if (launchLocation === "gracenote") { - gracenoteUrl = url - } - launchLocation = launchLocationKeyMapping[launchLocation][callsign] - } - } - - this.LOG("AppAPI launchApp with callsign: " + JSON.stringify(callsign) + " | url: " + JSON.stringify(url) + " | preventInternetCheck: " + JSON.stringify(preventInternetCheck) + " | preventCurrentExit: " + JSON.stringify(preventCurrentExit) + " | launchLocation: " + JSON.stringify(launchLocation)); - - let IIDqueryString = ""; - if (callsign === "Netflix") { - let netflixIids = await this.getNetflixIIDs(); - if (launchLocation) { - IIDqueryString = `source_type=${netflixIids[launchLocation].source_type}&iid=${netflixIids[launchLocation].iid}`; - if (url) { - IIDqueryString = "&" + IIDqueryString; //so that IIDqueryString can be appended with url later. - } - } else { - this.WARN("AppAPI launchLocation(IID) not specified while launching netflix"); - } - } - - const availableCallsigns = await RDKShellApis.getAvailableTypes(); - - if (!availableCallsigns.includes(callsign)) { - Storage.set("appSwitchingInProgress", false); - Router.navigate(GLOBALS.LastvisitedRoute); - return Promise.reject("Can't launch App: " + callsign + " | Error: callsign not found!"); - } - - if (!preventInternetCheck) { - let internet = await Network.get().isConnectedToInternet(); - if (!internet) { - Storage.set("appSwitchingInProgress", false); - Router.navigate(GLOBALS.LastvisitedRoute); - return Promise.reject("No Internet Available, can't launchApp."); - } - } - - const currentApp = GLOBALS.topmostApp; //get it from stack if required. | current app ==="" means residentApp - - let pluginStatus, pluginState;// to check if the plugin is active, resumed, deactivated etc - try { - if (callsign != "NativeApp") { - pluginStatus = await this.getPluginStatus(callsign); - pluginState = pluginStatus[0].state; - } - } catch (err) { - this.ERR("Getplugin status error"+err); - Storage.set("appSwitchingInProgress", false); - Router.navigate(GLOBALS.LastvisitedRoute); - return Promise.reject("AppAPI PluginError: " + callsign + ": App not supported on this device | Error: " + JSON.stringify(err)); - } - this.LOG("AppAPI " + callsign + " : pluginStatus: " + JSON.stringify(pluginStatus) + " pluginState: ", JSON.stringify(pluginState)); - - if(callsign.startsWith("Amazon") || callsign.startsWith("Netflix")||callsign.startsWith("YouTube")){ - if(pluginState ==='hibernated') - { - thunder.call('org.rdk.RDKShell.1','restore',{"callsign": callsign}).then(res =>{ - this.LOG(JSON.stringify(res)); - }) - } - } - if (callsign === "Netflix") { - if (pluginState === "deactivated" || pluginState === "deactivation") { //netflix cold launch scenario - this.LOG(`AppAPI Netflix : ColdLaunch`) - if (Router.getActivePage().showSplashImage) { - Router.getActivePage().showSplashImage(callsign) //to make the splash image for netflix visible - } - if (url) { - try { - this.LOG("AppAPI Netflix ColdLaunch passing netflix url & IIDqueryString using configureApplication method: ", url, IIDqueryString); - await this.configureApplication("Netflix", url + IIDqueryString); - } catch (err) { - this.ERR("AppAPI Netflix configureApplication error: ", err); - } - } else { - try { - this.LOG("AppAPI Netflix ColdLaunch passing netflix IIDqueryString using configureApplication method: ", IIDqueryString); - await this.configureApplication("Netflix", IIDqueryString); - } catch (err) { - this.ERR("AppAPI Netflix configureApplication error: ", err); - } - } - } else { //netflix hot launch scenario - this.LOG("AppAPI Netflix : HotLaunch") - if (url) { - try { - this.LOG("AppAPI Netflix HotLaunch passing netflix url & IIDqueryString using systemcommand method: ", url, IIDqueryString); - await thunder.call("Netflix", "systemcommand", { command: url + IIDqueryString }); - } catch (err) { - this.ERR("AppAPI Netflix systemcommand error: ", err); - Metrics.error(Metrics.ErrorType.OTHER, "PluginError", "Error in fetching Thunder Netflix systemcommand " + JSON.stringify(err), false, null) - } - } - else { - try { - this.LOG("AppAPI Netflix HotLaunch passing netflix IIDqueryString using systemcommand method: ", IIDqueryString); - await thunder.call("Netflix", "systemcommand", { command: IIDqueryString }); - } catch (err) { - this.ERR("AppAPI Netflix systemcommand error: ", err); - Metrics.error(Metrics.ErrorType.OTHER, "PluginError", "Error in fetching Thunder Netflix systemcommand " + JSON.stringify(err), false, null) - } - } - } - } - - let params = { - "callsign": callsign, - "type": callsign, - "configuration": {} - }; - if (url && (callsign === "LightningApp" || callsign === "HtmlApp" || callsign === "NativeApp")) { //for lightning/htmlapp url is passed via rdkshell.launch method - params.uri = url - } else if (callsign.startsWith("YouTube")) { - let language = Language.get() - language = availableLanguageCodes[language] ? availableLanguageCodes[language] : "en-US" //default to english US if language is not available. - if (gracenoteUrl === null) { - url = url ? url : Storage.get(callsign + "DefaultURL"); - } else { - /* Gracenote provided url cannot be used for 'Configuring' plugin. Use only to deeplink. */ - url = Storage.get(callsign + "DefaultURL"); - } - if (url) { - if (!url.includes("?")) { - url += "?" - } - if (!url.includes("inApp=")) { - if (!url.endsWith("&")) { - url += "&" - } - url += ((GLOBALS.topmostApp === callsign) ? "inApp=true" : "inApp=false") - } - if (!url.includes("launch=")) { - if (!url.endsWith("&")) { - url += "&" - } - url += "launch=" + launchLocation - } - if ((launchLocation === "voice") && !url.includes("vs=")) { - if (!url.endsWith("&")) { - url += "&" - } - url += "vs=2" // YT Dev Doc specific to Alexa - } - this.LOG("AppAPI " + callsign + " is being launched using the url: " + JSON.stringify(url)) - } - - params.configuration = { //for gracenote cold launch url needs to be re formatted to youtube.com/tv/ - "language": language, - "url": url, - "launchtype": "launch=" + launchLocation - } - params.type = "Cobalt"; - } - - else if (callsign === "Amazon") { - let language = Language.get(); - language = availableLanguageCodes[language] ? availableLanguageCodes[language] : "en-US" - params.configuration = { "deviceLanguage": language }; - } - else if (callsign === "Netflix") { - let language = Language.get(); - language = availableLanguageCodes[language] ? availableLanguageCodes[language] : "en-US" - params.configuration = { "language": language }; - } - - if (!preventCurrentExit && (currentApp !== GLOBALS.selfClientName) && (currentApp !== callsign)) { - //currentApp==="" means currently on residentApp | make currentApp = "residentApp" in the cache and stack - try { - this.LOG("AppAPI calling exitApp with params: " + callsign + " and exitInBackground " + currentApp + " true.") - await this.exitApp(currentApp, true) - } - catch (err) { - this.ERR("AppAPI currentApp " + currentApp + " exit failed!: launching new app...") - Metrics.error(Metrics.ErrorType.OTHER, "AppError", `exit failed! for ${currentApp} with ${JSON.stringify(err)}.So launching new app...`, false, null) - } - } - - if ((currentApp === GLOBALS.selfClientName) && callsign !== "Netflix") { //currentApp==="" means currently on residentApp | make currentApp = "residentApp" in the cache and stack | for netflix keep the splash screen visible till it launches - RDKShellApis.setVisibility(GLOBALS.selfClientName, false) - } - - if (callsign === "Netflix") { //special case for netflix to show splash screen - params.behind = GLOBALS.selfClientName //to make the app launch behind resident app | app will be moved to front after first frame event is triggered - } - if (JSON.stringify(params.configuration) === '{}') { - delete params.configuration; - } - this.LOG("AppAPI RDKShell launch with params: " + JSON.stringify(params)); - return new Promise((resolve, reject) => { - if (callsign === "NativeApp") { - // Could be coming from PartnerApp. - params.client = callsign; - params.mimeType = "application/native"; - RDKShellApis.launchApplication(params).then(res => { - this.LOG(`AppAPI ${callsign} : Launch results in ${JSON.stringify(res)}`) - if (res.success) { - if (args.appIdentifier) { - let order = Storage.get("appCarouselOrder") - if (!order) { - Storage.set("appCarouselOrder", "") - } else { - let storedApps = order.split(",") - let ix = storedApps.indexOf(args.appIdentifier) - if (ix != -1) { - storedApps.splice(ix, 1) - } - storedApps.unshift(args.appIdentifier) - Storage.set("appCarouselOrder", storedApps.toString()) - } - } - GLOBALS.topmostApp = callsign; - Storage.set("appSwitchingInProgress", false); - resolve(res); - } else { - this.ERR("AppAPI failed to launchApp(success false) : ", callsign, " ERROR: ", JSON.stringify(res)) - Storage.set("appSwitchingInProgress", false); - Router.navigate(GLOBALS.LastvisitedRoute); - Metrics.error(Metrics.ErrorType.OTHER, "PluginError", "Error in Thunder RDKShell launchApplication " + JSON.stringify(res), false, null) - reject(res) - } - }).catch(err => { - this.ERR("AppAPI failed to launchApp: ", callsign, " ERROR: ", JSON.stringify(err), " | Launching residentApp back") - RDKShellApis.kill(callsign); - this.launchResidentApp(GLOBALS.selfClientName); - Storage.set("appSwitchingInProgress", false); - Metrics.error(Metrics.ErrorType.OTHER, "PluginError", "Error in Thunder RDKShell launchApplication " + JSON.stringify(err), false, null) - Router.navigate(GLOBALS.LastvisitedRoute); - reject(err) - }) - } else { - RDKShellApis.launch(params).then(res => { - this.LOG("AppAPI " + callsign + " : Launch results in " + JSON.stringify(res)) - if (res.success) { - if (args.appIdentifier) { - let order = Storage.get("appCarouselOrder") - if (!order) { - Storage.set("appCarouselOrder", "") - } else { - let storedApps = order.split(",") - let ix = storedApps.indexOf(args.appIdentifier) - if (ix != -1) { - storedApps.splice(ix, 1) - } - storedApps.unshift(args.appIdentifier) - Storage.set("appCarouselOrder", storedApps.toString()) - } - } - - if (callsign !== "Netflix") { //if app is not netflix, move it to front(netflix will be moved to front from applauncherScreen.) - RDKShellApis.getZOrder().then(res => { - this.WARN("AppAPI zOrder:" + JSON.stringify(res)); - }).catch(err => { - this.ERR("AppAPI failed to zOrder : " + JSON.stringify(callsign) + " ERROR: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "PluginError", "Error in Thunder RDKShell zOrder " + JSON.stringify(err), false, null) - }) - RDKShellApis.moveToFront(callsign, callsign).catch(err => { - this.ERR("AppAPI failed to moveToFront : " + JSON.stringify(callsign) + " ERROR: " + JSON.stringify(err) + " | fail reason can be since app is already in front") - Metrics.error(Metrics.ErrorType.OTHER, "PluginError", "Error in Thunder RDKShell moveToFront " + JSON.stringify(err), false, null) - }) - } - - RDKShellApis.setFocus(callsign, callsign).catch(err => { - this.ERR("AppAPI failed to setFocus : ", callsign, " ERROR: ", JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "PluginError", "Error in Thunder RDKShell setFocus " + JSON.stringify(err), false, null) - }) - - RDKShellApis.setVisibility(callsign, true).catch(err => { - this.ERR("AppAPI failed to setVisibility : ", callsign, " ERROR: ", JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "PluginError", "Error in Thunder RDKShell setVisibility " + JSON.stringify(err), false, null) - }) - - if (callsign === "Netflix") { - this.LOG("AppAPI Netflix launched: hiding residentApp"); - //if netflix splash screen was launched resident app was kept visible Netflix until app launched. - RDKShellApis.setVisibility(GLOBALS.selfClientName, false).catch(err => { - this.ERR("AppAPI failed to setVisibility : ", GLOBALS.selfClientName, " ERROR: ", JSON.stringify(err)) - }) - } - - if (callsign.startsWith("YouTube") && ((res.launchType === "resume") || (gracenoteUrl != null))) { - // Page visibility requirement; 'launch' need to be 'deeplink'ed when app is 'resumed'. - if (gracenoteUrl != null) { - url = gracenoteUrl; - } else if (!url) { - url = params.configuration.url; - } - this.LOG("AppAPI Calling " + callsign + ".deeplink with url: " + url); - thunder.call(callsign, 'deeplink', url) - } - Storage.set("appSwitchingInProgress", false); - GLOBALS.topmostApp = callsign; - resolve(res); - } else { - this.ERR("AppAPI failed to launchApp(success false) : "+ JSON.stringify(callsign), " ERROR: ", JSON.stringify(res)) - Storage.set("appSwitchingInProgress", false); - Router.navigate(GLOBALS.LastvisitedRoute); - Metrics.error(Metrics.ErrorType.OTHER, "PluginError", "Error in Thunder RDKShell launch " + JSON.stringify(err), false, null) - reject(res) - } - }).catch(err => { - this.ERR("AppAPI failed to launchApp: " + JSON.stringify(callsign) + " ERROR: " + JSON.stringify(err) + " | Launching residentApp back") - Metrics.error(Metrics.ErrorType.OTHER, "PluginError", "Error in Thunder RDKShell launch " + JSON.stringify(err), false, null) - - //destroying the app incase it's stuck in launching | if taking care of ResidentApp as callsign, make sure to prevent destroying it - RDKShellApis.destroy(callsign).catch(err => { - this.ERR("AppAPI failed to destroy : " + JSON.stringify(callsign) + " ERROR: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "PluginError", "Error in Thunder RDKShell destroy " + JSON.stringify(err), false, null) - }) - this.launchResidentApp(GLOBALS.selfClientName); - Storage.set("appSwitchingInProgress", false); - Router.navigate(GLOBALS.LastvisitedRoute); - reject(err) - }) - } - }) - } - - /** * Function to launch Exit types of apps. * @param {String} callsign callsign of the particular app. * @param {boolean} exitInBackground to make the app not bring up residentApp on exit - * @param {boolean} forceDestroy to force the app to do rdkshell.destroy instead of suspend + * @param {boolean} forceDestroy to force the app to do destroy instead of suspend */ // exit method does not need to launch the previous app. @@ -756,15 +361,7 @@ export default class AppApi { this.LOG("AppAPI exit method called for hdmi") new HDMIApi().stopHDMIInput() Storage.set("_currentInputMode", {}); - if (!exitInBackground) { //means resident App needs to be launched - this.launchResidentApp(GLOBALS.selfClientName, GLOBALS.selfClientName); - } return Promise.resolve(true); - //check for hdmi scenario - } - - if (callsign === "LightningApp" || callsign === "HtmlApp" || callsign === "Peacock") { - forceDestroy = true //html and lightning apps need not be suspended. } let pluginStatus, pluginState;// to check if the plugin is active, resumed, deactivated etc @@ -782,89 +379,8 @@ export default class AppApi { return Promise.reject("AppAPI PluginError: " + callsign + ": App not supported on this device | Error: " + JSON.stringify(err)); } } - - if (!exitInBackground && GLOBALS.Miracastclientdevicedetails.state != "PLAYING") { //means resident App needs to be launched - this.launchResidentApp(GLOBALS.selfClientName, GLOBALS.selfClientName); - } - - //to hide the current app - this.LOG("AppAPI setting visibility of " + callsign + " to false") - await RDKShellApis.setVisibility(callsign, false).catch(err => { - this.ERR("AppAPI failed to setVisibility : " + callsign + " ERROR: ", JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "PluginError", "Error in Thunder RDKShell setVisibility " + JSON.stringify(err), false, null) - }) - - if (forceDestroy) { - if (pluginState != undefined) { // App is a Plugin - this.LOG("AppAPI Force Destroying the app: ", callsign) - await RDKShellApis.destroy(callsign).catch(err => { - this.ERR("AppAPI Error in destroying app: " + callsign + " " + JSON.stringify(err)); - RDKShellApis.kill(callsign).catch(err => { - this.ERR("AppAPI Error in killing app: " + callsign + " " + JSON.stringify(err)); - }) - }) - return Promise.resolve(true); - } else if (callsign === "NativeApp" || callsign.includes('application/dac.native')) { - await RDKShellApis.kill((callsign.includes('application/dac.native') ? callsign.substring(0, callsign.indexOf(';')) : callsign)).catch(err => { - this.ERR("AppAPI RDKShell kill: " + callsign + " ERROR: ", JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "PluginError", "Error in Thunder RDKShell kill " + JSON.stringify(err), false, null) - return Promise.resolve(false); - }); - } - } - else { - this.LOG("AppAPI Exiting from App: ", callsign, " depending on platform settings enableAppSuspended: ", Settings.get("platform", "enableAppSuspended")); - //enableAppSuspended = true means apps will be suspended by default - if (Settings.get("platform", "enableAppSuspended")) { - if (pluginState != undefined) { // App is a Plugin - await RDKShellApis.suspend(callsign).catch(err => { - this.ERR("AppAPI Error in suspending app: ", callsign, " | trying to destroy the app" + JSON.stringify(err)); - Metrics.error(Metrics.ErrorType.OTHER, "PluginError", "Error in Thunder RDKShell suspend " + JSON.stringify(err), false, null) - RDKShellApis.destroy(callsign); - }) - return Promise.resolve(true) - } else if (callsign === "NativeApp" || callsign.includes('application/dac.native')) { - // DAC Demo WorkAround; TODO: use suspendApplication instead of kill - await RDKShellApis.kill((callsign.includes('application/dac.native') ? callsign.substring(0, callsign.indexOf(';')) : callsign)).catch(err => { - this.ERR("AppAPI Error in kill app: ", callsign, " | trying to destroy the app" + JSON.stringify(err)); - Metrics.error(Metrics.ErrorType.OTHER, "PluginError", "Error in Thunder RDKShell kill " + JSON.stringify(err), false, null) - RDKShellApis.destroy(callsign); - }) - return Promise.resolve(true) - } - } - else { - await RDKShellApis.destroy(callsign); - return Promise.resolve(true); - } - } - } - - /** - * Function to launch ResidentApp explicitly(incase of special scenarios) - * Prefer using launchApp and exitApp for ALL app launch and exit scenarios. - */ - async launchResidentApp(client = GLOBALS.selfClientName, callsign = GLOBALS.selfClientName) { - this.LOG("AppAPI launchResidentApp got Called: setting visibility, focus and moving to front the client: " + client) - await RDKShellApis.moveToFront(client, callsign).catch(err => { - this.ERR("AppAPI failed to moveToFront : ResidentApp ERROR: ", JSON.stringify(err), " | fail reason can be since app is already in front") - Metrics.error(Metrics.ErrorType.OTHER, "PluginError", "Error in Thunder RDKShell moveToFront " + JSON.stringify(err), false, null) - }) - - await RDKShellApis.setFocus(client, callsign).catch(err => { - this.ERR("AppAPI failed to setFocus : ResidentApp ERROR: ", JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "PluginError", "Error in Thunder RDKShell setFocus " + JSON.stringify(err), false, null) - }) - - await RDKShellApis.setVisibility(client, true).catch(err => { - this.ERR("AppAPI failed to setVisibility : ResidentApp ERROR: ", JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "PluginError", "Error in Thunder RDKShell setVisibility " + JSON.stringify(err), false, null) - }) - - GLOBALS.topmostApp = client; } - async getNetflixIIDs() { let defaultIIDs = NetflixIIDs; let data = new HomeApi().getPartnerAppsInfo(); @@ -886,180 +402,33 @@ export default class AppApi { } } catch (err) { this.ERR("AppAPI Error in fetching iid data from specified path, returning defaultIIDs | Error:", err); - Metrics.error(Metrics.ErrorType.OTHER, "Apperror", "AppAPI Error in fetching iid data from specified path" + JSON.stringify(err), false, null) return defaultIIDs; } } - /* - *Function to launch apps in hidden mode - */ - launchPremiumAppInSuspendMode(childCallsign) { - return new Promise((resolve, reject) => { - RDKShellApis.launch({ - callsign: childCallsign, - type: childCallsign, - suspend: true, - visible: false, - focused: false, - }).then((res) => { - if (childCallsign == "Netflix") { - this.LOG(`AppAPI launchPremiumAppInSuspendMode : launch netflix results in :`, res); - } - else { - this.LOG(`AppAPI launchPremiumAppInSuspendMode : launch amazon results in :`, res); - } - resolve(true) - }).catch(err => { - if (childCallsign == "Netflix") { - this.ERR(`AppAPI Netflix : error while launching netflix :`, err); - } - else { - this.LOG(`AppAPI Amazon : error while launching amazon :`, err); - } - Metrics.error(Metrics.ErrorType.OTHER, "PluginError", "Error in Thunder RDKShell launch " + JSON.stringify(err), false, null) - reject(false) - }); - }) - } - - /** - * Function to launch Netflix/Amazon Prime app. - */ - launchPremiumApp(childCallsign) { - return new Promise((resolve, reject) => { - RDKShellApis.launch({ - callsign: childCallsign, - type: childCallsign, - visible: true, - focused: true - }).then((res) => { - if (childCallsign == "Netflix") { - this.LOG(`AppAPI launchPremiumApp : launch netflix results in :`, res); - } - else { - this.LOG(`AppAPI launchPremiumApp : launch amazon results in :`, res); - } - RDKShellApis.setVisibility(childCallsign, true) - RDKShellApis.setFocus(childCallsign) - RDKShellApis.moveToFront(childCallsign) - GLOBALS.topmostApp = childCallsign; - this.LOG(`AppAPI launchPremiumApp the current application Type : `, GLOBALS.topmostApp); - resolve(true) - }).catch(err => { - if (childCallsign == "Netflix") { - this.ERR(`AppAPI launchPremiumApp : error while launching netflix :`, err); - } - else { - this.ERR(`AppAPI launchPremiumApp : error while launching amazon :`, err); - } - Metrics.error(Metrics.ErrorType.OTHER, "PluginError", "Error in Thunder RDKShell launch " + JSON.stringify(err), false, null) - reject(false) - }); - }) - } - - /** - * Function to launch Resident app. - * @param {String} url url of app. - */ - launchResident(url, client) { - return new Promise((resolve, reject) => { - const childCallsign = client - RDKShellApis.launch({ - callsign: childCallsign, - type: GLOBALS.selfClientName, - uri: url, - }).then((res) => { - this.LOG(`AppAPI launchResident returned: `, JSON.stringify(res)); - resolve(true) - }).catch(err => { - this.ERR('AppAPI launchResident error: ' + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "PluginError", "Error in Thunder RDKShell launch " + JSON.stringify(err), false, null) - reject(false) - }) - }) - } - launchOverlay(url, client) { - return new Promise((resolve, reject) => { - const childCallsign = client - RDKShellApis.launch({ - callsign: childCallsign, - type: GLOBALS.selfClientName, - uri: url, - }).then(res => { - RDKShellApis.moveToFront(childCallsign, childCallsign) - this.LOG(`AppAPI launchOverlay : launched overlay : `, JSON.stringify(res)); - resolve(res) - }).catch(err => { - this.ERR("AppAPI launchOverlay : error ", JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "PluginError", "Error in Thunder RDKShell launch " + JSON.stringify(err), false, null) - reject(err) - }) - }) - } - - /** - * Function to suspend Netflix/Amazon Prime app. - */ - suspendPremiumApp(appName) { - return new Promise((resolve) => { - RDKShellApis.suspend(appName).then(() => { - resolve(true); - }).catch(err => { - this.ERR("AppAPI suspendPremiumApp error: ", JSON.stringify(err)); - Metrics.error(Metrics.ErrorType.OTHER, "PluginError", "Error in Thunder RDKShell suspend " + JSON.stringify(err), false, null) - resolve(false) - }) - }) + // FIXME: Implement logic to launch overlay apps here with AppManager. + // return new Promise((resolve, reject) => { + // const childCallsign = client + // RDKShellApis.launch({ + // callsign: childCallsign, + // type: GLOBALS.selfClientName, + // uri: url, + // }).then(res => { + // RDKShellApis.moveToFront(childCallsign, childCallsign) + // this.LOG(`AppAPI launchOverlay : launched overlay : `, JSON.stringify(res)); + // resolve(res) + // }).catch(err => { + // this.ERR("AppAPI launchOverlay : error ", JSON.stringify(err)) + // reject(err) + // }) + // }) } registerPowerEvent(callback) { return PowerManagerApi.get().registerEvent("onPowerModeChanged", callback); } - /** - * Function to deactivate html app. - */ - deactivateWeb() { - RDKShellApis.destroy("HtmlApp") - } - - /** - * Function to deactivate cobalt app. - */ - deactivateCobalt(instanceName = 'Cobalt') { - RDKShellApis.destroy(instanceName) - } - - cobaltStateChangeEvent() { - try { - thunder.on('Controller', 'statechange', notification => { - if (this._events.has('statechange')) { - this._events.get('statechange')(notification) - } - }) - } catch (e) { - this.ERR('AppAPI Failed to register statechange event' + e) - Metrics.error(Metrics.ErrorType.OTHER, "PluginError", "Error while Thunder Controller stateChange " + JSON.stringify(e), false, null) - } - } - - /** - * Function to deactivate lightning app. - */ - deactivateLightning() { - RDKShellApis.destroy("Lightning") - } - - /** - * Function to deactivate resident app. - */ - deactivateResidentApp(client) { - RDKShellApis.destroy(client) - } - enableInactivityReporting(bool) { return RDKWindowManager.get().enableInactivityReporting(bool) } @@ -1121,11 +490,9 @@ export default class AppApi { this.LOG(`AppAPI ${appName} : updating configuration with object ${res} results in ${resp}`) resolve(true); }).catch((err) => { - Metrics.error(Metrics.ErrorType.OTHER, "PluginError", `Error in Thunder ${plugin} ${method} ${JSON.stringify(err)}`, false, null) reject(err); //resolve(true) }); }).catch((err) => { - Metrics.error(Metrics.ErrorType.OTHER, "PluginError", `Error in Thunder ${plugin} ${method} ${JSON.stringify(err)}`, false, null) reject(err); }); }) @@ -1145,7 +512,6 @@ export default class AppApi { resolve(result); }).catch(err => { this.ERR("AppAPI System getPowerStateIsManagedByDevice failed: ", JSON.stringify(err)); - Metrics.error(Metrics.ErrorType.OTHER, "PowerStateFailure", "Error in Thunder System getPowerStateIsManagedByDevice " + JSON.stringify(err), false, null); reject(err); }); }); @@ -1170,7 +536,6 @@ export default class AppApi { }) .catch(err => { this.ERR("org.rdk.System: getWakeupReason: Error in getting wake up reason: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "PowerStateFailure", "Error in Thunder System getWakeupReason " + JSON.stringify(err), false, null) reject(err) }) }) @@ -1185,7 +550,6 @@ export default class AppApi { }) .catch(err => { this.ERR('AppAPI activate DisplaySettings error: ', JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "AppError", "Error while Thunder Controller displaySettings activate " + JSON.stringify(err), false, null) reject(err) }) }) @@ -1202,7 +566,6 @@ export default class AppApi { }) .catch(err => { this.ERR("AppAPI DisplaySettings getSoundMode error:", JSON.stringify(err, 3, null)) - Metrics.error(Metrics.ErrorType.OTHER, "PluginError", "Error in Thunder DisplaySettings getSoundMode " + JSON.stringify(err), false, null) resolve(false) }) }) @@ -1223,7 +586,6 @@ export default class AppApi { }) .catch(err => { this.ERR("AppAPI DisplaySettings setSoundMode error:", JSON.stringify(err, 3, null)) - Metrics.error(Metrics.ErrorType.OTHER, "PluginError", "Error in Thunder DisplaySettings setSoundMode " + JSON.stringify(err), false, null) resolve(false) }) }) @@ -1240,7 +602,6 @@ export default class AppApi { }) .catch(err => { this.ERR("AppAPI DisplaySettings getSupportedAudioModes error:", JSON.stringify(err, 3, null)) - Metrics.error(Metrics.ErrorType.OTHER, "PluginError", "Error in Thunder DisplaySettings getSupportedAudioModes " + JSON.stringify(err), false, null) reject(false) }) }) @@ -1258,7 +619,6 @@ export default class AppApi { }) .catch(err => { this.ERR("AppAPI DisplaySettings setEnableAudioPort error:", JSON.stringify(err, 3, null)) - Metrics.error(Metrics.ErrorType.OTHER, "PluginError", "Error in Thunder DisplaySettings setEnableAudioPort " + JSON.stringify(err), false, null) resolve(false) }) }) @@ -1273,7 +633,6 @@ export default class AppApi { }) .catch(err => { this.ERR("AppAPI DisplaySettings getDRCMode error:", JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "PluginError", "Error in Thunder DisplaySettings getDRCMode " + JSON.stringify(err), false, null) resolve(false) }) }) @@ -1290,7 +649,6 @@ export default class AppApi { }) .catch(err => { this.ERR("AppAPI DisplaySettings setDRCMode error:", JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "PluginError", "Error in Thunder DisplaySettings setDRCMode " + JSON.stringify(err), false, null) resolve(false) }) }) @@ -1305,7 +663,6 @@ export default class AppApi { }) .catch(err => { this.ERR("AppAPI DisplaySettings getZoomSetting error:", JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "PluginError", "Error in Thunder DisplaySettings getZoomSetting " + JSON.stringify(err), false, null) resolve(false) }) }) @@ -1320,7 +677,6 @@ export default class AppApi { }) .catch(err => { this.ERR("AppAPI DisplaySettings setZoomSetting error:", JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "PluginError", "Error in Thunder DisplaySettings setZoomSetting " + JSON.stringify(err), false, null) resolve(false) }) }) @@ -1335,7 +691,6 @@ export default class AppApi { }) .catch(err => { this.ERR("AppAPI DisplaySettings getEnableAudioPort error:", JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "PluginError", "Error in Thunder DisplaySettings getEnableAudioPort " + JSON.stringify(err), false, null) resolve(false) }) }) @@ -1350,7 +705,6 @@ export default class AppApi { }) .catch(err => { this.ERR("AppAPI DisplaySettings getSupportedAudioPorts error:", JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "PluginError", "Error in Thunder DisplaySettings getSupportedAudioPorts " + JSON.stringify(err), false, null) resolve(false) }) }) @@ -1374,7 +728,6 @@ export default class AppApi { }) .catch(err => { this.ERR("AppAPI System getFirmwareUpdateInfo error:", JSON.stringify(err, 3, null)) - Metrics.error(Metrics.ErrorType.OTHER, "PluginError", "Error in Thunder system getFirmwareUpdateInfo " + JSON.stringify(err), false, null) resolve(false) }) }) @@ -1390,7 +743,6 @@ export default class AppApi { }) .catch(err => { this.ERR(" AppAPI System getFirmwareUpdateState error:", JSON.stringify(err, 3, null)) - Metrics.error(Metrics.ErrorType.OTHER, "PluginError", "Error in Thunder system getFirmwareUpdateState " + JSON.stringify(err), false, null) resolve(false) }) }) @@ -1406,7 +758,6 @@ export default class AppApi { }) .catch(err => { this.ERR("AppAPI System getDownloadedFirmwareInfo error:", JSON.stringify(err, 3, null)) - Metrics.error(Metrics.ErrorType.OTHER, "PluginError", "Error in Thunder system getDownloadedFirmwareInfo " + JSON.stringify(err), false, null) resolve(false) }) }) @@ -1418,7 +769,6 @@ export default class AppApi { resolve(result.model) }).catch(err => { this.ERR("AppAPI DeviceInfo modelname failed:" + JSON.stringify(err)); - Metrics.error(Metrics.ErrorType.OTHER, "PluginError", "Error in Thunder DeviceInfo modelname " + JSON.stringify(err), false, null) resolve("RDK-VA") }) }) @@ -1430,7 +780,6 @@ export default class AppApi { resolve(result.serialnumber) }).catch(err => { this.ERR("AppAPI DeviceInfo serialnumber error:", JSON.stringify(err, 3, null)); - Metrics.error(Metrics.ErrorType.OTHER, "PluginError", "Error in Thunder DeviceInfo serialnumber " + JSON.stringify(err), false, null) resolve('0123456789') }) }) @@ -1447,7 +796,6 @@ export default class AppApi { }) .catch(err => { this.ERR("AppAPI System getSystemVersions error:" + JSON.stringify(err, 3, null)) - Metrics.error(Metrics.ErrorType.OTHER, "PluginError", "Error in Thunder system getSystemVersions " + JSON.stringify(err), false, null) resolve(false) }) }) @@ -1463,7 +811,6 @@ export default class AppApi { }) .catch(err => { this.ERR("AppAPI System updateFirmware error:", JSON.stringify(err, 3, null)) - Metrics.error(Metrics.ErrorType.OTHER, "PluginError", "Error in Thunder system updateFirmware " + JSON.stringify(err), false, null) resolve(false) }) }) @@ -1479,7 +826,6 @@ export default class AppApi { }) .catch(err => { this.ERR("AppAPI getFirmwareDownloadPercent error:", JSON.stringify(err, 3, null)) - Metrics.error(Metrics.ErrorType.OTHER, "PluginError", "Error in Thunder system getFirmwareDownloadPercent " + JSON.stringify(err), false, null) resolve(false) }) }) @@ -1496,7 +842,6 @@ export default class AppApi { }) .catch(err => { this.ERR("AppAPI systeminfo error:", JSON.stringify(err, 3, null)) - Metrics.error(Metrics.ErrorType.OTHER, "PluginError", "Error in Thunder DeviceInfo systeminfo " + JSON.stringify(err), false, null) resolve(false) }) }) @@ -1511,7 +856,6 @@ export default class AppApi { }) .catch(err => { this.ERR("AppAPI devicetype error:", JSON.stringify(err, 3, null)) - Metrics.error(Metrics.ErrorType.OTHER, "PluginError", "Error in Thunder DeviceInfo devicetype " + JSON.stringify(err), false, null) resolve(false) }) }) @@ -1540,7 +884,6 @@ export default class AppApi { }) .catch(err => { this.ERR("AppAPI getPreferredStandbyMode error:", JSON.stringify(err, 3, null)) - Metrics.error(Metrics.ErrorType.NETWORK, "PluginError", "Error in Thunder system getPreferredStandbyMode " + JSON.stringify(err), false, null) resolve(false) }) }) @@ -1552,7 +895,6 @@ export default class AppApi { resolve(result) }).catch(err => { this.ERR("AppAPI getNetworkStandbyMode error:", JSON.stringify(err, 3, null)) - Metrics.error(Metrics.ErrorType.NETWORK, "PluginError", "Error in Thunder system getNetworkStandbyMode " + JSON.stringify(err), false, null) reject(err) }) }) @@ -1570,7 +912,6 @@ export default class AppApi { } }).catch(err => { this.ERR("AppAPI getFriendlyName error:", JSON.stringify(err, 3, null)) - Metrics.error(Metrics.ErrorType.OTHER, "PluginError", "Error in Thunder system getFriendlyName " + JSON.stringify(err), false, null) reject(err) }) }) @@ -1588,7 +929,6 @@ export default class AppApi { } }).catch(err => { this.ERR("AppAPI setFriendlyName error:", JSON.stringify(err, 3, null)) - Metrics.error(Metrics.ErrorType.OTHER, "PluginError", "Error in Thunder system setFriendlyName " + JSON.stringify(err), false, null) reject(err) }) }) @@ -1606,7 +946,6 @@ export default class AppApi { } }).catch(err => { this.ERR("AppAPI getRFCConfig error:", JSON.stringify(err, 3, null)) - Metrics.error(Metrics.ErrorType.OTHER, "PluginError", "Error in Thunder system getRFCConfig " + JSON.stringify(err), false, null) reject(err) }) }) @@ -1616,28 +955,6 @@ export default class AppApi { return PowerManagerApi.get().setWakeupSourceConfig(params) } - async sendAppState(value) { - const state = await thunder - .call('org.rdk.RDKShell', 'getState', {}) - .then(result => result.state); - this.state = state; - let params = { applicationName: value, state: 'stopped' }; - for (let i = 0; i < state.length; i++) { - if (state[i].callsign == value) { - if (state[i].state == 'resumed') { - params.state = 'running'; - } else if (state[i].state == 'suspended') { - params.state = 'suspended'; - } else { - params.state = 'stopped' - } - } - } - await thunder - .call('org.rdk.Xcast', 'onApplicationStateChanged', params) - .then(result => result.success); - } - // Volume Apis getConnectedAudioPorts() { return new Promise((resolve, reject) => { @@ -1648,7 +965,6 @@ export default class AppApi { }) .catch(err => { this.ERR('AppAPI getConnectedAudioPorts error:', JSON.stringify(err, 3, null)) - Metrics.error(Metrics.ErrorType.OTHER, "PluginError", "Error in Thunder getConnectedAudioPorts of DisplaySettings " + JSON.stringify(err), false, null) reject(false) }) }) @@ -1660,7 +976,6 @@ export default class AppApi { resolve(result) }).catch(err => { this.ERR('AppAPI getVolumeLevel error:', JSON.stringify(err, 3, null)) - Metrics.error(Metrics.ErrorType.OTHER, "PluginError", "Error in Thunder getVolumeLevel of DisplaySettings " + JSON.stringify(err), false, null) reject(false) }) }) @@ -1677,7 +992,6 @@ export default class AppApi { }) .catch(err => { this.ERR('AppAPI getMuted error:', JSON.stringify(err, 3, null)) - Metrics.error(Metrics.ErrorType.OTHER, "PluginError", "Error in Thunder getMuted of DisplaySettings " + JSON.stringify(err), false, null) reject(false) }) }) @@ -1704,7 +1018,6 @@ export default class AppApi { }) .catch(err => { this.ERR('AppAPI setVolumeLevel error:', JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "PluginError", "Error in Thunder setVolumeLevel of DisplaySettings " + JSON.stringify(err), false, null) resolve(false) }) }) @@ -1722,7 +1035,6 @@ export default class AppApi { }) .catch(err => { this.ERR('AppAPI audio_mute setMuted error:', JSON.stringify(err, 3, null)) - Metrics.error(Metrics.ErrorType.OTHER, "PluginError", "Error in Thunder setMuted of DisplaySettings " + JSON.stringify(err), false, null) resolve(false) }) }) @@ -1738,7 +1050,6 @@ export default class AppApi { }) .catch(err => { this.ERR("AppAPI getPluginStatusParams error: ", err) - Metrics.error(Metrics.ErrorType.OTHER, "PluginError", `Error in fetching Thunder status@${plugin} of Thunder Controller ${JSON.stringify(err)}`, false, null) reject(err) }) }) @@ -1757,7 +1068,6 @@ export default class AppApi { }) .catch(err => { this.ERR('AppAPI activateAutoPairing error:', JSON.stringify(err, 3, null)) - Metrics.error(Metrics.ErrorType.OTHER, "PluginError", "Error in fetching Thunder startPairing of RemoteControl " + JSON.stringify(err), false, null) resolve(false) }) }) @@ -1774,7 +1084,6 @@ export default class AppApi { }) .catch(err => { this.ERR("AppAPI resetBassEnhancer error: ", err) - Metrics.error(Metrics.ErrorType.OTHER, "PluginError", "Error in fetching Thunder resetBassEnhancer of DisplaySettings " + JSON.stringify(err), false, null) resolve(false) }); }) @@ -1791,7 +1100,6 @@ export default class AppApi { }) .catch(err => { this.ERR("AppAPI resetDialogEnhancement error:", err) - Metrics.error(Metrics.ErrorType.OTHER, "PluginError", "Error in fetching Thunder resetDialogEnhancement of DisplaySettings " + JSON.stringify(err), false, null) resolve(false) }); }) @@ -1808,7 +1116,6 @@ export default class AppApi { }) .catch(err => { this.ERR("AppAPI resetSoundVitualizer error:", err) - Metrics.error(Metrics.ErrorType.OTHER, "PluginError", "Error in fetching Thunder resetSurroundVirtualizer of DisplaySettings " + JSON.stringify(err), false, null) resolve(false) }); }) @@ -1825,7 +1132,6 @@ export default class AppApi { }) .catch(err => { this.ERR("AppAPI resetvolumeLevel error:", err) - Metrics.error(Metrics.ErrorType.OTHER, "PluginError", "Error in fetching Thunder resetVolumeLeveller of DisplaySettings " + JSON.stringify(err), false, null) resolve(false) }); }) @@ -1846,7 +1152,6 @@ export default class AppApi { }) .catch(err => { this.ERR("AppAPI monitorStatus error:", err) - Metrics.error(Metrics.ErrorType.OTHER, "PluginError", "Error in Thunder fetching resetstats of Monitor " + JSON.stringify(err), false, null) resolve(false) }); }) @@ -1861,7 +1166,6 @@ export default class AppApi { }) .catch(err => { this.ERR("AppAPI deletecache error:", err) - Metrics.error(Metrics.ErrorType.OTHER, "PluginError", `Error in Thunder delete of ${systemcCallsign} ${JSON.stringify(err)}`, false, null) resolve(false) }); }) @@ -1877,7 +1181,6 @@ export default class AppApi { }) .catch(err => { this.ERR("AppAPI activateController error:", err) - Metrics.error(Metrics.ErrorType.OTHER, "PluginError", `Error while Thunder Controller activate ${callsign} ${JSON.stringify(err)}`, false, null) resolve(false) }); }) @@ -1890,7 +1193,6 @@ export default class AppApi { resolve(res) }).catch(err => { this.ERR("AppAPI checkStatus error:", err) - Metrics.error(Metrics.ErrorType.OTHER, "PluginError", `Error while Thunder Controller fetching status@${plugin} ${JSON.stringify(err)}`, false, null) resolve(false) }); }) @@ -1904,7 +1206,6 @@ export default class AppApi { resolve(res) }).catch(err => { this.ERR("AppAPI configStatus error:", err) - Metrics.error(Metrics.ErrorType.OTHER, "PluginError", `Error while Thunder Controller fetching status ${JSON.stringify(err)}`, false, null) resolve(false) }); }) @@ -1919,7 +1220,6 @@ export default class AppApi { }) .catch(err => { this.ERR("AppAPI getAvCodeStatus error:", err) - Metrics.error(Metrics.ErrorType.OTHER, "PluginError", 'Error in Thunder fetching getAVDecoderStatus of DeviceDiagnostics' + JSON.stringify(err), false, null) resolve(false) }); }) @@ -1932,64 +1232,4 @@ export default class AppApi { getUILanguage() { return UserSettingsApi.get().getPresentationLanguage() } - - deeplinkToApp(app = undefined, payload = undefined, launchLocation = "voice", namespace = undefined) { - return new Promise((resolve, reject) => { - if (app === undefined || app === "" || payload == undefined) { - this.ERR("AppApi: deeplinkToApp '" + app + "' not possible with payload '" + payload + "'."); - Metrics.error(Metrics.ErrorType.OTHER, "AppError", `AppApi: deeplinkToApp ${app} not possible with payload ${payload}`, false, null) - resolve(false); - } else if (app.startsWith("YouTube")) { - let url = Storage.get(app + "DefaultURL").toString(); - url = url.substring(0, url.indexOf('?')); - if (!url.endsWith("?")) url += "?"; - url += ((GLOBALS.topmostApp === app) ? "inApp=true" : "inApp=false"); - // For the timebeing Alexa alone. Revisit when we have other voice sysyems. - url += "&launch=voice" + "&vs=" + ((launchLocation === "alexa") ? 2 : 0); - - if (namespace === "ExternalMediaPlayer") { - // Received sample : {"payload":{"playbackContextToken":"{deeplinkMethodType=PLAY, searchString='cat videos'}"}} - url += "&va=" + ((payload.playbackContextToken.includes("deeplinkMethodType=PLAY")) ? "play" : "search"); - if (payload.playbackContextToken.includes("deeplinkMethodType")) { - let searchString = payload.playbackContextToken.replace(/[{}]/g, '').split(','); - for (let i = 0; i < searchString.length; i++) { - if (searchString[i].includes("searchString")) { - let data = searchString[i].split('=').slice(1)[0].replace(/'/g, ''); - url += "&vaa=" + encodeURI(data.trim()); - break; - } - } - } - } else if (namespace === "Alexa.SeekController") { - let time = payload.deltaPositionMilliseconds / 1000 - let minutes = Math.abs(parseInt(time / 60)) - let seconds = Math.abs(parseInt(time % 60)) - url += "&va=" + ((time < 0) ? "mediaRewind" : "mediaFastForward") + "&vaa=" + minutes + "m" + seconds + "s"; - } else if (namespace === "Alexa.PlaybackController") { - let playbackOperations = new Set(["Play", "Pause", "FastForward", "Rewind", "Shuffle", "Repeat"]) - if (playbackOperations.has(payload)) { - url += "&va=media" + payload; - } else if (payload === "Next" || payload === "Previous") { - url += "&va=media" + payload + "Video"; - } - } - this.INFO("AppApi: deeplinkToApp " + app + " url - " + url); - thunder.call(app, 'deeplink', url); - } else if (app === "Amazon") { - // TODO: no deeplink format support. - this.ERR("AppApi: deeplinkToApp '" + app + "' not supported."); - Metrics.error(Metrics.ErrorType.OTHER, "AppDeeplinkError", JSON.stringify(err), false, null) - reject(false); - } else if (app === "Netflix") { - // TODO: no deeplink format support. - this.ERR("AppApi: deeplinkToApp '" + app + "' not supported."); - Metrics.error(Metrics.ErrorType.OTHER, "AppDeeplinkError", JSON.stringify(err), false, null) - reject(false); - } else { - this.ERR("AppApi: deeplinkToApp '" + app + "' not supported."); - Metrics.error(Metrics.ErrorType.OTHER, "AppDeeplinkError", JSON.stringify(err), false, null) - reject(false); - } - }); - } } diff --git a/accelerator-home-ui/src/api/AppManagerApi.js b/accelerator-home-ui/src/api/AppManagerApi.js index 70a6e0cd..18226d83 100644 --- a/accelerator-home-ui/src/api/AppManagerApi.js +++ b/accelerator-home-ui/src/api/AppManagerApi.js @@ -18,7 +18,6 @@ **/ import ThunderJS from 'ThunderJS'; import { CONFIG } from '../Config/Config' -import { Metrics } from "@firebolt-js/sdk" let instance = null export default class AppManager { @@ -45,7 +44,6 @@ export default class AppManager { }) .catch(err => { this.ERR("Error Activation AppManager" + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "AppManager", `Error while Thunder Controller ${this.callsign} activate ${JSON.stringify(err)}`, false, null) reject(err) }) }) @@ -59,7 +57,6 @@ export default class AppManager { }) .catch(err => { this.ERR("Error Deactivation AppManager" + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "AppManager", `Error while Thunder Controller ${this.callsign} deactivate ${JSON.stringify(err)}`, false, null) reject(err) }) }) @@ -74,7 +71,6 @@ export default class AppManager { }) .catch(err => { this.ERR("Error launchApp: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "launchAppError", `Error while Thunder call ${this.callsign} ListPackages ${JSON.stringify(err)}`, false, null) reject(err) }) }) @@ -87,10 +83,9 @@ export default class AppManager { }) .catch(err => { this.ERR("Error getLoadedApps: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "getLoadedAppsError", `Error while Thunder call ${this.callsign} ListPackages ${JSON.stringify(err)}`, false, null) reject(err) - }) - }) + }) + }) } isInstalled(appId){ return new Promise((resolve, reject) => { @@ -98,13 +93,12 @@ export default class AppManager { .then(response => { resolve(response) this.INFO("isInstalled response: " + JSON.stringify(response)); - }) + }) .catch(err => { this.ERR("Error in isInstalled: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "AppManager", `Error while calling isInstalled on ${this.callsign} ${JSON.stringify(err)}`, false, null) reject(err) }) - }) + }) } closeApp(appId) { return new Promise((resolve, reject) => { @@ -116,7 +110,6 @@ export default class AppManager { }) .catch(err => { this.ERR("Error closeApp: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "closeAppError", `Error while Thunder call ${this.callsign} ListPackages ${JSON.stringify(err)}`, false, null) reject(err) }) }) @@ -131,12 +124,11 @@ export default class AppManager { }) .catch(err => { this.ERR("Error terminateApp: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "terminateAppError", `Error while Thunder call ${this.callsign} ListPackages ${JSON.stringify(err)}`, false, null) reject(err) }) }) } - killApp(appId) { + killApp(appId) { return new Promise((resolve, reject) => { this.INFO("killApp called with appId: " + appId ); this.thunder.call(this.callsign, 'killApp', { "appId":appId }) @@ -146,7 +138,6 @@ export default class AppManager { }) .catch(err => { this.ERR("Error killApp: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "killAppError", `Error while Thunder call ${this.callsign} ListPackages ${JSON.stringify(err)}`, false, null) reject(err) }) }) @@ -160,12 +151,11 @@ export default class AppManager { }) .catch(err => { this.ERR("Error getInstalledApps: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "getInstalledAppsError", `Error while Thunder call ${this.callsign} ListPackages ${JSON.stringify(err)}`, false, null) reject(err) }) - }) + }) } - preloadApp(appId) { + preloadApp(appId) { return new Promise((resolve, reject) => { this.INFO("preloadApp called with appId: " + appId ); this.thunder.call(this.callsign, 'preloadApp', { "appId":appId }) @@ -175,7 +165,6 @@ export default class AppManager { }) .catch(err => { this.ERR("Error preloadApp: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "preloadAppError", `Error while Thunder call ${this.callsign} ListPackages ${JSON.stringify(err)}`, false, null) reject(err) }) }) @@ -190,7 +179,6 @@ export default class AppManager { }) .catch(err => { this.ERR("Error startSystemApp: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "startSystemAppError", `Error while Thunder call ${this.callsign} ListPackages ${JSON.stringify(err)}`, false, null) reject(err) }) }) @@ -205,7 +193,6 @@ export default class AppManager { }) .catch(err => { this.ERR("Error stopSystemApp: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "stopSystemAppError", `Error while Thunder call ${this.callsign} ListPackages ${JSON.stringify(err)}`, false, null) reject(err) }) }) @@ -220,7 +207,6 @@ export default class AppManager { }) .catch(err => { this.ERR("Error activateSystemApp: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "activateSystemAppError", `Error while Thunder call ${this.callsign} ListPackages ${JSON.stringify(err)}`, false, null) reject(err) }) }) @@ -235,7 +221,6 @@ export default class AppManager { }) .catch(err => { this.ERR("Error deactivateSystemApp: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "deactivateSystemAppError", `Error while Thunder call ${this.callsign} ListPackages ${JSON.stringify(err)}`, false, null) reject(err) }) }) @@ -250,7 +235,6 @@ export default class AppManager { }) .catch(err => { this.ERR("Error hibernateSystemApp: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "hibernateSystemAppError", `Error while Thunder call ${this.callsign} ListPackages ${JSON.stringify(err)}`, false, null) reject(err) }) }) @@ -265,7 +249,6 @@ export default class AppManager { }) .catch(err => { this.ERR("Error sendIntent: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "sendIntentError", `Error while Thunder call ${this.callsign} ListPackages ${JSON.stringify(err)}`, false, null) reject(err) }) }) @@ -280,7 +263,6 @@ export default class AppManager { }) .catch(err => { this.ERR("Error clearAppData: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "clearAppDataError", `Error while Thunder call ${this.callsign} ListPackages ${JSON.stringify(err)}`, false, null) reject(err) }) }) @@ -295,14 +277,13 @@ export default class AppManager { }) .catch(err => { this.ERR("Error getAppProperty: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "getAppPropertyError", `Error while Thunder call ${this.callsign} ListPackages ${JSON.stringify(err)}`, false, null) reject(err) }) }) } setAppProperty(appId,key,value) { return new Promise((resolve, reject) => { - this.INFO("setAppProperty called with appId: " + appId + " key: " + key + " and value: " + value ); + this.INFO("setAppProperty called with appId: " + appId + " key: " + key + " and value: " + value ); this.thunder.call(this.callsign, 'setAppProperty', { "appId":appId, "key":key, "value":value }) .then(response => { resolve(response) @@ -310,7 +291,6 @@ export default class AppManager { }) .catch(err => { this.ERR("Error setAppProperty: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "setAppPropertyError", `Error while Thunder call ${this.callsign} ListPackages ${JSON.stringify(err)}`, false, null) reject(err) }) }) diff --git a/accelerator-home-ui/src/api/BluetoothApi.js b/accelerator-home-ui/src/api/BluetoothApi.js index 254d73c2..4df8a118 100644 --- a/accelerator-home-ui/src/api/BluetoothApi.js +++ b/accelerator-home-ui/src/api/BluetoothApi.js @@ -18,7 +18,6 @@ **/ import ThunderJS from 'ThunderJS' import { CONFIG } from '../Config/Config' -import { Metrics } from '@firebolt-js/sdk' /** * Class for Bluetooth thunder plugin apis. @@ -50,7 +49,7 @@ export default class BluetoothApi { .then(() => { resolve(true) }).catch(err => { - Metrics.error(Metrics.ErrorType.OTHER, "BluetoothError", "Error while Thunder Controller Bluetooth activate "+JSON.stringify(err), false, null) + this.ERR("Error while Thunder Controller Bluetooth activate "+JSON.stringify(err)) reject(err) }) }) @@ -64,7 +63,7 @@ export default class BluetoothApi { .then(() => { resolve(true) }).catch(err => { - Metrics.error(Metrics.ErrorType.OTHER, "BluetoothError", "Error while Thunder Controller Bluetooth deactivate "+JSON.stringify(err), false, null) + this.ERR("Error while Thunder Controller Bluetooth deactivate "+JSON.stringify(err)) reject(err) }) }) @@ -111,8 +110,7 @@ export default class BluetoothApi { resolve('Blutooth activated') }) .catch(err => { - this.ERR('Activation failure', err) - Metrics.error(Metrics.ErrorType.OTHER, "BluetoothError", "Error while Thunder Controller Bluetooth activate "+JSON.stringify(err), false, null) + this.ERR("Error while Thunder Controller Bluetooth activate "+JSON.stringify(err)) reject('Bluetooth activation failed', err) }) }) @@ -148,7 +146,6 @@ export default class BluetoothApi { }) .catch(err => { this.ERR("Can't disable : " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "BluetoothError", "Error while Thunder Bluetooth disable "+JSON.stringify(err), false, null) }) }) } @@ -166,7 +163,6 @@ export default class BluetoothApi { }) .catch(err => { this.ERR("Can't enable : " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "BluetoothError", "Error while Thunder Bluetooth enable "+JSON.stringify(err), false, null) reject() }) }) @@ -191,7 +187,6 @@ export default class BluetoothApi { }) .catch(err => { this.ERR("Error: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "BluetoothError", "Error while Thunder Bluetooth startScan "+JSON.stringify(err), false, null) reject() }) }) @@ -213,7 +208,6 @@ export default class BluetoothApi { }) .catch(err => { this.ERR("Error: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "BluetoothError", "Error while Thunder Bluetooth startScan "+JSON.stringify(err), false, null) reject(err) }) }) @@ -232,7 +226,6 @@ export default class BluetoothApi { }) .catch(err => { this.ERR("Error: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "BluetoothError", "Error while Thunder Bluetooth stopScan "+JSON.stringify(err), false, null) reject() }) }) @@ -251,7 +244,6 @@ export default class BluetoothApi { }) .catch(err => { this.ERR("Can't get discovered devices : " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "BluetoothError", "Error while Thunder Bluetooth getDiscoveredDevices "+JSON.stringify(err), false, null) }) }) } @@ -272,7 +264,6 @@ export default class BluetoothApi { }) .catch(err => { this.ERR("Can't get paired devices : " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "BluetoothError", "Error while Thunder Bluetooth getPairedDevices "+JSON.stringify(err), false, null) reject(false) }) }) @@ -294,7 +285,6 @@ export default class BluetoothApi { }) .catch(err => { this.ERR("Can't get connected devices : " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "BluetoothError", "Error while Thunder Bluetooth getConnectedDevices "+JSON.stringify(err), false, null) reject() }) }) @@ -323,7 +313,6 @@ export default class BluetoothApi { }) .catch(err => { this.ERR("Connection failed: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "BluetoothError", "Error while Thunder Bluetooth connect "+JSON.stringify(err), false, null) reject() }) }) @@ -347,7 +336,6 @@ export default class BluetoothApi { }) .catch(err => { this.ERR("disconnect failed: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "BluetoothError", "Error while Thunder Bluetooth disconnect "+JSON.stringify(err), false, null) reject() }) }) @@ -367,7 +355,6 @@ export default class BluetoothApi { }) .catch(err => { this.ERR("unpair failed: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "BluetoothError", "Error while Thunder Bluetooth unpair "+JSON.stringify(err), false, null) resolve(false) }) }) @@ -387,7 +374,6 @@ export default class BluetoothApi { }) .catch(err => { this.ERR("Error on pairing: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "BluetoothError", "Error while Thunder Bluetooth pair "+JSON.stringify(err), false, null) reject() }) }) @@ -413,7 +399,6 @@ export default class BluetoothApi { }) .catch(err => { this.ERR("Error on respondToEvent: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "BluetoothError", "Error while Thunder Bluetooth respondToEvent "+JSON.stringify(err), false, null) reject() }) }) @@ -441,7 +426,6 @@ export default class BluetoothApi { }) .catch(err => { this.ERR("Can't get connected devices : " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "BluetoothError", "Error while Thunder Bluetooth setAudioStream "+JSON.stringify(err), false, null) reject() }) }) diff --git a/accelerator-home-ui/src/api/CECApi.js b/accelerator-home-ui/src/api/CECApi.js index 7e730f29..6ec6b5d3 100644 --- a/accelerator-home-ui/src/api/CECApi.js +++ b/accelerator-home-ui/src/api/CECApi.js @@ -18,7 +18,6 @@ **/ import ThunderJS from 'ThunderJS'; import { CONFIG } from '../Config/Config' -import { Metrics } from '@firebolt-js/sdk'; const thunder = ThunderJS(CONFIG.thunderConfig) @@ -37,7 +36,6 @@ export default class CECApi { }) .catch(err => { this.ERR("CEC Error Activation: " + err) - Metrics.error(Metrics.ErrorType.OTHER, "HdmiCecSourceError", "Error while Thunder Controller HdmiCecSource activate "+JSON.stringify(err), false, null) reject(err) }) }) @@ -50,7 +48,6 @@ export default class CECApi { }) .catch(err => { this.ERR("CEC Error Deactivation: " + err) - Metrics.error(Metrics.ErrorType.OTHER, "HdmiCecSourceError", "Error while Thunder Controller HdmiCecSource deactivate "+JSON.stringify(err), false, null) reject(err) }) }) @@ -63,7 +60,6 @@ export default class CECApi { }) .catch(err => { this.ERR("CEC Get Enabled: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "HdmiCecSourceError", "Error in Thunder HdmiCecSource getEnabled "+JSON.stringify(err), false, null) resolve({ enabled: false }) }) }) @@ -77,7 +73,6 @@ export default class CECApi { }) .catch(err => { this.ERR("CEC Set Enabled: " + err) - Metrics.error(Metrics.ErrorType.OTHER, "HdmiCecSourceError", "Error in Thunder HdmiCecSource setEnabled "+JSON.stringify(err), false, null) resolve({ success: false }) }) }) @@ -90,7 +85,6 @@ export default class CECApi { }) .catch(err => { this.ERR("getOSDName: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "HdmiCecSourceError", "Error in Thunder HdmiCecSource getOSDName "+JSON.stringify(err), false, null) resolve({ enabled: false }) }) }) @@ -103,7 +97,6 @@ export default class CECApi { }) .catch(err => { this.ERR("setOSDName: " + err); - Metrics.error(Metrics.ErrorType.OTHER, "HdmiCecSourceError", "Error in Thunder HdmiCecSource setOSDName "+JSON.stringify(err), false, null) resolve({ success: false }) }) }) @@ -117,7 +110,6 @@ export default class CECApi { }) .catch(err => { this.ERR("CEC Otp Error: " + err) - Metrics.error(Metrics.ErrorType.OTHER, "HdmiCecSourceError", "Error in Thunder HdmiCecSource performOTPAction "+JSON.stringify(err), false, null) resolve({ success: false }) }) }) @@ -131,7 +123,6 @@ export default class CECApi { }) .catch(err => { this.ERR("CECApi HdmiCecSource getActiveSourceStatus failed: " + err); - Metrics.error(Metrics.ErrorType.OTHER, "HdmiCecSourceError", "Error in Thunder HdmiCecSource getActiveSourceStatus "+JSON.stringify(err), false, null) reject(err) }) }) diff --git a/accelerator-home-ui/src/api/DACApi.js b/accelerator-home-ui/src/api/DACApi.js index ab0a7d21..fb60c151 100644 --- a/accelerator-home-ui/src/api/DACApi.js +++ b/accelerator-home-ui/src/api/DACApi.js @@ -23,7 +23,6 @@ import PackageManager from './PackageManagerApi'; import AppManager from './AppManagerApi'; import AppController from '../AppController'; import { ThunderError } from './ThunderError'; -import { Metrics } from '@firebolt-js/sdk' import { SIDELOADED_APP_DEFAULT_ICON, deriveNameFromPackageId } from '../helpers/DACAppPresentation' import { getApps, getAppDetails, makeDownloadURL } from './AppCatalog'; @@ -49,7 +48,6 @@ function logWarning(call, err) { function logError(call, err) { let errMessage = makeLogMessage(call, err); console.error(errMessage); - Metrics.error(Metrics.ErrorType.OTHER, "DACApiError", errMessage, false, null); } class OperationLock { @@ -86,7 +84,6 @@ export async function getAppCatalogInfo() { } offset = result.length; } catch (err) { - Metrics.error(Metrics.ErrorType.OTHER, "DACApiError", err.toString(), false, null); break; } } diff --git a/accelerator-home-ui/src/api/DTVApi.js b/accelerator-home-ui/src/api/DTVApi.js index e5673ece..66f31bcf 100644 --- a/accelerator-home-ui/src/api/DTVApi.js +++ b/accelerator-home-ui/src/api/DTVApi.js @@ -18,7 +18,6 @@ **/ import ThunderJS from "ThunderJS"; import { CONFIG } from '../Config/Config' -import { Metrics } from "@firebolt-js/sdk"; const thunder = ThunderJS(CONFIG.thunderConfig) let playerID = -1; //set to -1 to indicate nothing is currently playing @@ -36,7 +35,6 @@ const getCustomServiceList = async () => { console.log("customServiceList: ", customServiceList); console.log("customEventList: ", customEventList); } catch (err) { - Metrics.error(Metrics.ErrorType.OTHER,"DTVApiError", JSON.stringify(err), false, null) console.log("Failed to read Custom Channel Data: ", err); } }; @@ -59,7 +57,6 @@ export default class DTVApi { }) .catch((err) => { this.ERR("DTV Error Activation: " + JSON.stringify(err)); - Metrics.error(Metrics.ErrorType.OTHER,"DTVApiError", "Error while Thunder Controller DTV activate "+JSON.stringify(err), false, null) reject(err); }); }); @@ -72,7 +69,6 @@ export default class DTVApi { }) .catch((err) => { this.ERR("DTV Error Deactivation: " + JSON.stringify(err)); - Metrics.error(Metrics.ErrorType.OTHER,"DTVApiError", "Error while Thunder Controller DTV deactivate "+JSON.stringify(err), false, null) reject(err); }); }); @@ -87,7 +83,6 @@ export default class DTVApi { }) .catch((err) => { this.ERR("Error: noOfCountries: " + JSON.stringify(err)); - Metrics.error(Metrics.ErrorType.OTHER,"DTVApiError", "Error in Thunder DTV numberOfCountries "+JSON.stringify(err), false, null) reject(err); }); }); @@ -102,7 +97,6 @@ export default class DTVApi { }) .catch((err) => { this.ERR("Error: countryList: " + JSON.stringify(err)); - Metrics.error(Metrics.ErrorType.OTHER,"DTVApiError", "Error in Thunder DTV countryList "+JSON.stringify(err), false, null) reject(err); }); }); @@ -130,7 +124,6 @@ export default class DTVApi { }) .catch((err) => { this.ERR("Error: serviceList: " + JSON.stringify(err)); - Metrics.error(Metrics.ErrorType.OTHER,"DTVApiError", "Error in Thunder DTV serviceList@dvbs "+JSON.stringify(err), false, null) resolve(arr); }); }); @@ -156,7 +149,6 @@ export default class DTVApi { resolve(data); } else { this.ERR("Error: getting schedule from custom channels"); - Metrics.error(Metrics.ErrorType.OTHER,"DTVApiError", "Error: getting schedule from custom channels", false, null) resolve([]); } } else { @@ -172,7 +164,6 @@ export default class DTVApi { }) .catch((err) => { this.ERR("Error: scheduleEvents: " + JSON.stringify(err)); - Metrics.error(Metrics.ErrorType.OTHER,"DTVApiError", "Error in Thunder DTV scheduleEvents@dvbs "+JSON.stringify(err), false, null) reject(err); }); } @@ -193,7 +184,6 @@ export default class DTVApi { }) .catch((err) => { this.ERR("Error: satelliteList: " + JSON.stringify(err)); - Metrics.error(Metrics.ErrorType.OTHER,"DTVApiError", "Error in Thunder DTV satelliteList "+JSON.stringify(err), false, null) reject(err); }); }); @@ -254,7 +244,6 @@ export default class DTVApi { }) .catch((err) => { this.ERR("serviceSearchError: " + JSON.stringify(err)); - Metrics.error(Metrics.ErrorType.OTHER,"DTVApiError", "Error in Thunder DTV startServiceSearch "+JSON.stringify(err), false, null) reject(err); }); }); @@ -270,7 +259,6 @@ export default class DTVApi { }) .catch((err) => { this.ERR("Error: numberOfServices: " + JSON.stringify(err)); - Metrics.error(Metrics.ErrorType.OTHER,"DTVApiError", "Error in Thunder DTV numberOfServices "+JSON.stringify(err), false, null) reject(err); }); }); @@ -288,7 +276,6 @@ export default class DTVApi { }) .catch((err) => { this.ERR("Error: nowNextEvents: " + JSON.stringify(err)); - Metrics.error(Metrics.ErrorType.OTHER,"DTVApiError", "Error in Thunder DTV nowNextEvents@dvbs "+JSON.stringify(err), false, null) reject(err); }); }); @@ -316,7 +303,6 @@ export default class DTVApi { }) .catch((err) => { this.ERR("ERROR: startPlaying: " + JSON.stringify(err)); - Metrics.error(Metrics.ErrorType.OTHER,"DTVApiError", "Error in Thunder DTV startPlaying "+JSON.stringify(err), false, null) reject(err); }); }); @@ -334,7 +320,6 @@ export default class DTVApi { }) .catch((err) => { this.ERR("ERROR: stopPlaying: " + JSON.stringify(err)); - Metrics.error(Metrics.ErrorType.OTHER,"DTVApiError", "Error in Thunder DTV stopPlaying "+JSON.stringify(err), false, null) reject(err); }); }); @@ -375,7 +360,6 @@ export default class DTVApi { resolve(result) }).catch(err => { this.ERR("launchChannel: FAILED: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER,"DTVApiError", JSON.stringify(err), false, null) reject(err) }) }); @@ -399,7 +383,6 @@ export default class DTVApi { resolve(result) }).catch(err => { this.ERR("exitChannel: FAILED: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER,"DTVApiError", JSON.stringify(err), false, null) reject(err) }) }); diff --git a/accelerator-home-ui/src/api/DownloadManagerApi.js b/accelerator-home-ui/src/api/DownloadManagerApi.js index 5083475c..51cb1fa4 100644 --- a/accelerator-home-ui/src/api/DownloadManagerApi.js +++ b/accelerator-home-ui/src/api/DownloadManagerApi.js @@ -20,7 +20,6 @@ import { ThunderError } from './ThunderError'; import ThunderJS from 'ThunderJS'; import { CONFIG } from '../Config/Config' -import { Metrics } from "@firebolt-js/sdk" const REFRESH_INTERVAL_MS = 500; @@ -78,7 +77,6 @@ export default class DownloadManager { const err = new ThunderError(thunderCall, thunderErr); const errString = err.toString(); this.ERR(errString); - Metrics.error(Metrics.ErrorType.OTHER, "DownloadManager", errString, false, null); throw err; } diff --git a/accelerator-home-ui/src/api/HDMIApi.js b/accelerator-home-ui/src/api/HDMIApi.js index 290d412c..ee9ab14b 100644 --- a/accelerator-home-ui/src/api/HDMIApi.js +++ b/accelerator-home-ui/src/api/HDMIApi.js @@ -19,7 +19,6 @@ import ThunderJS from 'ThunderJS'; import { CONFIG } from '../Config/Config' -import { Metrics } from '@firebolt-js/sdk'; /** * Class for HDMI thunder plugin apis. @@ -78,7 +77,6 @@ export default class HDMIApi { }) .catch(err => { this.ERR("Failed to activate HdmiInput plugin" + " " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER,"HdmiApiError", "Error while Thunder Controller HdmiApi activate "+JSON.stringify(err), false, null) reject(false) }) }) @@ -95,7 +93,6 @@ export default class HDMIApi { .catch(err => { // reject(err) // #forTesting //make the api reject, instead of resolving empty array this.ERR("getHDMIDevices Error: " + JSON.stringify(err) + " resolving empty array") - Metrics.error(Metrics.ErrorType.OTHER,"HdmiApiError", "Error in Thunder HdmiApi getHDMIInputDevices "+JSON.stringify(err), false, null) resolve([]) }) }) @@ -110,7 +107,6 @@ export default class HDMIApi { }) .catch(err => { this.ERR(JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER,"HdmiApiError", "Error while Thunder Controller.1 HdmiApi status "+JSON.stringify(err), false, null) reject(err) }) }) @@ -128,7 +124,6 @@ export default class HDMIApi { }) .catch(err => { this.ERR('Failed to fetch dimensions' + " " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER,"HdmiApiError", "Error in Thunder playerInfo resolution "+JSON.stringify(err), false, null) resolve([1920, 1080]) }) }) @@ -147,7 +142,6 @@ export default class HDMIApi { resolve(result) }) .catch(err => { - Metrics.error(Metrics.ErrorType.OTHER,"HdmiApiError", "Error in Thunder HdmiApi startHdmiInput "+JSON.stringify(err), false, null) reject(err) }) } else { diff --git a/accelerator-home-ui/src/api/HomeApi.js b/accelerator-home-ui/src/api/HomeApi.js index 934f645f..caeb60fa 100644 --- a/accelerator-home-ui/src/api/HomeApi.js +++ b/accelerator-home-ui/src/api/HomeApi.js @@ -28,7 +28,6 @@ import { uiInfo } from "./../../static/data/UIInfo"; import { metroAppsInfo } from "./../../static/data/MetroAppsInfo.js"; import { metroAppsInfoOffline } from "./../../static/data/MetroAppsInfoOffline.js"; import { showCaseApps } from "../../static/data/LightningShowcase"; -import { Metrics } from "@firebolt-js/sdk"; import xml2json from "@hendt/xml2json"; import PersistentStoreApi from "./PersistentStore.js"; @@ -158,7 +157,6 @@ export default class HomeApi { }); } catch (err) { this.ERR("API key not defined." + JSON.stringify(err)); - Metrics.error(Metrics.ErrorType.OTHER,"ApiError", JSON.stringify(err), false, null) } } }).catch((err) => { @@ -195,7 +193,6 @@ export default class HomeApi { }) .catch((err) => { this.ERR("Gracenote: Incorrect API key or no data available" + JSON.stringify(err)); - Metrics.error(Metrics.ErrorType.OTHER,"ApiError", JSON.stringify(err), false, null) resolve({ key: res.value, data: [], @@ -203,7 +200,6 @@ export default class HomeApi { }); } catch (err) { this.ERR("Gracenote fetch failed." + JSON.stringify(err)); - Metrics.error(Metrics.ErrorType.OTHER,"ApiError", JSON.stringify(err), false, null) resolve({ key: res.value, data: [], @@ -211,7 +207,6 @@ export default class HomeApi { } } else { this.ERR("Gracenote apiKey is invalid in PersistentStore."); - Metrics.error(Metrics.ErrorType.OTHER,"ApiError", JSON.stringify(err), false, null) resolve({ key: "", data: [], diff --git a/accelerator-home-ui/src/api/LISAApi.js b/accelerator-home-ui/src/api/LISAApi.js deleted file mode 100644 index a246629a..00000000 --- a/accelerator-home-ui/src/api/LISAApi.js +++ /dev/null @@ -1,167 +0,0 @@ -/** - * If not stated otherwise in this file or this component's LICENSE - * file the following copyright and licenses apply: - * - * Copyright 2023 RDK Management - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - **/ -import ThunderJS from 'ThunderJS'; -import { CONFIG } from '../Config/Config' -import { Metrics } from '@firebolt-js/sdk'; - -let instance = null - -export default class LISA { - constructor() { - this.thunder = ThunderJS(CONFIG.thunderConfig); - this.callsign = 'LISA'; - this.INFO = console.info; - this.LOG = console.log; - this.ERR = console.error; - this.metadata = null; - } - - static get() { - if (instance === null) { - instance = new LISA() - } - return instance; - } - - activate() { - return new Promise((resolve, reject) => { - this.thunder.call('Controller', 'activate', { callsign: this.callsign }).then(result => { - this.INFO("LISA: activate result:", result) - resolve(true) - }).catch(err => { - this.ERR("LISA: activate error: ", err) - Metrics.error(Metrics.ErrorType.OTHER,"LisaApiError", "Error while Thunder Controller LisaApi activate "+JSON.stringify(err), false, null) - reject(err) - }); - }); - } - - deactivate() { - return new Promise((resolve, reject) => { - this.thunder.call('Controller', 'deactivate', { callsign: this.callsign }).then(result => { - this.INFO("LISA: deactivate result:", result) - resolve(true) - }).catch(err => { - this.ERR("LISA: deactivate error: ", err) - Metrics.error(Metrics.ErrorType.OTHER,"LisaApiError", "Error while Thunder Controller LisaApi deactivate "+JSON.stringify(err), false, null) - reject(err) - }); - }); - } - - getMetadata() { - return new Promise((resolve, reject) => { - if ((this.metadata != null) && - Object.prototype.hasOwnProperty.call(this.metadata, "dacBundlePlatformNameOverride") && - Object.prototype.hasOwnProperty.call(this.metadata, "dacBundleFirmwareCompatibilityKey") && - Object.prototype.hasOwnProperty.call(this.metadata, "configUrl")) { - this.INFO("LISA: getMetadata using cached value."); - resolve(this.metadata) - } else { - // "version" is reserved by ThunderJS; use "versionAsParameter" to avoid "unsupported version error". - let params = { "id": "lisa.dac.config", "type": "application/LISA", "versionAsParameter": "0" }; - this.thunder.call(this.callsign, 'getMetadata', params).then(result => { - this.INFO("LISA: getMetadata result: ", result) - if (Object.prototype.hasOwnProperty.call(result, "auxMetadata")) { - let metadata = {} - result.auxMetadata.forEach(item => { - metadata[item.key] = item.value; - }); - this.metadata = metadata; - resolve(this.metadata) - } - reject(false) - }).catch(err => { - this.ERR("LISA: getMetadata error: ", err) - Metrics.error(Metrics.ErrorType.OTHER,"LisaApiError", "Error in Thunder LisaApi getMetaData "+JSON.stringify(err), false, null) - this.metadata = null; - reject(err) - }) - } - }) - } - - install(params) { - return new Promise((resolve, reject) => { - this.LOG("LISA: install params:", params); - this.thunder.call(this.callsign, 'install', params).then(result => { - this.INFO("LISA: install result: ", result) - resolve(result) - }).catch(err => { - Metrics.error(Metrics.ErrorType.OTHER,"LisaApiError", "Error in Thunder LisaApi install "+JSON.stringify(err), false, null) - this.ERR("LISA: install error: ", err) - reject(err) - }) - }) - } - - uninstall(params) { - return new Promise((resolve, reject) => { - this.LOG("LISA: uninstall params:", params); - this.thunder.call(this.callsign, 'uninstall', params).then(result => { - this.INFO("LISA: uninstall result: ", result) - resolve(result) - }).catch(err => { - Metrics.error(Metrics.ErrorType.OTHER,"LisaApiError", "Error in Thunder LisaApi uninstall "+JSON.stringify(err), false, null) - this.ERR("LISA: uninstall error: ", err) - reject(err) - }) - }) - } - - getStorageDetails(params) { - return new Promise((resolve, reject) => { - this.LOG("LISA: getStorageDetails params:", params); - this.thunder.call(this.callsign, 'getStorageDetails', params).then(result => { - this.INFO("LISA: getStorageDetails result: ", result) - resolve(result) - }).catch(err => { - Metrics.error(Metrics.ErrorType.OTHER,"LisaApiError", "Error in Thunder LisaApi getStaorageDetails "+JSON.stringify(err), false, null) - this.ERR("LISA: getStorageDetails error: ", err) - reject(err) - }) - }) - } - - getList() { - return new Promise((resolve, reject) => { - this.thunder.call(this.callsign, 'getList').then(result => { - this.INFO("LISA: getList result: ", result) - resolve(result) - }).catch(err => { - Metrics.error(Metrics.ErrorType.OTHER,"LisaApiError", "Error in Thunder LisaApi getList "+JSON.stringify(err), false, null) - this.ERR("LISA: getList error: ", err) - reject(err) - }) - }) - } - - getProgress(handle) { - return new Promise((resolve, reject) => { - this.thunder.call(this.callsign, 'getProgress', { handle: handle }).then(result => { - this.LOG("LISA: getProgress result: ", result) - resolve(result) - }).catch(err => { - Metrics.error(Metrics.ErrorType.OTHER,"LisaApiError", "Error in Thunder LisaApi getProgress "+JSON.stringify(err), false, null) - this.ERR("LISA: getProgress error: ", err) - reject(err) - }) - }) - } -} diff --git a/accelerator-home-ui/src/api/Miracast.js b/accelerator-home-ui/src/api/Miracast.js index b9d46323..c66ef491 100644 --- a/accelerator-home-ui/src/api/Miracast.js +++ b/accelerator-home-ui/src/api/Miracast.js @@ -18,7 +18,7 @@ **/ import ThunderJS from 'ThunderJS'; import { CONFIG } from '../Config/Config' -import { Metrics } from "@firebolt-js/sdk"; + export default class Miracast { constructor() { this._thunder = ThunderJS(CONFIG.thunderConfig); @@ -36,7 +36,6 @@ export default class Miracast { }).catch(err => { reject(err) this.ERR('MiracastService: Error Activation ' + JSON.stringify(err)); - Metrics.error(Metrics.ErrorType.OTHER,"MiracastServiceError", "Error while Thunder Controller MiracastService activate "+JSON.stringify(err), false, null) }) }) } @@ -49,7 +48,6 @@ export default class Miracast { }).catch(err => { reject(err) this.ERR('MiracastPlayer: Error Activation ' + JSON.stringify(err)); - Metrics.error(Metrics.ErrorType.OTHER,"MiracastPlayerError", "Error while Thunder Controller MiracastPlayer activate "+JSON.stringify(err), false, null) }) }) } @@ -63,7 +61,6 @@ export default class Miracast { }).catch(err => { reject(err) this.ERR('MiracastService: Error deactivation ' + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER,"MiracastServiceError", "Error while Thunder Controller MiracastService deactivate "+JSON.stringify(err), false, null) }) }) } @@ -77,7 +74,6 @@ export default class Miracast { }).catch(err => { reject(err) this.ERR('MiracastPlayer: Error deactivation ' + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER,"MiracastPlayerError", "Error while Thunder Controller MiracastPlayer deactivate "+JSON.stringify(err), false, null) }) }) } @@ -91,7 +87,6 @@ export default class Miracast { }) .catch(err => { this.ERR("Error response from setEnable " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER,"setEnable", "Error while Thunder setEnable status "+JSON.stringify(err), false, null) reject(err) }) }) @@ -107,7 +102,6 @@ export default class Miracast { }) .catch(err => { this.ERR("Error response from getEnable " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER,"getEnable", "Error while Thunder getEnable status "+JSON.stringify(err), false, null) reject(err) }) }) @@ -123,7 +117,6 @@ export default class Miracast { }) .catch(err => { this.ERR("Error response from acceptClientConnection " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER,"acceptClientConnection", "Error while Thunder acceptClientConnection status "+JSON.stringify(err), false, null) reject(err) }) }) @@ -139,7 +132,6 @@ export default class Miracast { }) .catch(err => { this.ERR("Error response from updatePlayerState " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER,"updatePlayerState", "Error while Thunder updatePlayerState status "+JSON.stringify(err), false, null) reject(err) }) }) @@ -155,7 +147,6 @@ export default class Miracast { }) .catch(err => { this.ERR("Error response from stopClientConnection " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER,"stopClientConnection", "Error while Thunder stopClientConnection status "+JSON.stringify(err), false, null) reject(err) }) }) @@ -171,7 +162,6 @@ export default class Miracast { }) .catch(err => { this.ERR("Error response from setLogging " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER,"setLogging", "Error while Thunder setLogging status "+JSON.stringify(err), false, null) reject(err) }) }) @@ -189,7 +179,6 @@ export default class Miracast { }) .catch(err => { this.ERR("Error response from playRequest " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER,"playRequest", "Error while Thunder playRequest status "+JSON.stringify(err), false, null) reject(err) }) }) @@ -205,7 +194,6 @@ export default class Miracast { }) .catch(err => { this.ERR("Error response from stopRequest " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER,"stopRequest", "Error while Thunder stopRequest status "+JSON.stringify(err), false, null) reject(err) }) }) @@ -221,7 +209,6 @@ export default class Miracast { }) .catch(err => { this.ERR("Error response from setPlayerState " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER,"setPlayerState", "Error while Thunder setPlayerState status "+JSON.stringify(err), false, null) reject(err) }) }) @@ -237,7 +224,6 @@ export default class Miracast { }) .catch(err => { this.ERR("Error response from setVideoRectangle " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER,"setVideoRectangle", "Error while Thunder setVideoRectangle status "+JSON.stringify(err), false, null) reject(err) }) }) @@ -253,7 +239,6 @@ export default class Miracast { }) .catch(err => { this.ERR("Error response from setRTSPWaitTimeout " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER,"setRTSPWaitTimeout", "Error while Thunder setRTSPWaitTimeout status "+JSON.stringify(err), false, null) reject(err) }) }) @@ -269,7 +254,6 @@ export default class Miracast { }) .catch(err => { this.ERR("Error response from setLogging " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER,"setLogging", "Error while Thunder setLogging status "+JSON.stringify(err), false, null) reject(err) }) }) @@ -290,7 +274,6 @@ export default class Miracast { }) .catch(err => { this.ERR("Error response from setVideoFormats " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER,"setVideoFormats", "Error while Thunder playResetVideoFormatsquest status "+JSON.stringify(err), false, null) reject(err) }) }) @@ -306,7 +289,6 @@ export default class Miracast { }) .catch(err => { this.ERR("Error response from setAudioFormats " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER,"setAudioFormats", "Error while Thunder setAudioFormats status "+JSON.stringify(err), false, null) reject(err) }) }) diff --git a/accelerator-home-ui/src/api/NetworkApi.js b/accelerator-home-ui/src/api/NetworkApi.js deleted file mode 100644 index 6015fa7f..00000000 --- a/accelerator-home-ui/src/api/NetworkApi.js +++ /dev/null @@ -1,403 +0,0 @@ -/** - * If not stated otherwise in this file or this component's LICENSE - * file the following copyright and licenses apply: - * - * Copyright 2020 RDK Management - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - **/ -import ThunderJS from 'ThunderJS'; -import { CONFIG } from '../Config/Config' -import { Metrics } from '@firebolt-js/sdk'; - -let instance = null - -export default class Network { - constructor() { - this._thunder = ThunderJS(CONFIG.thunderConfig); - this.callsign = 'org.rdk.Network'; - this.INFO = console.info; - this.LOG = console.log; - this.ERR = console.error; - this.WARN = console.warn; - } - - static get() { - if (instance === null) { - instance = new Network() - // Vital plugins; always keep activated. - instance.activate(); - } - return instance; - } - - activate() { - return new Promise((resolve, reject) => { - this._thunder.call('Controller', 'activate', { callsign: this.callsign }).then(result => { - this.INFO(this.callsign + " activate result:" + JSON.stringify(result)) - resolve(true) - }).catch(err => { - this.ERR(this.callsign + " activate error: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.NETWORK,"NetworkApiError", "Error while Thunder Controller Network activate "+JSON.stringify(err), false, null) - reject(err) - }); - }); - } - - deactivate() { - return new Promise((resolve, reject) => { - this._thunder.call('Controller', 'deactivate', { callsign: this.callsign }).then(result => { - this.INFO(this.callsign + " deactivate result:" + JSON.stringify(result)) - resolve(true) - }).catch(err => { - this.ERR(this.callsign + " deactivate error: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.NETWORK,"NetworkApiError", "Error while Thunder Controller Network deactivate "+JSON.stringify(err), false, null) - reject(err) - }); - }); - } - - getDefaultInterface() { - return new Promise((resolve, reject) => { - this._thunder.call(this.callsign, 'getDefaultInterface').then(result => { - this.INFO(this.callsign + " getDefaultInterface result: " + JSON.stringify(result)) - if (result.success) resolve(result.interface) - reject(false) - }).catch(err => { - this.ERR(this.callsign + " getDefaultInterface error: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.NETWORK,"NetworkApiError", "Error in Thunder Network getDefaultInterface "+JSON.stringify(err), false, null) - reject(err) - }) - }) - } - - getInterfaces() { - return new Promise((resolve, reject) => { - this._thunder.call(this.callsign, 'getInterfaces').then(result => { - this.INFO(this.callsign + " getInterfaces result: " + JSON.stringify(result)) - if (result.success) { - resolve(result.interfaces) - } - reject(false) - }).catch(err => { - this.ERR(this.callsign + " getInterfaces error: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.NETWORK,"NetworkApiError", "Error in Thunder Network getInterfaces "+JSON.stringify(err), false, null) - reject(err) - }) - }) - } - - getIPSettings(interfaceName, ipversion = "IPv4") { - return new Promise((resolve, reject) => { - this._thunder.call(this.callsign, 'getIPSettings', { "interface": interfaceName, "ipversion": ipversion }).then(result => { - this.INFO(this.callsign + "[getIPSettings] result: " + JSON.stringify(result)) - if (result.success) { - resolve(result); - } - reject(false); - }).catch(err => { - this.ERR(this.callsign + "[getIPSettings] error: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.NETWORK,"NetworkApiError", "Error in Thunder Network getIPSettings "+JSON.stringify(err), false, null) - reject(err) - }) - }) - } - - getNamedEndpoints() { - return new Promise((resolve, reject) => { - this._thunder.call(this.callsign, 'getNamedEndpoints').then(result => { - this.INFO(this.callsign + "[getNamedEndpoints] result: " + JSON.stringify(result)) - if (result.success) resolve(result.endpoints); - reject(false) - }).catch(err => { - this.ERR(this.callsign + "[getNamedEndpoints] error: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.NETWORK,"NetworkApiError", "Error in Thunder Network getNamedEndpoints "+JSON.stringify(err), false, null) - reject(err) - }) - }) - } - - getQuirks() { - return new Promise((resolve, reject) => { - // TODO: unknown usecase. - reject(false) - }) - } - - getStbIp() { - return new Promise((resolve, reject) => { - this._thunder.call(this.callsign, 'getStbIp').then(result => { - this.INFO(this.callsign + "[getStbIp] result: " + JSON.stringify(result)) - if (result.success) { - resolve(result.ip) - } - reject(false) - }).catch(err => { - this.ERR(this.callsign + "[getStbIp] error: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.NETWORK,"NetworkApiError", "Error in Thunder Network getStbIp result "+JSON.stringify(err), false, null) - reject(err) - }) - }) - } - - getSTBIPFamily(family = "AF_INET") { - return new Promise((resolve, reject) => { - this._thunder.call(this.callsign, 'getSTBIPFamily', { "family": family }).then(result => { - this.INFO(this.callsign + "[getSTBIPFamily] result: " + JSON.stringify(result)) - if (result.success) { resolve(result) } - reject(false); - }).catch(err => { - this.ERR(this.callsign + "[getSTBIPFamily] error: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.NETWORK,"NetworkApiError", "Error in Thunder Network getSTBIPFamily "+JSON.stringify(err), false, null) - reject(err) - }) - }) - } - - setConnectivityTestEndpoints(endpoints = []) { - return new Promise((resolve, reject) => { - if (!endpoints.length) reject(false) - this._thunder.call(this.callsign, 'setConnectivityTestEndpoints', { endpoints: endpoints }).then(result => { - this.INFO(this.callsign + "[setConnectivityTestEndpoints] result: " + JSON.stringify(result)) - resolve(result.success) - }).catch(err => { - this.ERR(this.callsign + "[setConnectivityTestEndpoints] error: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.NETWORK,"NetworkApiError", "Error in Thunder Network setConnectivityTestEndpoints "+JSON.stringify(err), false, null) - reject(err) - }) - }) - } - - isConnectedToInternet() { - return new Promise((resolve, reject) => { - this._thunder.call(this.callsign, 'isConnectedToInternet').then(result => { - this.LOG(this.callsign + "[isConnectedToInternet] result: " + JSON.stringify(result)) - if (result.success) resolve(result.connectedToInternet) - resolve(false) - }).catch(err => { - this.ERR(this.callsign + "[isConnectedToInternet] error: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.NETWORK,"NetworkApiError", "Error in Thunder Network isConnectedToInternet "+JSON.stringify(err), false, null) - reject(err) - }) - }) - } - - getinternetconnectionstate() { - return new Promise((resolve, reject) => { - this._thunder.call(this.callsign, 'getInternetConnectionState').then(result => { - this.INFO(this.callsign + "[getinternetconnectionstate] result: " + JSON.stringify(result)) - if (result.success) resolve(result) - reject(false) - }).catch(err => { - this.ERR(this.callsign + "[getinternetconnectionstate] error: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.NETWORK,"NetworkApiError", "Error in Thunder Network getInternetConnectionState "+JSON.stringify(err), false, null) - reject(err) - }) - }) - } - - getCaptivePortalURI() { - return new Promise((resolve, reject) => { - this._thunder.call(this.callsign, 'getCaptivePortalURI').then(result => { - this.INFO(this.callsign + "[getCaptivePortalURI] result: " + JSON.stringify(result)) - if (result.success) resolve(result) - reject(false) - }).catch(err => { - this.ERR(this.callsign + "[getCaptivePortalURI] error: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.NETWORK,"NetworkApiError", "Error in Thunder Network getCaptivePortalURI "+JSON.stringify(err), false, null) - reject(err) - }) - }) - } - - startConnectivityMonitoring(intervalInSec = 30) { - return new Promise((resolve, reject) => { - this._thunder.call(this.callsign, 'startConnectivityMonitoring', { "interval": intervalInSec }).then(result => { - this.INFO(this.callsign + "[startConnectivityMonitoring] result: " + JSON.stringify(result)) - resolve(result.success) - }).catch(err => { - this.ERR(this.callsign + "[startConnectivityMonitoring] error: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.NETWORK,"NetworkApiError", "Error in Thunder Network startConnectivityMonitoring "+JSON.stringify(err), false, null) - reject(err) - }) - }) - } - - stopConnectivityMonitoring() { - return new Promise((resolve, reject) => { - this._thunder.call(this.callsign, 'stopConnectivityMonitoring').then(result => { - this.INFO(this.callsign + "[stopConnectivityMonitoring] result: " + JSON.stringify(result)) - resolve(result.success) - }).catch(err => { - this.ERR(this.callsign + "[stopConnectivityMonitoring] error: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.NETWORK,"NetworkApiError", "Error in Thunder Network stopConnectivityMonitoring "+JSON.stringify(err), false, null) - reject(err) - }) - }) - } - - isInterfaceEnabled(interfaceName = "WIFI") { - return new Promise((resolve, reject) => { - this._thunder.call(this.callsign, 'isInterfaceEnabled', { "interface": interfaceName }).then(result => { - this.INFO(this.callsign + "[isInterfaceEnabled]" + interfaceName + " result: " + JSON.stringify(result)) - if (result.success) resolve(result.enabled) - resolve(false) - }).catch(err => { - this.ERR(this.callsign + "[isInterfaceEnabled] error: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.NETWORK,"NetworkApiError", "Error in Thunder Network isInterfaceEnabled "+JSON.stringify(err), false, null) - reject(err) - }) - }) - } - - ping(endpoint = "8.8.8.8", packets = 10, guid = "2c6ff543-d929-4be4-a0d8-9abae2ca7471") { - return new Promise((resolve, reject) => { - this._thunder.call(this.callsign, 'ping', { "endpoint": endpoint, "packets": packets, "guid": guid }).then(result => { - this.INFO(this.callsign + "[ping] result: " + JSON.stringify(result)) - if (result.success) resolve(result) - resolve(false) - }).catch(err => { - this.ERR(this.callsign + "[ping] error: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.NETWORK,"NetworkApiError", "Error in Thunder Network ping "+JSON.stringify(err), false, null) - reject(err) - }) - }) - } - - pingNamedEndpoint(endpointName = "CMTS", packets = 15, guid = "2c6ff543-d929-4be4-a0d8-9abae2ca7471") { - return new Promise((resolve, reject) => { - this._thunder.call(this.callsign, 'pingNamedEndpoint', { "endpointName": endpointName, "packets": packets, "guid": guid }).then(result => { - this.INFO(this.callsign + "[pingNamedEndpoint] result: " + JSON.stringify(result)) - if (result.success) resolve(result) - resolve(false) - }).catch(err => { - this.ERR(this.callsign + "[pingNamedEndpoint] error: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.NETWORK,"NetworkApiError", "Error in Thunder Network pingNamedEndpoint "+JSON.stringify(err), false, null) - reject(err) - }) - }) - } - - setDefaultInterface(interfaceName = "ETHERNET", persist = true) { - return new Promise((resolve, reject) => { - this._thunder.call(this.callsign, 'setDefaultInterface', { "interface": interfaceName, "persist": persist }).then(result => { - this.INFO(this.callsign + "[setDefaultInterface] result: " + JSON.stringify(result)) - resolve(result.success) - }).catch(err => { - this.ERR(this.callsign + "[setDefaultInterface] error: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.NETWORK,"NetworkApiError", "Error in Thunder Network setDefaultInterface "+JSON.stringify(err), false, null) - reject(err) - }) - }) - } - - setInterfaceEnabled(interfaceName, enabled = true, persist = true) { - return new Promise((resolve, reject) => { - this._thunder.call(this.callsign, 'setInterfaceEnabled', { "interface": interfaceName, "enabled": enabled, "persist": persist }).then(result => { - this.INFO(this.callsign + "[setInterfaceEnabled] result: " + JSON.stringify(result)) - resolve(result.success) - }).catch(err => { - this.ERR(this.callsign + "[setInterfaceEnabled] error: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.NETWORK,"NetworkApiError", "Error in Thunder Network setInterfaceEnabled "+JSON.stringify(err), false, null) - reject(err) - }) - }) - } - - setIPSettings(IPSettings) { - return new Promise((resolve, reject) => { - this._thunder.call(this.callsign, 'setIPSettings', IPSettings).then(result => { - this.INFO(this.callsign + "[setIPSettings] result: " + JSON.stringify(result)) - resolve(result.success) - }).catch(err => { - this.ERR(this.callsign + "[setIPSettings] error: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.NETWORK,"NetworkApiError", "Error in Thunder Network setIPSettings "+JSON.stringify(err), false, null) - reject(err) - }) - }) - } - - getPublicIP(iface = "ETHERNET", ipv6 = false) { - return new Promise((resolve, reject) => { - this._thunder.call(this.callsign, 'getPublicIP', { "iface": iface, "ipv6": ipv6 }).then(result => { - this.INFO(this.callsign + "[getPublicIP] result: " + JSON.stringify(result)) - if (result.success) resolve(result.public_ip) - resolve(false) - }).catch(err => { - this.ERR(this.callsign + "[getPublicIP] error: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.NETWORK,"NetworkApiError", "Error in Thunder Network getPublicIP "+JSON.stringify(err), false, null) - reject(err) - }) - }) - } - - setStunEndPoint(server = "global.stun.twilio.com", port = 3478, sync = true, timeout = 30, cache_timeout = 0) { - return new Promise((resolve, reject) => { - this._thunder.call(this.callsign, 'setStunEndPoint', { - "server": server, - "port": port, - "sync": sync, - "timeout": timeout, - "cache_timeout": cache_timeout - }).then(result => { - this.INFO(this.callsign + "[setStunEndPoint] result: " + JSON.stringify(result)) - resolve(result.success) - }).catch(err => { - this.ERR(this.callsign + "[setStunEndPoint] error: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.NETWORK,"NetworkApiError", "Error in Thunder Network setStunEndPoint "+JSON.stringify(err), false, null) - reject(err) - }) - }) - } - - configurePNI(disableConnectivityTest = true) { - return new Promise((resolve, reject) => { - this._thunder.call(this.callsign, 'configurePNI', { "disableConnectivityTest": disableConnectivityTest }).then(result => { - this.INFO(this.callsign + "[configurePNI] result: " + JSON.stringify(result)) - resolve(result.success) - }).catch(err => { - this.ERR(this.callsign + "[configurePNI] error: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.NETWORK,"NetworkApiError", "Error in Thunder Network configurePNI "+JSON.stringify(err), false, null) - reject(err) - }) - }) - } - - trace(endpoint = "8.8.8.8", packets = 15) { - return new Promise((resolve, reject) => { - this._thunder.call(this.callsign, 'trace', { endpoint: endpoint, packets: packets }).then(result => { - this.INFO(this.callsign + "[trace] result: " + JSON.stringify(result)) - if (result.success) resolve(result) - reject(false) - }).catch(err => { - this.ERR(this.callsign + "[trace] error: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.NETWORK,"NetworkApiError", "Error in Thunder Network trace "+JSON.stringify(err), false, null) - reject(err) - }) - }) - } - - traceNamedEndpoint(endpointName = "CMTS", packets = 15) { - return new Promise((resolve, reject) => { - this._thunder.call(this.callsign, 'trace', { "endpointName": endpointName, "packets": packets }).then(result => { - this.INFO(this.callsign + "[traceNamedEndpoint] result: " + JSON.stringify(result)) - if (result.success) resolve(result) - reject(false) - }).catch(err => { - this.ERR(this.callsign + "[traceNamedEndpoint] error: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.NETWORK,"NetworkApiError", "Error in Thunder Network traceNamedEndpoint "+JSON.stringify(err), false, null) - reject(err) - }) - }) - } -} diff --git a/accelerator-home-ui/src/api/NetworkManagerAPI.js b/accelerator-home-ui/src/api/NetworkManagerAPI.js index 9831ee4c..9a3e3cdf 100644 --- a/accelerator-home-ui/src/api/NetworkManagerAPI.js +++ b/accelerator-home-ui/src/api/NetworkManagerAPI.js @@ -18,7 +18,6 @@ **/ import ThunderJS from 'ThunderJS'; import { CONFIG } from '../Config/Config' -import { Metrics } from "@firebolt-js/sdk" export const WiFiState = { WIFI_STATE_UNINSTALLED:0, @@ -66,7 +65,6 @@ class NetworkManager { } } else { this.ERR("NetworkManager: Error " + infoMessage + " " + JSON.stringify(params) + " result: " + JSON.stringify(result)); - Metrics.error(Metrics.ErrorType.OTHER, "NetworkManagerError", `Error ${infoMessage} ${JSON.stringify(params)} result: ${JSON.stringify(result)}`, false, null) reject(result.success); } }) @@ -83,7 +81,6 @@ class NetworkManager { resolve(true) }).catch(err => { this.ERR(this.callsign + " NetworkManager activate error: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.NETWORK,"NetworkManagerError", "Error while Thunder Controller NetworkManager activate "+JSON.stringify(err), false, null) reject(err) }); }); @@ -96,7 +93,6 @@ class NetworkManager { resolve(true) }).catch(err => { this.ERR(this.callsign + " NetworkManager deactivate error: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.NETWORK,"NetworkManagerError", "Error while Thunder Controller NetworkManager deactivate "+JSON.stringify(err), false, null) reject(err) }); }); @@ -142,7 +138,6 @@ class NetworkManager { }).catch(err => { this.ERR(this.callsign + ": connect error: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.NETWORK,"NetworkManagerError", "Error in Thunder NetworkManager connect params "+JSON.stringify(err), false, null) reject(err) }) }) diff --git a/accelerator-home-ui/src/api/PackageManagerApi.js b/accelerator-home-ui/src/api/PackageManagerApi.js index bdf01169..8df57274 100644 --- a/accelerator-home-ui/src/api/PackageManagerApi.js +++ b/accelerator-home-ui/src/api/PackageManagerApi.js @@ -19,7 +19,6 @@ import ThunderJS from 'ThunderJS'; import { CONFIG } from '../Config/Config' -import { Metrics } from "@firebolt-js/sdk" import { ThunderError } from './ThunderError'; let instance = null; @@ -36,7 +35,6 @@ export default class PackageManager { constructor() { this.thunder = ThunderJS(CONFIG.thunderConfig); this.callsign = 'org.rdk.AppPackageManager'; - this.metricsComponent = 'PackageManager'; this.INFO = console.info; this.LOG = console.log; this.ERR = console.error; @@ -46,7 +44,6 @@ export default class PackageManager { const err = new ThunderError(thunderCall, thunderErr); const errString = err.toString(); this.ERR(errString); - Metrics.error(Metrics.ErrorType.OTHER, this.metricsComponent, errString, false, null) throw err; } diff --git a/accelerator-home-ui/src/api/PersistentStore.js b/accelerator-home-ui/src/api/PersistentStore.js index c9e99695..47d79a63 100644 --- a/accelerator-home-ui/src/api/PersistentStore.js +++ b/accelerator-home-ui/src/api/PersistentStore.js @@ -17,8 +17,7 @@ * limitations under the License. **/ import ThunderJS from 'ThunderJS'; -import { CONFIG } from '../Config/Config' -import { Metrics } from '@firebolt-js/sdk'; +import { CONFIG } from '../Config/Config'; export default class PersistentStoreApi { constructor() { @@ -67,7 +66,6 @@ export default class PersistentStoreApi { resolve(true); }).catch(err => { this.ERR('PersistentStoreApi: Error Activation ' + JSON.stringify(err)); - Metrics.error(Metrics.ErrorType.OTHER,"PersistentStoreApiError", "Error while Thunder Controller PersistentStore activate "+JSON.stringify(err), false, null) reject(err); }) }) @@ -79,7 +77,6 @@ export default class PersistentStoreApi { resolve(true) }).catch(err => { this.ERR('PersistentStoreApi: Error deactivation ' + JSON.stringify(err)); - Metrics.error(Metrics.ErrorType.OTHER,"PersistentStoreApiError", "Error while Thunder Controller PersistentStore deactivate "+JSON.stringify(err), false, null) reject(err); }) }) @@ -95,7 +92,6 @@ export default class PersistentStoreApi { resolve(result); }).catch(err => { this.ERR("PersistentStoreApi: deleteKey error:" + JSON.stringify(err)); - Metrics.error(Metrics.ErrorType.OTHER,"PersistentStoreApiError", "Error in Thunder PersistentStore deleteKey "+JSON.stringify(err), false, null) reject(err); }); }) @@ -108,7 +104,6 @@ export default class PersistentStoreApi { resolve(result); }).catch(err => { this.ERR("PersistentStoreApi: deleteNamespace error:" + JSON.stringify(err)); - Metrics.error(Metrics.ErrorType.OTHER,"PersistentStoreApiError", "Error in Thunder PersistentStore deleteNamespace "+JSON.stringify(err), false, null) reject(err); }); }) @@ -120,7 +115,6 @@ export default class PersistentStoreApi { resolve(result); }).catch(err => { this.ERR("PersistentStoreApi: flushCache error:" + JSON.stringify(err)); - Metrics.error(Metrics.ErrorType.OTHER,"PersistentStoreApiError", "Error in Thunder PersistentStore flushCache "+JSON.stringify(err), false, null) reject(err); }); }) @@ -133,7 +127,6 @@ export default class PersistentStoreApi { resolve(result); }).catch(err => { this.ERR("PersistentStoreApi: getKeys error:" + JSON.stringify(err)); - Metrics.error(Metrics.ErrorType.OTHER,"PersistentStoreApiError", "Error in Thunder PersistentStore getKeys "+JSON.stringify(err), false, null) reject(err); }); }) @@ -145,7 +138,6 @@ export default class PersistentStoreApi { resolve(result); }).catch(err => { this.ERR("PersistentStoreApi: getNamespaces error:" + JSON.stringify(err)); - Metrics.error(Metrics.ErrorType.OTHER,"PersistentStoreApiError", "Error in Thunder PersistentStore getNamespaces "+JSON.stringify(err), false, null) reject(err); }); }) @@ -157,7 +149,6 @@ export default class PersistentStoreApi { resolve(result); }).catch(err => { this.ERR("PersistentStoreApi: getStorageSize error:" + JSON.stringify(err)); - Metrics.error(Metrics.ErrorType.OTHER,"PersistentStoreApiError", "Error in Thunder PersistentStore getStorageSize "+JSON.stringify(err), false, null) reject(err); }); }) @@ -170,7 +161,6 @@ export default class PersistentStoreApi { resolve(result); }).catch(err => { this.ERR("PersistentStoreApi: getValue error:" + JSON.stringify(err)); - Metrics.error(Metrics.ErrorType.OTHER,"PersistentStoreApiError", "Error in Thunder PersistentStore getValue "+JSON.stringify(err), false, null) reject(err); }); }) @@ -183,7 +173,6 @@ export default class PersistentStoreApi { resolve(result); }).catch(err => { this.ERR("PersistentStoreApi: setValue error:" + JSON.stringify(err)); - Metrics.error(Metrics.ErrorType.OTHER,"PersistentStoreApiError", "Error in Thunder PersistentStore setValue "+JSON.stringify(err), false, null) reject(err); }); }) diff --git a/accelerator-home-ui/src/api/PictureSettingsApi.js b/accelerator-home-ui/src/api/PictureSettingsApi.js index f8b16068..162bfb10 100644 --- a/accelerator-home-ui/src/api/PictureSettingsApi.js +++ b/accelerator-home-ui/src/api/PictureSettingsApi.js @@ -19,7 +19,6 @@ import ThunderJS from "ThunderJS"; import { CONFIG } from '../Config/Config' -import {Metrics} from "@firebolt-js/sdk" /** * Class for ControlSettings thunder plugin apis. @@ -80,7 +79,6 @@ export default class PictureSettingsApi { }) .catch(err => { this.ERR("Failed to activate tv.ControlSettings plugin: " + JSON.stringify(err)); - Metrics.error(Metrics.ErrorType.OTHER,"PictureSettingsApiError", "Error while Thunder Controller TvControlSettings activate "+JSON.stringify(err), false, null) reject(err); }); }); @@ -94,7 +92,6 @@ export default class PictureSettingsApi { resolve(result) }).catch(err => { this.ERR("Error from getSettingsValue API for " + JSON.stringify(settingsName) + " : " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER,"PictureSettingsApiError", "Error in Thunder TvControlSettings getSettings "+JSON.stringify(err), false, null) reject(err) }) }) @@ -108,7 +105,6 @@ export default class PictureSettingsApi { resolve(result) }).catch(err => { this.ERR("Error from setSettingsValue API for " + JSON.stringify(settingsName) + " and value : " + JSON.stringify(value) + " | Error: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER,"PictureSettingsApiError", "Error in Thunder TvControlSettings setSettings "+JSON.stringify(err), false, null) reject(err) }) }) @@ -130,7 +126,6 @@ export default class PictureSettingsApi { } }).catch(err => { this.ERR("getSupportedPictureModes Error: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER,"PictureSettingsApiError", "Error in Thunder TvControlSettings getSupportedPictureModes "+JSON.stringify(err), false, null) reject(err) }) }) @@ -147,7 +142,6 @@ export default class PictureSettingsApi { } }).catch(err => { this.ERR("Error from getSupportedColorTemps API: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER,"PictureSettingsApiError", "Error in Thunder TvControlSettings getColorTemperature "+JSON.stringify(err), false, null) reject(err) }) }) @@ -161,7 +155,6 @@ export default class PictureSettingsApi { resolve(result.pictureMode); }) .catch(err => { - Metrics.error(Metrics.ErrorType.OTHER,"PictureSettingsApiError", "Error in Thunder TvControlSettings getPictureMode "+JSON.stringify(err), false, null) reject(err); }); }); @@ -177,7 +170,6 @@ export default class PictureSettingsApi { resolve(result); }) .catch(err => { - Metrics.error(Metrics.ErrorType.OTHER,"PictureSettingsApiError", "Error in Thunder TvControlSettings setPictureMode "+JSON.stringify(err), false, null) reject(err); }); }); @@ -191,7 +183,6 @@ export default class PictureSettingsApi { resolve(result.ColorTemperature.Selected); }) .catch(err => { - Metrics.error(Metrics.ErrorType.OTHER,"PictureSettingsApiError", "Error in Thunder TvControlSettings getColorTemperature "+JSON.stringify(err), false, null) reject(err); }); }); @@ -207,7 +198,6 @@ export default class PictureSettingsApi { resolve(result); }) .catch(err => { - Metrics.error(Metrics.ErrorType.OTHER,"PictureSettingsApiError", "Error in Thunder TvControlSettings setColorTemperature "+JSON.stringify(err), false, null) reject(err); }); }); @@ -221,7 +211,6 @@ export default class PictureSettingsApi { resolve(result.Brightness.Setting); }) .catch(err => { - Metrics.error(Metrics.ErrorType.OTHER,"PictureSettingsApiError", "Error in Thunder TvControlSettings getBrightness "+JSON.stringify(err), false, null) reject(err); }); }); @@ -237,7 +226,6 @@ export default class PictureSettingsApi { resolve(result); }) .catch(err => { - Metrics.error(Metrics.ErrorType.OTHER,"PictureSettingsApiError", "Error in Thunder TvControlSettings setBrightness "+JSON.stringify(err), false, null) reject(err); }); }); @@ -251,7 +239,6 @@ export default class PictureSettingsApi { resolve(result.Contrast.Setting); }) .catch(err => { - Metrics.error(Metrics.ErrorType.OTHER,"PictureSettingsApiError", "Error in Thunder TvControlSettings getContrast "+JSON.stringify(err), false, null) reject(err); }); }); @@ -267,7 +254,6 @@ export default class PictureSettingsApi { resolve(result); }) .catch(err => { - Metrics.error(Metrics.ErrorType.OTHER,"PictureSettingsApiError", "Error in Thunder TvControlSettings setContrast "+JSON.stringify(err), false, null) reject(err); }); }); @@ -281,7 +267,6 @@ export default class PictureSettingsApi { resolve(result.Sharpness.Setting); }) .catch(err => { - Metrics.error(Metrics.ErrorType.OTHER,"PictureSettingsApiError", "Error in Thunder TvControlSettings getSharpness "+JSON.stringify(err), false, null) reject(err); }); }); @@ -297,7 +282,6 @@ export default class PictureSettingsApi { resolve(result); }) .catch(err => { - Metrics.error(Metrics.ErrorType.OTHER,"PictureSettingsApiError", "Error in Thunder TvControlSettings setSharpness "+JSON.stringify(err), false, null) reject(err); }); }); @@ -311,7 +295,6 @@ export default class PictureSettingsApi { resolve(result.Saturation.Setting); }) .catch(err => { - Metrics.error(Metrics.ErrorType.OTHER,"PictureSettingsApiError", "Error in Thunder TvControlSettings getSaturation "+ JSON.stringify(err), false, null) reject(err); }); }); @@ -327,7 +310,6 @@ export default class PictureSettingsApi { resolve(result); }) .catch(err => { - Metrics.error(Metrics.ErrorType.OTHER,"PictureSettingsApiError", "Error in Thunder TvControlSettings setSaturation "+JSON.stringify(err), false, null) reject(err); }); }); @@ -341,7 +323,6 @@ export default class PictureSettingsApi { resolve(result.Backlight.Setting); }) .catch(err => { - Metrics.error(Metrics.ErrorType.OTHER,"PictureSettingsApiError", "Error in Thunder TvControlSettings getBacklight "+JSON.stringify(err), false, null) reject(err); }); }); @@ -357,7 +338,6 @@ export default class PictureSettingsApi { resolve(result); }) .catch(err => { - Metrics.error(Metrics.ErrorType.OTHER,"PictureSettingsApiError", "Error in Thunder TvControlSettings setBacklight "+JSON.stringify(err), false, null) reject(err); }); }); diff --git a/accelerator-home-ui/src/api/PowerManagerApi.js b/accelerator-home-ui/src/api/PowerManagerApi.js index 9153fe21..107ff007 100644 --- a/accelerator-home-ui/src/api/PowerManagerApi.js +++ b/accelerator-home-ui/src/api/PowerManagerApi.js @@ -19,7 +19,6 @@ import ThunderJS from 'ThunderJS'; import { CONFIG } from '../Config/Config' -import { Metrics } from '@firebolt-js/sdk'; export const PowerState = { POWER_STATE_ON:'ON', @@ -42,7 +41,7 @@ export default class PowerManagerApi { this.callsign = "org.rdk.PowerManager"; this._events = new Map(); } - + static get() { if (instance === null) { @@ -65,7 +64,6 @@ export default class PowerManagerApi { }) .catch(err => { this.ERR("Error Activation " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "PowerManager", `Error while Thunder Controller ${this.callsign} activate ${JSON.stringify(err)}`, false, null) reject(err) }) }) @@ -79,7 +77,6 @@ export default class PowerManagerApi { }) .catch(err => { this.ERR("Error Deactivation " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "PackageManager", `Error while Thunder Controller ${this.callsign} deactivate ${JSON.stringify(err)}`, false, null) reject(err) }) }) @@ -93,7 +90,6 @@ export default class PowerManagerApi { resolve(result) }).catch(err => { this.ERR(" setWakeupSourceConfig error:", JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "PluginError", "Error in Thunder system setWakeupSourceConfig " + JSON.stringify(err), false, null) reject(err) }) }) @@ -101,7 +97,7 @@ export default class PowerManagerApi { setPowerState(value) { return new Promise((resolve) => { - this.thunder.call(this.callsign, 'setPowerState', { "powerState": value, "standbyReason": "ResidentApp User Requested" }) + this.thunder.call(this.callsign, 'setPowerState', { "powerState": value, "standbyReason": "SystemUI User Requested" }) .then(result => { this.LOG("PowerManager setPowerState result:", JSON.stringify(result)) if(result === null){ @@ -112,7 +108,6 @@ export default class PowerManagerApi { }) .catch(err => { this.ERR("PowerManager setPowerState failed: ", JSON.stringify(err)); - Metrics.error(Metrics.ErrorType.OTHER, "PowerStateFailure", "Error in Thunder PowerManager setPowerState " + JSON.stringify(err), false, null) resolve(false) }) }) @@ -125,7 +120,6 @@ export default class PowerManagerApi { resolve(result); }).catch(err => { this.ERR("PowerManager getPowerStateBeforeReboot failed: ", JSON.stringify(err)); - Metrics.error(Metrics.ErrorType.OTHER, "PowerStateFailure", "Error in Thunder PowerManager getPowerStateBeforeReboot " + JSON.stringify(err), false, null); reject(err); }); }); @@ -140,7 +134,6 @@ export default class PowerManagerApi { }) .catch(err => { this.ERR("PowerManager getPowerState failed: ", JSON.stringify(err)); - Metrics.error(Metrics.ErrorType.OTHER, "PowerStateFailure", "Error in Thunder PowerManager getPowerState " + JSON.stringify(err), false, null) reject(err) }) }) @@ -157,7 +150,6 @@ export default class PowerManagerApi { }) .catch(err => { this.ERR("PowerManager reboot error:", JSON.stringify(err, 3, null)) - Metrics.error(Metrics.ErrorType.OTHER, "PluginError", "Error in Thunder PowerManager reboot " + JSON.stringify(err), false, null) resolve(false) }) }) diff --git a/accelerator-home-ui/src/api/RDKShellApis.js b/accelerator-home-ui/src/api/RDKShellApis.js deleted file mode 100644 index 9b2576ff..00000000 --- a/accelerator-home-ui/src/api/RDKShellApis.js +++ /dev/null @@ -1,140 +0,0 @@ -/** - * If not stated otherwise in this file or this component's LICENSE - * file the following copyright and licenses apply: - * - * Copyright 2020 RDK Management - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - **/ -import ThunderJS from 'ThunderJS'; -import { CONFIG } from '../Config/Config' -import { Metrics } from "@firebolt-js/sdk" - -class RDKShellApis { - constructor() { - this._events = new Map(); - this.thunder = ThunderJS(CONFIG.thunderConfig); - this.callsign = 'org.rdk.RDKShell'; - this.INFO = console.info; - this.LOG = console.log; - this.ERR = console.error; - } - - registerEvent = (eventId, callback) => { - this._events.set(eventId, callback) - } - - thunderCall = (infoMessage, method, params = {}, property) => { - return new Promise((resolve, reject) => { - this.INFO('info', `RDKShellApi: ${infoMessage}.`); - this.thunder.call(this.callsign, method, params) - .then(result => { - this.LOG('info', `RDKShellApi: ${infoMessage}: ${JSON.stringify(params)} result: ${JSON.stringify(result)}`); - if (result.success) { - if (property === 'result') { - resolve(result); - } else { - resolve(property ? result[property] : result.success); - } - } else { - this.ERR('error', `RDKShellApi: Error ${infoMessage} ${JSON.stringify(params)} result: ${JSON.stringify(result)}`); - Metrics.error(Metrics.ErrorType.OTHER, "RDKShellApiError", `Error ${infoMessage} ${JSON.stringify(params)} result: ${JSON.stringify(result)}`, false, null) - reject(result.success); - } - }) - .catch(err => { - this.ERR('error', `RDKShellApi: Error ${infoMessage} ${err}`); - reject(err); - }); - }); - } - - getKeyRepeatsEnabled = () => this.thunderCall('getKeyRepeatsEnabled', 'getKeyRepeatsEnabled', {}, 'keyRepeat'); - getLastWakeupKey = () => this.thunderCall('getLastWakeupKey', 'getLastWakeupKey', {}, 'result'); - getLogLevel = () => this.thunderCall('getLogLevel', 'getLogLevel', {}, 'logLevel'); - getLogsFlushingEnabled = () => this.thunderCall('getLogsFlushingEnabled', 'getLogsFlushingEnabled', {}, 'enabled'); - getOpacity = (client) => this.thunderCall('getOpacity', 'getOpacity', { client }, 'opacity'); - getScale = (client) => this.thunderCall('getScale', 'getScale', { client }, 'result'); - getVirtualDisplayEnabled = (client, callsign = client) => this.thunderCall('getVirtualDisplayEnabled', 'getVirtualDisplayEnabled', { client, callsign }, 'enabled'); - getVirtualResolution = (client, callsign = client) => this.thunderCall('getVirtualResolution', 'getVirtualResolution', { client, callsign }, 'result'); - getVisibility = (client, callsign = client) => this.thunderCall('getVisibility', 'getVisibility', { client, callsign }, 'visible'); - getZOrder = () => this.thunderCall('getZOrder', 'getZOrder', {}, 'clients'); - getGraphicsFrameRate = () => this.thunderCall('getGraphicsFrameRate', 'getGraphicsFrameRate', {}, 'frameRate'); - launch = (params) => this.thunderCall('launch', 'launch', params, 'result'); - getBlockedAVApplications = () => this.thunderCall('getBlockedAVApplications', 'getBlockedAVApplications'); - activate = () => this.thunderCall('activate', 'Controller.activate', {}); - deactivate = () => this.thunderCall('deactivate', 'Controller.deactivate', {}); - addAnimation = (params) => this.thunderCall('addAnimation', 'addAnimation', params); - addKeyIntercept = (params) => this.thunderCall('addKeyIntercept', 'addKeyIntercept', params); - addKeyIntercepts = (params) => this.thunderCall('addKeyIntercepts', 'addKeyIntercepts', params); - addKeyListener = (params) => this.thunderCall('addKeyListener', 'addKeyListener', params); - addKeyMetadataListener = (client, callsign = client) => this.thunderCall('addKeyMetadataListener', 'addKeyMetadataListener', { client, callsign }); - createDisplay = (params) => this.thunderCall('createDisplay', 'createDisplay', params); - destroy = (callsign) => this.thunderCall('destroy', 'destroy', { callsign }); - enableInactivityReporting = (enable = true) => this.thunderCall('enableInactivityReporting', 'enableInactivityReporting', { enable }); - enableKeyRepeats = (enable = true) => this.thunderCall('enableKeyRepeats', 'enableKeyRepeats', { enable }); - enableLogsFlushing = (enable = true) => this.thunderCall('enableLogsFlushing', 'enableLogsFlushing', { enable }); - enableVirtualDisplay = (client, enable = true, callsign) => this.thunderCall('enableVirtualDisplay', 'enableVirtualDisplay', { client, enable, callsign: callsign !== undefined ? callsign : client }); - generateKey = (params) => this.thunderCall('generateKey', 'generateKey', params); - getAvailableTypes = () => this.thunderCall('getAvailableTypes', 'getAvailableTypes', {}, "types"); - getBounds = (client, callsign = client) => this.thunderCall('getBounds', 'getBounds', { client, callsign }, 'bounds'); - getClients = () => this.thunderCall('getClients', 'getClients', {}, 'clients'); - getCursorSize = () => this.thunderCall('getCursorSize', 'getCursorSize', {}, 'result'); - getHolePunch = (client, callsign = client) => this.thunderCall('getHolePunch', 'getHolePunch', { client, callsign }, 'holePunch'); - hideAllClients = (hide = true) => this.thunderCall('hideAllClients', 'hideAllClients', { hide }); - hideCursor = () => this.thunderCall('hideCursor', 'hideCursor', {}); - hideFullScreenImage = () => this.thunderCall('hideFullScreenImage', 'hideFullScreenImage', {}); - hideSplashLogo = () => this.thunderCall('hideSplashLogo', 'hideSplashLogo', {}); - ignoreKeyInputs = (ignore = true) => this.thunderCall('ignoreKeyInputs', 'ignoreKeyInputs', { ignore }); - injectKey = (params) => this.thunderCall('injectKey', 'injectKey', params); - kill = (client, callsign = client) => this.thunderCall('kill', 'kill', { client, callsign }); - launchApplication = (params) => this.thunderCall('launchApplication', 'launchApplication', params); - launchResidentApp = () => this.thunderCall('launchResidentApp', 'launchResidentApp', {}); - moveBehind = (client, target) => this.thunderCall('moveBehind', 'moveBehind', { client, target }); - moveToBack = (client, callsign = client) => this.thunderCall('moveToBack', 'moveToBack', { client, callsign }); - moveToFront = (client, callsign = client) => this.thunderCall('moveToFront', 'moveToFront', { client, callsign }); - removeAllKeyIntercepts = () => this.thunderCall('removeAllKeyIntercepts', 'removeAllKeyIntercepts', {}); - removeAllKeyListeners = () => this.thunderCall('removeAllKeyListeners', 'removeAllKeyListeners', {}); - removeAnimation = (client, callsign = client) => this.thunderCall('removeAnimation', 'removeAnimation', { client, callsign }); - removeKeyIntercept = (params) => this.thunderCall('removeKeyIntercept', 'removeKeyIntercept', params); - removeKeyListener = (params) => this.thunderCall('removeKeyListener', 'removeKeyListener', params); - removeKeyMetadataListener = (client, callsign = client) => this.thunderCall('removeKeyMetadataListener', 'removeKeyMetadataListener', { client, callsign }); - resetInactivityTime = () => this.thunderCall('resetInactivityTime', 'resetInactivityTime', {}); - resumeApplication = (client) => this.thunderCall('resumeApplication', 'resumeApplication', { client }); - scaleToFit = (params) => this.thunderCall('scaleToFit', 'scaleToFit', params); - setBounds = (params) => this.thunderCall('setBounds', 'setBounds', params); - setCursorSize = (width, height) => this.thunderCall('setCursorSize', 'setCursorSize', { width, height }); - setFocus = (client, callsign = client) => this.thunderCall('setFocus', 'setFocus', { client, callsign }); - setHolePunch = (client, holePunch = true, callsign) => this.thunderCall('setHolePunch', 'setHolePunch', { client, holePunch, callsign: callsign !== undefined ? callsign : client }); - setInactivityInterval = (interval) => this.thunderCall('setInactivityInterval', 'setInactivityInterval', { interval }); - setLogLevel = (logLevel = "INFO") => this.thunderCall('setLogLevel', 'setLogLevel', { logLevel }); - setOpacity = (client, opacity) => this.thunderCall('setOpacity', 'setOpacity', { client, opacity }); - setScale = (client, xScale, yScale, callsign) => this.thunderCall('setScale', 'setScale', { client, xScale, yScale, callsign: callsign !== undefined ? callsign : client }); - setScreenResolution = (w, h) => this.thunderCall('setScreenResolution', 'setScreenResolution', { w, h }); - setTopmost = (client, topmost = true, focus = true) => this.thunderCall('setTopmost', 'setTopmost', { client, topmost, focus }); - setVisibility = (client, visible = true, callsign) => { const params = { client, visible }; params.callsign = callsign !== undefined ? callsign : client; return this.thunderCall('setVisibility', 'setVisibility', params);}; - setGraphicsFrameRate = (frameRate) => this.thunderCall('setGraphicsFrameRate', 'setGraphicsFrameRate', { frameRate }); - showCursor = () => this.thunderCall('showCursor', 'showCursor', {}); - showFullScreenImage = (path) => this.thunderCall('showFullScreenImage', 'showFullScreenImage', { path }); - showSplashLogo = (displayTime) => this.thunderCall('showSplashLogo', 'showSplashLogo', { displayTime }); - showWatermark = (show = true) => this.thunderCall('showWatermark', 'showWatermark', { show }); - suspend = (callsign) => this.thunderCall('suspend', 'suspend', { callsign }); - suspendApplication = (client) => this.thunderCall('suspendApplication', 'suspendApplication', { client }); - keyRepeatConfig = (params) => this.thunderCall('keyRepeatConfig', 'keyRepeatConfig', params); - setAVBlocked = (callsign, blocked = true) => this.thunderCall('setAVBlocked', 'setAVBlocked', { callsign, blocked }); - restore = (callsign) => this.thunderCall('restore', 'restore', { callsign }); - hibernate = (callsign, timeout = 1000, procsequence = []) => this.thunderCall('hibernate', 'hibernate', { callsign, timeout, procsequence }); -} - -const rdkShellApisInstance = new RDKShellApis(); -export default rdkShellApisInstance; diff --git a/accelerator-home-ui/src/api/RDKWindowManagerApi.js b/accelerator-home-ui/src/api/RDKWindowManagerApi.js index d5e66e32..c5b70ad8 100644 --- a/accelerator-home-ui/src/api/RDKWindowManagerApi.js +++ b/accelerator-home-ui/src/api/RDKWindowManagerApi.js @@ -18,7 +18,6 @@ **/ import ThunderJS from 'ThunderJS'; import { CONFIG } from '../Config/Config' -import { Metrics } from "@firebolt-js/sdk" let instance = null export default class RDKWindowManager { @@ -45,7 +44,6 @@ export default class RDKWindowManager { }) .catch(err => { this.ERR("Error Activation RDKWindowManager" + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "RDKWindowManager", `Error while Thunder Controller ${this.callsign} activate ${JSON.stringify(err)}`, false, null) reject(err) }) }) @@ -59,7 +57,6 @@ export default class RDKWindowManager { }) .catch(err => { this.ERR("Error Deactivation RDKWindowManager" + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "RDKWindowManager", `Error while Thunder Controller ${this.callsign} deactivate ${JSON.stringify(err)}`, false, null) reject(err) }) }) @@ -73,21 +70,19 @@ export default class RDKWindowManager { }) .catch(err => { this.ERR("Error in setFocus: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "RDKWindowManager", `Error while calling setFocus on ${this.callsign} ${JSON.stringify(err)}`, false, null) reject(err) }) }) } setVisible(client, visible) { return new Promise((resolve, reject) => { - this.thunder.call(this.callsign, 'setVisible', { "client":client, "visible":visible }) + this.thunder.call(this.callsign, 'setVisible', { "client":client, "visible":visible }) .then(response => { resolve(response) this.INFO("setVisible response: " + JSON.stringify(response)); }) .catch(err => { this.ERR("Error in setVisible: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "RDKWindowManager", `Error while calling setVisible on ${this.callsign} ${JSON.stringify(err)}`, false, null) reject(err) }) }) @@ -95,7 +90,7 @@ export default class RDKWindowManager { getApps() { return new Promise((resolve, reject) => { - this.thunder.call(this.callsign, 'getApps', {}) + this.thunder.call(this.callsign, 'getApps', {}) .then(response => { if (typeof response === "string") { resolve(JSON.parse(response)); @@ -106,7 +101,6 @@ export default class RDKWindowManager { }) .catch(err => { this.ERR("Error in getApps: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "RDKWindowManager", `Error while calling getApps on ${this.callsign} ${JSON.stringify(err)}`, false, null) reject(err) }) }) @@ -120,7 +114,6 @@ export default class RDKWindowManager { }) .catch(err => { this.ERR("Error in setZOrder: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "RDKWindowManager", `Error while calling setZOrder on ${this.callsign} ${JSON.stringify(err)}`, false, null) reject(err) }) }) @@ -134,23 +127,21 @@ export default class RDKWindowManager { }) .catch(err => { this.ERR("Error in getZOrder: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "RDKWindowManager", `Error while calling getZOrder on ${this.callsign} ${JSON.stringify(err)}`, false, null) reject(err) }) }) } enableInactivityReporting(enable) { return new Promise((resolve, reject) => { - this.thunder.call(this.callsign, 'enableInactivityReporting', { "enable":enable }) + this.thunder.call(this.callsign, 'enableInactivityReporting', { "enable":enable }) .then(response => { this.INFO("enableInactivityReporting response: " + JSON.stringify(response)); resolve(response == null ? true : response) }) .catch(err => { this.ERR("Error in enableInactivityReporting: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "Runtime", `Error while calling enableInactivityReporting on ${this.callsign} ${JSON.stringify(err)}`, false, null) reject(err) - }) + }) }) } setInactivityInterval(interval) { @@ -162,12 +153,11 @@ export default class RDKWindowManager { }) .catch(err => { this.ERR("Error in setInactivityInterval: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "RDKWindowManager", `Error while calling setInactivityInterval on ${this.callsign} ${JSON.stringify(err)}`, false, null) reject(err) }) }) } - resetInactivityTime() { + resetInactivityTime() { return new Promise((resolve, reject) => { this.thunder.call(this.callsign, 'resetInactivityTime', {}) .then(response => { @@ -176,7 +166,6 @@ export default class RDKWindowManager { }) .catch(err => { this.ERR("Error in resetInactivityTimeout: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "RDKWindowManager", `Error while calling resetInactivityTimeout on ${this.callsign} ${JSON.stringify(err)}`, false, null) reject(err) }) }) @@ -190,7 +179,6 @@ export default class RDKWindowManager { }) .catch(err => { this.ERR("Error in renderReady: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "RDKWindowManager", `Error while calling renderReady on ${this.callsign} ${JSON.stringify(err)}`, false, null) reject(err) }) }) @@ -204,7 +192,6 @@ export default class RDKWindowManager { }) .catch(err => { this.ERR("Error in enableDisplayRender: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "RDKWindowManager", `Error while calling enableDisplayRender on ${this.callsign} ${JSON.stringify(err)}`, false, null) reject(err) }) }) @@ -218,7 +205,6 @@ export default class RDKWindowManager { }) .catch(err => { this.ERR("Error in generateKey: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "RDKWindowManager", `Error while calling generateKey on ${this.callsign} ${JSON.stringify(err)}`, false, null) reject(err) }) }) @@ -235,12 +221,11 @@ export default class RDKWindowManager { }) .catch(err => { this.ERR("Error in removeKeyIntercept: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "RDKWindowManager", `Error while calling removeKeyIntercept on ${this.callsign} ${JSON.stringify(err)}`, false, null) reject(err) }) }) } - addKeyIntercepts (params) { + addKeyIntercepts (params) { return new Promise((resolve, reject) => { this.thunder.call(this.callsign, 'addKeyIntercepts', params) .then(response => { @@ -249,11 +234,10 @@ export default class RDKWindowManager { }) .catch(err => { this.ERR("Error in addKeyIntercepts: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "RDKWindowManager", `Error while calling addKeyIntercepts on ${this.callsign} ${JSON.stringify(err)}`, false, null) reject(err) }) }) - } + } createDisplay(client,displayName,displayWidth,virtualWidth,virtualHeight,ownerId) { return new Promise((resolve, reject) => { this.thunder.call(this.callsign, 'createDisplay', { "client":client, "displayName":displayName, "displayWidth":displayWidth, "virtualWidth":virtualWidth, "virtualHeight":virtualHeight, "ownerId":ownerId }) @@ -263,7 +247,6 @@ export default class RDKWindowManager { }) .catch(err => { this.ERR("Error in createDisplay: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "RDKWindowManager", `Error while calling createDisplay on ${this.callsign} ${JSON.stringify(err)}`, false, null) reject(err) }) }) diff --git a/accelerator-home-ui/src/api/RemoteControl.js b/accelerator-home-ui/src/api/RemoteControl.js index c6b13965..3e2a6c6f 100644 --- a/accelerator-home-ui/src/api/RemoteControl.js +++ b/accelerator-home-ui/src/api/RemoteControl.js @@ -18,7 +18,6 @@ **/ import ThunderJS from 'ThunderJS'; import { CONFIG } from '../Config/Config' -import { Metrics } from '@firebolt-js/sdk'; let instance = null @@ -39,41 +38,6 @@ export default class RCApi { return instance } - activate() { - return new Promise((resolve, reject) => { - this.thunder.call('Controller', `status@${this.callsign}`).then(result => { - if (Array.isArray(result) && result[0] && result[0].state === "activated") { - resolve(true); - return; - } - this.INFO("RCApi: activate."); - this.thunder.Controller.activate({ callsign: this.callsign }).then(() => { - resolve(true); - }).catch(err => { - this.ERR("RCApi: Error Activation " + JSON.stringify(err)); - Metrics.error(Metrics.ErrorType.OTHER,"RemoteControlApiError", "Error while Thunder Controller RemoteControl activate "+JSON.stringify(err), false, null) - reject(err) - }) - }).catch(err => { - this.ERR("RCApi: Error checking activation status " + JSON.stringify(err)); - reject(err); - }) - }) - } - - deactivate() { - return new Promise((resolve, reject) => { - this.thunder.Controller.deactivate({ callsign: this.callsign }).then(() => { - this.INFO("RCApi: deactivated " + this.callsign) - resolve(true) - }).catch(err => { - this.ERR("RCApi: Error deactivation " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER,"RemoteControlApiError", "Error while Thunder Controller RemoteControl deactivate "+JSON.stringify(err), false, null) - reject(err) - }) - }) - } - getApiVersionNumber() { return new Promise((resolve, reject) => { this.INFO("RCApi: getApiVersionNumber"); @@ -82,7 +46,6 @@ export default class RCApi { resolve(result); }).catch(err => { this.ERR("RCApi: getApiVersionNumber error: " + JSON.stringify(err)); - Metrics.error(Metrics.ErrorType.OTHER,"RemoteControlApiError", "Error in Thunder RemoteControl getApiVersionNumber "+JSON.stringify(err), false, null) reject(err); }); }) @@ -99,7 +62,6 @@ export default class RCApi { } }).catch(err => { this.ERR("RCApi: getNetStatus error: " + JSON.stringify(err)); - Metrics.error(Metrics.ErrorType.OTHER,"RemoteControlApiError", "Error in Thunder RemoteControl getNetStatus "+JSON.stringify(err), false, null) reject(err); }); }) @@ -112,7 +74,6 @@ export default class RCApi { resolve(result.success); }).catch(err => { this.ERR("RCApi: startPairing error: " + JSON.stringify(err)); - Metrics.error(Metrics.ErrorType.OTHER,"RemoteControlApiError", "Error in Thunder RemoteControl startPairing "+JSON.stringify(err), false, null) reject(err); }); }) @@ -126,7 +87,6 @@ export default class RCApi { resolve(result.success); }).catch(err => { this.ERR("RCApi: stopPairing error: " + JSON.stringify(err)); - Metrics.error(Metrics.ErrorType.OTHER, "RemoteControlApiError", "Error in Thunder RemoteControl stopPairing " + JSON.stringify(err), false, null) reject(err); }); }); @@ -135,7 +95,6 @@ export default class RCApi { initializeIRDB() { return new Promise((resolve, reject) => { /*TODO: implement when requirement comes.*/ - Metrics.error(Metrics.ErrorType.OTHER,"RemoteControlApiError", "NotImplemented", false, null) reject("NotImplemented") }); } @@ -143,7 +102,6 @@ export default class RCApi { clearIRCodes() { return new Promise((resolve, reject) => { /*TODO: implement when requirement comes.*/ - Metrics.error(Metrics.ErrorType.OTHER,"RemoteControlApiError", "NotImplemented", false, null) reject("NotImplemented") }); } @@ -151,7 +109,6 @@ export default class RCApi { setIRCode() { return new Promise((resolve, reject) => { /*TODO: implement when requirement comes.*/ - Metrics.error(Metrics.ErrorType.OTHER,"RemoteControlApiError", "NotImplemented", false, null) reject("NotImplemented") }); } @@ -159,7 +116,6 @@ export default class RCApi { getIRCodesByAutoLookup() { return new Promise((resolve, reject) => { /*TODO: implement when requirement comes.*/ - Metrics.error(Metrics.ErrorType.OTHER,"RemoteControlApiError", "NotImplemented", false, null) reject("NotImplemented") }); } @@ -167,7 +123,6 @@ export default class RCApi { getIRCodesByNames() { return new Promise((resolve, reject) => { /*TODO: implement when requirement comes.*/ - Metrics.error(Metrics.ErrorType.OTHER,"RemoteControlApiError", "NotImplemented", false, null) reject("NotImplemented") }); } @@ -175,7 +130,6 @@ export default class RCApi { getIRDBManufacturers() { return new Promise((resolve, reject) => { /*TODO: implement when requirement comes.*/ - Metrics.error(Metrics.ErrorType.OTHER,"RemoteControlApiError", "NotImplemented", false, null) reject("NotImplemented") }); } @@ -183,7 +137,6 @@ export default class RCApi { getIRDBModels() { return new Promise((resolve, reject) => { /*TODO: implement when requirement comes.*/ - Metrics.error(Metrics.ErrorType.OTHER,"RemoteControlApiError", "NotImplemented", false, null) reject("NotImplemented") }); } @@ -191,7 +144,6 @@ export default class RCApi { getLastKeypressSource() { return new Promise((resolve, reject) => { /*TODO: implement when requirement comes.*/ - Metrics.error(Metrics.ErrorType.OTHER,"RemoteControlApiError", "NotImplemented", false, null) reject("NotImplemented") }); } @@ -205,7 +157,6 @@ export default class RCApi { resolve(result.success); }).catch(err => { this.ERR("RCApi: configureWakeupKeys error: " + JSON.stringify(err)); - Metrics.error(Metrics.ErrorType.OTHER,"RemoteControlApiError", "Error in Thunder RemoteControl configureWakeupKeys "+JSON.stringify(err), false, null) reject(err); }); }) @@ -219,7 +170,6 @@ export default class RCApi { resolve(result.success); }).catch(err => { this.ERR("RCApi: findMyRemote error: " + JSON.stringify(err)); - Metrics.error(Metrics.ErrorType.OTHER,"RemoteControlApiError", "Error in Thunder RemoteControl findMyRemote "+JSON.stringify(err), false, null) reject(err); }); }) @@ -235,7 +185,6 @@ export default class RCApi { resolve(result.success); }).catch(err => { this.ERR("RCApi: factoryReset error: " + JSON.stringify(err)); - Metrics.error(Metrics.ErrorType.OTHER,"RemoteControlApiError", "Error in Thunder RemoteControl factoryReset "+JSON.stringify(err), false, null) reject(err); }); }) @@ -249,7 +198,6 @@ export default class RCApi { resolve(result.success); }).catch(err => { this.ERR("RCApi: unpair error: " + JSON.stringify(err)); - Metrics.error(Metrics.ErrorType.OTHER, "RemoteControlApiError", "Error in Thunder RemoteControl unpair " + JSON.stringify(err), false, null) reject(err); }); }); diff --git a/accelerator-home-ui/src/api/RuntimeManagerApi.js b/accelerator-home-ui/src/api/RuntimeManagerApi.js index eecac214..cc9adecd 100644 --- a/accelerator-home-ui/src/api/RuntimeManagerApi.js +++ b/accelerator-home-ui/src/api/RuntimeManagerApi.js @@ -18,7 +18,6 @@ **/ import ThunderJS from 'ThunderJS'; import { CONFIG } from '../Config/Config' -import { Metrics } from "@firebolt-js/sdk" let instance = null export default class RuntimeManager { @@ -45,7 +44,6 @@ export default class RuntimeManager { }) .catch(err => { this.ERR("Error Activation RuntimeManager" + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "Runtime", `Error while Thunder Controller ${this.callsign} activate ${JSON.stringify(err)}`, false, null) reject(err) }) }) @@ -59,7 +57,6 @@ export default class RuntimeManager { }) .catch(err => { this.ERR("Error Deactivation RuntimeManager" + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "Runtime", `Error while Thunder Controller ${this.callsign} deactivate ${JSON.stringify(err)}`, false, null) reject(err) }) }) diff --git a/accelerator-home-ui/src/api/TTSApi.js b/accelerator-home-ui/src/api/TTSApi.js index c4d2310c..83cbeb26 100644 --- a/accelerator-home-ui/src/api/TTSApi.js +++ b/accelerator-home-ui/src/api/TTSApi.js @@ -18,7 +18,6 @@ **/ import ThunderJS from 'ThunderJS'; import { CONFIG } from '../Config/Config' -import { Metrics } from '@firebolt-js/sdk'; const thunder = ThunderJS(CONFIG.thunderConfig) const callsign = 'org.rdk.TextToSpeech' @@ -40,7 +39,6 @@ export default class TTSApi { }) .catch(err => { this.ERR("Error Activation " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, errorName, `Error while Thunder Controller ${callsign} activate ${JSON.stringify(err)}`, false, null) reject(err) }) }) @@ -53,7 +51,6 @@ export default class TTSApi { }) .catch(err => { this.ERR("Error Deactivation " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, errorName, `Error while Thunder Controller ${callsign} deactivate ${JSON.stringify(err)}`, false, null) reject(err) }) }) @@ -70,7 +67,6 @@ export default class TTSApi { }) .catch(err => { this.ERR("TTSApi TextToSpeech enable error: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "PluginError", "Error in Thunder TextToSpeech enable " + JSON.stringify(err), false, null) resolve(false) }) }) @@ -85,7 +81,6 @@ export default class TTSApi { }) .catch(err => { this.ERR("TTSApi TextToSpeech isEnabled error: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "PluginError", "Error in Thunder TextToSpeech isEnabled " + JSON.stringify(err), false, null) resolve(false) }) }) @@ -100,7 +95,6 @@ export default class TTSApi { }) .catch(err => { this.ERR("TTSApi TextToSpeech setTTSConfiguration error: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "PluginError", "Error in Thunder TextToSpeech setTTSConfiguration " + JSON.stringify(err), false, null) resolve(false) }) }) @@ -115,7 +109,6 @@ export default class TTSApi { }) .catch(err => { this.ERR("TTSApi TextToSpeech getTTSConfiguration error: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "PluginError", "Error in Thunder TextToSpeech getTTSConfiguration " + JSON.stringify(err), false, null) resolve(false) }) }) @@ -132,7 +125,6 @@ export default class TTSApi { }) .catch(err => { this.ERR("TTSAPI TextToSpeech speak error: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "PluginError", "Error in Thunder TextToSpeech Speak " + JSON.stringify(err), false, null) resolve(false) }) }) @@ -149,7 +141,6 @@ export default class TTSApi { }) .catch(err => { this.ERR("TTSAPI TextToSpeech resume error: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "PluginError", "Error in Thunder TextToSpeech resume " + JSON.stringify(err), false, null) resolve(false) }) }) @@ -166,7 +157,6 @@ export default class TTSApi { }) .catch(err => { this.ERR("TTSApi TextToSpeech pause error: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "PluginError", "Error in Thunder TextToSpeech pause " + JSON.stringify(err), false, null) resolve(false) }) }) @@ -183,7 +173,6 @@ export default class TTSApi { }) .catch(err => { this.ERR("TTSAPI TextToSpeech listvoices error: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "PluginError", "Error in Thunder TextToSpeech listVoices " + JSON.stringify(err), false, null) resolve(false) }) }) diff --git a/accelerator-home-ui/src/api/UsbApi.js b/accelerator-home-ui/src/api/UsbApi.js deleted file mode 100644 index 9307de01..00000000 --- a/accelerator-home-ui/src/api/UsbApi.js +++ /dev/null @@ -1,284 +0,0 @@ -/** - * If not stated otherwise in this file or this component's LICENSE - * file the following copyright and licenses apply: - * - * Copyright 2020 RDK Management - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - **/ -import ThunderJS from 'ThunderJS' -import { imageListInfo } from '../../static/data/ImageListInfo' -import { musicListInfo } from '../../static/data/MusicListInfo' -import { videoListInfo } from '../../static/data/VideoListInfo' -import { UsbInnerFolderListInfo } from '../../static/data/UsbInnerFolderListInfo' -import { CONFIG } from '../Config/Config' -import { Metrics } from '@firebolt-js/sdk' - -let thunder = ThunderJS(CONFIG.thunderConfig) - -/** - * Class that contains functions which commuicates with thunder API's - */ -export default class UsbApi { - - constructor() { - this.INFO = console.info; - this.LOG = console.log; - this.ERR = console.error; - this.WARN = console.warn; - } - - /** - * Function to activate USB Access Plugin - */ - activate() { - return new Promise((resolve, reject) => { - const systemcCallsign = 'org.rdk.UsbAccess' - thunder.Controller.activate({ callsign: systemcCallsign }) - .then(res => { - resolve(res) - }).catch(err => { - this.ERR('UsbAccess Plugin Activation Failed: ' + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER,"UsbApiError", "Error while Thunder Controller usbAccess activate "+JSON.stringify(err), false, null) - reject(err) - }) - }) - } - - /** - * Function to deactivate USB Access Plugin - */ - deactivate() { - return new Promise((resolve, reject) => { - const systemcCallsign = 'org.rdk.UsbAccess' - thunder.Controller.deactivate({ callsign: systemcCallsign }) - .then(res => { - resolve(res) - }).catch(err => { - this.ERR('UsbAccess Plugin Deactivation Failed: ' + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER,"UsbApiError", "Error while Thunder Controller usbAccess deactivate "+JSON.stringify(err), false, null) - reject(err) - }) - }) - } - - /** - * Function to create link for USB content - */ - clearLink() { - return new Promise((resolve) => { - const systemcCallsign = 'org.rdk.UsbAccess' - thunder - .call(systemcCallsign, 'clearLink') - .then(result => { - resolve(result) - }).catch(err => { - this.ERR('UsbAccess Plugin ClearLink Failed: ' + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER,"UsbApiError", "Error in Thunder usbAccess clearLink "+JSON.stringify(err), false, null) - resolve(false) - }) - }) - } - - /** - * Function to create link for USB content - */ - createLink() { - return new Promise((resolve) => { - const systemcCallsign = 'org.rdk.UsbAccess' - thunder - .call(systemcCallsign, 'createLink') - .then(result => { - resolve(result) - }).catch(err => { - this.ERR('UsbAccess Plugin CreateLink Failed: ' + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER,"UsbApiError", "Error in Thunder usbAccess createLink "+JSON.stringify(err), false, null) - resolve(false) - }) - }) - } - - /** - * Function to get getUsbList - */ - getUsbFileList() { - if (arguments.length === 0) { - return new Promise((resolve) => { - const systemcCallsign = 'org.rdk.UsbAccess' - thunder - .call(systemcCallsign, 'getFileList') - .then(result => { - resolve(result.contents) - }).catch(err => { - this.ERR('UsbAccess Plugin getFileList Failed: ' + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER,"UsbApiError", "Error in Thunder usbAccess getFileList "+JSON.stringify(err), false, null) - resolve(false) - }) - }) - } else { - - return new Promise((resolve) => { - const systemcCallsign = 'org.rdk.UsbAccess' - thunder - .call(systemcCallsign, 'getFileList', { "path": arguments[0] }) - .then(result => { - resolve(result.contents) - }).catch(err => { - this.ERR('UsbAccess Plugin getFileList Failed: ' + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER,"UsbApiError", "Error in Thunder usbAccess getFileList "+JSON.stringify(err), false, null) - resolve(false) - }) - }) - - } - - } - - retrieUsb() { - this.usbLink = "" - let self = this; - return new Promise((resolve, reject) => { - self.clearLink().then( - () => { - self.createLink().then( - res => { - if (res.success) { - self.usbLink = res.baseURL - self.getUsbFileList().then( - result1 => { - self.getUsbContentList(result1) - resolve(true) - } - ).catch(err => { reject(err) }) - } - } - ).catch(err => { reject(err) }) - } - ).catch(err => { reject(err) }) - }) - - } - - destroy() { - imageListInfo.length = 0; - videoListInfo.length = 0; - musicListInfo.length = 0; - UsbInnerFolderListInfo.length = 0; - } - - cd(dname) { - return new Promise((resolve, reject) => { - this.getUsbFileList(dname).then( - result1 => { - this.getUsbContentList(result1, dname) - resolve(true) - } - ).catch(err => { - reject(err) - }) - }) - } - - getMountedDevices() { - return new Promise((resolve, reject) => { - const systemcCallsign = "org.rdk.UsbAccess" - thunder - .call(systemcCallsign, 'getMounted') - .then(result => { - resolve(result) - }) - .catch(err => { - reject(err) - this.ERR("Error while getting the mounted device " + JSON.stringify(err)); - Metrics.error(Metrics.ErrorType.OTHER,"UsbApiError", "Error in Thunder usbAccess getMounted "+JSON.stringify(err), false, null) - }); - }); - } - - getUsbContentList(result) { - this.destroy() - let cwd = this.usbLink; - if (arguments[1]) { - cwd = cwd + '/' + arguments[1]; - } - // to add support for more formats, extension can be added same as below - let extensionForImage = ['.png', '.jpg', '.PNG', '.jpeg', '.JPEG', '.jpg', '.JPG']; - let extensionForVideo = ['.mp4', '.MP4', '.mov', '.MOV', '.avi', '.AVI', '.m3u8', '.M3U8', '.mpeg2', '.MPEG2']; - let extensionForAudio = ['.mp3', '.mpeg', '.MP3', '.MPEG']; - - this._discoveredC = result; - // this.LOG("Discovered result :: " + JSON.stringify(result)); - - this._discoveredC.filter(device => { - for (let i in extensionForImage) { - if (device.name.indexOf(extensionForImage[i]) !== -1) { - let obj1 = { - displayName: device.name, - uri: cwd + '/' + device.name, - url: cwd + '/' + device.name, - // url: '/images/usb/picture-default-tile.jpg', - // url: '/images/usb/USB_Photo_Placeholder.jpg', - // uri: this.usbLink + '/' + device.name, - }; - imageListInfo.push(obj1); - return device - } - } - }); - - this._discoveredC.filter(device => { - for (let i in extensionForVideo) { - if (device.name.indexOf(extensionForVideo[i]) !== -1) { - let obj2 = { - displayName: device.name, - // url: '/images/usb/video-default-tile.jpg', - url: '/images/usb/USB_Video_Placeholder.jpg', - uri: cwd + '/' + device.name, - }; - videoListInfo.push(obj2); - return device - } - } - }); - - this._discoveredC.filter(device => { - for (let i in extensionForAudio) { - if (device.name.indexOf(extensionForAudio[i]) !== -1) { - let obj3 = { - displayName: device.name, - // url: '/images/usb/music-default-tile.jpg', - url: '/images/usb/USB_Audio_Placeholder.jpg', - uri: cwd + '/' + device.name, - }; - musicListInfo.push(obj3); - return device - } - } - }); - - - this._discoveredC.filter(device => { - if (device.t === 'd') { - if (!(device.name === '.' || device.name === "..")) { - let obj4 = { - displayName: device.name, - url: "/images/usb/USB_Folder.jpg", - uri: cwd + "/" + device.name - } - UsbInnerFolderListInfo.push(obj4); - return device - } - } - }) - } -} diff --git a/accelerator-home-ui/src/api/UserSettingsApi.js b/accelerator-home-ui/src/api/UserSettingsApi.js index dd1bffbb..dfb4e3ca 100644 --- a/accelerator-home-ui/src/api/UserSettingsApi.js +++ b/accelerator-home-ui/src/api/UserSettingsApi.js @@ -18,7 +18,6 @@ **/ import ThunderJS from 'ThunderJS'; import { CONFIG } from '../Config/Config' -import { Metrics } from '@firebolt-js/sdk'; const thunder = ThunderJS(CONFIG.thunderConfig) const callsign = 'org.rdk.UserSettings' @@ -49,7 +48,6 @@ export default class UserSettingsApi { }) .catch(err => { this.ERR("Error Activation " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, errorName, `Error while Thunder Controller ${callsign} activate ${JSON.stringify(err)}`, false, null) reject(err) }) }) @@ -62,7 +60,6 @@ export default class UserSettingsApi { }) .catch(err => { this.ERR("Error Deactivation " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, errorName, `Error while Thunder Controller ${callsign} deactivate ${JSON.stringify(err)}`, false, null) reject(err) }) }) @@ -79,7 +76,6 @@ export default class UserSettingsApi { }) .catch(err => { this.ERR("Error enable " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "PluginError", "Error in Thunder UserSettings setVoiceGuidance " + JSON.stringify(err), false, null) resolve(false) }) }) @@ -94,7 +90,6 @@ export default class UserSettingsApi { }) .catch(err => { this.ERR("Error enable " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "PluginError", "Error in Thunder UserSettings getVoiceGuidance " + JSON.stringify(err), false, null) resolve(false) }) }) @@ -106,7 +101,6 @@ export default class UserSettingsApi { resolve(result) }).catch(err => { this.ERR('UserSettingsApi setPresentationLanguage failed:' + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "PluginError", 'Error in Thunder setPresentationLanguage of UserSettings' + JSON.stringify(err), false, null) resolve(false) }) }) @@ -118,7 +112,6 @@ export default class UserSettingsApi { resolve(result) }).catch(err => { this.ERR('UserSettingsApi getPresentationLanguage failed:' + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "PluginError", 'Error in Thunder getPresentationLanguage of UserSettings' +JSON.stringify(err), false, null) resolve(false) }) }) diff --git a/accelerator-home-ui/src/api/VoiceApi.js b/accelerator-home-ui/src/api/VoiceApi.js index aef78d4b..1ef28f72 100644 --- a/accelerator-home-ui/src/api/VoiceApi.js +++ b/accelerator-home-ui/src/api/VoiceApi.js @@ -18,7 +18,6 @@ **/ import ThunderJS from 'ThunderJS'; import { CONFIG } from '../Config/Config' -import { Metrics } from '@firebolt-js/sdk'; export default class VoiceApi { constructor() { @@ -75,7 +74,6 @@ export default class VoiceApi { resolve(true); }).catch(err => { this.ERR('VoiceApi: Error Activation ' + JSON.stringify(err)); - Metrics.error(Metrics.ErrorType.OTHER,"VoiceApiError", "Error while Thunder Controller VoiceApi activate "+JSON.stringify(err), false, null) }) }) } @@ -86,7 +84,6 @@ export default class VoiceApi { resolve(true) }).catch(err => { this.ERR('VoiceApi: Error deactivation ' + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER,"VoiceApiError", "Error while Thunder Controller VoiceApi deactivate "+JSON.stringify(err), false, null) }) }) } @@ -98,7 +95,6 @@ export default class VoiceApi { resolve(result); }).catch(err => { this.ERR("VoiceApi: configureVoice error: " + JSON.stringify(err)); - Metrics.error(Metrics.ErrorType.OTHER,"VoiceApiError", "Error while Thunder VoiceApi configureVoice "+JSON.stringify(err), false, null) resolve(false); }); }) @@ -111,7 +107,6 @@ export default class VoiceApi { resolve(result); }).catch(err => { this.ERR("VoiceApi: sendVoiceMessage error: " + JSON.stringify(err)); - Metrics.error(Metrics.ErrorType.OTHER,"VoiceApiError", "Error in Thunder VoiceApi sendVoiceMessage "+JSON.stringify(err), false, null) resolve(false); }); }) @@ -124,7 +119,6 @@ export default class VoiceApi { resolve(result); }).catch(err => { this.ERR("VoiceApi: setVoiceInit error: " + JSON.stringify(err)); - Metrics.error(Metrics.ErrorType.OTHER,"VoiceApiError", "Error in Thunder VoiceApi setVoiceInit "+JSON.stringify(err), false, null) resolve(false); }); }) @@ -137,7 +131,6 @@ export default class VoiceApi { resolve(result); }).catch(err => { this.ERR("VoiceApi: voiceSessionByText error: " + JSON.stringify(err)); - Metrics.error(Metrics.ErrorType.OTHER,"VoiceApiError", "Error in Thunder VoiceApi voiceSessionByText "+JSON.stringify(err), false, null) resolve(false); }); }) @@ -149,7 +142,6 @@ export default class VoiceApi { resolve(result); }).catch(err => { this.ERR("VoiceApi: voiceSessionTypes error: " + JSON.stringify(err)); - Metrics.error(Metrics.ErrorType.OTHER,"VoiceApiError", "Error in Thunder VoiceApi voiceSessionTypes "+JSON.stringify(err), false, null) resolve(false); }); }) @@ -162,7 +154,6 @@ export default class VoiceApi { resolve(result); }).catch(err => { this.ERR("VoiceApi: voiceSessionRequest error: " + JSON.stringify(err)); - Metrics.error(Metrics.ErrorType.OTHER,"VoiceApiError", "Error in Thunder VoiceApi voiceSessionRequest "+JSON.stringify(err), false, null) resolve(false); }); }) @@ -175,7 +166,6 @@ export default class VoiceApi { resolve(result); }).catch(err => { this.ERR("VoiceApi: voiceSessionTerminate error: " + JSON.stringify(err)); - Metrics.error(Metrics.ErrorType.OTHER,"VoiceApiError", "Error in Thunder VoiceApi voiceSessionTerminate "+JSON.stringify(err), false, null) resolve(false); }); }) @@ -188,7 +178,6 @@ export default class VoiceApi { resolve(result); }).catch(err => { this.ERR("VoiceApi: voiceSessionAudioStreamStart error: " + JSON.stringify(err)); - Metrics.error(Metrics.ErrorType.OTHER,"VoiceApiError", "Error in Thunder VoiceApi voiceSessionAudioStreamStart "+JSON.stringify(err), false, null) resolve(false); }); }) @@ -201,7 +190,6 @@ export default class VoiceApi { resolve(result); }).catch(err => { this.ERR("VoiceApi: voiceStatus error: " + JSON.stringify(err)); - Metrics.error(Metrics.ErrorType.OTHER,"VoiceApiError", "Error in Thunder VoiceApi voiceStatus "+JSON.stringify(err), false, null) resolve(false); }); }) diff --git a/accelerator-home-ui/src/api/WarehouseApis.js b/accelerator-home-ui/src/api/WarehouseApis.js index 43c46210..7c689dcb 100644 --- a/accelerator-home-ui/src/api/WarehouseApis.js +++ b/accelerator-home-ui/src/api/WarehouseApis.js @@ -18,7 +18,6 @@ **/ import ThunderJS from 'ThunderJS'; import { CONFIG } from '../Config/Config' -import { Metrics } from '@firebolt-js/sdk'; let instance = null @@ -46,7 +45,6 @@ export default class Warehouse { resolve(true) }).catch(err => { this.ERR(this.callsign + " activate error: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER,"WarehouseApiError", "Error in Thunder controller warehouseApi activate "+JSON.stringify(err), false, null) reject(err) }); }); @@ -59,7 +57,6 @@ export default class Warehouse { resolve(true) }).catch(err => { this.ERR(this.callsign + " deactivate error: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER,"WarehouseApiError", "Error in Thunder controller warehouseApi deactivate "+JSON.stringify(err), false, null) reject(err) }); }); @@ -73,7 +70,6 @@ export default class Warehouse { reject(false) }).catch(err => { this.ERR(this.callsign + " executeHardwareTest error: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER,"WarehouseApiError", "Error while Thunder warehouseApi executeHardwareTest "+JSON.stringify(err), false, null) reject(err) }) }) @@ -87,7 +83,6 @@ export default class Warehouse { reject(false) }).catch(err => { this.ERR(this.callsign + " internalReset error: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER,"WarehouseApiError", "Error while Thunder warehouseApi internalReset "+JSON.stringify(err), false, null) reject(err) }) }) @@ -101,7 +96,6 @@ export default class Warehouse { reject(false) }).catch(err => { this.ERR(this.callsign + " isClean error: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER,"WarehouseApiError", "Error while Thunder warehouseApi isClean "+JSON.stringify(err), false, null) reject(err) }) }) @@ -115,7 +109,6 @@ export default class Warehouse { else{reject(false)} }).catch(err => { this.ERR(this.callsign + " lightReset error: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER,"WarehouseApiError", "Error while Thunder warehouseApi lightReset "+JSON.stringify(err), false, null) reject(err) }) }) @@ -134,7 +127,6 @@ export default class Warehouse { } }).catch(err => { this.ERR(this.callsign + " resetDevice error: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER,"WarehouseApiError", "Error while Thunder warehouseApi resetDevice "+JSON.stringify(err), false, null) reject(err) }) }) @@ -148,7 +140,6 @@ export default class Warehouse { reject(false) }).catch(err => { this.ERR(this.callsign + " setFrontPanelState error: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER,"WarehouseApiError", "Error while Thunder warehouseApi setFrontPanelState "+JSON.stringify(err), false, null) reject(err) }) }) diff --git a/accelerator-home-ui/src/api/WifiApi.js b/accelerator-home-ui/src/api/WifiApi.js deleted file mode 100644 index 0d4d3440..00000000 --- a/accelerator-home-ui/src/api/WifiApi.js +++ /dev/null @@ -1,372 +0,0 @@ -/** - * If not stated otherwise in this file or this component's LICENSE - * file the following copyright and licenses apply: - * - * Copyright 2020 RDK Management - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - **/ -import ThunderJS from 'ThunderJS' -import { CONFIG } from '../Config/Config' -import { Metrics } from '@firebolt-js/sdk' - -export const WiFiErrorMessages = { - 0: 'SSID_CHANGED - The SSID of the network changed', - 1: 'CONNECTION_LOST - The connection to the network was lost', - 2: 'CONNECTION_FAILED - The connection failed for an unknown reason', - 3: 'CONNECTION_INTERRUPTED - The connection was interrupted', - 4: 'INVALID_CREDENTIALS - The connection failed due to invalid credentials', - 5: 'NO_SSID - The SSID does not exist', - 6: 'UNKNOWN - Any other error.', - 7: 'WIFI_AUTH_FAILED - Authentication Failed' -} - -export const WiFiStateMessages = { - 0: 'Uninstalled or system error', - 1: 'Interface disabled', - 2: 'Disconnected', - 3: 'Pairing', - 4: 'Connecting', - 5: 'Connected', - 6: 'Failed', -} - -export const WiFiState = { - UNINSTALLED: 0, - DISABLED: 1, - DISCONNECTED: 2, - PAIRING: 3, - CONNECTING: 4, - CONNECTED: 5, - FAILED: 6, -} - -export const WiFiError = { - SSID_CHANGED: 0, - CONNECTION_LOST: 1, - CONNECTION_FAILED: 2, - CONNECTION_INTERRUPTED: 3, - INVALID_CREDENTIALS: 4, - NO_SSID: 5, - UNKNOWN: 6, - WIFI_AUTH_FAILED: 7, -} - -export const WiFiSecurityModes = { - "NET_WIFI_SECURITY_NONE": 0, - "NET_WIFI_SECURITY_WEP_64": 1, - "NET_WIFI_SECURITY_WEP_128": 2, - "NET_WIFI_SECURITY_WPA_PSK_TKIP": 3, - "NET_WIFI_SECURITY_WPA_PSK_AES": 4, - "NET_WIFI_SECURITY_WPA2_PSK_TKIP": 5, - "NET_WIFI_SECURITY_WPA2_PSK_AES": 6, - "NET_WIFI_SECURITY_WPA_ENTERPRISE_TKIP": 7, - "NET_WIFI_SECURITY_WPA_ENTERPRISE_AES": 8, - "NET_WIFI_SECURITY_WPA2_ENTERPRISE_TKIP": 9, - "NET_WIFI_SECURITY_WPA2_ENTERPRISE_AES": 10, - "NET_WIFI_SECURITY_WPA_WPA2_PSK": 11, - "NET_WIFI_SECURITY_WPA_WPA2_ENTERPRISE": 12, - "NET_WIFI_SECURITY_WPA3_PSK_AES": 13, - "NET_WIFI_SECURITY_WPA3_SAE": 14 -} - -let instance = null - -export default class Wifi { - constructor() { - this.thunder = ThunderJS(CONFIG.thunderConfig); - this.callsign = 'org.rdk.Wifi'; - this.INFO = console.info; - this.LOG = console.log; - this.ERR = console.error; - this.WARN = console.warn; - } - - static get() { - if (instance == null) { - instance = new Wifi(); - // Vital plugins; always keep activated. - instance.activate(); - } - return instance - } - - activate() { - return new Promise((resolve, reject) => { - this.LOG(this.callsign + " activate"); - this.thunder.call('Controller', 'activate', { callsign: this.callsign }).then(result => { - resolve(result) - }).catch(err => { - this.ERR(this.callsign + " activate error: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.NETWORK,"WifiApiError", "Error in Thunder Controller wifi activate" + JSON.stringify(err), false, null) - reject(err) - }) - }) - } - - deactivate() { - return new Promise((resolve, reject) => { - this.LOG(this.callsign + " deactivate"); - this.thunder.call('Controller', 'deactivate', { callsign: this.callsign }).then(result => { - resolve(result) - }).catch(err => { - this.ERR(this.callsign + " deactivate error: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.NETWORK,"WifiApiError", "Error in Thunder Controller wifi deactivate" +JSON.stringify(err), false, null) - reject(err) - }) - }) - } - - cancelWPSPairing() { - return new Promise((resolve, reject) => { - this.LOG(this.callsign + " cancelWPSPairing"); - this.thunder.call(this.callsign, 'cancelWPSPairing').then(result => { - resolve(result) - }).catch(err => { - this.ERR(this.callsign + ": cancelWPSPairing error:" + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.NETWORK,"WifiApiError", "Error in Thunder wifi cancelWPSPairing"+JSON.stringify(err), false, null) - reject(err) - }) - }) - } - - clearSSID() { - return new Promise((resolve, reject) => { - this.LOG(this.callsign + " clearSSID"); - this.thunder.call(this.callsign, 'clearSSID').then(result => { - resolve(result) - }).catch(err => { - this.ERR(this.callsign + ": clearSSID error:" + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.NETWORK,"WifiApiError", "Error in Thunder wifi clearing SSID"+JSON.stringify(err), false, null) - reject(err) - }) - }) - } - - connect(useSaved = false, networkInfo, passphrase = "") { - let params = {} - if (!useSaved) { // saveSSID was never called earlier. Need proper params. - params.ssid = networkInfo.ssid - if (Object.prototype.hasOwnProperty.call(networkInfo, "security")) params.securityMode = networkInfo.security - if (passphrase.length) params.passphrase = passphrase - } - return new Promise((resolve, reject) => { - this.LOG(this.callsign + " connect with params: " + JSON.stringify(params)); - this.thunder.call(this.callsign, 'connect', params).then(result => { - result.success ? resolve(result.success) : reject(result.success) - - }).catch(err => { - this.ERR(this.callsign + ": connect error:" + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.NETWORK,"WifiApiError", "Error in Thunder wifi connect params "+JSON.stringify(err), false, null) - reject(err) - }) - }) - } - - disconnect() { - return new Promise((resolve, reject) => { - this.LOG(this.callsign + " disconnect"); - this.thunder.call(this.callsign, 'disconnect').then(result => { - resolve(result) - }).catch(err => { - this.ERR(this.callsign + ": disconnect error:" + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.NETWORK,"WifiApiError", "Error in Thunder wifi disconnect params "+JSON.stringify(err), false, null) - reject(err) - }) - }) - } - - getConnectedSSID() { - return new Promise((resolve, reject) => { - this.thunder.call(this.callsign, 'getConnectedSSID').then(result => { - this.LOG(this.callsign + " getConnectedSSID result:" + "Error in Thunder wifi connect params"+JSON.stringify(result)) - resolve(result) - }).catch(err => { - this.ERR(this.callsign + " getConnectedSSID error: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.NETWORK,"WifiApiError", "Error in Thunder wifi getConnectedSSID "+JSON.stringify(err), false, null) - reject(err) - }) - }) - } - - getCurrentState() { - return new Promise((resolve, reject) => { - this.thunder.call(this.callsign, 'getCurrentState').then(result => { - this.LOG(this.callsign + " getCurrentState result:" + JSON.stringify(result)) - resolve(result.success ? result.state : 0) // 0 is UNINSTALLED - }).catch(err => { - this.ERR(this.callsign + " getCurrentState error: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.NETWORK,"WifiApiError", "Error in Thunder wifi getCurrentState "+JSON.stringify(err), false, null) - reject(err) - }) - }) - } - - getPairedSSID() { - return new Promise((resolve, reject) => { - this.thunder.call(this.callsign, 'getPairedSSID').then(result => { - this.LOG(this.callsign + " getPairedSSID result:" + JSON.stringify(result)) - if (result.success) resolve(result.ssid) - reject(result) - }).catch(err => { - this.ERR(this.callsign + " getPairedSSID error: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.NETWORK,"WifiApiError", "Error in Thunder wifi getPairedSSID "+JSON.stringify(err), false, null) - reject(err) - }) - }) - } - - getPairedSSIDInfo() { - return new Promise((resolve, reject) => { - this.thunder.call(this.callsign, 'getPairedSSIDInfo').then(result => { - this.LOG(this.callsign + " getPairedSSIDInfo result:" + JSON.stringify(result)) - if (result.success) resolve(result) - reject(result) - }).catch(err => { - this.ERR(this.callsign + " getPairedSSIDInfo error: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.NETWORK,"WifiApiError", "Error in Thunder wifi getPairedSSIDInfo "+JSON.stringify(err), false, null) - reject(err) - }) - }) - } - - getSupportedSecurityModes() { - return new Promise((resolve, reject) => { - this.thunder.call(this.callsign, 'getSupportedSecurityModes').then(result => { - this.LOG(this.callsign + " getSupportedSecurityModes result:" + JSON.stringify(result)) - resolve(result) - }).catch(err => { - this.ERR(this.callsign + " getSupportedSecurityModes error: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.NETWORK,"WifiApiError", "Error in Thunder wifi getSupportedSecurityModes "+JSON.stringify(err), false, null) - reject(err) - }) - }) - } - - initiateWPSPairing(method = "PIN", wps_pin = "") { // SERIALIZED_PIN/PIN/PBC - return new Promise((resolve, reject) => { - let params = { method: method } - if (method == "PIN") { - params.wps_pin = wps_pin - } - this.thunder.call(this.callsign, 'initiateWPSPairing', params).then(result => { - this.LOG(this.callsign + " initiateWPSPairing result:" + JSON.stringify(result)) - resolve(result) - }).catch(err => { - this.ERR(this.callsign + " initiateWPSPairing error: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.NETWORK,"WifiApiError", "Error in Thunder wifi initiateWPSPairing "+JSON.stringify(err), false, null) - reject(err) - }) - }) - } - - isPaired() { - return new Promise((resolve, reject) => { - this.thunder.call(this.callsign, 'isPaired').then(result => { - this.LOG(this.callsign + " isPaired result:" + JSON.stringify(result)) - if (result.success) resolve(result.result) - reject(result) - }).catch(err => { - this.ERR(this.callsign + " isPaired error: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.NETWORK,"WifiApiError", "Error in Thunder wifi isPaired "+JSON.stringify(err), false, null) - reject(err) - }) - }) - } - - isSignalThresholdChangeEnabled() { - return new Promise((resolve, reject) => { - this.thunder.call(this.callsign, 'isSignalThresholdChangeEnabled').then(result => { - this.LOG(this.callsign + " isSignalThresholdChangeEnabled result:" + JSON.stringify(result)) - resolve(result) - }).catch(err => { - this.ERR(this.callsign + " isSignalThresholdChangeEnabled error: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.NETWORK,"WifiApiError", "Error in Thunder wifi isSignalThresholdChangeEnabled "+JSON.stringify(err), false, null) - reject(err) - }) - }) - } - - saveSSID(ssid, passphrase, securityMode) { - return new Promise((resolve, reject) => { - this.thunder.call(this.callsign, 'saveSSID', { - ssid: ssid, - passphrase: passphrase, - securityMode: securityMode - }).then(result => { - this.LOG(this.callsign + " saveSSID result:" + JSON.stringify(result)) - resolve(result) - }).catch(err => { - this.ERR(this.callsign + " saveSSID error: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.NETWORK,"WifiApiError", "Error in Thunder wifi saveSSID "+JSON.stringify(err), false, null) - reject(err) - }) - }) - } - - setEnabled(enable = true) { - return new Promise((resolve, reject) => { - this.thunder.call(this.callsign, 'setEnabled', { enable: enable }).then(result => { - this.LOG(this.callsign + " setEnabled result:" + JSON.stringify(result)) - resolve(result.success) - }).catch(err => { - this.ERR(this.callsign + " setEnabled error: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.NETWORK,"WifiApiError", "Error in Thunder wifi setEnabled "+JSON.stringify(err), false, null) - reject(err) - }) - }) - } - - setSignalThresholdChangeEnabled(enabled = true, interval = 2000) { - return new Promise((resolve, reject) => { - this.thunder.call(this.callsign, 'setSignalThresholdChangeEnabled', { enabled: enabled, interval: interval }).then(result => { - this.LOG(this.callsign + " setSignalThresholdChangeEnabled result:" + JSON.stringify(result)) - resolve(result.success) - }).catch(err => { - this.ERR(this.callsign + " setSignalThresholdChangeEnabled error: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.NETWORK,"WifiApiError", "Error in Thunder wifi setSignalThresholdChangeEnabled "+JSON.stringify(err), false, null) - reject(err) - }) - }) - } - - startScan(incremental = false, ssid = "", frequency = "") { // frequence: 2.5 or 5.0 - return new Promise((resolve, reject) => { - let params = { incremental: incremental } - if (ssid.length) params.ssid = ssid - if (frequency.length) params.frequency = frequency - this.LOG(this.callsign + " startScan params:" + JSON.stringify(params)) - this.thunder.call(this.callsign, 'startScan', params).then(result => { - this.LOG(this.callsign + " startScan result:" + JSON.stringify(result)) - resolve(result) - }).catch(err => { - this.ERR(this.callsign + " startScan error: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.NETWORK,"WifiApiError", "Error in Thunder wifi startScan "+JSON.stringify(err), false, null) - reject(err) - }) - }) - } - - stopScan() { - return new Promise((resolve, reject) => { - this.thunder.call(this.callsign, 'stopScan').then(result => { - this.LOG(this.callsign + " stopScan result:" + JSON.stringify(result)) - resolve(result.success) - }).catch(err => { - this.ERR(this.callsign + " stopScan error: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.NETWORK,"WifiApiError", "Error in Thunder wifi stopScan "+JSON.stringify(err), false, null) - reject(err) - }) - }) - } -} diff --git a/accelerator-home-ui/src/api/XcastApi.js b/accelerator-home-ui/src/api/XcastApi.js index 49e06029..0e358041 100644 --- a/accelerator-home-ui/src/api/XcastApi.js +++ b/accelerator-home-ui/src/api/XcastApi.js @@ -19,7 +19,6 @@ import ThunderJS from 'ThunderJS'; import { CONFIG } from '../Config/Config' -import { Metrics } from '@firebolt-js/sdk'; /** * Class for Xcast thunder plugin apis. @@ -87,13 +86,11 @@ export default class XcastApi { }) .catch(err => { this.ERR("Enabling failure: " + JSON.stringify(err)); - Metrics.error(Metrics.ErrorType.OTHER,"XcastApiError", "Error in Thunder Xcast enable " + JSON.stringify(err), false, null) reject('Xcast enabling failed', err); }); }) .catch(err => { this.ERR("Activation failure: " + JSON.stringify(err)); - Metrics.error(Metrics.ErrorType.OTHER,"XcastApiError", "Error in Thunder Controller Xcast activate "+JSON.stringify(err), false, null) reject('Xcast activation failed', err); }); }); @@ -107,7 +104,6 @@ export default class XcastApi { }) .catch(err => { this.ERR("Xdial setEnabled error: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER,"XcastApiError", "Error while fetching Thunder Xcast enable status"+JSON.stringify(err), false, null) reject(err) }) }) @@ -121,7 +117,6 @@ export default class XcastApi { }) .catch(err => { this.ERR("Xdial error: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER,"XcastApiError", "Error while fetching Thunder Xcast enable status"+JSON.stringify(err), false, null) reject(err) }) }) @@ -134,7 +129,6 @@ export default class XcastApi { }) .catch(err => { this.ERR("Xdial getFriendlyName error: " + JSON.stringify(err)); - Metrics.error(Metrics.ErrorType.OTHER,"XcastApiError", "Error while getting Thunder Xcast FriendlyName "+JSON.stringify(err), false, null) reject(err) }) }) @@ -148,7 +142,6 @@ export default class XcastApi { }) .catch(err => { this.ERR("Xdial getModelName error: " + JSON.stringify(err)); - Metrics.error(Metrics.ErrorType.OTHER,"XcastApiError", "Error while getting Thunder Xcast getModelName "+JSON.stringify(err), false, null) reject(err) }) }) @@ -162,7 +155,6 @@ export default class XcastApi { }) .catch(err => { this.ERR("Xdial setStandbyBehavior error: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER,"XcastApiError", "Error while fetching Thunder setStandbyBehavior status"+JSON.stringify(err), false, null) reject(err) }) }) @@ -174,13 +166,11 @@ export default class XcastApi { resolve(result); }).catch(err => { this.ERR(JSON.stringify(err)); resolve(false); - Metrics.error(Metrics.ErrorType.OTHER,"XcastApiError", "Error while setting Thunder Xcast FriendlyName "+JSON.stringify(err), false, null) }); }).then(val => { this.LOG("The resolved value is: " + JSON.stringify(val)); }) .catch(error => { - Metrics.error(Metrics.ErrorType.OTHER,"XcastApiError", "An error occurred: "+JSON.stringify(error), false, null) this.ERR("An error occurred: " + JSON.stringify(error)); }); } @@ -202,7 +192,6 @@ export default class XcastApi { this._thunder.call('Controller', 'deactivate', { callsign: this.callsign }).then(res => { resolve(res); }).catch(err => { - Metrics.error(Metrics.ErrorType.OTHER,"XcastApiError", "Error Failed to deactivate Xcast: "+JSON.stringify(err), false, null) this.ERR("Failed to deactivate Xcast: " + JSON.stringify(err)) }) }) @@ -216,7 +205,6 @@ export default class XcastApi { resolve(true); }).catch(err => { this.ERR("setApplicationState failed trying older API. error is: " + JSON.stringify(err)); - Metrics.error(Metrics.ErrorType.OTHER,"XcastApiError", "Error in Thunder Xcast setApplicationState "+JSON.stringify(err), false, null) resolve(false); }); }); @@ -233,7 +221,6 @@ export default class XcastApi { resolve(result); }).catch(err => { this.ERR(JSON.stringify(err)); resolve(false); - Metrics.error(Metrics.ErrorType.OTHER,"XcastApiError", "Error in Thunder Xcast.1 onApplicationStateChange "+JSON.stringify(err), false, null) }); }); } @@ -246,7 +233,6 @@ export default class XcastApi { }) .catch(err => { this.ERR("Xdial registerApplications error: " + JSON.stringify(err)); - Metrics.error(Metrics.ErrorType.OTHER,"XcastApiError", "Error while getting Thunder Xcast registerApplications "+JSON.stringify(err), false, null) reject(err) }) }) diff --git a/accelerator-home-ui/src/api/firebolt/FBTDeviceInfo.js b/accelerator-home-ui/src/api/firebolt/FBTDeviceInfo.js deleted file mode 100644 index e24bc8ad..00000000 --- a/accelerator-home-ui/src/api/firebolt/FBTDeviceInfo.js +++ /dev/null @@ -1,281 +0,0 @@ -/** - * If not stated otherwise in this file or this component's LICENSE - * file the following copyright and licenses apply: - * - * Copyright 2020 RDK Management - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - **/ - -import { Device, Metrics } from '@firebolt-js/sdk' - -export default class FBTDeviceInfo { - constructor() { - this.INFO = console.info; - this.LOG = console.log; - this.ERR = console.error; - this.WARN = console.warn; - } - - getaudio(){ - return new Promise((resolve,reject)=>{ - Device.audio() - .then(supportedAudioProfiles => { - this.LOG("supportedAudioProfiles: " + JSON.stringify(supportedAudioProfiles)) - resolve(supportedAudioProfiles) - }) - .catch(err => { - this.ERR("firebolt getaudio error: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "FireboltDevicePluginError", "firebolt get audio error "+err, false, null) - reject(err) - }) - }) - } - getdistributor(){ - return new Promise((resolve,reject)=>{ - Device.distributor() - .then(distributorId => { - this.LOG("distributorId: " + JSON.stringify(distributorId)) - resolve(distributorId) - }) - .catch(err => { - this.ERR("firebolt getdistributor error: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "FireboltDevicePluginError", "firebolt get distributor error "+err, false, null) - reject(err) - }) - }) - } - gethdcp(){ - return new Promise((resolve,reject)=>{ - Device.hdcp() - .then(supportedHdcpProfiles => { - this.LOG("supportedHdcpProfiles: " + JSON.stringify(supportedHdcpProfiles)) - resolve(supportedHdcpProfiles) - }) - .catch(err => { - this.ERR("firebolt gethdcp error: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "FireboltDevicePluginError", "firebolt get hdcp error " + err, false, null) - reject(err) - }) - }) - } - gethdr(){ - return new Promise((resolve,reject)=>{ - Device.hdr() - .then(supportedHdrProfiles => { - this.LOG("supportedHdrProfiles: " + JSON.stringify(supportedHdrProfiles)) - resolve(supportedHdrProfiles) - }) - .catch(err => { - this.ERR("firebolt gethdr error: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "FireboltDevicePluginError", "firebolt get hdr error "+err, false, null) - reject(err) - }) - }) - } - getid(){ - return new Promise((resolve,reject)=>{ - Device.id() - .then(id => { - this.LOG("id: " + JSON.stringify(id)) - resolve(id) - }) - .catch(err => { - this.ERR("firebolt getid error: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "FireboltDevicePluginError", "firebolt get Id error "+err, false, null) - reject(err) - }) - }) - } - getmake(){ - return new Promise((resolve,reject)=>{ - Device.make() - .then(make => { - this.LOG("make: " + JSON.stringify(make)) - resolve(make) - }) - .catch(err => { - this.ERR("firebolt getmake error: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "FireboltDevicePluginError", "firebolt get make error "+err, false, null) - reject(err) - }) - }) - } - getmodel(){ - return new Promise((resolve,reject)=>{ - Device.model() - .then(model => { - this.LOG("model: " + JSON.stringify(model)) - resolve(model) - }) - .catch(err => { - this.ERR("firebolt getmodel error: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "FireboltDevicePluginError", "firebolt get model error " +err, false, null) - reject(err) - }) - }) - } - getname(){ - return new Promise((resolve,reject)=>{ - Device.name() - .then(value => { - this.LOG("name: " + JSON.stringify(value)) - resolve(value) - }) - .catch(err => { - this.ERR("firebolt getname error: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "FireboltDevicePluginError", "firebolt get name error "+err, false, null) - reject(err) - }) - }) - } - getnetwork(){ - return new Promise((resolve,reject)=>{ - Device.network() - .then(networkInfo => { - this.LOG("networkInfo: " + JSON.stringify(networkInfo)) - resolve(networkInfo) - }) - .catch(err => { - this.ERR("firebolt getnetwork error: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "FireboltDevicePluginError", "firebolt get network error "+err, false, null) - reject(err) - }) - }) - } - getplatform(){ - return new Promise((resolve,reject)=>{ - Device.platform() - .then(platformId => { - this.LOG("platformId: " + JSON.stringify(platformId)) - resolve(platformId) - }) - .catch(err => { - this.ERR("firebolt getplatform error: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "FireboltDevicePluginError", "firebolt get platform error " +err, false, null) - reject(err) - }) - }) - } - getscreenresolution(){ - return new Promise((resolve,reject)=>{ - Device.screenResolution() - .then(screenResolution => { - this.LOG("screenResolution: " + JSON.stringify(screenResolution)) - resolve(screenResolution) - }) - .catch(err => { - this.ERR("firebolt getscreenresolution error: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "FireboltDevicePluginError", "firebolt get screen resolution error " +err, false, null) - reject(err) - }) - }) - } - getsku(){ - return new Promise((resolve,reject)=>{ - Device.sku() - .then(sku => { - this.LOG("sku: " + JSON.stringify(sku)) - resolve(sku) - }) - .catch(err => { - this.ERR("firebolt getsku error: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "FireboltDevicePluginError", "firebolt get sku error "+err, false, null) - reject(err) - }) - }) - } - gettype(){ - return new Promise((resolve,reject)=>{ - Device.type() - .then(deviceType => { - this.LOG("deviceType: " + JSON.stringify(deviceType)) - resolve(deviceType) - }) - .catch(err => { - this.ERR("firebolt gettype error: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "FireboltDevicePluginError", "firebolt get type error "+err, false, null) - reject(err) - }) - }) - } - - getuid(){ - return new Promise((resolve,reject)=>{ - Device.uid() - .then(uniqueId => { - this.LOG("uniqueId: " + JSON.stringify(uniqueId)) - resolve(uniqueId) - }) - .catch(err => { - this.ERR("firebolt getuid error: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "FireboltDevicePluginError", "firebolt get uid error"+err, false, null) - reject(err) - }) - }) - } - getversion(){ - return new Promise((resolve,reject)=>{ - Device.version() - .then(versions => { - this.LOG("versions: " + JSON.stringify(versions)) - resolve(versions) - }) - .catch(err => { - this.ERR("firebolt getversion error: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "FireboltDevicePluginErrorr", "firebolt get version error "+err, false, null) - reject(err) - }) - }) - } - getvideoresolution(){ - return new Promise((resolve,reject)=>{ - Device.videoResolution() - .then(videoResolution => { - this.LOG("videoResolution: " + JSON.stringify(videoResolution)) - resolve(videoResolution) - }) - .catch(err => { - this.ERR("firebolt getvideoresolution error: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "FireboltDevicePluginError", "firebolt get video resolution error "+err, false, null) - reject(err) - }) - }) - } - listen(event){ - return new Promise((resolve,reject)=>{ - Device.listen(event, value => { - this.LOG("listen value: " + JSON.stringify(value)) - resolve(value) - }) - .catch(err => { - this.ERR("firebolt listen error: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "FireboltDevicePluginError", "firebolt listen error "+err, false, null) - reject(err) - }) - }) - } - once(event){ - return new Promise((resolve,reject)=>{ - Device.once(event, value => { - this.LOG("once value: " + JSON.stringify(value)) - resolve(value) - }) - .catch(err => { - this.ERR("firebolt once error: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "FireboltDevicePluginError", "firebolt once error "+err, false, null) - reject(err) - }) - }) - } -} \ No newline at end of file diff --git a/accelerator-home-ui/src/api/firebolt/FBTDiscovery.js b/accelerator-home-ui/src/api/firebolt/FBTDiscovery.js deleted file mode 100644 index ab11b1ab..00000000 --- a/accelerator-home-ui/src/api/firebolt/FBTDiscovery.js +++ /dev/null @@ -1,41 +0,0 @@ -/** - * If not stated otherwise in this file or this component's LICENSE - * file the following copyright and licenses apply: - * - * Copyright 2020 RDK Management - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - **/ -import { Discovery, Metrics } from '@firebolt-js/sdk' -export default class FBTDiscovery { - constructor() { - this.INFO = console.info; - this.LOG = console.log; - this.ERR = console.error; - this.WARN = console.warn; - } - - launch(appId,intent){ - return new Promise((resolve,reject)=>{ - Discovery.launch(appId, intent).then(success => { - this.LOG("Discovery.launch result:" + JSON.stringify(success)) - resolve(success); - }) - .catch(err => { - this.ERR("firebolt Discovery.launch error: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "fireboltDiscoveryError", "Discovery.launch error"+ err, false, null) - reject(err) - }) - }) - } -} \ No newline at end of file diff --git a/accelerator-home-ui/src/api/firebolt/FBTLifecycle.js b/accelerator-home-ui/src/api/firebolt/FBTLifecycle.js deleted file mode 100644 index ccd20eeb..00000000 --- a/accelerator-home-ui/src/api/firebolt/FBTLifecycle.js +++ /dev/null @@ -1,114 +0,0 @@ -/** - * If not stated otherwise in this file or this component's LICENSE - * file the following copyright and licenses apply: - * - * Copyright 2020 RDK Management - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - **/ -import { Lifecycle, Metrics } from '@firebolt-js/sdk' - - -export default class FBTLifecycle { - constructor() { - this._events = new Map(); - this.INFO = console.info; - this.LOG = console.log; - this.ERR = console.error; - this.WARN = console.warn; - Lifecycle.listen('background', value => { - this.LOG("Fireboltapi background " + JSON.stringify(value)); - if (this._events.has('background')) { - this._events.get('background')(value) - } - }) - Lifecycle.listen('foreground', value => { - this.LOG("Fireboltapi foreground " + JSON.stringify(value)); - if (this._events.has('foreground')) { - this._events.get('foreground')(value) - } - }) - Lifecycle.listen('inactive', value => { - this.LOG("Fireboltapi inactive " + JSON.stringify(value)); - if (this._events.has('inactive')) { - this._events.get('inactive')(value) - } - }) - Lifecycle.listen('suspended', value => { - this.LOG("Fireboltapi suspended " + JSON.stringify(value)); - if (this._events.has('suspended')) { - this._events.get('suspended')(value) - } - }) - Lifecycle.listen('unloading', value => { - this.LOG("Fireboltapi unloading " + JSON.stringify(value)); - if (this._events.has('unloading')) { - this._events.get('unloading')(value) - } - }) - } - - registerEvent(eventId, callback) { - this._events.set(eventId, callback) - } - - close() { - return new Promise((resolve, reject) => { - Lifecycle.close("remoteButton") - .then(success => { - this.LOG("Fireboltapi close success: " + JSON.stringify(success)) - resolve(success) - }) - .catch(err => { - this.ERR("firebolt Lifecycle.close error: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "LifecycleError", err, false, null) - reject(err) - }) - }) - } - finished() { - return new Promise((resolve, reject) => { - Lifecycle.finished() - .then(results => { - this.LOG("Fireboltapi finished results: " + JSON.stringify(results)) - resolve(results) - }) - .catch(err => { - this.ERR("firebolt Lifecycle.finished error: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "LifecycleError", err, false, null) - reject(err) - }) - }) - } - ready() { - return new Promise((resolve, reject) => { - Lifecycle.ready() - .then(result => { - this.LOG("Fireboltapi ready result: " + JSON.stringify(result)) - resolve(result) - }) - .catch(err => { - this.ERR("firebolt Lifecycle.ready error: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "LifecycleError", err, false, null) - reject(err) - }) - }) - } - state() { - return new Promise((resolve) => { - const state = Lifecycle.state() - this.LOG("Fireboltapi state: " + JSON.stringify(state)) - resolve(state) - }) - } -} diff --git a/accelerator-home-ui/src/api/firebolt/FBTLocalization.js b/accelerator-home-ui/src/api/firebolt/FBTLocalization.js deleted file mode 100644 index 8bf1a83a..00000000 --- a/accelerator-home-ui/src/api/firebolt/FBTLocalization.js +++ /dev/null @@ -1,161 +0,0 @@ -/** - * If not stated otherwise in this file or this component's LICENSE - * file the following copyright and licenses apply: - * - * Copyright 2020 RDK Management - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - **/ - -import { Localization, Metrics } from '@firebolt-js/manage-sdk' - -export default class FBTLocalization { - - constructor() { - this.INFO = console.info; - this.LOG = console.log; - this.ERR = console.error; - this.WARN = console.warn; - } - - listen(event){ - return new Promise((resolve,reject)=>{ - Localization.listen(event, value => { - this.LOG("Firebolt listening to " + JSON.stringify(value)) - resolve(value) - }) - .catch(err => { - this.ERR('firebolt listen error: ' + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "LocalizationError", err, false, null) - reject(err) - }) - }) - } - - additionalInfo() { - return new Promise((resolve, reject) => { - Localization.additionalInfo() - .then(info => { - this.LOG("AdditionalInfo: " + JSON.stringify(info)) - resolve(info) - }) - .catch(err => { - this.ERR('firebolt Localization.additionalInfo error: ' + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "LocalizationError", err, false, null) - reject(err) - }) - }) - } - countryCode() { - return new Promise((resolve, reject) => { - Localization.countryCode() - .then(code => { - this.LOG("CountryCode: " + JSON.stringify(code)) - resolve(code) - }) - .catch(err => { - this.ERR('firebolt Localization.countryCode error: ' + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "LocalizationError", err, false, null) - reject(err) - }) - }) - } - locality() { - return new Promise((resolve, reject) => { - Localization.locality() - .then(locality => { - this.LOG("Locality: " + JSON.stringify(locality)) - }) - .catch(err => { - this.ERR('firebolt Localization.locality error: ' + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "LocalizationError", err, false, null) - reject(err) - }) - }) - } - latlon() { - return new Promise((resolve, reject) => { - Localization.latlon() - .then(latlong => { - this.LOG("LatLon: " + JSON.stringify(latlong)) - resolve(latlong) - }) - .catch(err => { - this.ERR('firebolt Localization.latlon error: ' + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "LocalizationError", err, false, null) - reject(err) - }) - }) - } - - language() { - return new Promise((resolve,reject)=>{ - Localization.language() - .then(lang => { - this.LOG("Localization.language : " + JSON.stringify(lang)) - resolve(lang) - }) - .catch(err => { - this.ERR('firebolt Localization.language error: ' + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "LocalizationError", err, false, null) - reject (err) - }) - }) - } - - setlanguage(lang){ - return new Promise((resolve,reject)=>{ - Localization.language(lang) - .then(lang => { - this.LOG("Localization.language : " + JSON.stringify(lang)) - resolve(lang) - }) - .catch(err => { - this.ERR('firebolt Localization.language error: ' + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "LocalizationError", err, false, null) - reject (err) - }) - }) - - } - - setTimeZone(zone){ - return new Promise((resolve,reject)=>{ - Localization.timeZone(zone) - .then(zone => { - this.LOG("set Localization.timeZone : " + JSON.stringify(zone)) - resolve(zone) - }) - .catch(err => { - this.ERR('firebolt set Localization.timeZone error: ' + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "LocalizationError", err, false, null) - reject (err) - }) - }) - } - - getTimeZone(){ - return new Promise((resolve,reject)=>{ - Localization.timeZone() - .then(zone => { - this.LOG("get Localization.timeZone : " + JSON.stringify(zone)) - resolve(zone) - }) - .catch(err => { - this.ERR('firebolt get Localization.timeZone error: ' + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, "LocalizationError", err, false, null) - reject (err) - }) - }) - } -} diff --git a/accelerator-home-ui/src/api/firebolt/FireBoltApi.js b/accelerator-home-ui/src/api/firebolt/FireBoltApi.js deleted file mode 100644 index 59e057b8..00000000 --- a/accelerator-home-ui/src/api/firebolt/FireBoltApi.js +++ /dev/null @@ -1,42 +0,0 @@ -/** - * If not stated otherwise in this file or this component's LICENSE - * file the following copyright and licenses apply: - * - * Copyright 2020 RDK Management - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - **/ -import FBTDeviceInfo from "./FBTDeviceInfo"; -import FBTLifecycle from "./FBTLifecycle"; -import FBTDiscovery from "./FBTDiscovery"; -import FBTLocalization from "./FBTLocalization" - -let instance = null -export default class FireBoltApi { - constructor() { - this.deviceinfo = new FBTDeviceInfo(); - this.lifecycle = new FBTLifecycle(); - this.discovery = new FBTDiscovery(); - this.localization = new FBTLocalization(); - } - /** - * - * @returns {FireBoltApi} - */ - static get() { - if (instance == null) { - instance = new FireBoltApi() - } - return instance - } -} diff --git a/accelerator-home-ui/src/api/firebolt/provider/AckChallengeProvider.js b/accelerator-home-ui/src/api/firebolt/provider/AckChallengeProvider.js deleted file mode 100644 index 4320fa21..00000000 --- a/accelerator-home-ui/src/api/firebolt/provider/AckChallengeProvider.js +++ /dev/null @@ -1,40 +0,0 @@ -/** - * If not stated otherwise in this file or this component's LICENSE - * file the following copyright and licenses apply: - * - * Copyright 2020 RDK Management - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - **/ -import { Router } from '@lightningjs/sdk' - -export default class AckChallengeProvider { - - challenge(challenge, session) { - if (!challenge) return - console.log("Got challenge req:" + JSON.stringify(challenge) + "challenge") - return new Promise((resolve) => { - this.showChallengeUi(challenge, resolve) - session.focus() - }) - } - - showChallengeUi(challenge, responder) { - new Promise(async (resolve) => { - let message = 'Do you give access to ' + challenge.requestor.name + ' to ' + challenge.capability + '?' - let params = { message: message, responder } - Router.navigate('settings/other/AcknowledgeScreen', params) - resolve(true) - }) - } -} diff --git a/accelerator-home-ui/src/api/firebolt/provider/AcknowledgeScreen.js b/accelerator-home-ui/src/api/firebolt/provider/AcknowledgeScreen.js deleted file mode 100644 index d7b504d4..00000000 --- a/accelerator-home-ui/src/api/firebolt/provider/AcknowledgeScreen.js +++ /dev/null @@ -1,208 +0,0 @@ -/** - * If not stated otherwise in this file or this component's LICENSE - * file the following copyright and licenses apply: - * - * Copyright 2020 RDK Management - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - **/ -import { Lightning, Router, Language } from '@lightningjs/sdk' -import { CONFIG } from '../../../Config/Config' - -export default class AcknowledgeScreen extends Lightning.Component { - - constructor(...args) { - super(...args); - this.INFO = console.info; - this.LOG = console.log; - this.ERR = console.error; - this.WARN = console.warn; - } - - pageTransition() { - return 'left' - } - - set params(args) - { - this.LOG("args: " + JSON.stringify(args)) - if(args.message!=="") - { - this.tag('Info').text.text=Language.translate(args.message) - } - this.responder=args.responder - } - - static _template() { - return { - w: 1920, - h: 2000, - rect: true, - color: 0xCC000000, - RebootScreen: { - x: 950, - y: 270, - Title: { - x: 0, - y: 0, - mountX: 0.5, - text: { - text: "Acknowledge", - fontFace: CONFIG.language.font, - fontSize: 40, - textColor: CONFIG.theme.hex, - }, - }, - BorderTop: { - x: 0, y: 75, w: 1558, h: 3, rect: true, mountX: 0.5, - }, - Info: { - x: 0, - y: 125, - mountX: 0.5, - text: { - text: Language.translate("Default text"), - fontFace: CONFIG.language.font, - fontSize: 25, - }, - }, - Buttons: { - x: 100, y: 200, w: 440, mountX: 0.5, h: 50, - YesButton: { - x: 0, w: 200, mountX: 0.5, h: 50, rect: true, color: 0xFFFFFFFF, - Title: { - x: 100, - y: 25, - mount: 0.5, - text: { - text: "Grant", - fontFace: CONFIG.language.font, - fontSize: 22, - textColor: 0xFF000000 - }, - } - }, - NoButton: { - x: 220, w: 200, mountX: 0.5, h: 50, rect: true, color: 0xFFFFFFFF, - Title: { - x: 100, - y: 25, - mount: 0.5, - text: { - text: "Deny", - fontFace: CONFIG.language.font, - fontSize: 22, - textColor: 0xFF000000 - }, - } - }, - }, - BorderBottom: { - x: 0, y: 300, w: 1558, h: 3, rect: true, mountX: 0.5, - } - } - } - } - - _focus() { - this._setState('NoButton') - } - - _handleBack() { - if(!Router.isNavigating()){ - this.responder({ - granted: null - }) - Router.back() - } - } - - static _states() { - return [ - class YesButton extends this { - $enter() { - this._focus() - } - _handleEnter() { - this.responder({ - granted: true - }) - Router.back() - } - _handleRight() { - this._setState('NoButton') - } - _focus() { - this.tag('YesButton').patch({ - color: CONFIG.theme.hex - }) - this.tag('YesButton.Title').patch({ - text: { - textColor: 0xFFFFFFFF - } - }) - } - _unfocus() { - this.tag('YesButton').patch({ - color: 0xFFFFFFFF - }) - this.tag('YesButton.Title').patch({ - text: { - textColor: 0xFF000000 - } - }) - } - $exit() { - this._unfocus() - } - }, - class NoButton extends this { - $enter() { - this._focus() - } - _handleEnter() { - this.responder({ - granted: false - }) - Router.back() - } - _handleLeft() { - this._setState('YesButton') - } - _focus() { - this.tag('NoButton').patch({ - color: CONFIG.theme.hex - }) - this.tag('NoButton.Title').patch({ - text: { - textColor: 0xFFFFFFFF - } - }) - } - _unfocus() { - this.tag('NoButton').patch({ - color: 0xFFFFFFFF - }) - this.tag('NoButton.Title').patch({ - text: { - textColor: 0xFF000000 - } - }) - } - $exit() { - this._unfocus() - } - } - ] - } -} diff --git a/accelerator-home-ui/src/api/firebolt/provider/KeyboardScreen.js b/accelerator-home-ui/src/api/firebolt/provider/KeyboardScreen.js deleted file mode 100644 index cf55f1e5..00000000 --- a/accelerator-home-ui/src/api/firebolt/provider/KeyboardScreen.js +++ /dev/null @@ -1,341 +0,0 @@ -/** - * If not stated otherwise in this file or this component's LICENSE - * file the following copyright and licenses apply: - * - * Copyright 2020 RDK Management - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - **/ -import { Lightning, Router, Language } from '@lightningjs/sdk' -import { CONFIG } from '../../../Config/Config'; -import { Keyboard } from '../../../ui-components/index' -import { KEYBOARD_FORMATS } from '../../../ui-components/components/Keyboard' -import PasswordSwitch from '../../../screens/PasswordSwitch'; -export default class KeyboardScreen extends Lightning.Component { - constructor(...args) { - super(...args); - this.INFO = console.info; - this.LOG = console.log; - this.ERR = console.error; - this.WARN = console.warn; - } - - set params(args) { - if (args.message !== "") { - this.tag('Description').text.text = Language.translate(args.message) - } - this.tag('InputType').text.text = args.type - this.hidePasswd = false; - this.password = false - if (args.type === 'password') { - this.password = true - this.hidePasswd = true; - this.LOG("Making the password switch visible") - this.tag('PasswrdSwitch').patch({ - visible: true - }); - this.tag('ShowPassword').patch({ - visible: true - }); - } - this.responder = args.responder - } - pageTransition() { - return 'left' - } - - handleDone() { - this.responder({ text: this.textCollection['TextBox'], canceled: false }) - Router.back(); - } - - static _template() { - return { - Background: { - w: 1920, - h: 1080, - rect: true, - alpha: 1, - color: 0xCC000000, - }, - Title: { - x: 200, - y: 70, - text: { - text: "Keyboard challenge", - fontFace: CONFIG.language.font, - fontSize: 35, - textColor: CONFIG.theme.hex, - }, - }, - Description: { - x: 200, - y: 130, - text: { - text: Language.translate('Default description'), - fontFace: CONFIG.language.font, - fontSize: 25, - textColor: 0xffffffff, - }, - }, - BorderTop: { - x: 190, y: 125, w: 1488, h: 2, rect: true, - }, - - InputType: { - x: 190, - y: 316, - text: { - text: "Password: ", - fontFace: CONFIG.language.font, - fontSize: 25, - }, - }, - InputBox: { - x: 400, - y: 300, - texture: Lightning.Tools.getRoundRect(1279, 70, 0, 3, 0xffffffff, false) - }, - InputText: { - x: 420, - y: 310, - zIndex: 2, - text: { - text: '', - fontSize: 25, - fontFace: CONFIG.language.font, - textColor: 0xffffffff, - wordWrapWidth: 1300, - wordWrap: false, - textOverflow: 'ellipsis', - }, - }, - PasswrdSwitch: { - h: 45, - w: 66.9, - x: 1642, - y: 340, - zIndex: 2, - type: PasswordSwitch, - mount: 0.5, - visible: false - }, - ShowPassword: { - x: 1420, - y: 322, - w: 300, - h: 75, - zIndex: 2, - text: { text: 'Show Password', fontSize: 25, fontFace: CONFIG.language.font, textColor: 0xffffffff, textAlign: 'left' }, - visible: false - }, - - Keyboard: { - y: 437, - x: 400, - type: Keyboard, - visible: true, - zIndex: 2, - formats: KEYBOARD_FORMATS.qwerty - }, - Cancel: { - x: 1580, y: 60, w: 150, mountX: 0.5, h: 60, rect: true, color: 0xFFFFFFFF, - Title: { - x: 75, - y: 30, - mount: 0.5, - text: { - text: "Cancel", - fontFace: CONFIG.language.font, - fontSize: 22, - textColor: 0xFF000000, - fontStyle: 'bold' - }, - }, - visible: true, - } - } - } - - _focus() { - this._setState("InputBox") - this.tag("InputText").text.text = ""; - this.textCollection = { 'TextBox': '', 'encrypted': '' } - } - - get session() { - return this._session - } - - set session(session) { - this.donePending = false - this._session = session - this.onDone = session.onDone - this.onCancel = session.onCancel - } - - - _getFocused() { - return this - } - - _handleBack() { - this.responder({ text: '', canceled: true }) - if (!Router.isNavigating()) { - Router.back() - } - } - _updateText(txt) { - this.tag("InputText").text.text = txt; - } - - static _states() { - return [ - class InputBox extends this{ - $enter() { - this.tag('InputBox').texture = Lightning.Tools.getRoundRect(1279, 70, 0, 3, CONFIG.theme.hex, false) - } - _handleDown() { - this._setState("Keyboard"); - } - _handleUp() { - this._setState("Cancel"); - } - _handleEnter() { - this._setState('Keyboard') - } - $exit() { - this.tag('InputBox').texture = Lightning.Tools.getRoundRect(1279, 70, 0, 3, 0xffffffff, false) - } - }, - class Keyboard extends this{ - $enter(state) { - this.prevState = state.prevState - if (this.prevState === 'InputBox') { - this.element = 'InputText' - } - } - _getFocused() { - return this.tag('Keyboard') - } - _handleUp() { - if (this.password) - this._setState("PasswordSwitchState"); - else - this._setState("Cancel") - } - - $onSoftKey({ key }) { - if (key === 'Done') { - this.handleDone(); - } else if (key === 'Delete') { - this.textCollection['encrypted'] = this.textCollection['encrypted'].substring(0, this.textCollection['encrypted'].length - 1); - this.textCollection['TextBox'] = this.textCollection['TextBox'].substring(0, this.textCollection['TextBox'].length - 1); - this.tag("InputText").text.text = this.hidePasswd ? this.textCollection['encrypted'] : this.textCollection['TextBox']; - } else if (key === 'Space') { - this.textCollection['TextBox'] += ' ' - this.textCollection['encrypted'] += '\u25CF' - this.tag(this.element).text.text = this.hidePasswd ? this.textCollection['encrypted'] : this.textCollection['TextBox']; - } else if (key === 'Clear') { - this.textCollection['encrypted'] = '' - this.textCollection['TextBox'] = '' - this.tag("InputText").text.text = this.hidePasswd ? this.textCollection['encrypted'] : this.textCollection['TextBox']; - } - else if (key === '#@!' || key === 'abc' || key === 'áöû' || key === 'shift') { - this.LOG('no saving') - } - else { - this.textCollection['TextBox'] += key - this.textCollection['encrypted'] += '\u25CF'; - this.tag("InputText").text.text = this.hidePasswd ? this.textCollection['encrypted'] : this.textCollection['TextBox']; - } - } - - _handleBack() { - this._setState(this.prevState) - } - }, - - class PasswordSwitchState extends this{ - $enter() { - this.tag("InputBox").texture = Lightning.Tools.getRoundRect(1279, 70, 0, 3, CONFIG.theme.hex, false) - } - _handleDown() { - this._setState("Keyboard"); - } - _handleUp() { - this._setState("Cancel"); - } - _getFocused() { - return this.tag('PasswrdSwitch'); - } - - $handleEnter(bool) { - if (bool) { - this._updateText(this.textCollection['TextBox']) - this.hidePasswd = false; - } - else { - this._updateText(this.textCollection['encrypted']); - this.hidePasswd = true; - } - this.isOn = bool; - } - - $exit() { - this.tag("InputBox").texture = Lightning.Tools.getRoundRect(1279, 70, 0, 3, 0xffffffff, false) - } - }, - class Cancel extends this{ - $enter() { - this.tag("Cancel") - this._focus() - } - _handleEnter() { - this.responder({ text: '', canceled: true }) - Router.back(); - } - _handleDown() { - if (this.hidePasswd) - this._setState("PasswordSwitchState"); - else - this._setState("InputBox"); - } - - _focus() { - this.tag('Cancel').patch({ - color: CONFIG.theme.hex - }) - this.tag('Cancel.Title').patch({ - text: { - textColor: 0xFFFFFFFF - } - }) - } - _unfocus() { - this.tag('Cancel').patch({ - color: 0xFFFFFFFF - }) - this.tag('Cancel.Title').patch({ - text: { - textColor: 0xFF000000 - } - }) - } - $exit() { - this._unfocus() - } - } - ] - } -} diff --git a/accelerator-home-ui/src/api/firebolt/provider/KeyboardUIProvider.js b/accelerator-home-ui/src/api/firebolt/provider/KeyboardUIProvider.js deleted file mode 100644 index 49ed705b..00000000 --- a/accelerator-home-ui/src/api/firebolt/provider/KeyboardUIProvider.js +++ /dev/null @@ -1,69 +0,0 @@ -/** - * If not stated otherwise in this file or this component's LICENSE - * file the following copyright and licenses apply: - * - * Copyright 2020 RDK Management - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - **/ -import { Router, Storage } from '@lightningjs/sdk' -import ThunderJS from 'ThunderJS'; -import { CONFIG, GLOBALS } from '../../../Config/Config' - -let thunder = ThunderJS(CONFIG.thunderConfig) - -export default class KeyboardUIProvider { - constructor(app) { - this._app = app - this.INFO = function () { }; - this.LOG = console.log; - this.ERR = console.error; - } - - standard(keyboardSession, providerSession) { - this.LOG("Inside standard call") - if (!keyboardSession) return - return new Promise((resolve) => { - this.showKeyboardUi(keyboardSession, false, resolve) - providerSession.focus() - }) - } - - email(keyboardSession, providerSession) { - this.LOG("Inside email call") - if (!keyboardSession) return - return new Promise((resolve) => { - this.showKeyboardUi(keyboardSession, false, resolve) - providerSession.focus() - }) - } - - password(keyboardSession, providerSession) { - this.LOG("Inside password call") - if (!keyboardSession) return - return new Promise((resolve) => { - this.showKeyboardUi(keyboardSession, true, resolve) - providerSession.focus() - }) - } - - async showKeyboardUi(session, mask, responder) { - if (!session) return - this.LOG('Got session ' + JSON.stringify(session), "showKeyboardUi") - this.LOG("Displaying Keyboard overlay with: " + GLOBALS.selfClientName) - let params = { message: session.message, type: session.type, responder } - thunder.call('org.rdk.RDKShell', 'setVisibility', { client: GLOBALS.selfClientName, visible: true }).then(() => { - Router.navigate("settings/other/KeyboardScreen", params) - }) - } -} diff --git a/accelerator-home-ui/src/api/firebolt/provider/PinChallengeProvider.js b/accelerator-home-ui/src/api/firebolt/provider/PinChallengeProvider.js deleted file mode 100644 index 632de61b..00000000 --- a/accelerator-home-ui/src/api/firebolt/provider/PinChallengeProvider.js +++ /dev/null @@ -1,56 +0,0 @@ -/** - * If not stated otherwise in this file or this component's LICENSE - * file the following copyright and licenses apply: - * - * Copyright 2020 RDK Management - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - **/ -import { Router, Storage } from '@lightningjs/sdk' -import ThunderJS from 'ThunderJS'; -import { CONFIG, GLOBALS } from '../../../Config/Config' -import { Metrics } from '@firebolt-js/sdk'; - -let thunder = ThunderJS(CONFIG.thunderConfig) - -export default class PinChallengeProvider { - - constructor(...args) { - this.INFO = console.info; - this.LOG = console.log; - this.ERR = console.error; - this.WARN = console.warn; - } - - challenge(challenge, session) { - if (!challenge) return - this.LOG('Got challenge ' + JSON.stringify(challenge) + " challenge") - - return new Promise((resolve) => { - this.showChallengeUi(challenge, resolve) - session.focus() - }) - } - - showChallengeUi(challenge, responder) { - this.LOG("Displaying showChallengeUi with: " + JSON.stringify(GLOBALS.selfClientName)) - new Promise(async (resolve) => { - let message = challenge.requestor.name + ' is requesting that you enter your ' + challenge.pinSpace + ' pin.' - let params = { message: message, challenge: challenge, responder } - thunder.call('org.rdk.RDKShell', 'setVisibility', { client: GLOBALS.selfClientName, visible: true }).then(() => { - Router.navigate('settings/other/SecurityPinScreen', params) - }).catch(err => Metrics.error(Metrics.ErrorType.OTHER, "PluginError", "Thunder RDKShell set visibility error "+err, true, null)) - resolve(true) - }) - } -} diff --git a/accelerator-home-ui/src/api/firebolt/provider/SecurityPinScreen.js b/accelerator-home-ui/src/api/firebolt/provider/SecurityPinScreen.js deleted file mode 100644 index 277c9776..00000000 --- a/accelerator-home-ui/src/api/firebolt/provider/SecurityPinScreen.js +++ /dev/null @@ -1,207 +0,0 @@ -/** - * If not stated otherwise in this file or this component's LICENSE - * file the following copyright and licenses apply: - * - * Copyright 2020 RDK Management - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - **/ -import { Lightning, Router, Language } from '@lightningjs/sdk' -import { CONFIG } from '../../../Config/Config'; -import { Keyboard } from '../../../ui-components/index' -import { KEYBOARD_FORMATS } from '../../../ui-components/components/Keyboard' -import { CONSTANTS } from './constant'; -import { PinChallenge } from '@firebolt-js/manage-sdk' -export default class SecurityPinScreen extends Lightning.Component { - constructor(...args) { - super(...args); - this.INFO = console.info; - this.LOG = console.log; - this.ERR = console.error; - this.WARN = console.warn; - } - - set params(args) { - this.LOG("args: " + JSON.stringify(args)) - if (args.message !== "") { - this.tag('Description').text.text = Language.translate(args.message) - } - this.responder = args.responder - this.challenge = args.challenge - this.numFailures = 0 - this.lockedTime = 0 - } - pageTransition() { - return 'left' - } - - handleDone() { - this.LOG("Inside handle done") - this.onPinEntered(this.textCollection['TextBox']) - } - - static _template() { - return { - Background: { - w: 1920, - h: 1080, - rect: true, - alpha: 1, - color: 0xCC000000, - }, - KeypadBg: { - x: 730, - y: 200, - w: 380, - h: 600, - rect: true, - color: 0xCC000000, - alpha: 1 - }, - Title: { - x: 730, - y: 70, - text: { - text: Language.translate('Security PIN input'), - fontFace: CONFIG.language.font, - fontSize: 40, - textColor: CONFIG.theme.hex, - }, - }, - Description: { - x: 730, - y: 130, - text: { - text: Language.translate('Default description'), - fontFace: CONFIG.language.font, - fontSize: 25, - textColor: 0xffffffff, - }, - }, - BorderTop: { - x: 570, y: 125, w: 700, h: 2, rect: true, - }, - TextBox: { - x: 750, - y: 220, - texture: Lightning.Tools.getRoundRect(340, 65, 0, 3, 0xffffffff, false) - }, - PinText: { - x: 770, - y: 240, - zIndex: 2, - text: { - text: '', - fontSize: 25, - fontFace: CONFIG.language.font, - textColor: 0xffffffff, - wordWrapWidth: 1300, - wordWrap: false, - textOverflow: 'ellipsis', - }, - }, - Keyboard: { - y: 300, - x: 750, - type: Keyboard, - visible: true, - zIndex: 2, - formats: KEYBOARD_FORMATS.numbers - } - } - } - onPinEntered(pin) { - if (pin === CONSTANTS.PINS[this.challenge.pinSpace]) { - this.LOG("Correct pin") - this.responder({ - granted: true, - reason: PinChallenge.ResultReason.CORRECT_PIN - }) - Router.back() - } else { - this.LOG("Wrong pin") - this.numFailures++ - if (this.numFailures >= CONSTANTS.MAX_FAILURES) { - this.lockedTime = Date.now() - this.responder({ - granted: false, - reason: PinChallenge.ResultReason.EXCEEDED_PIN_FAILURES - }) - Router.back() - } - } - } - - _focus() { - this.tag("PinText").text.text = ""; - this.textCollection = { 'TextBox': '', 'encrypted': '' } - } - _handleDown() { - this._setState('TextBox'); - } - - _handleBack() { - if (!Router.isNavigating()) { - Router.back() - } - } - - static _states() { - return [ - class TextBox extends this{ - $enter() { - this.tag('TextBox').texture = Lightning.Tools.getRoundRect(340, 65, 0, 3, CONFIG.theme.hex, false) - } - _handleEnter() { - this._setState('Keyboard') - } - $exit() { - this.tag('TextBox').texture = Lightning.Tools.getRoundRect(340, 65, 0, 3, 0xffffffff, false) - } - }, - class Keyboard extends this{ - $enter(state) { - this.prevState = state.prevState - if (this.prevState === 'TextBox') { - this.element = 'PinText' - } - } - _getFocused() { - return this.tag('Keyboard') - } - - $onSoftKey({ key }) { - if (key === 'Done') { - this.handleDone(); - } else if (key === 'Clear') { - this.textCollection['TextBox'] = '' - this.textCollection['encrypted'] = '' - this.tag('PinText').text.text = this.textCollection['encrypted']; - } else if (key === 'Space') { - this.textCollection['encrypted'] += '\u25CF' - this.textCollection['TextBox'] += ' ' - this.tag('PinText').text.text = this.textCollection['encrypted']; - } else if (key === 'Delete') { - this.textCollection['encrypted'] = this.textCollection['encrypted'].substring(0, this.textCollection['encrypted'].length - 1); - this.textCollection['TextBox'] = this.textCollection['TextBox'].substring(0, this.textCollection['TextBox'].length - 1); - this.tag('PinText').text.text = this.textCollection['encrypted']; - } else { - this.textCollection['TextBox'] += key - this.textCollection['encrypted'] += '\u25CF' - this.tag('PinText').text.text = this.textCollection['encrypted']; - } - } - } - ] - } -} diff --git a/accelerator-home-ui/src/api/firebolt/provider/constant.js b/accelerator-home-ui/src/api/firebolt/provider/constant.js deleted file mode 100644 index 253a14ea..00000000 --- a/accelerator-home-ui/src/api/firebolt/provider/constant.js +++ /dev/null @@ -1,23 +0,0 @@ -/** - * If not stated otherwise in this file or this component's LICENSE - * file the following copyright and licenses apply: - * - * Copyright 2020 RDK Management - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - **/ -export const CONSTANTS = { - LOCK_TIME : 20000, - MAX_FAILURES : 3, - PINS : { purchase: "1111"}, -} diff --git a/accelerator-home-ui/src/items/SubscriptionItem.js b/accelerator-home-ui/src/items/SubscriptionItem.js index 316ba5ad..3fbdd203 100644 --- a/accelerator-home-ui/src/items/SubscriptionItem.js +++ b/accelerator-home-ui/src/items/SubscriptionItem.js @@ -162,19 +162,9 @@ export default class SubscriptionItem extends Lightning.Component { } _handleEnter() { - // this.handleDone() - if (this._item.host["_@attribute"].toLowerCase() === "youtube") { - let appApi = new AppApi() - this.LOG("this._item.url: " + JSON.stringify(this._item.url)); - let params = { - url: this._item.url, - launchLocation: "gracenote", - appIdentifier: 'n:3' - } - appApi.launchApp("YouTube", params).catch((err) => { - this.ERR("Error in launching YouTube: " + JSON.stringify(err)) - }); - } + // FIXME: Implement subscription selection logic here. + this.WARN("Subscription selection not implemented."); + this.handleDone() } _handleRight() { // index = (3 + (++index)) % 3; diff --git a/accelerator-home-ui/src/items/TimeItems.js b/accelerator-home-ui/src/items/TimeItems.js index 20118214..d98467df 100644 --- a/accelerator-home-ui/src/items/TimeItems.js +++ b/accelerator-home-ui/src/items/TimeItems.js @@ -20,7 +20,6 @@ import { Lightning, Router } from '@lightningjs/sdk' import AppApi from '../api/AppApi.js' import { CONFIG, GLOBALS } from '../Config/Config.js' import TimeItem from './TimeItem.js' -import FireBoltApi from '../api/firebolt/FireBoltApi.js' /** * Class for rendering items in Settings screen. */ @@ -81,14 +80,6 @@ export default class TimeItems extends Lightning.Component { this.appApi = new AppApi() } - _active() { - if ("ResidentApp" !== GLOBALS.selfClientName){ - FireBoltApi.get().localization.listen("timeZoneChanged",value =>{ - this.LOG('timezone changed successfully to ' + JSON.stringify(value)) - }) - } - } - _handleDown() { this.tag('List').setNext() } @@ -100,11 +91,7 @@ export default class TimeItems extends Lightning.Component { _handleEnter() { this.LOG(`${this._item.zone}/${this.tag('List').element._item[0]}`) this.widgets.menu.updateTimeZone(`${this._item.zone}/${this.tag('List').element._item[0]}`) - if ("ResidentApp" === GLOBALS.selfClientName) { - this.appApi.setZone(`${this._item.zone}/${this.tag('List').element._item[0]}`) - } else { - FireBoltApi.get().localization.setTimeZone(`${this._item.zone}/${this.tag('List').element._item[0]}`) - } + this.appApi.setZone(`${this._item.zone}/${this.tag('List').element._item[0]}`) Router.navigate('settings/advanced/device/timezone', { refresh: true }) } diff --git a/accelerator-home-ui/src/items/TimeOverlayItems.js b/accelerator-home-ui/src/items/TimeOverlayItems.js index d397fbe2..46c0c875 100644 --- a/accelerator-home-ui/src/items/TimeOverlayItems.js +++ b/accelerator-home-ui/src/items/TimeOverlayItems.js @@ -19,8 +19,6 @@ import { Lightning } from '@lightningjs/sdk' import AppApi from '../api/AppApi.js' import TimeItem from './TimeItem.js' - import { GLOBALS } from '../Config/Config.js'; -import FireBoltApi from '../api/firebolt/FireBoltApi.js'; /** * Class for rendering items in Settings screen. */ @@ -75,15 +73,6 @@ import FireBoltApi from '../api/firebolt/FireBoltApi.js'; this.appApi = new AppApi() } - _init(){ - if ("ResidentApp" !== GLOBALS.selfClientName){ - FireBoltApi.get().localization.listen("timeZoneChanged",value =>{ - this.LOG('timezone changed successfully to ' + JSON.stringify(value)) - }) - } - } - - _handleDown() { this.tag('List').setNext() } @@ -96,11 +85,7 @@ import FireBoltApi from '../api/firebolt/FireBoltApi.js'; this.LOG(`${this._item.zone}/${this.tag('List').element._item[0]}`) this.fireAncestors("$updateTimeZone",`${this._item.zone}/${this.tag('List').element._item[0]}`) // this.widgets.menu.updateTimeZone(`${this._item.zone}/${this.tag('List').element._item[0]}`) - if ("ResidentApp" === GLOBALS.selfClientName) { - this.appApi.setZone(`${this._item.zone}/${this.tag('List').element._item[0]}`) - } else { - FireBoltApi.get().localization.setTimeZone(`${this._item.zone}/${this.tag('List').element._item[0]}`) - } + this.appApi.setZone(`${this._item.zone}/${this.tag('List').element._item[0]}`) // Router.navigate('settings/advanced/device/timezone', { refresh: true }) return false; //to execute handle enter in parent component } diff --git a/accelerator-home-ui/src/keyIntercept/keyIntercept.js b/accelerator-home-ui/src/keyIntercept/keyIntercept.js index f7ba8bac..cde28425 100644 --- a/accelerator-home-ui/src/keyIntercept/keyIntercept.js +++ b/accelerator-home-ui/src/keyIntercept/keyIntercept.js @@ -16,15 +16,10 @@ * See the License for the specific language governing permissions and * limitations under the License. **/ -import ThunderJS from "ThunderJS"; import Keymap from "../Config/Keymap"; -import { CONFIG, GLOBALS } from "../Config/Config"; -import {Metrics} from '@firebolt-js/sdk' import RDKWindowManager from "../api/RDKWindowManagerApi"; -const thunder = ThunderJS(CONFIG.thunderConfig); - -export function keyIntercept(clientName = GLOBALS.selfClientId) { +export function keyIntercept(clientId) { return new Promise((resolve, reject) => { const intercepts = [ { "keyCode": Keymap.Home, "modifiers": [] }, @@ -44,7 +39,7 @@ export function keyIntercept(clientName = GLOBALS.selfClientId) { ]; RDKWindowManager.get().addKeyIntercepts( { - "clientId": clientName, + "clientId": clientId, "intercepts": JSON.stringify(intercepts) } ).then(result => { @@ -54,7 +49,6 @@ export function keyIntercept(clientName = GLOBALS.selfClientId) { reject(result); } }).catch(err => { - Metrics.error(Metrics.ErrorType.OTHER,"KeyInterceptError", "Thunder RDKWindowManager addKeyIntercepts error "+JSON.stringify(err), false, null) reject(err); }); }); diff --git a/accelerator-home-ui/src/overlays/AppCarousel.js b/accelerator-home-ui/src/overlays/AppCarousel.js index 01a423ab..92e5a670 100644 --- a/accelerator-home-ui/src/overlays/AppCarousel.js +++ b/accelerator-home-ui/src/overlays/AppCarousel.js @@ -3,8 +3,8 @@ import ListItem from "../items/ListItem"; import { List } from '@lightningjs/ui' import HomeApi from "../api/HomeApi"; import AppApi from "../api/AppApi"; -import RDKShellApis from "../api/RDKShellApis.js"; import { GLOBALS } from "../Config/Config.js"; +import AppManager from "../api/AppManagerApi.js"; export default class AppCarousel extends Lightning.Component { constructor(...args) { @@ -156,11 +156,14 @@ export default class AppCarousel extends Lightning.Component { } _handleBack() { - let self = this; if (GLOBALS.topmostApp !== GLOBALS.selfClientName) { // if a non-resident app is on focus - RDKShellApis.moveToFront(GLOBALS.topmostApp) - RDKShellApis.setFocus(GLOBALS.topmostApp) - RDKShellApis.setVisibility(GLOBALS.topmostApp, true) + AppManager.get().closeApp(GLOBALS.topmostApp).then(() => { + AppManager.get().launchApp(GLOBALS.selfClientName).catch(err => { + this.ERR("Error while launching This app: " + JSON.stringify(err)); + }); + }).catch(err => { + this.ERR("Error while closing app: " + JSON.stringify(err)); + }); } Router.focusPage(); } @@ -184,16 +187,8 @@ export default class AppCarousel extends Lightning.Component { let applicationType = this.tag('AppList').items[this.tag('AppList').index].data.applicationType; let uri = this.tag('AppList').items[this.tag('AppList').index].data.uri; let appIdentifier = this.tag('AppList').items[this.tag('AppList').index].data.appIdentifier; - let params = { - url: uri, - launchLocation: "mainView", - appIdentifier: appIdentifier - } - this.appApi.launchApp(applicationType, params).then(() => { - Router.focusPage(); - }).catch(err => { - this.ERR("ApplaunchError: " + JSON.stringify(err)) - }); + // FIXME: Implement app launch logic from carousel here. + this.WARN("App launch from carousel not implemented."); } }, ] diff --git a/accelerator-home-ui/src/overlays/AudioScreens/ResolutionOverlay.js b/accelerator-home-ui/src/overlays/AudioScreens/ResolutionOverlay.js index e8ecc6fb..46ce9329 100644 --- a/accelerator-home-ui/src/overlays/AudioScreens/ResolutionOverlay.js +++ b/accelerator-home-ui/src/overlays/AudioScreens/ResolutionOverlay.js @@ -20,8 +20,7 @@ import { Lightning, Utils, Storage } from '@lightningjs/sdk' import VideoAndAudioItem from '../../items/VideoAndAudioItem' import AppApi from '../../api/AppApi' import thunderJS from 'ThunderJS'; -import { CONFIG, GLOBALS} from '../../Config/Config' -import FireBoltApi from '../../api/firebolt/FireBoltApi'; +import { CONFIG } from '../../Config/Config' const thunder = thunderJS(CONFIG.thunderConfig) diff --git a/accelerator-home-ui/src/overlays/AudioScreens/VideoScreenOverlay.js b/accelerator-home-ui/src/overlays/AudioScreens/VideoScreenOverlay.js index 11558ebc..0c464ab5 100644 --- a/accelerator-home-ui/src/overlays/AudioScreens/VideoScreenOverlay.js +++ b/accelerator-home-ui/src/overlays/AudioScreens/VideoScreenOverlay.js @@ -22,7 +22,6 @@ import { COLORS } from "../../colors/Colors"; import { CONFIG, GLOBALS } from "../../Config/Config"; import AppApi from "../../api/AppApi"; import ResolutionOverlay from './ResolutionOverlay'; -import FireBoltApi from '../../api/firebolt/FireBoltApi'; /** * Class for Video screen. @@ -185,58 +184,30 @@ export default class VideoScreen extends Lightning.Component { } _focus() { - if ("FireboltMainApp-refui" === GLOBALS.selfclientAppName) - { - FireBoltApi.get().deviceinfo.getscreenresolution().then(resolution =>{ - this.tag("Resolution.Title").text.text = Language.translate('Resolution: ') + `${JSON.stringify(resolution[0])} , ${JSON.stringify(resolution[1])}`; - }) - FireBoltApi.get().deviceinfo.gethdcp().then(res=>{ - let hdcp ="" - for (let key in res) - { - hdcp += `\t\t${key} : ${res[key]} ` - hdcp += "," - } - this.tag("HDCP.Title").text.text = `${Language.translate('HDCP Status: ')} ${hdcp.substring(0, hdcp.length -1)}` - }) - FireBoltApi.get().deviceinfo.gethdr().then(res=>{ - let hdr ="" - for (let key in res) - { - hdr += `\t\t${key} : ${res[key]}` - hdr += "," - } - this.tag("HDR.Title").text.text = `${Language.translate('High Dynamic Range: ')}${hdr.substring(0,hdr.length -1 )}` - }) - - } - else{ - this._appApi.getResolution().then(resolution => { - this.tag("Resolution.Title").text.text = Language.translate('Resolution: ') + resolution; - }).catch(err => { - this.ERR("Error fetching the Resolution" + JSON.stringify(err)) - }) - this._appApi.getHDCPStatus().then(result => { - if (result.isHDCPCompliant && result.isHDCPEnabled) { - this.tag("HDCP.Title").text.text = `${Language.translate('HDCP Status: ')}Enabled, Version: ${result.currentHDCPVersion}`; - } else { - this.tag("HDCP.Title").text.text = `${Language.translate('HDCP Status: ')}Not Supported `; - } + this._appApi.getResolution().then(resolution => { + this.tag("Resolution.Title").text.text = Language.translate('Resolution: ') + resolution; + }).catch(err => { + this.ERR("Error fetching the Resolution" + JSON.stringify(err)) + }) + this._appApi.getHDCPStatus().then(result => { + if (result.isHDCPCompliant && result.isHDCPEnabled) { + this.tag("HDCP.Title").text.text = `${Language.translate('HDCP Status: ')}Enabled, Version: ${result.currentHDCPVersion}`; + } else { + this.tag("HDCP.Title").text.text = `${Language.translate('HDCP Status: ')}Not Supported `; + } + }) - }) - - this._appApi.getHDRSetting().then(result => { - const availableHDROptions = { - "HdrOff": "Off", - "Hdr10": "HDR 10", - "Hdr10Plus": "HDR 10+", - "HdrHlg": "HLG", - "HdrDolbyvision": "Dolby Vision", - "HdrTechnicolor": "Technicolor HDR" - } - this.tag("HDR.Title").text.text = Language.translate('High Dynamic Range: ') + availableHDROptions[result]; - }) - } + this._appApi.getHDRSetting().then(result => { + const availableHDROptions = { + "HdrOff": "Off", + "Hdr10": "HDR 10", + "Hdr10Plus": "HDR 10+", + "HdrHlg": "HLG", + "HdrDolbyvision": "Dolby Vision", + "HdrTechnicolor": "Technicolor HDR" + } + this.tag("HDR.Title").text.text = Language.translate('High Dynamic Range: ') + availableHDROptions[result]; + }) this._setState('Resolution') } diff --git a/accelerator-home-ui/src/overlays/NetworkScreens/NetworkConfigurationOverlay.js b/accelerator-home-ui/src/overlays/NetworkScreens/NetworkConfigurationOverlay.js index 9bae7f1f..1a8ee50f 100644 --- a/accelerator-home-ui/src/overlays/NetworkScreens/NetworkConfigurationOverlay.js +++ b/accelerator-home-ui/src/overlays/NetworkScreens/NetworkConfigurationOverlay.js @@ -155,11 +155,18 @@ export default class NetworkConfigurationScreen extends Lightning.Component { if(interfaceName === "wlan0"){this.$NetworkInterfaceText("WIFI")} }) - this.onDefaultIfaceChangedCB = NetworkManager.thunder.on(NetworkManager.callsign, 'onActiveInterfaceChange', data => { + this.onActiveInterfaceChangeCB = NetworkManager.thunder.on(NetworkManager.callsign, 'onActiveInterfaceChange', data => { if(data.currentActiveInterface === "eth0"){this.$NetworkInterfaceText("ETHERNET")} else{this.$NetworkInterfaceText("WIFI")} this.tag('TestInternetAccess.Title').text.text = Language.translate('Test Internet Access: ') - Metrics.action("user", "User changed the network interface", null) + }); + + this.onInternetStatusChangeCB = NetworkManager.thunder.on(NetworkManager.callsign, 'onInternetStatusChange', data => { + if (data.status && data.status === "FULLY_CONNECTED") { + this.tag('TestInternetAccess.Title').text.text = Language.translate('Test Internet Access: ') + Language.translate("Connected") + } else { + this.tag('TestInternetAccess.Title').text.text = Language.translate('Test Internet Access: ') + Language.translate("Disconnected") + } }); _newIPSettings = _currentIPSettings @@ -173,7 +180,10 @@ export default class NetworkConfigurationScreen extends Lightning.Component { } _inactive() { - this.onDefaultIfaceChangedCB.dispose(); + if (this.onActiveInterfaceChangeCB) { this.onActiveInterfaceChangeCB.dispose(); } + if (this.onInternetStatusChangeCB) { this.onInternetStatusChangeCB.dispose(); } + if (this.loadingAnimation) { this.loadingAnimation.stop(); } + this.tag('TestInternetAccess.Loader').visible = false } _focus() { diff --git a/accelerator-home-ui/src/overlays/NetworkScreens/NetworkInfoScreen.js b/accelerator-home-ui/src/overlays/NetworkScreens/NetworkInfoScreen.js index 40d59b7a..ad0ced36 100644 --- a/accelerator-home-ui/src/overlays/NetworkScreens/NetworkInfoScreen.js +++ b/accelerator-home-ui/src/overlays/NetworkScreens/NetworkInfoScreen.js @@ -65,7 +65,7 @@ export default class NetworkInfo extends Lightning.Component { }, }, ConnectionType: { - //alpha: 0.3, // disabled + alpha: 0, y: 90, type: SettingsMainItem, Title: { @@ -92,7 +92,7 @@ export default class NetworkInfo extends Lightning.Component { }, }, IPAddress: { - //alpha: 0.3, // disabled + alpha: 0, y: 180, type: SettingsMainItem, Title: { @@ -119,6 +119,7 @@ export default class NetworkInfo extends Lightning.Component { }, }, Gateway: { + alpha: 0, y: 270, type: SettingsMainItem, Title: { @@ -145,7 +146,7 @@ export default class NetworkInfo extends Lightning.Component { }, }, MACAddress: { - //alpha: 0.3, // disabled + alpha: 0, y: 360, type: SettingsMainItem, Title: { @@ -172,7 +173,7 @@ export default class NetworkInfo extends Lightning.Component { }, }, InternetProtocol: { - //alpha: 0.3, // disabled + alpha: 0, y: 450, type: SettingsMainItem, Title: { @@ -199,7 +200,7 @@ export default class NetworkInfo extends Lightning.Component { }, }, SSID: { - //alpha: 0.3, // disabled + alpha: 0, y: 540, type: SettingsMainItem, Title: { @@ -226,7 +227,7 @@ export default class NetworkInfo extends Lightning.Component { }, }, SignalStrength: { - //alpha: 0.3, // disabled + alpha: 0, y: 630, type: SettingsMainItem, Title: { @@ -257,86 +258,101 @@ export default class NetworkInfo extends Lightning.Component { } _active() { - this.onInterfaceStatusChangedCB = NetworkManager.thunder.on(NetworkManager.callsign,'onInterfaceStatusChanged', data => { + this.onInterfaceStateChangeCB = NetworkManager.thunder.on(NetworkManager.callsign,'onInterfaceStateChange', data => { this.refreshDetails(); }) - this.onIPAddressStatusChangedCB = NetworkManager.thunder.on(NetworkManager.callsign,'onAddressChange', data => { + this.onAddressChangeCB = NetworkManager.thunder.on(NetworkManager.callsign,'onAddressChange', data => { this.refreshDetails(); }) - this.onDefaultInterfaceChangedCB = NetworkManager.thunder.on(NetworkManager.callsign,'onActiveInterfaceChange', data => { + this.onActiveInterfaceChangeCB = NetworkManager.thunder.on(NetworkManager.callsign,'onActiveInterfaceChange', data => { this.refreshDetails(); }) - if ("ResidentApp" !== GLOBALS.selfClientName) - { - this.OnNetworkChangedfirebolt = FireBoltApi.get().deviceinfo.listen("networkChanged",value =>{ - this.refreshDetails(); - }) - } } _inactive() { - this.onInterfaceStatusChangedCB.dispose() - this.onIPAddressStatusChangedCB.dispose() - this.onDefaultInterfaceChangedCB.dispose() + if (this.onInterfaceStateChangeCB) this.onInterfaceStateChangeCB.dispose() + if (this.onAddressChangeCB) this.onAddressChangeCB.dispose() + if (this.onActiveInterfaceChangeCB) this.onActiveInterfaceChangeCB.dispose() } _disable() { - if (this.NetworkManagerActivated) {NetworkManager.deactivate()} + } + + setConnectedRowsVisibility(isConnected) { + const connectedAlpha = isConnected ? 1 : 0 + this.tag("ConnectionType").alpha = connectedAlpha + this.tag("IPAddress").alpha = connectedAlpha + this.tag("Gateway").alpha = connectedAlpha + this.tag("MACAddress").alpha = connectedAlpha + this.tag("InternetProtocol").alpha = connectedAlpha + if (!isConnected) { + this.tag("SSID").alpha = 0 + this.tag("SignalStrength").alpha = 0 + } } async refreshDetails() { this.tag("ConnectionType.Value").text.text = `NA` - this.tag("Status.Value").text.text = Language.translate('Disconnected') + this.tag("Status.Value").text.text = Language.translate('Loading...') this.tag("IPAddress.Value").text.text = `NA` this.tag("Gateway.Value").text.text = `NA` this.tag("MACAddress.Value").text.text = `NA` - await NetworkManager.GetPrimaryInterface().then((defaultInterface) => { - console.log("defaultinterface"+defaultInterface) - NetworkManager.GetIPSettings(defaultInterface).then((result) => { - if (result.interface === "wlan0") { - this.tag("ConnectionType.Value").text.text = Language.translate("Wireless") - this.tag("SSID").alpha = 1 - this.tag("SignalStrength").alpha = 1 - NetworkManager.GetConnectedSSID().then((result) => { - if (parseInt(result.strength) >= -50) { - this.tag("SignalStrength.Value").text.text = `Excellent` - } - else if (parseInt(result.strength) >= -60) { - this.tag("SignalStrength.Value").text.text = `Good` - } - else if (parseInt(result.strength) >= -67) { - this.tag("SignalStrength.Value").text.text = `Fair` - } - else { - this.tag("SignalStrength.Value").text.text = `Poor` - } - this.tag("SSID.Value").text.text = `${result.ssid}` - }).catch((error) => this.ERR("GetConnectedSSID error: " + JSON.stringify(error))); - } else if (result.interface === "eth0") { - this.tag("ConnectionType.Value").text.text = 'Ethernet' - this.tag("SSID").alpha = 0 - this.tag("SignalStrength").alpha = 0 - } - this.tag('InternetProtocol.Value').text.text = result.ipversion - this.tag('IPAddress.Value').text.text = result.ipaddress - this.tag("Gateway.Value").text.text = result.gateway - }).catch((err) => this.ERR("GetIPSettings error: " + JSON.stringify(err))) + this.tag('InternetProtocol.Value').text.text = 'NA' + this.tag('SSID.Value').text.text = 'NA' + this.tag('SignalStrength.Value').text.text = 'NA' + this.setConnectedRowsVisibility(false) - NetworkManager.GetAvailableInterfaces().then((interfaces) => { - const matchedInterface = interfaces.find((data) => data.name === defaultInterface) - if (!matchedInterface) { - this.ERR("Interface not found for: " + defaultInterface) - return - } - if (matchedInterface.connected) { - this.tag("Status.Value").text.text = Language.translate('Connected') - } - else { - this.tag('Status.Value').text.text = Language.translate('Disconnected') + try { + const defaultInterface = await NetworkManager.GetPrimaryInterface() + console.log("defaultinterface" + defaultInterface) + + const interfaces = await NetworkManager.GetAvailableInterfaces() + const matchedInterface = interfaces.find((data) => data.name === defaultInterface) + if (!matchedInterface || !matchedInterface.connected) { + this.tag('Status.Value').text.text = Language.translate('Disconnected') + return + } + + this.tag("Status.Value").text.text = Language.translate('Connected') + this.tag('MACAddress.Value').text.text = matchedInterface.mac + this.setConnectedRowsVisibility(true) + + const result = await NetworkManager.GetIPSettings(defaultInterface) + if (result.interface === "wlan0") { + this.tag("ConnectionType.Value").text.text = Language.translate("Wireless") + this.tag("SSID").alpha = 1 + this.tag("SignalStrength").alpha = 1 + try { + const connectedSsidResult = await NetworkManager.GetConnectedSSID() + if (parseInt(connectedSsidResult.strength) >= -50) { + this.tag("SignalStrength.Value").text.text = `Excellent` + } + else if (parseInt(connectedSsidResult.strength) >= -60) { + this.tag("SignalStrength.Value").text.text = `Good` + } + else if (parseInt(connectedSsidResult.strength) >= -67) { + this.tag("SignalStrength.Value").text.text = `Fair` + } + else { + this.tag("SignalStrength.Value").text.text = `Poor` + } + this.tag("SSID.Value").text.text = `${connectedSsidResult.ssid}` + } catch (error) { + this.ERR("GetConnectedSSID error: " + JSON.stringify(error)) } - this.tag('MACAddress.Value').text.text = matchedInterface.mac - }).catch((error) => this.ERR("GetAvailableInterfaces error: " + JSON.stringify(error))); - }).catch((error) => this.ERR("GetPrimaryInterface error: " + JSON.stringify(error))); + } else if (result.interface === "eth0") { + this.tag("ConnectionType.Value").text.text = 'Ethernet' + this.tag("SSID").alpha = 0 + this.tag("SignalStrength").alpha = 0 + } + + this.tag('InternetProtocol.Value').text.text = result.ipversion + this.tag('IPAddress.Value').text.text = result.ipaddress + this.tag("Gateway.Value").text.text = result.gateway + } catch (error) { + this.ERR("GetPrimaryInterface error: " + JSON.stringify(error)) + this.tag('Status.Value').text.text = Language.translate('Disconnected') + } } _focus() { @@ -344,12 +360,6 @@ export default class NetworkInfo extends Lightning.Component { } _unfocus() { - this.tag('SSID.Value').text.text = 'NA' - this.tag('SignalStrength.Value').text.text = 'NA' - this.tag('MACAddress.Value').text.text = 'NA' - this.tag('Gateway.Value').text.text = 'NA' - this.tag('IPAddress.Value').text.text = 'NA' - this.tag('ConnectionType.Value').text.text = 'NA' - this.tag('InternetProtocol.Value').text.text = 'NA' + this.setConnectedRowsVisibility(false) } } diff --git a/accelerator-home-ui/src/overlays/NetworkScreens/NetworkInterfaceOverlay.js b/accelerator-home-ui/src/overlays/NetworkScreens/NetworkInterfaceOverlay.js index bc09ad32..045234d0 100644 --- a/accelerator-home-ui/src/overlays/NetworkScreens/NetworkInterfaceOverlay.js +++ b/accelerator-home-ui/src/overlays/NetworkScreens/NetworkInterfaceOverlay.js @@ -23,7 +23,6 @@ import { Language } from '@lightningjs/sdk'; import WifiScreen from './NetworkWifiOverlay' import NetworkManager from '../../api/NetworkManagerAPI'; - import { Metrics } from '@firebolt-js/sdk' export default class NetworkInterfaceScreen extends Lightning.Component { @@ -104,7 +103,7 @@ } _active() { - this.onDefaultInterfaceChangedCB = NetworkManager.thunder.on(NetworkManager.callsign, 'onActiveInterfaceChange', (notification) => { + this.onActiveInterfaceChangeCB = NetworkManager.thunder.on(NetworkManager.callsign, 'onActiveInterfaceChange', (notification) => { this.LOG('onActiveInterfaceChange notification from networkInterfaceScreen: ' + JSON.stringify(notification)) if (notification.currentActiveInterface === "eth0") { this.loadingAnimation.stop() @@ -119,14 +118,12 @@ this.tag('Ethernet.Loader').visible = false this.tag('Ethernet.Title').text.text = 'Ethernet' } - Metrics.action("user", "The user changed the network interface", null) }); - this.onConnectionStatusChangedCB = NetworkManager.thunder.on(NetworkManager.callsign, 'onInterfaceStateChange', (notification) => { + this.onInterfaceStateChange = NetworkManager.thunder.on(NetworkManager.callsign, 'onInterfaceStateChange', (notification) => { this.LOG('onInterfaceStateChange notification from networkInterfaceScreen: ' + JSON.stringify(notification)) if (notification.interface === "eth0") { this.tag('Ethernet.Title').text.text = 'Ethernet: ' + Language.translate(notification.state.toLowerCase()) } - Metrics.action("App", "network connection of app changed", null) }); this.loadingAnimation = this.tag('Ethernet.Loader').animation({ @@ -138,8 +135,8 @@ } _inactive() { - this.onDefaultInterfaceChangedCB.dispose() - this.onConnectionStatusChangedCB.dispose() + if (this.onActiveInterfaceChangeCB) this.onActiveInterfaceChangeCB.dispose() + if (this.onInterfaceStateChange) this.onInterfaceStateChange.dispose() } _firstActive() { diff --git a/accelerator-home-ui/src/overlays/NetworkScreens/NetworkWifiOverlay.js b/accelerator-home-ui/src/overlays/NetworkScreens/NetworkWifiOverlay.js index ae926705..86e5825d 100644 --- a/accelerator-home-ui/src/overlays/NetworkScreens/NetworkWifiOverlay.js +++ b/accelerator-home-ui/src/overlays/NetworkScreens/NetworkWifiOverlay.js @@ -246,7 +246,6 @@ export default class WiFiScreen extends Lightning.Component { this.LOG("check - not calling stopScan since this.wifiStatus is FALSE.") } if (this.onWIFIStateChangedHandler) this.onWIFIStateChangedHandler.dispose(); - if (this.onErrorHandler) this.onErrorHandler.dispose(); if (this.onAvailableSSIDsCB) this.onAvailableSSIDsCB.dispose(); } diff --git a/accelerator-home-ui/src/overlays/OtherSettings/AdvancedSettingsScreenOverlay.js b/accelerator-home-ui/src/overlays/OtherSettings/AdvancedSettingsScreenOverlay.js index 26d46bc9..26c10960 100644 --- a/accelerator-home-ui/src/overlays/OtherSettings/AdvancedSettingsScreenOverlay.js +++ b/accelerator-home-ui/src/overlays/OtherSettings/AdvancedSettingsScreenOverlay.js @@ -22,11 +22,11 @@ import { CONFIG } from '../../Config/Config' import CECApi from '../../api/CECApi' import DeviceScreen from './DeviceScreenOverlay' - + /** * Class for AdvancedSettings screen. */ - + export default class AdvanceSettingsScreen extends Lightning.Component { constructor(...args) { super(...args); @@ -174,25 +174,35 @@ _init() { this.cecApi = new CECApi() - this.cecApi.activate() - .then(() => { - this.tag('CECControl.Button').src = Utils.asset('images/settings/ToggleOnOrange.png') - this.performOTPAction() - }) + this.performOTPAction() this._setState('CECControl') } + + _active() { + this.cecApi.getEnabled().then(res => { + if (res.enabled !== undefined) { + if (res.enabled) { + this.tag('CECControl.Button').src = Utils.asset('images/settings/ToggleOnOrange.png') + } else { + this.tag('CECControl.Button').src = Utils.asset('images/settings/ToggleOffWhite.png') + } + } + }); + } + _focus() { this._setState('CECControl') } performOTPAction() { - this.cecApi.setEnabled().then(res => { + return this.cecApi.setEnabled().then(res => { if (res.success) { - this.cecApi.performOTP().then(otpRes => { + return this.cecApi.performOTP().then(otpRes => { if (otpRes.success) { this.LOG('Otp Action success full') } }) } + return null; }) } @@ -200,18 +210,13 @@ this.cecApi.getEnabled() .then(res => { this.LOG("toggleCEC getEnabled result: " + JSON.stringify(res)) - if (res.enabled) { - this.cecApi.deactivate() - .then(() => { - this.tag('CECControl.Button').src = Utils.asset('images/settings/ToggleOffWhite.png') - }) - } - else { - this.cecApi.activate() - .then(() => { - this.tag('CECControl.Button').src = Utils.asset('images/settings/ToggleOnOrange.png') - }) - } + this.cecApi.setEnabled(!res.enabled).then(() => { + if (res.enabled) { + this.tag('CECControl.Button').src = Utils.asset('images/settings/ToggleOffWhite.png') + } else { + this.tag('CECControl.Button').src = Utils.asset('images/settings/ToggleOnOrange.png') + } + }) }) } @@ -352,4 +357,4 @@ } - } \ No newline at end of file + } diff --git a/accelerator-home-ui/src/overlays/OtherSettings/DeviceInformationOverlay.js b/accelerator-home-ui/src/overlays/OtherSettings/DeviceInformationOverlay.js index a283fef9..cd8c6060 100644 --- a/accelerator-home-ui/src/overlays/OtherSettings/DeviceInformationOverlay.js +++ b/accelerator-home-ui/src/overlays/OtherSettings/DeviceInformationOverlay.js @@ -20,7 +20,6 @@ import { Lightning, Language, Settings, Storage } from '@lightningjs/sdk' import { COLORS } from '../../colors/Colors' import { CONFIG, GLOBALS } from '../../Config/Config' import AppApi from '../../api/AppApi.js'; -import FireBoltApi from '../../api/firebolt/FireBoltApi'; /** * Class for Video and Audio screen. */ @@ -193,26 +192,16 @@ export default class DeviceInformationScreen extends Lightning.Component { } _focus() { - this._setState('DeviceInformationScreen') this.appApi.getSerialNumber().then(result => { this.tag("SerialNumber.Value").text.text = `${result}`; }) - if ("ResidentApp" === GLOBALS.selfClientName) { - this.appApi.getSystemVersions().then(res => { - this.tag('FirmwareVersions.Value').text.text = `UI Version - ${Settings.get('platform', 'version')} \nBuild Version - ${res.stbVersion} \nTime Stamp - ${res.stbTimestamp} ` - }).catch(err => { - this.ERR("error while getting the system versions" + JSON.stringify(err)) - }) - } else { - FireBoltApi.get().deviceinfo.getversion().then(res => { - this.LOG("build verion" + JSON.stringify(res.firmware.readable) + " Firebolt API Version - " + JSON.stringify(res.api.readable)) - this.tag('FirmwareVersions.Value').text.text = `UI Version - ${Settings.get('platform', 'version')} \nBuild Version - ${res.firmware.readable} \nFirebolt API Version - ${res.api.readable} ` - }).catch(err => { - this.ERR("error while getting the system versions from Firebolt.getversion API" + JSON.stringify(err)) - }) - } + this.appApi.getSystemVersions().then(res => { + this.tag('FirmwareVersions.Value').text.text = `UI Version - ${Settings.get('platform', 'version')} \nBuild Version - ${res.stbVersion} \nTime Stamp - ${res.stbTimestamp} ` + }).catch(err => { + this.ERR("error while getting the system versions" + JSON.stringify(err)) + }) this.appApi.getDRMS().then(result => { this.LOG("from device info supported drms " + JSON.stringify(result)) @@ -232,49 +221,8 @@ export default class DeviceInformationScreen extends Lightning.Component { this.tag('SupportedDRM.Value').text.text = `${drms.substring(0, drms.length - 1)}` }) - let self = this; - if (Storage.get('Netflix_ESN')) { - self.tag('AppVersions.Value').text.text = `Youtube: NA\nAmazon Prime: NA\nNetflix ESN: ${Storage.get('Netflix_ESN')}` - } - else { - self.appApi.getPluginStatus('Netflix') - .then(result => { - let sel = self; - this.LOG("Netflix : plugin status : " + JSON.stringify(result)); - if (result[0].state === 'deactivated' || result[0].state === 'deactivation') { - sel.appApi.launchPremiumAppInSuspendMode("Netflix").then(res => { - this.LOG("Netflix : netflix launch for esn value in suspend mode returns : " + JSON.stringify(res)); - let se = sel; - se.appApi.getNetflixESN() - .then(res => { - Storage.set('Netflix_ESN', res) - this.LOG("Netflix : netflix esn call returns : " + JSON.stringify(res)); - se.netflixESN = `YouTube: NA \nAmazon Prime: NA \nNetflix ESN: ${res}` - }) - .catch(err => { - this.ERR("Netflix : error while getting netflix esn : " + JSON.stringify(err)) - }) - }).catch(err => { - this.ERR("Netflix : error while launching netflix in suspendMode : " + JSON.stringify(err)) - }) - } - else { - self.appApi.getNetflixESN() - .then(res => { - Storage.set('Netflix_ESN', res) - this.LOG("Netflix : netflix esn call returns : " + JSON.stringify(res)); - self.netflixESN = `YouTube: NA \nAmazon Prime: NA \nNetflix ESN: ${res}`; - }) - .catch(err => { - this.ERR("Netflix : error while getting netflix esn : " + JSON.stringify(err)) - }) - } - }).catch(err => { - this.ERR("Netflix : error while getting netflix plugin status ie. " + JSON.stringify(err)) - }) - } - - + // FIXME: Implement logic to fetch and display YouTube, Amazon Prime, and Netflix ESN versions here. + this.tag('AppVersions.Value').text.text = `Youtube: NA\nAmazon Prime: NA\nNetflix ESN: ${Storage.get('Netflix_ESN')}` } set netflixESN(v) { diff --git a/accelerator-home-ui/src/overlays/OtherSettings/FirmWareOverlay.js b/accelerator-home-ui/src/overlays/OtherSettings/FirmWareOverlay.js index 284355fe..e214f79c 100644 --- a/accelerator-home-ui/src/overlays/OtherSettings/FirmWareOverlay.js +++ b/accelerator-home-ui/src/overlays/OtherSettings/FirmWareOverlay.js @@ -21,7 +21,6 @@ import { COLORS } from '../../colors/Colors' import { CONFIG } from '../../Config/Config' import AppApi from '../../api/AppApi'; import ThunderJS from 'ThunderJS'; -import { Metrics } from '@firebolt-js/sdk'; /** * Class for Firmware screen. @@ -131,12 +130,10 @@ export default class FirmwareScreen extends Lightning.Component { } }, err => { this.ERR("FirmwareOverlay: error while fetching notification ie. " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER,"PluginError", "Thunder system error while fetching onFirmwareUpdateStateChange notification "+JSON.stringify(err), false, null) }) }) .catch(err => { this.ERR("FirmwareOverlay: error while activating the system plugin" + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER,"PluginError", "Thunder Controller.activate system error "+JSON.stringify(err), false, null) }) } diff --git a/accelerator-home-ui/src/overlays/OtherSettings/PrivacyScreenOverlay.js b/accelerator-home-ui/src/overlays/OtherSettings/PrivacyScreenOverlay.js index dc65efd2..e33cb02b 100644 --- a/accelerator-home-ui/src/overlays/OtherSettings/PrivacyScreenOverlay.js +++ b/accelerator-home-ui/src/overlays/OtherSettings/PrivacyScreenOverlay.js @@ -17,15 +17,13 @@ * limitations under the License. **/ import AppApi from '../../api/AppApi' -import { Lightning, Utils, Storage, Language } from '@lightningjs/sdk' +import { Lightning, Utils, Language } from '@lightningjs/sdk' import SettingsMainItem from '../../items/SettingsMainItem' import { COLORS } from '../../colors/Colors' import { CONFIG, GLOBALS } from '../../Config/Config' import XcastApi from '../../api/XcastApi' -import UsbApi from '../../api/UsbApi' import PrivacyPolicyScreen from './PrivacyPolicyOverlay' import Warehouse from '../../api/WarehouseApis' -import AlexaApi from '../../api/AlexaApi' /** * Class for Privacy Screen. */ @@ -70,33 +68,8 @@ export default class PrivacyScreen extends Lightning.Component { src: Utils.asset('images/settings/ToggleOffWhite.png'), }, }, - UsbMediaDevices: { - alpha:0.3, - y: 90, - type: SettingsMainItem, - Title: { - x: 10, - y: 45, - mountY: 0.5, - text: { - text: Language.translate('USB Media Devices'), - textColor: COLORS.titleColor, - fontFace: CONFIG.language.font, - fontSize: 25, - } - }, - Button: { - h: 45, - w: 67, - x: 1600, - mountX: 1, - y: 45, - mountY: 0.5, - src: Utils.asset('images/settings/ToggleOffWhite.png'), - }, - }, AudioInput: { - y: 180, + y: 90, type: SettingsMainItem, Title: { x: 10, @@ -120,7 +93,7 @@ export default class PrivacyScreen extends Lightning.Component { }, }, ClearCookies: { - y: 270, + y: 180, type: SettingsMainItem, Title: { x: 10, @@ -144,7 +117,7 @@ export default class PrivacyScreen extends Lightning.Component { }, }, PrivacyPolicy: { - y: 360, + y: 270, type: SettingsMainItem, Title: { x: 10, @@ -180,7 +153,6 @@ export default class PrivacyScreen extends Lightning.Component { _firstEnable() { this._setState('LocalDeviceDiscovery') this.checkLocalDeviceStatus() - this.USBApi = new UsbApi() this.AppApi = new AppApi() this.Warehouse= new Warehouse() } @@ -188,18 +160,6 @@ export default class PrivacyScreen extends Lightning.Component { _focus() { this._setState(this.state) this.checkLocalDeviceStatus() - // this.checkUSBDeviceStatus() - } - - checkUSBDeviceStatus() { - if (!Storage.get('UsbMedia')) { - this.tag('UsbMediaDevices.Button').src = Utils.asset('images/settings/ToggleOnOrange.png') - Storage.set('UsbMedia', 'ON') - } else if (Storage.get('UsbMedia') === 'ON') { - this.tag('UsbMediaDevices.Button').src = Utils.asset('images/settings/ToggleOnOrange.png') - } else if (Storage.get('UsbMedia') === 'OFF') { - this.tag('UsbMediaDevices.Button').src = Utils.asset('images/settings/ToggleOffWhite.png') - } } checkLocalDeviceStatus() { @@ -265,41 +225,6 @@ export default class PrivacyScreen extends Lightning.Component { this.toggleLocalDeviceDiscovery() } }, - class UsbMediaDevices extends this { - $enter() { - this.tag('UsbMediaDevices')._focus() - } - $exit() { - this.tag('UsbMediaDevices')._unfocus() - } - _handleUp() { - this._setState('LocalDeviceDiscovery') - } - _handleDown() { - this._setState('AudioInput') - } - _handleEnter() { - let _UsbMedia = Storage.get('UsbMedia') - if (_UsbMedia === 'ON') { - this.fireAncestors('$deRegisterUsbMount') - this.USBApi.deactivate().then(() => { - Storage.set('UsbMedia', 'OFF') - this.tag('UsbMediaDevices.Button').src = Utils.asset('images/settings/ToggleOffWhite.png') - this.widgets.menu.refreshMainView() - }).catch(err => { - this.ERR("error while disabling the usb plugin = " + JSON.stringify(err)) - this.fireAncestors('$registerUsbMount') - }) - } else if (_UsbMedia === 'OFF') { - this.USBApi.activate().then(() => { - Storage.set('UsbMedia', 'ON') - this.tag('UsbMediaDevices.Button').src = Utils.asset('images/settings/ToggleOnOrange.png') - this.fireAncestors('$registerUsbMount') - this.widgets.menu.refreshMainView() - }) - } - } - }, class AudioInput extends this { $enter() { this.tag('AudioInput')._focus() @@ -344,28 +269,6 @@ export default class PrivacyScreen extends Lightning.Component { } setTimeout(async () => { - if(GLOBALS.AlexaAvsstatus){ - AlexaApi.get().resetAVSCredentials().then((result) => { - this.LOG("Triggering AVS credential reset." + JSON.stringify(result)) - if (result.success) { - AlexaApi.get().setAlexaAuthStatus("AlexaAuthPending"); - this.tag('ClearCookies.Title').text = Language.translate('Clear Cookies and App Data') + " - " + Language.translate('Finished') - setTimeout(() => { - this.tag('ClearCookies.Title').text = Language.translate('Clear Cookies and App Data') - this.tag('ClearCookies.Button').src = Utils.asset('images/settings/ToggleOffWhite.png') - cookieToggle = !cookieToggle - }, 2000) - } else { - //UNSUCCESSFULL API CALL - this.tag('ClearCookies.Title').text = Language.translate('Clear Cookies and App Data')+ " - " + Language.translate("Error!") - setTimeout(() => { - this.tag('ClearCookies.Title').text = Language.translate('Clear Cookies and App Data') - this.tag('ClearCookies.Button').src = Utils.asset('images/settings/ToggleOffWhite.png') - cookieToggle = !cookieToggle - }, 2000) - } - }) } - else{ try { await this.Warehouse.activate() await this.Warehouse.lightReset() @@ -391,7 +294,7 @@ export default class PrivacyScreen extends Lightning.Component { cookieToggle = !cookieToggle }, 2000) }) - }}, 2000) + }, 2000) } }, class PrivacyPolicy extends this { diff --git a/accelerator-home-ui/src/overlays/OtherSettings/TimeZoneOverlay.js b/accelerator-home-ui/src/overlays/OtherSettings/TimeZoneOverlay.js index 019d4ebd..71bc5661 100644 --- a/accelerator-home-ui/src/overlays/OtherSettings/TimeZoneOverlay.js +++ b/accelerator-home-ui/src/overlays/OtherSettings/TimeZoneOverlay.js @@ -1,9 +1,8 @@ import { Language, Lightning, Utils } from "@lightningjs/sdk"; import AppApi from "../../api/AppApi"; -import { CONFIG, GLOBALS } from "../../Config/Config"; +import { CONFIG } from "../../Config/Config"; import TimeOverlayItems from "../../items/TimeOverlayItems"; import TimeZoneOverlayItem from "../../items/TimeZoneOverlayItem"; -import FireBoltApi from "../../api/firebolt/FireBoltApi"; export default class TimeZone extends Lightning.Component { constructor(...args) { @@ -86,11 +85,7 @@ export default class TimeZone extends Lightning.Component { this.appApi = new AppApi() this.resp = await this.appApi.fetchTimeZone() let data = [] - if ("ResidentApp" === GLOBALS.selfClientName) { - this.zone = await this.appApi.getZone() - }else { - this.zone = await FireBoltApi.get().localization.getTimeZone() - } + this.zone = await this.appApi.getZone() try { this.LOG("TimeZoneOverlay: resp: " + JSON.stringify(this.resp) + " zone: " + JSON.stringify(this.zone)) @@ -184,4 +179,4 @@ export default class TimeZone extends Lightning.Component { } ]; } -} \ No newline at end of file +} diff --git a/accelerator-home-ui/src/overlays/SettingsOverlay.js b/accelerator-home-ui/src/overlays/SettingsOverlay.js index 1a601742..14b10f09 100644 --- a/accelerator-home-ui/src/overlays/SettingsOverlay.js +++ b/accelerator-home-ui/src/overlays/SettingsOverlay.js @@ -22,7 +22,6 @@ import SettingsMainItem from "../items/SettingsMainItem"; import { CONFIG, GLOBALS } from "../Config/Config"; import DTVApi from "../api/DTVApi"; import AppApi from "../api/AppApi"; -import RDKShellApis from "../api/RDKShellApis"; import AudioScreenOverlay from './AudioScreens/AudioScreenOverlay' import VideoScreenOverlay from './AudioScreens/VideoScreenOverlay'; import NetworkConfigurationOverlay from "./NetworkScreens/NetworkConfigurationOverlay"; @@ -30,7 +29,6 @@ import BluetoothScreenOverlay from './NetworkScreens/BluetoothScreenOverlay' import LiveTvSettings from './LiveTvSettings/LiveTvSettingsOverlay' import ThunderJS from 'ThunderJS'; import OtherSettingsScreen from "./OtherSettings/OtherSettingsOverlay"; -import { Metrics } from "@firebolt-js/sdk"; var thunder = ThunderJS(CONFIG.thunderConfig); /** @@ -305,8 +303,6 @@ export default class SettingsOverlay extends Lightning.Component { } } else { Router.focusPage(); - RDKShellApis.setVisibility(GLOBALS.selfClientName, false); - RDKShellApis.setFocus(GLOBALS.topmostApp); } } @@ -461,7 +457,6 @@ export default class SettingsOverlay extends Lightning.Component { self.LOG("Netflix : nfr disable updation results in " + JSON.stringify(nr)) }).catch(nerr => { self.ERR("Netflix : error while updating nfrstatus") - Metrics.error(Metrics.ErrorType.OTHER,"PluginError", "Thunder Netflix.1 error disabling nfrstatus "+JSON.stringify(nerr), false, null) self.ERR(JSON.stringify(nerr)) }) @@ -474,7 +469,6 @@ export default class SettingsOverlay extends Lightning.Component { self.LOG("Netflix : nfr enable results in " + JSON.stringify(nr)) }).catch(nerr => { self.ERR("Netflix : error while updating nfrstatus ") - Metrics.error(Metrics.ErrorType.OTHER,"PluginError", "Thunder Netflix.1 error enabling nfrstatus "+JSON.stringify(nerr), false, null) self.ERR("Netflix : nfr enable results in error:" + JSON.stringify(nerr)) }) diff --git a/accelerator-home-ui/src/routes/otherSettingsRoutes.js b/accelerator-home-ui/src/routes/otherSettingsRoutes.js index 94477df1..c1bccf13 100644 --- a/accelerator-home-ui/src/routes/otherSettingsRoutes.js +++ b/accelerator-home-ui/src/routes/otherSettingsRoutes.js @@ -31,11 +31,6 @@ import TimeZone from '../screens/OtherSettingsScreens/TimeZone' import TimeItems from '../items/TimeItems' import FactoryResetConfirmationScreen from '../screens/OtherSettingsScreens/FactoryResetConfirmationScreen' import SreenSaverScreen from '../screens/ScreenSaverTimer' -import SecurityPinScreen from '../api/firebolt/provider/SecurityPinScreen' -import KeyboardScreen from '../api/firebolt/provider/KeyboardScreen' -import AcknowledgeScreen from '../api/firebolt/provider/AcknowledgeScreen' - - export default { otherSettingsRoutes: [ @@ -59,19 +54,6 @@ export default { component: PrivacyScreen, widgets: ['Menu', 'Volume', "AppCarousel"] }, - { - path: "settings/other/SecurityPinScreen", - component: SecurityPinScreen, - }, - { - path: "settings/other/KeyboardScreen", - component: KeyboardScreen, - }, - { - path: "settings/other/AcknowledgeScreen", - component: AcknowledgeScreen, - }, - { path: 'settings/advanced', component: AdvancedSettingsScreen, @@ -126,4 +108,4 @@ export default { widgets: ['Menu', 'Volume', "AppCarousel"], } ] -} \ No newline at end of file +} diff --git a/accelerator-home-ui/src/routes/routes.js b/accelerator-home-ui/src/routes/routes.js index b8da51db..89774394 100644 --- a/accelerator-home-ui/src/routes/routes.js +++ b/accelerator-home-ui/src/routes/routes.js @@ -46,7 +46,6 @@ import AlexaConfirmationScreen from '../screens/AlexaConfirmationScreen' import CameraStreamingScreen from '../screens/CameraStreamingScreen' import CameraStreamingScreenExitConfirmationScreen from '../screens/CameraStreamingScreenExitConfirmationScreen' import { Storage } from '@lightningjs/sdk' -import { Metrics } from '@firebolt-js/sdk' import { GLOBALS } from '../Config/Config.js' import AppInfoPage from '../views/AppInfoPage.js' @@ -202,9 +201,6 @@ export default { ], afterEachRoute: (request) => { console.log("Routed to:" + JSON.stringify(request.hash)); - if ("ResidentApp" !== GLOBALS.selfClientName) { - Metrics.page(request.hash).catch(err => { console.log("error in metrics.page" + JSON.stringify(err)) }); - } if (request.hash === "menu") { /* To prevent the onboarding screen appearing next time. */ GLOBALS.RCSkipStatus=true; diff --git a/accelerator-home-ui/src/screens/AlexaConfirmationScreen.js b/accelerator-home-ui/src/screens/AlexaConfirmationScreen.js index a5c996fa..8bf84528 100644 --- a/accelerator-home-ui/src/screens/AlexaConfirmationScreen.js +++ b/accelerator-home-ui/src/screens/AlexaConfirmationScreen.js @@ -17,9 +17,7 @@ * limitations under the License. **/ import { Lightning, Router, Language } from '@lightningjs/sdk' -import AppApi from '../api/AppApi' import { CONFIG } from '../Config/Config' -import AlexaApi from '../api/AlexaApi' /** * Class for Reboot Confirmation Screen. @@ -118,7 +116,6 @@ export default class AlexaConfirmationScreen extends Lightning.Component { this._focus() } _handleEnter() { - AlexaApi.get().setAlexaAuthStatus("AlexaUserDenied") Router.navigate("menu") } _handleRight() { diff --git a/accelerator-home-ui/src/screens/AlexaLoginScreen.js b/accelerator-home-ui/src/screens/AlexaLoginScreen.js index 8bdd9e26..375cddb8 100644 --- a/accelerator-home-ui/src/screens/AlexaLoginScreen.js +++ b/accelerator-home-ui/src/screens/AlexaLoginScreen.js @@ -18,7 +18,6 @@ **/ import { Language, Lightning, Router, Utils } from '@lightningjs/sdk' import { CONFIG } from '../Config/Config' -import AlexaApi from '../api/AlexaApi' export default class AlexaLoginScreen extends Lightning.Component { constructor(...args) { @@ -139,10 +138,8 @@ export default class AlexaLoginScreen extends Lightning.Component { }) } async _handleEnter() { - if(AlexaApi.get().checkAlexaAuthStatus() != "AlexaUserDenied"){ - this.LOG("Code coming from AlexaLoginScreen") - Router.navigate("CodeScreen") - } + // FIXME: make this routing conditional based on OTP code reception. + Router.navigate("CodeScreen") } _handleUp(){ this._setState("BackButton") @@ -193,7 +190,3 @@ export default class AlexaLoginScreen extends Lightning.Component { ] } } - - - - diff --git a/accelerator-home-ui/src/screens/AppLauncherScreen.js b/accelerator-home-ui/src/screens/AppLauncherScreen.js index 13b76c22..2fbc05ec 100644 --- a/accelerator-home-ui/src/screens/AppLauncherScreen.js +++ b/accelerator-home-ui/src/screens/AppLauncherScreen.js @@ -17,12 +17,9 @@ * limitations under the License. **/ -import { Lightning, Registry, Router, Storage, Utils, Settings } from "@lightningjs/sdk"; +import { Lightning, Registry, Router, Utils } from "@lightningjs/sdk"; import ThunderJS from "ThunderJS"; -import AppApi from "../api/AppApi"; -import RDKShellApis from "../api/RDKShellApis"; import { CONFIG, GLOBALS } from '../Config/Config' -import { Metrics } from "@firebolt-js/sdk"; //applauncher screen "will" be responsible for handling all overlays as widget and splash screens for apps(if required) | currently only handles settings overlay widget export default class AppLauncherScreen extends Lightning.Component { @@ -52,37 +49,6 @@ export default class AppLauncherScreen extends Lightning.Component { }; } - showSplashImage(callsign) { - if (this.splashImages[callsign]) { //splash image won't be shown if the callsign and image location is mapped in this.splashImages - - //first frame event - this.firstFrameListener = this._thunder.on("org.rdk.RDKShell", "onApplicationFirstFrame", (notification) => { - this.LOG("onApplicationFirstFrame notification from applauncherscreen: " + JSON.stringify(notification)) - if (notification.client === callsign.toLowerCase()) { - this.LOG("firstframe event triggered hiding splash image"); - this.tag("SplashImage").src = "" - this.tag("SplashImage").visible = false; - this.moveApptoFront(callsign); - this.firstFrameListener.dispose(); //dispose listener after event is triggered for first time - } - }) - - //to show the splash image - this.splashTimeout && Registry.clearTimeout(this.splashTimeout) - this.tag("SplashImage").src = Utils.asset(this.splashImages[callsign]) - this.tag("SplashImage").visible = true; - - //to hide the splash image after 30 sec in case firstframe event failed - this.splashTimeout = Registry.setTimeout(() => { - this.LOG("timeout triggered hiding splash image"); - this.tag("SplashImage").src = "" - this.tag("SplashImage").visible = false; - RDKShellApis.moveToFront(callsign); - this.firstFrameListener.dispose(); //dispose the event listener incase event did not trigger till 30s - }, 30000) - } - } - _firstEnable() { this.LOG("AppLauncherScreen is enabled for firstTime"); this.splashImages = { @@ -98,14 +64,12 @@ export default class AppLauncherScreen extends Lightning.Component { _handleKey() { this.LOG("AppLauncherScreen is in focus, returning focus to corresponding app") if (GLOBALS.topmostApp === GLOBALS.selfClientName) { //if appLauncher screen is in focus while on residentApp - RDKShellApis.moveToFront(GLOBALS.selfClientName); - RDKShellApis.setFocus(GLOBALS.selfClientName); - RDKShellApis.setVisibility(GLOBALS.selfClientName, true); - Router.navigate(GLOBALS.LastvisitedRoute); + // FIXME: use new AppManager APIs. + this.WARN("App : Are we missing any logic here when using AppManager APIs?"); + Router.navigate(GLOBALS.LastvisitedRoute); } else { - RDKShellApis.moveToFront(GLOBALS.topmostApp); - RDKShellApis.setFocus(GLOBALS.topmostApp); - RDKShellApis.setVisibility(GLOBALS.topmostApp, true); + // FIXME: use new AppManager APIs. + this.WARN("App : Are we missing any logic here when using AppManager APIs?"); } } } diff --git a/accelerator-home-ui/src/screens/CodeScreen.js b/accelerator-home-ui/src/screens/CodeScreen.js index 702efafc..4789bb33 100644 --- a/accelerator-home-ui/src/screens/CodeScreen.js +++ b/accelerator-home-ui/src/screens/CodeScreen.js @@ -16,11 +16,9 @@ * See the License for the specific language governing permissions and * limitations under the License. **/ -import { Lightning, Router, Utils, Language, Storage } from '@lightningjs/sdk' -import { CONFIG, GLOBALS } from '../Config/Config' +import { Lightning, Router, Utils, Language } from '@lightningjs/sdk' +import { CONFIG } from '../Config/Config' import ThunderJS from 'ThunderJS' -import AlexaApi from '../api/AlexaApi' -import { Metrics } from '@firebolt-js/sdk' var thunder = ThunderJS(CONFIG.thunderConfig); @@ -106,46 +104,7 @@ export default class CodeScreen extends Lightning.Component { this._setState('Description') } _focus() { - if (AlexaApi.get().checkAlexaAuthStatus() !== "AlexaUserDenied") { - thunder.Controller.activate({ callsign: "org.rdk.VoiceControl" }).then(res => { - if (Storage.get("alexaOTPReset")) { - if(GLOBALS.AlexaAvsstatus){AlexaApi.get().resetAVSCredentials();} - Storage.remove("alexaOTPReset"); - } - thunder.on("org.rdk.VoiceControl", 'onServerMessage', notification => { - this.LOG("VoiceControl.onServerMessage Notification: " + JSON.stringify(notification)) - this.VoiceControlData = notification - if (notification.xr_speech_avs.url != undefined) { - this.tag('Description').text.text = Language.translate('Enter the code at') + ` ${notification.xr_speech_avs.url}` - } else { - this.tag('Description').text.text = Language.translate('Fetching authorization code') - } - this.tag("Description2").visible = true - if (notification.xr_speech_avs.code != undefined) { - this.tag("Description2").text.text = `${notification.xr_speech_avs.code}` - } else { - this.tag("Description2").text.text = Language.translate('Please wait') - } - if (notification.xr_speech_avs.state === "refreshed") { - // DAB Demo Work Around - show Alexa Error screens only after Auth is succeeded. - AlexaApi.get().setAlexaAuthStatus("AlexaHandleError"); - AlexaApi.get().enableSmartScreen(); - Router.navigate("SuccessScreen"); - } - else if ((notification.xr_speech_avs.state === "uninitialized") || (notification.xr_speech_avs.state === "authorizing")) { - this.LOG("notification state is uninitialised") - AlexaApi.get().setAlexaAuthStatus("AlexaAuthPending") - } else if (notification.xr_speech_avs.state === "unrecoverable error") { - this.LOG("notification state is unrecoverable error") - Router.navigate("FailureScreen") - } - }) - }).catch(err => { - this.ERR("VoiceControl Plugin Activation ERROR!: " + JSON.stringify(err)) - Metrics.error(Metrics.ErrorType.OTHER, 'PluginError', "Thunder Controller.activate Voice Error"+JSON.stringify(err), false, null) - }) - this._setState('Description') - } + // TODO: Implement focus logic when voice integration is done } _active() { diff --git a/accelerator-home-ui/src/screens/EpgScreens/Epg.js b/accelerator-home-ui/src/screens/EpgScreens/Epg.js index 9b5bf548..7c59810c 100644 --- a/accelerator-home-ui/src/screens/EpgScreens/Epg.js +++ b/accelerator-home-ui/src/screens/EpgScreens/Epg.js @@ -278,7 +278,8 @@ export default class Epg extends Lightning.Component { if(appIdentifier){ params.appIdentifier = appIdentifier } - this.appApi.launchApp(channel.callsign,params) + // FIXME: Implement OTT channel launch logic here. + this.WARN("OTT channel launch not implemented."); } else if(channel.dvburi.startsWith("C_") && eventUri != null){ if (!Router.isNavigating()) { let playerParams = { @@ -311,14 +312,10 @@ export default class Epg extends Lightning.Component { return currentChannel } - - setShows4Channels(channels, headStart = 0) { this.strtindexesofrows = [] let ltp = this.ltp let rtp = new Date(this.ltp.getTime() + 3 * 60 * 60 * 1000) - - let cells = [] let self = this function filterShowsBasedOnTimeWindow(shows, index) { @@ -326,7 +323,6 @@ export default class Epg extends Lightning.Component { let i = Math.abs(headStart) while (i >= 0) { // binary search can optimize this loop. - shows[i].endtime = shows[i].duration + shows[i].starttime if (i >= shows.length) { self.WARN("Reached the end of data , can't traverse shows any further!") diff --git a/accelerator-home-ui/src/screens/FailureScreen.js b/accelerator-home-ui/src/screens/FailureScreen.js index 489379be..5b69e6da 100644 --- a/accelerator-home-ui/src/screens/FailureScreen.js +++ b/accelerator-home-ui/src/screens/FailureScreen.js @@ -18,13 +18,7 @@ **/ import { Lightning, Router, Utils, Language, Storage } from '@lightningjs/sdk' import { CONFIG, GLOBALS } from '../Config/Config' -import AlexaApi from '../api/AlexaApi' import AppApi from '../api/AppApi'; -import RDKShellApis from '../api/RDKShellApis'; -import ThunderJS from "ThunderJS"; -import { Metrics } from '@firebolt-js/sdk'; - -var thunder = ThunderJS(CONFIG.thunderConfig); export default class FailureScreen extends Lightning.Component { constructor(...args) { @@ -116,23 +110,10 @@ export default class FailureScreen extends Lightning.Component { this.tag('RetryButton.Title').text.textColor = CONFIG.theme.hex } _handleEnter() { + // Nothing to do here. TODO: Implement retry logic when voice integration is done. if (GLOBALS.topmostApp !== GLOBALS.selfClientName) { - if(GLOBALS.AlexaAvsstatus){ - AlexaApi.get().resetAVSCredentials().then(() => { - this.LOG("avs credentials reseted") - })} - this.LOG("Current app: " + JSON.stringify(GLOBALS.topmostApp) + ", moving the app to front") - RDKShellApis.moveToFront(GLOBALS.topmostApp) - RDKShellApis.setFocus(GLOBALS.topmostApp).catch((err) => { - Metrics.error(Metrics.ErrorType.OTHER, 'PluginError', "Thunder RDKshell set focus error" + JSON.stringify(err), false, null) - }); - } - else { - if(GLOBALS.AlexaAvsstatus){ - AlexaApi.get().resetAVSCredentials().then(async () => { - await Router.navigate('AlexaLoginScreen'); - }) - } + this.LOG("Dismiss button pressed") + Router.back() } } _focus() { diff --git a/accelerator-home-ui/src/screens/OtherSettingsScreens/AdvancedSettingsScreen.js b/accelerator-home-ui/src/screens/OtherSettingsScreens/AdvancedSettingsScreen.js index ea828bb9..661e5769 100644 --- a/accelerator-home-ui/src/screens/OtherSettingsScreens/AdvancedSettingsScreen.js +++ b/accelerator-home-ui/src/screens/OtherSettingsScreens/AdvancedSettingsScreen.js @@ -182,32 +182,40 @@ export default class AdvanceSettingsScreen extends Lightning.Component { _init() { this.cecApi = new CECApi() - this.cecApi.activate() - .then(() => { - this.tag('CECControl.Button').src = Utils.asset('images/settings/ToggleOnOrange.png') - this.performOTPAction() - }) this._setState('TTSOptions') } + + _active() { + this.cecApi.getEnabled().then(res => { + this.LOG("cec getenabled result:" + JSON.stringify(res)) + if (res.enabled) { + this.tag('CECControl.Button').src = Utils.asset('images/settings/ToggleOnOrange.png') + } else { + this.tag('CECControl.Button').src = Utils.asset('images/settings/ToggleOffWhite.png') + } + }) + } + _focus() { this._setState(this.state) } _handleBack() { if(!Router.isNavigating()){ - Router.navigate('settings/other') + Router.navigate('settings/other') } } performOTPAction() { - this.cecApi.setEnabled().then(res => { + return this.cecApi.setEnabled().then(res => { if (res.success) { - this.cecApi.performOTP().then(otpRes => { + return this.cecApi.performOTP().then(otpRes => { if (otpRes.success) { this.LOG('Otp Action success full') } }) } + return null; }) } @@ -216,16 +224,9 @@ export default class AdvanceSettingsScreen extends Lightning.Component { .then(res => { this.LOG("cec getenabled result:" + JSON.stringify(res)) if (res.enabled) { - this.cecApi.deactivate() - .then(() => { - this.tag('CECControl.Button').src = Utils.asset('images/settings/ToggleOffWhite.png') - }) - } - else { - this.cecApi.activate() - .then(() => { - this.tag('CECControl.Button').src = Utils.asset('images/settings/ToggleOnOrange.png') - }) + this.tag('CECControl.Button').src = Utils.asset('images/settings/ToggleOffWhite.png') + } else { + this.tag('CECControl.Button').src = Utils.asset('images/settings/ToggleOnOrange.png') } }) } @@ -333,7 +334,7 @@ export default class AdvanceSettingsScreen extends Lightning.Component { } _handleEnter() { if(!Router.isNavigating()){ - Router.navigate('settings/advanced/device') + Router.navigate('settings/advanced/device') } } }, @@ -341,4 +342,4 @@ export default class AdvanceSettingsScreen extends Lightning.Component { } -} \ No newline at end of file +} diff --git a/accelerator-home-ui/src/screens/OtherSettingsScreens/DeviceInformationScreen.js b/accelerator-home-ui/src/screens/OtherSettingsScreens/DeviceInformationScreen.js index 96eef21a..daa7aa84 100644 --- a/accelerator-home-ui/src/screens/OtherSettingsScreens/DeviceInformationScreen.js +++ b/accelerator-home-ui/src/screens/OtherSettingsScreens/DeviceInformationScreen.js @@ -20,7 +20,6 @@ import { Lightning, Language, Router, Settings, Storage } from '@lightningjs/sdk import { COLORS } from '../../colors/Colors' import { CONFIG, GLOBALS } from '../../Config/Config' import AppApi from '../../api/AppApi.js'; -import FireBoltApi from '../../api/firebolt/FireBoltApi'; /** * Class for Video and Audio screen. @@ -203,27 +202,16 @@ export default class DeviceInformationScreen extends Lightning.Component { } _focus() { - this._setState('DeviceInformationScreen') this.appApi.getSerialNumber().then(result => { this.tag("SerialNumber.Value").text.text = `${result}`; }) - if ("ResidentApp" === GLOBALS.selfClientName) { - this.appApi.getSystemVersions().then(res => { - this.tag('FirmwareVersions.Value').text.text = `UI Version - ${Settings.get('platform', 'version')} \nBuild Version - ${res.stbVersion} \nTime Stamp - ${res.stbTimestamp} ` - }).catch(err => { - this.ERR("error while getting the system versions" + JSON.stringify(err)) - }) - } else { - // Firebolt mode - FireBoltApi.get().deviceinfo.getversion().then(res => { - this.LOG("build verion" + JSON.stringify(res.firmware.readable) + " Firebolt API Version - " + JSON.stringify(res.api.readable)) - this.tag('FirmwareVersions.Value').text.text = `UI Version - ${Settings.get('platform', 'version')} \nBuild Version - ${res.firmware.readable} \nFirebolt API Version - ${res.api.readable} ` - }).catch(err => { - this.ERR("error while getting the system versions from Firebolt.getversion API" + JSON.stringify(err)) - }) - } + this.appApi.getSystemVersions().then(res => { + this.tag('FirmwareVersions.Value').text.text = `UI Version - ${Settings.get('platform', 'version')} \nBuild Version - ${res.stbVersion} \nTime Stamp - ${res.stbTimestamp} ` + }).catch(err => { + this.ERR("error while getting the system versions" + JSON.stringify(err)) + }) this.appApi.getDRMS().then(result => { this.LOG("from device info supported drms " + JSON.stringify(result)) @@ -243,50 +231,8 @@ export default class DeviceInformationScreen extends Lightning.Component { this.tag('SupportedDRM.Value').text.text = `${drms.substring(0, drms.length - 1)}` }) - let self = this; - if (Storage.get('Netflix_ESN')) { - self.tag('AppVersions.Value').text.text = `Youtube: NA\nAmazon Prime: NA\nNetflix ESN: ${Storage.get('Netflix_ESN')}` - } - else { - self.appApi.getPluginStatus('Netflix') - .then(result => { - let sel = self; - sel.LOG("Netflix : plugin status : " + JSON.stringify(result)); - if (result[0].state === 'deactivated' || result[0].state === 'deactivation') { - sel.appApi.launchPremiumAppInSuspendMode("Netflix").then(res => { - sel.LOG("Netflix : netflix launch for esn value in suspend mode returns : " + JSON.stringify(res)); - let se = sel; - se.appApi.getNetflixESN() - .then(res => { - Storage.set('Netflix_ESN', res) - se.LOG("Netflix : netflix esn call returns : " + JSON.stringify(res)); - se.netflixESN = `Youtube: NA \nAmazon Prime: NA \nNetflix ESN: ${res}` - }) - .catch(err => { - se.ERR("Netflix : error while getting netflix esn : " + JSON.stringify(err)) - }) - }).catch(err => { - sel.ERR("Netflix : error while launching netflix in suspendMode : " + JSON.stringify(err)) - }) - } - else { - self.appApi.getNetflixESN() - .then(res => { - Storage.set('Netflix_ESN', res) - self.LOG("Netflix : netflix esn call returns : " + JSON.stringify(res)); - self.netflixESN = `Youtube: NA \nAmazon Prime: NA \nNetflix ESN: ${res}`; - }) - .catch(err => { - self.ERR("Netflix : error while getting netflix esn : " + JSON.stringify(err)) - }) - } - }).catch(err => { - self.ERR("Netflix : error while getting netflix plugin status ie. " + JSON.stringify(err)) - self.netflixESN = `Youtube: NA \nAmazon Prime: NA \nNetflix ESN: "Not Detected"`; - }) - } - - + // FIXME: Implement logic to fetch and display YouTube, Amazon Prime, and Netflix ESN versions here. + this.tag('AppVersions.Value').text.text = `Youtube: NA\nAmazon Prime: NA\nNetflix ESN: ${Storage.get('Netflix_ESN')}` } set netflixESN(v) { diff --git a/accelerator-home-ui/src/screens/OtherSettingsScreens/FactoryResetConfirmationScreen.js b/accelerator-home-ui/src/screens/OtherSettingsScreens/FactoryResetConfirmationScreen.js index f0c81030..d7b340e0 100644 --- a/accelerator-home-ui/src/screens/OtherSettingsScreens/FactoryResetConfirmationScreen.js +++ b/accelerator-home-ui/src/screens/OtherSettingsScreens/FactoryResetConfirmationScreen.js @@ -19,7 +19,6 @@ import { Lightning, Utils, Router, Language } from '@lightningjs/sdk' import AppApi from '../../api/AppApi' import { CONFIG,GLOBALS } from '../../Config/Config' -import AlexaApi from '../../api/AlexaApi.js'; import RCApi from '../../api/RemoteControl' import Warehouse from '../../api/WarehouseApis.js' @@ -169,11 +168,7 @@ export default class RebootConfirmationScreen extends Lightning.Component { } async _performFactoryReset() { - // Deactivate SmartScreen instance to prevent overlay when Auth is revoked. - AlexaApi.get().disableSmartScreen(); - if(GLOBALS.AlexaAvsstatus){AlexaApi.get().resetAVSCredentials();} - AlexaApi.get().setAlexaAuthStatus("AlexaAuthPending"); - await RCApi.get().activate().then(()=> RCApi.get().factoryReset()).catch(err => this.ERR("error while resetting remote control" + JSON.stringify(err))); + await RCApi.get().factoryReset().catch(err => this.ERR("error while resetting remote control" + JSON.stringify(err))); let rsactivitytime = await appApi.resetInactivityTime().catch(err => { this.ERR("resetInactivityTime" + JSON.stringify(err)) }); if (rsactivitytime != null) { this.LOG("rsactivitytime" + JSON.stringify(rsactivitytime)) } try { diff --git a/accelerator-home-ui/src/screens/OtherSettingsScreens/FirmwareScreen.js b/accelerator-home-ui/src/screens/OtherSettingsScreens/FirmwareScreen.js index b5a101cf..6cf17f28 100644 --- a/accelerator-home-ui/src/screens/OtherSettingsScreens/FirmwareScreen.js +++ b/accelerator-home-ui/src/screens/OtherSettingsScreens/FirmwareScreen.js @@ -16,12 +16,11 @@ * See the License for the specific language governing permissions and * limitations under the License. **/ -import { Lightning, Language, Router, Settings } from '@lightningjs/sdk' +import { Lightning, Language, Router } from '@lightningjs/sdk' import { COLORS } from '../../colors/Colors' import { CONFIG } from '../../Config/Config' import AppApi from '../../api/AppApi'; import ThunderJS from 'ThunderJS'; -import { Metrics } from '@firebolt-js/sdk'; /** * Class for Firmware screen. @@ -276,4 +275,4 @@ export default class FirmwareScreen extends Lightning.Component { ] } } -FirmwareScreen.STATES = ['Uninitialized', 'Requesting', 'Downloading', 'Failed', 'Download Complete', 'Validation Complete', 'Preparing to Reboot'] \ No newline at end of file +FirmwareScreen.STATES = ['Uninitialized', 'Requesting', 'Downloading', 'Failed', 'Download Complete', 'Validation Complete', 'Preparing to Reboot'] diff --git a/accelerator-home-ui/src/screens/OtherSettingsScreens/LanguageScreen.js b/accelerator-home-ui/src/screens/OtherSettingsScreens/LanguageScreen.js index 322ca3f3..f01f1451 100644 --- a/accelerator-home-ui/src/screens/OtherSettingsScreens/LanguageScreen.js +++ b/accelerator-home-ui/src/screens/OtherSettingsScreens/LanguageScreen.js @@ -20,7 +20,6 @@ import { Language, Lightning, Router } from '@lightningjs/sdk' import LanguageItem from '../../items/LanguageItem' import { availableLanguages, availableLanguageCodes, CONFIG } from '../../Config/Config' import AppApi from '../../api/AppApi'; -import AlexaApi from '../../api/AlexaApi'; import thunderJS from 'ThunderJS'; @@ -114,18 +113,6 @@ export default class LanguageScreen extends Lightning.Component { _handleEnter() { if (Language.get() !== availableLanguages[this._Languages.tag('List').index]) { let updatedLanguage = availableLanguageCodes[availableLanguages[this._Languages.tag('List').index]] - if (AlexaApi.get().checkAlexaAuthStatus() === "AlexaHandleError") { - AlexaApi.get().getAlexaDeviceSettings(); - thunder.on('org.rdk.VoiceControl', 'onServerMessage', notification => { - if (notification.xr_speech_avs.deviceSettings.currentLocale.toString() != updatedLanguage) { - for (let i = 0; i < notification.xr_speech_avs.deviceSettings.supportedLocales.length; i++) { - if (updatedLanguage === notification.xr_speech_avs.deviceSettings.supportedLocales[i].toString()) { - AlexaApi.get().updateDeviceLanguageInAlexa(updatedLanguage) - } - } - } - }) - } appApi.setUILanguage(updatedLanguage) localStorage.setItem('Language',availableLanguages[this._Languages.tag('List').index]) location.reload(); diff --git a/accelerator-home-ui/src/screens/OtherSettingsScreens/NetworkConfigurationScreen.js b/accelerator-home-ui/src/screens/OtherSettingsScreens/NetworkConfigurationScreen.js index 87a0e609..e7b2ef54 100644 --- a/accelerator-home-ui/src/screens/OtherSettingsScreens/NetworkConfigurationScreen.js +++ b/accelerator-home-ui/src/screens/OtherSettingsScreens/NetworkConfigurationScreen.js @@ -20,7 +20,6 @@ import { Lightning, Utils, Language, Router } from '@lightningjs/sdk' import SettingsMainItem from '../../items/SettingsMainItem' import { COLORS } from '../../colors/Colors' import { CONFIG } from '../../Config/Config' -import { Metrics } from '@firebolt-js/sdk' import NetworkManager from '../../api/NetworkManagerAPI' export default class NetworkConfigurationScreen extends Lightning.Component { @@ -149,11 +148,18 @@ export default class NetworkConfigurationScreen extends Lightning.Component { if(interfaceName === "wlan0"){this.$NetworkInterfaceText("WIFI")} }) - this.onDefaultIfaceChangedCB = NetworkManager.thunder.on(NetworkManager.callsign, 'onActiveInterfaceChange', data => { + this.onActiveInterfaceChangeCB = NetworkManager.thunder.on(NetworkManager.callsign, 'onActiveInterfaceChange', data => { if(data.currentActiveInterface === "eth0"){this.$NetworkInterfaceText("ETHERNET")} else{this.$NetworkInterfaceText("WIFI")} this.tag('TestInternetAccess.Title').text.text = Language.translate('Test Internet Access: ') - Metrics.action("user", "User changed the network interface", null) + }); + + this.onInternetStatusChangeCB = NetworkManager.thunder.on(NetworkManager.callsign, 'onInternetStatusChange', data => { + if (data.status && data.status === "FULLY_CONNECTED") { + this.tag('TestInternetAccess.Title').text.text = Language.translate('Test Internet Access: ') + Language.translate("Connected") + } else { + this.tag('TestInternetAccess.Title').text.text = Language.translate('Test Internet Access: ') + Language.translate("Disconnected") + } }); _newIPSettings = _currentIPSettings @@ -166,7 +172,10 @@ export default class NetworkConfigurationScreen extends Lightning.Component { }); } _inactive() { - this.onDefaultIfaceChangedCB.dispose(); + if (this.onActiveInterfaceChangeCB) { this.onActiveInterfaceChangeCB.dispose(); } + if (this.onInternetStatusChangeCB) { this.onInternetStatusChangeCB.dispose(); } + if (this.loadingAnimation) { this.loadingAnimation.stop(); } + this.tag('TestInternetAccess.Loader').visible = false } _focus() { this._setState(this.state) //can be used on init as well @@ -273,4 +282,4 @@ export default class NetworkConfigurationScreen extends Lightning.Component { }, ] } -} \ No newline at end of file +} diff --git a/accelerator-home-ui/src/screens/OtherSettingsScreens/NetworkInfoScreen.js b/accelerator-home-ui/src/screens/OtherSettingsScreens/NetworkInfoScreen.js index dcd58b78..e5550f1f 100644 --- a/accelerator-home-ui/src/screens/OtherSettingsScreens/NetworkInfoScreen.js +++ b/accelerator-home-ui/src/screens/OtherSettingsScreens/NetworkInfoScreen.js @@ -20,13 +20,11 @@ import { Lightning, Language, Router } from '@lightningjs/sdk' import SettingsMainItem from '../../items/SettingsMainItem' import { COLORS } from '../../colors/Colors' import { CONFIG, GLOBALS } from '../../Config/Config' -import FireBoltApi from '../../api/firebolt/FireBoltApi' import NetworkManager from '../../api/NetworkManagerAPI' var defaultInterface = ""; var currentInterface = []; export default class NetworkInfo extends Lightning.Component { - constructor(...args) { super(...args); this.INFO = console.info; @@ -85,7 +83,7 @@ export default class NetworkInfo extends Lightning.Component { }, }, ConnectionType: { - //alpha: 0.3, // disabled + alpha: 0, y: 90, type: SettingsMainItem, Title: { @@ -109,10 +107,10 @@ export default class NetworkInfo extends Lightning.Component { fontFace: CONFIG.language.font, fontSize: 25, } - }, + } }, IPAddress: { - //alpha: 0.3, // disabled + alpha: 0, y: 180, type: SettingsMainItem, Title: { @@ -139,6 +137,7 @@ export default class NetworkInfo extends Lightning.Component { }, }, Gateway: { + alpha: 0, y: 270, type: SettingsMainItem, Title: { @@ -165,7 +164,7 @@ export default class NetworkInfo extends Lightning.Component { }, }, MACAddress: { - //alpha: 0.3, // disabled + alpha: 0, y: 360, type: SettingsMainItem, Title: { @@ -192,7 +191,7 @@ export default class NetworkInfo extends Lightning.Component { }, }, InternetProtocol: { - //alpha: 0.3, // disabled + alpha: 0, y: 450, type: SettingsMainItem, Title: { @@ -219,7 +218,7 @@ export default class NetworkInfo extends Lightning.Component { }, }, SSID: { - //alpha: 0.3, // disabled + alpha: 0, y: 540, type: SettingsMainItem, Title: { @@ -246,7 +245,7 @@ export default class NetworkInfo extends Lightning.Component { }, }, SignalStrength: { - //alpha: 0.3, // disabled + alpha: 0, y: 630, type: SettingsMainItem, Title: { @@ -277,85 +276,101 @@ export default class NetworkInfo extends Lightning.Component { } _active() { - this.onInterfaceStatusChangedCB = NetworkManager.thunder.on(NetworkManager.callsign,'onInterfaceStateChange', data => { - this.WARN("Oninterfacestatuschanged" + JSON.stringify(data)) + this.onInterfaceStatusChangeCB = NetworkManager.thunder.on(NetworkManager.callsign,'onInterfaceStateChange', data => { + this.WARN("Oninterfacestatuschange" + JSON.stringify(data)) this.refreshDetails(); }) - this.onIPAddressStatusChangedCB = NetworkManager.thunder.on(NetworkManager.callsign,'onAddressChange', data => { + this.onAddressChangeCB = NetworkManager.thunder.on(NetworkManager.callsign,'onAddressChange', data => { this.WARN("OnAdrresschanged" + JSON.stringify(data)) this.refreshDetails(); }) - this.onDefaultInterfaceChangedCB = NetworkManager.thunder.on(NetworkManager.callsign,'onActiveInterfaceChange', data => { + this.onActiveInterfaceChangeCB = NetworkManager.thunder.on(NetworkManager.callsign,'onActiveInterfaceChange', data => { this.WARN("OnActiveInterfaceChange" + JSON.stringify(data)) this.refreshDetails(); }) - if ("ResidentApp" !== GLOBALS.selfClientName) - { - this.OnNetworkChangedfirebolt = FireBoltApi.get().deviceinfo.listen("networkChanged",value =>{ - this.refreshDetails(); - }) - } } _inactive() { - this.onInterfaceStatusChangedCB.dispose(); - this.onIPAddressStatusChangedCB.dispose(); - this.onDefaultInterfaceChangedCB.dispose(); + if (this.onInterfaceStatusChangeCB) this.onInterfaceStatusChangeCB.dispose(); + if (this.onAddressChangeCB) this.onAddressChangeCB.dispose(); + if (this.onActiveInterfaceChangeCB) this.onActiveInterfaceChangeCB.dispose(); + } + + setConnectedRowsVisibility(isConnected) { + const connectedAlpha = isConnected ? 1 : 0 + this.tag("ConnectionType").alpha = connectedAlpha + this.tag("IPAddress").alpha = connectedAlpha + this.tag("Gateway").alpha = connectedAlpha + this.tag("MACAddress").alpha = connectedAlpha + this.tag("InternetProtocol").alpha = connectedAlpha + if (!isConnected) { + this.tag("SSID").alpha = 0 + this.tag("SignalStrength").alpha = 0 + } } async refreshDetails() { this.tag("ConnectionType.Value").text.text = `NA` - this.tag("Status.Value").text.text = Language.translate('Disconnected') + this.tag("Status.Value").text.text = Language.translate('Loading...') this.tag("IPAddress.Value").text.text = `NA` this.tag("Gateway.Value").text.text = `NA` this.tag("MACAddress.Value").text.text = `NA` - await NetworkManager.GetPrimaryInterface().then((defaultInterface) => { - console.log("defaultinterface"+defaultInterface) - NetworkManager.GetIPSettings(defaultInterface).then((result) => { - if (result.interface === "wlan0") { - this.tag("ConnectionType.Value").text.text = Language.translate("Wireless") - this.tag("SSID").alpha = 1 - this.tag("SignalStrength").alpha = 1 - NetworkManager.GetConnectedSSID().then((result) => { - if (parseInt(result.strength) >= -50) { - this.tag("SignalStrength.Value").text.text = `Excellent` - } - else if (parseInt(result.strength) >= -60) { - this.tag("SignalStrength.Value").text.text = `Good` - } - else if (parseInt(result.strength) >= -67) { - this.tag("SignalStrength.Value").text.text = `Fair` - } - else { - this.tag("SignalStrength.Value").text.text = `Poor` - } - this.tag("SSID.Value").text.text = `${result.ssid}` - }).catch((error) => this.ERR("Error: " + JSON.stringify(error))); - } else if (result.interface === "eth0") { - this.tag("ConnectionType.Value").text.text = 'Ethernet' - this.tag("SSID").alpha = 0 - this.tag("SignalStrength").alpha = 0 - } - this.tag('InternetProtocol.Value').text.text = result.ipversion - this.tag('IPAddress.Value').text.text = result.ipaddress - this.tag("Gateway.Value").text.text = result.gateway - }).catch((err) => this.ERR("Error: " + JSON.stringify(err))) + this.tag('InternetProtocol.Value').text.text = 'NA' + this.tag('SSID.Value').text.text = 'NA' + this.tag('SignalStrength.Value').text.text = 'NA' + this.setConnectedRowsVisibility(false) - NetworkManager.GetAvailableInterfaces().then((interfaces) => { - const matchedInterface = interfaces.find((data) => data.name === defaultInterface) - if (!matchedInterface) { - this.ERR("Interface not found for: " + defaultInterface) - return - } - if (matchedInterface.connected) { - this.tag("Status.Value").text.text = Language.translate('Connected') - } - else { - this.tag('Status.Value').text.text = Language.translate('Disconnected') + try { + const defaultInterface = await NetworkManager.GetPrimaryInterface() + console.log("defaultinterface" + defaultInterface) + + const interfaces = await NetworkManager.GetAvailableInterfaces() + const matchedInterface = interfaces.find((data) => data.name === defaultInterface) + if (!matchedInterface || !matchedInterface.connected) { + this.tag('Status.Value').text.text = Language.translate('Disconnected') + return + } + + this.tag("Status.Value").text.text = Language.translate('Connected') + this.tag('MACAddress.Value').text.text = matchedInterface.mac + this.setConnectedRowsVisibility(true) + + const result = await NetworkManager.GetIPSettings(defaultInterface) + if (result.interface === "wlan0") { + this.tag("ConnectionType.Value").text.text = Language.translate("Wireless") + this.tag("SSID").alpha = 1 + this.tag("SignalStrength").alpha = 1 + try { + const connectedSsidResult = await NetworkManager.GetConnectedSSID() + if (parseInt(connectedSsidResult.strength) >= -50) { + this.tag("SignalStrength.Value").text.text = `Excellent` + } + else if (parseInt(connectedSsidResult.strength) >= -60) { + this.tag("SignalStrength.Value").text.text = `Good` + } + else if (parseInt(connectedSsidResult.strength) >= -67) { + this.tag("SignalStrength.Value").text.text = `Fair` + } + else { + this.tag("SignalStrength.Value").text.text = `Poor` + } + this.tag("SSID.Value").text.text = `${connectedSsidResult.ssid}` + } catch (error) { + this.ERR("Error: " + JSON.stringify(error)) } - this.tag('MACAddress.Value').text.text = matchedInterface.mac - }).catch((error) => this.ERR("Error: " + JSON.stringify(error))); - }).catch((error) => this.ERR("Error: " + JSON.stringify(error))); + } else if (result.interface === "eth0") { + this.tag("ConnectionType.Value").text.text = 'Ethernet' + this.tag("SSID").alpha = 0 + this.tag("SignalStrength").alpha = 0 + } + + this.tag('InternetProtocol.Value').text.text = result.ipversion + this.tag('IPAddress.Value').text.text = result.ipaddress + this.tag("Gateway.Value").text.text = result.gateway + } catch (error) { + this.ERR("Error: " + JSON.stringify(error)) + this.tag('Status.Value').text.text = Language.translate('Disconnected') + } } _focus() { @@ -363,12 +378,6 @@ export default class NetworkInfo extends Lightning.Component { } _unfocus() { - this.tag('SSID.Value').text.text = 'NA' - this.tag('SignalStrength.Value').text.text = 'NA' - this.tag('MACAddress.Value').text.text = 'NA' - this.tag('Gateway.Value').text.text = 'NA' - this.tag('IPAddress.Value').text.text = 'NA' - this.tag('ConnectionType.Value').text.text = 'NA' - this.tag('InternetProtocol.Value').text.text = 'NA' + this.setConnectedRowsVisibility(false) } -} \ No newline at end of file +} diff --git a/accelerator-home-ui/src/screens/OtherSettingsScreens/NetworkInterfaceScreen.js b/accelerator-home-ui/src/screens/OtherSettingsScreens/NetworkInterfaceScreen.js index eec59295..e84fed05 100644 --- a/accelerator-home-ui/src/screens/OtherSettingsScreens/NetworkInterfaceScreen.js +++ b/accelerator-home-ui/src/screens/OtherSettingsScreens/NetworkInterfaceScreen.js @@ -21,7 +21,6 @@ import SettingsMainItem from '../../items/SettingsMainItem' import { COLORS } from '../../colors/Colors' import { CONFIG } from '../../Config/Config' import { Language } from '@lightningjs/sdk'; -import { Metrics } from '@firebolt-js/sdk' import NetworkManager, { ETHERNET_STATUS } from '../../api/NetworkManagerAPI' export default class NetworkInterfaceScreen extends Lightning.Component { @@ -103,7 +102,7 @@ export default class NetworkInterfaceScreen extends Lightning.Component { } _active() { - this.onDefaultInterfaceChangedCB = NetworkManager.thunder.on(NetworkManager.callsign, 'onActiveInterfaceChange', (notification) => { + this.onActiveInterfaceChangeCB = NetworkManager.thunder.on(NetworkManager.callsign, 'onActiveInterfaceChange', (notification) => { this.LOG('onActiveInterfaceChange notification from networkInterfaceScreen: ' + JSON.stringify(notification)) if (notification.currentActiveInterface === "eth0") { this.loadingAnimation.stop() @@ -118,9 +117,8 @@ export default class NetworkInterfaceScreen extends Lightning.Component { this.tag('Ethernet.Loader').visible = false this.tag('Ethernet.Title').text.text = 'Ethernet : ' + Language.translate('Not Connected') } - Metrics.action("user", "The user changed the network interface", null) }); - this.onConnectionStatusChangedCB = NetworkManager.thunder.on(NetworkManager.callsign, 'onInterfaceStateChange', (notification) => { + this.onInterfaceStateChange = NetworkManager.thunder.on(NetworkManager.callsign, 'onInterfaceStateChange', (notification) => { this.LOG('onInterfaceStateChange notification from networkInterfaceScreen: ' + JSON.stringify(notification)) if (notification.interface === "eth0") { if (notification.status == ETHERNET_STATUS.DISCONNECTED) { @@ -131,7 +129,6 @@ export default class NetworkInterfaceScreen extends Lightning.Component { this.tag('Ethernet.Title').text.text = 'Ethernet: ' + Language.translate(notification.status.toLowerCase()) } } - Metrics.action("App", "network connection of app changed", null) }); this.loadingAnimation = this.tag('Ethernet.Loader').animation({ @@ -143,8 +140,8 @@ export default class NetworkInterfaceScreen extends Lightning.Component { } _inactive() { - this.onDefaultInterfaceChangedCB.dispose() - this.onConnectionStatusChangedCB.dispose() + if (this.onActiveInterfaceChangeCB) this.onActiveInterfaceChangeCB.dispose() + if (this.onInterfaceStateChange) this.onInterfaceStateChange.dispose() } _firstActive() { @@ -226,4 +223,4 @@ export default class NetworkInterfaceScreen extends Lightning.Component { }, ] } -} \ No newline at end of file +} diff --git a/accelerator-home-ui/src/screens/OtherSettingsScreens/PrivacyScreen.js b/accelerator-home-ui/src/screens/OtherSettingsScreens/PrivacyScreen.js index 4742ec1e..a1a2a269 100644 --- a/accelerator-home-ui/src/screens/OtherSettingsScreens/PrivacyScreen.js +++ b/accelerator-home-ui/src/screens/OtherSettingsScreens/PrivacyScreen.js @@ -17,13 +17,11 @@ * limitations under the License. **/ import AppApi from '../../api/AppApi' -import AlexaApi from '../../api/AlexaApi' -import { Lightning, Utils, Storage, Language, Router } from '@lightningjs/sdk' +import { Lightning, Utils, Language, Router } from '@lightningjs/sdk' import SettingsMainItem from '../../items/SettingsMainItem' import { COLORS } from '../../colors/Colors' import { CONFIG,GLOBALS } from '../../Config/Config' import XcastApi from '../../api/XcastApi' -import UsbApi from '../../api/UsbApi' import Warehouse from '../../api/WarehouseApis' /** @@ -83,33 +81,8 @@ export default class PrivacyScreen extends Lightning.Component { src: Utils.asset('images/settings/ToggleOffWhite.png'), }, }, - UsbMediaDevices: { - alpha:0.3, - y: 90, - type: SettingsMainItem, - Title: { - x: 10, - y: 45, - mountY: 0.5, - text: { - text: Language.translate('USB Media Devices'), - textColor: COLORS.titleColor, - fontFace: CONFIG.language.font, - fontSize: 25, - } - }, - Button: { - h: 45, - w: 67, - x: 1600, - mountX: 1, - y: 45, - mountY: 0.5, - src: Utils.asset('images/settings/ToggleOffWhite.png'), - }, - }, AudioInput: { - y: 180, + y: 90, type: SettingsMainItem, Title: { x: 10, @@ -133,7 +106,7 @@ export default class PrivacyScreen extends Lightning.Component { }, }, ClearCookies: { - y: 270, + y: 180, type: SettingsMainItem, Title: { x: 10, @@ -157,7 +130,7 @@ export default class PrivacyScreen extends Lightning.Component { }, }, PrivacyPolicy: { - y: 360, + y: 270, type: SettingsMainItem, Title: { x: 10, @@ -189,7 +162,6 @@ export default class PrivacyScreen extends Lightning.Component { _firstEnable() { this._setState('LocalDeviceDiscovery') this.checkLocalDeviceStatus() - this.USBApi = new UsbApi() this.AppApi = new AppApi() this.Warehouse= new Warehouse() } @@ -197,7 +169,6 @@ export default class PrivacyScreen extends Lightning.Component { _focus() { this._setState(this.state) this.checkLocalDeviceStatus() - // this.checkUSBDeviceStatus() } _handleBack() { @@ -206,17 +177,6 @@ export default class PrivacyScreen extends Lightning.Component { } } - checkUSBDeviceStatus() { - if (!Storage.get('UsbMedia')) { - this.tag('UsbMediaDevices.Button').src = Utils.asset('images/settings/ToggleOnOrange.png') - Storage.set('UsbMedia', 'ON') - } else if (Storage.get('UsbMedia') === 'ON') { - this.tag('UsbMediaDevices.Button').src = Utils.asset('images/settings/ToggleOnOrange.png') - } else if (Storage.get('UsbMedia') === 'OFF') { - this.tag('UsbMediaDevices.Button').src = Utils.asset('images/settings/ToggleOffWhite.png') - } - } - checkLocalDeviceStatus() { xcastApi.getEnabled().then(res => { if (res.enabled) { @@ -274,41 +234,6 @@ export default class PrivacyScreen extends Lightning.Component { this.toggleLocalDeviceDiscovery() } }, - class UsbMediaDevices extends this { - $enter() { - this.tag('UsbMediaDevices')._focus() - } - $exit() { - this.tag('UsbMediaDevices')._unfocus() - } - _handleUp() { - this._setState('LocalDeviceDiscovery') - } - _handleDown() { - this._setState('AudioInput') - } - _handleEnter() { - let _UsbMedia = Storage.get('UsbMedia') - if (_UsbMedia === 'ON') { - this.fireAncestors('$deRegisterUsbMount') - this.USBApi.deactivate().then((res) => { - Storage.set('UsbMedia', 'OFF') - this.tag('UsbMediaDevices.Button').src = Utils.asset('images/settings/ToggleOffWhite.png') - this.widgets.menu.refreshMainView() - }).catch(err => { - this.ERR("error while disabling the usb plugin = " + JSON.stringify(err)) - this.fireAncestors('$registerUsbMount') - }) - } else if (_UsbMedia === 'OFF') { - this.USBApi.activate().then(res => { - Storage.set('UsbMedia', 'ON') - this.tag('UsbMediaDevices.Button').src = Utils.asset('images/settings/ToggleOnOrange.png') - this.fireAncestors('$registerUsbMount') - this.widgets.menu.refreshMainView() - }) - } - } - }, class AudioInput extends this { $enter() { this.tag('AudioInput')._focus() @@ -353,32 +278,10 @@ export default class PrivacyScreen extends Lightning.Component { } setTimeout(async () => { - if(GLOBALS.AlexaAvsstatus){ - AlexaApi.get().resetAVSCredentials().then((result) => { - this.LOG("Triggering AVS credential reset." + JSON.stringify(result)) - if (result.success) { - AlexaApi.get().setAlexaAuthStatus("AlexaAuthPending"); - this.tag('ClearCookies.Title').text = Language.translate('Clear Cookies and App Data') + " - " + Language.translate('Finished') - setTimeout(() => { - this.tag('ClearCookies.Title').text = Language.translate('Clear Cookies and App Data') - this.tag('ClearCookies.Button').src = Utils.asset('images/settings/ToggleOffWhite.png') - cookieToggle = !cookieToggle - }, 2000) - } else { - //UNSUCCESSFULL API CALL - this.tag('ClearCookies.Title').text = Language.translate('Clear Cookies and App Data')+ " - " + Language.translate("Error!") - setTimeout(() => { - this.tag('ClearCookies.Title').text = Language.translate('Clear Cookies and App Data') - this.tag('ClearCookies.Button').src = Utils.asset('images/settings/ToggleOffWhite.png') - cookieToggle = !cookieToggle - }, 2000) - } - })} - else{ try { - await this.Warehouse.activate() - await this.Warehouse.lightReset()} - catch (err) { + await this.Warehouse.activate() + await this.Warehouse.lightReset() + } catch (err) { this.ERR("FactoryReset: warehouse plugin activation failed; feature may not work." + JSON.stringify(err)); } this.AppApi.clearCache() @@ -391,15 +294,15 @@ export default class PrivacyScreen extends Lightning.Component { }, 2000) }) .catch((err) => { - this.ERR("Error clearing cache: " + JSON.stringify(err)); - this.tag('ClearCookies.Title').text = Language.translate('Clear Cookies and App Data') + " - " + Language.translate("Error!") - setTimeout(() => { - this.tag('ClearCookies.Title').text = Language.translate('Clear Cookies and App Data') - this.tag('ClearCookies.Button').src = Utils.asset('images/settings/ToggleOffWhite.png') - cookieToggle = !cookieToggle - }, 2000) - }) - }}, 2000) + this.ERR("Error clearing cache: " + JSON.stringify(err)); + this.tag('ClearCookies.Title').text = Language.translate('Clear Cookies and App Data') + " - " + Language.translate("Error!") + setTimeout(() => { + this.tag('ClearCookies.Title').text = Language.translate('Clear Cookies and App Data') + this.tag('ClearCookies.Button').src = Utils.asset('images/settings/ToggleOffWhite.png') + cookieToggle = !cookieToggle + }, 2000) + }) + }, 2000) } }, class PrivacyPolicy extends this { diff --git a/accelerator-home-ui/src/screens/OtherSettingsScreens/TimeZone.js b/accelerator-home-ui/src/screens/OtherSettingsScreens/TimeZone.js index c5218e40..07b2673f 100644 --- a/accelerator-home-ui/src/screens/OtherSettingsScreens/TimeZone.js +++ b/accelerator-home-ui/src/screens/OtherSettingsScreens/TimeZone.js @@ -1,9 +1,7 @@ import { Lightning, Language, Router, Utils } from "@lightningjs/sdk"; import AppApi from "../../api/AppApi"; -import AlexaApi from "../../api/AlexaApi"; -import { CONFIG, GLOBALS } from "../../Config/Config"; +import { CONFIG } from "../../Config/Config"; import TimeZoneItem from "../../items/TimeZoneItem"; -import FireBoltApi from "../../api/firebolt/FireBoltApi"; export default class TimeZone extends Lightning.Component { @@ -89,11 +87,8 @@ export default class TimeZone extends Lightning.Component { this.appApi = new AppApi() this.resp = await this.appApi.fetchTimeZone() let data = [] - if ("ResidentApp" === GLOBALS.selfClientName) { - this.zone = await this.appApi.getZone() - }else { - this.zone = await FireBoltApi.get().localization.getTimeZone() - } + this.zone = await this.appApi.getZone() + try { this.LOG(JSON.stringify(this.resp) + " " + JSON.stringify(this.zone)) delete this.resp.Etc @@ -102,9 +97,6 @@ export default class TimeZone extends Lightning.Component { data.push([i, this.resp[i], this.zone !== undefined ? this.zone.split('/')[0] === i : false]) } } - if (AlexaApi.get().checkAlexaAuthStatus() === "AlexaHandleError" && this.zone.length) { - AlexaApi.get().updateDeviceTimeZoneInAlexa(this.zone) - } } catch (error) { this.ERR('no api present' + JSON.stringify(error)) } @@ -157,4 +149,4 @@ export default class TimeZone extends Lightning.Component { static _states() { return []; } -} \ No newline at end of file +} diff --git a/accelerator-home-ui/src/screens/RcInformationScreen.js b/accelerator-home-ui/src/screens/RcInformationScreen.js index 9ebd6528..3eb010a6 100644 --- a/accelerator-home-ui/src/screens/RcInformationScreen.js +++ b/accelerator-home-ui/src/screens/RcInformationScreen.js @@ -359,7 +359,6 @@ export default class RCInformationScreen extends Lightning.Component { this.tag('DeviceInfoContents').visible = false this.tag('PairingStatus').visible = false this.clearPairingAttemptTimeout() - await RCApi.get().activate().catch(err => { this.ERR("RCInformationScreen error: " + JSON.stringify(err)) }); this.onStatusCBhandle = _thunder.on('org.rdk.RemoteControl', 'onStatus', data => { this.onStatusCB(data) }); await RCApi.get().getNetStatus().then(result => { this.onStatusCB(result); diff --git a/accelerator-home-ui/src/screens/SettingsScreen.js b/accelerator-home-ui/src/screens/SettingsScreen.js index 34b766f1..3d134140 100644 --- a/accelerator-home-ui/src/screens/SettingsScreen.js +++ b/accelerator-home-ui/src/screens/SettingsScreen.js @@ -23,7 +23,6 @@ import SettingsMainItem from '../items/SettingsMainItem' import { CONFIG, GLOBALS } from '../Config/Config' import DTVApi from '../api/DTVApi'; import AppApi from '../api/AppApi'; -import { Metrics } from '@firebolt-js/sdk'; var thunder = ThunderJS(CONFIG.thunderConfig); @@ -458,7 +457,6 @@ export default class SettingsScreen extends Lightning.Component { self.LOG("Netflix : nfr disable updation results in " + JSON.stringify(nr)) }).catch(nerr => { self.ERR("Netflix : error while updating nfrstatus" + JSON.stringify(nerr)) - Metrics.error(Metrics.ErrorType.OTHER, 'PluginError', "Thunder Netflix.1 nfrstatus disabling error"+JSON.stringify(nerr), false, null) }) } @@ -471,7 +469,6 @@ export default class SettingsScreen extends Lightning.Component { }).catch(nerr => { self.ERR("Netflix : error while updating nfrstatus ") self.ERR(nerr) - Metrics.error(Metrics.ErrorType.OTHER, 'PluginError', "Thunder Netflix.1 nfrstatus enabling error"+JSON.stringify(nerr), false, null) }) } diff --git a/accelerator-home-ui/src/screens/SplashScreen.js b/accelerator-home-ui/src/screens/SplashScreen.js index e24b5494..cb40155d 100644 --- a/accelerator-home-ui/src/screens/SplashScreen.js +++ b/accelerator-home-ui/src/screens/SplashScreen.js @@ -499,9 +499,7 @@ export default class SplashScreen extends Lightning.Component { } _handleEnter() { if (this.tag('UISwitch.UIList').element._item.title != 'DEFAULT') { - this.appApi.launchResident(this.tag('UISwitch.UIList').element._item.uri, GLOBALS.selfClientName).catch(err => { - console.log(JSON.stringify(err)); - }) + // FIXME: Implement logic to switch (multiple)System UI here. } else { if (this.remotePaired == false) this._setState('AutoRemotePair') else if (this.hasInternet == false) this._setState('ConnectivityScreen') diff --git a/accelerator-home-ui/src/screens/SplashScreens/BluetoothScreen.js b/accelerator-home-ui/src/screens/SplashScreens/BluetoothScreen.js index 0e49e6a7..7cce66f5 100644 --- a/accelerator-home-ui/src/screens/SplashScreens/BluetoothScreen.js +++ b/accelerator-home-ui/src/screens/SplashScreens/BluetoothScreen.js @@ -298,13 +298,7 @@ export default class BluetoothScreen extends Lightning.Component { } } - async rcPairingFlow(activatePlugin = false) { - if (activatePlugin) { - await RCApi.get().activate().catch(err => { - this.ERR("SplashBluetoothScreen org.rdk.RemoteControl activate error: " + JSON.stringify(err)) - return; - }); - } + async rcPairingFlow() { this.rcStatusListener = _thunder.on('org.rdk.RemoteControl', 'onStatus', data => { this.onStatusCB(data) }); this.RCTimeout = Registry.setTimeout(() => { this.RCTimeout = null; @@ -368,12 +362,9 @@ export default class BluetoothScreen extends Lightning.Component { return; // Prevent duplicate setup } this.pairingInitialized = true; - appApi.getPluginStatus('org.rdk.RemoteControl').then(result => { - if (result[0].state != "activated") { - this.rcPairingFlow(true); - } else { - this.rcPairingFlow(); - } + appApi.getPluginStatus('org.rdk.RemoteControl').then(() => { + // Success means the plugin is available and activated by systemd target. + this.rcPairingFlow(); this.voiceRcuPluginUsed = true; }).catch(err => { this.ERR('SplashBluetoothScreen getPluginStatus org.rdk.RemoteControl error: ' + JSON.stringify(err)) diff --git a/accelerator-home-ui/src/screens/SplashScreens/NetworkScreen.js b/accelerator-home-ui/src/screens/SplashScreens/NetworkScreen.js index 6922462c..64227254 100644 --- a/accelerator-home-ui/src/screens/SplashScreens/NetworkScreen.js +++ b/accelerator-home-ui/src/screens/SplashScreens/NetworkScreen.js @@ -21,7 +21,6 @@ import { Lightning, Router, Storage, Language, Registry } from '@lightningjs/sdk import { COLORS } from '../../colors/Colors' import { CONFIG, GLOBALS } from '../../Config/Config' import SettingsMainItem from '../../items/SettingsMainItem' -import AlexaApi from '../../api/AlexaApi' import AppApi from '../../api/AppApi' import NetworkManager from '../../api/NetworkManagerAPI' @@ -212,7 +211,7 @@ export default class NetworkScreen extends Lightning.Component { } }) } - }); + }); } _handleDown() { this._setState('Skip') @@ -246,15 +245,9 @@ export default class NetworkScreen extends Lightning.Component { }) } _handleEnter() { - if (AlexaApi.get().checkAlexaAuthStatus() !== "AlexaUserDenied" && GLOBALS.AlexaAvsstatus) { - NetworkManager.IsConnectedToInternet().then(result => { - if (result.connected) - Registry.setTimeout(() => { - Router.navigate('AlexaLoginScreen') - }, (Router.isNavigating() ? 20 : 0)); - else - Registry.setTimeout(() => { Router.navigate('menu') }, (Router.isNavigating() ? 20 : 0)); - }) + if (false) { + // TODO: implement when voice integration is done + Router.navigate('AlexaLoginScreen') } else { Registry.setTimeout(() => { Router.navigate('menu') }, (Router.isNavigating() ? 20 : 0)); } diff --git a/accelerator-home-ui/src/screens/SuccessScreen.js b/accelerator-home-ui/src/screens/SuccessScreen.js index f182e593..c08d68c6 100644 --- a/accelerator-home-ui/src/screens/SuccessScreen.js +++ b/accelerator-home-ui/src/screens/SuccessScreen.js @@ -18,7 +18,6 @@ **/ import { Language, Lightning, Registry, Router, Utils } from '@lightningjs/sdk' import { CONFIG } from '../Config/Config' -import AlexaApi from '../api/AlexaApi.js'; export default class SuccessScreen extends Lightning.Component { static _template() { @@ -142,7 +141,6 @@ export default class SuccessScreen extends Lightning.Component { this.tag("DoneButton") } _handleEnter() { - AlexaApi.get().enableSmartScreen() Registry.setTimeout(() => { Router.navigate('menu') }, (Router.isNavigating() ? 20 : 0)); diff --git a/accelerator-home-ui/src/screens/UsbAppsScreen.js b/accelerator-home-ui/src/screens/UsbAppsScreen.js index 4a5d9e36..2c9b17e0 100644 --- a/accelerator-home-ui/src/screens/UsbAppsScreen.js +++ b/accelerator-home-ui/src/screens/UsbAppsScreen.js @@ -17,7 +17,6 @@ * limitations under the License. **/ import { Language, Lightning, Router } from "@lightningjs/sdk" -import UsbApi from '../api/UsbApi' import { CONFIG } from '../Config/Config.js' import { imageListInfo } from '../../static/data/ImageListInfo' import { musicListInfo } from '../../static/data/MusicListInfo' @@ -26,10 +25,7 @@ import { UsbInnerFolderListInfo } from "../../static/data/UsbInnerFolderListInfo import UsbListItem from '../items/UsbListItem.js' import LightningPlayerControls from "../MediaPlayer/LightningPlayerControl" -var usbApi = new UsbApi(); - export default class UsbAppsScreen extends Lightning.Component { - constructor(...args) { super(...args); this.INFO = console.info; @@ -237,12 +233,7 @@ export default class UsbAppsScreen extends Lightning.Component { let clone = [...this.cwd] clone.pop(); let cwdname = clone.join("/"); - usbApi.cd(cwdname).then(() => { - this.cwd.pop(); - this.loadData(); - }).catch(err => { - this.ERR("error while getting the usb contents; error = " + JSON.stringify(err)); - }); + // TODO: Integrate when USB drive support is available. } else { Router.navigate('menu'); } @@ -430,24 +421,9 @@ export default class UsbAppsScreen extends Lightning.Component { _handleEnter() { //do something after folder click. let dname = this.cwd.join("/") + "/" + this.tag('Row4').element.data.displayName; - usbApi.cd(dname).then(() => { - - this.cwd.push(this.tag('Row4').element.data.displayName); - // console.log(`loading the data from the directory ${this.cwd} - - // and its data = music:${JSON.stringify(musicListInfo)} - - // Pictures : ${JSON.stringify(imageListInfo)} - - // videos : ${JSON.stringify(videoListInfo)} - - // folders : ${JSON.stringify(UsbInnerFolderListInfo)} - - // `); - this.loadData(); - }).catch(err => { - this.ERR("error while getting the usb contents; error = " + JSON.stringify(err)); - }); + // TODO: Integrate when USB drive support is available. + this.cwd.push(this.tag('Row4').element.data.displayName); + this.loadData(); } @@ -628,13 +604,7 @@ export default class UsbAppsScreen extends Lightning.Component { if (this.thisDir) { if (this.thisDir.length > 0) { this.cwd = [...this.thisDir]; - let dname = this.cwd.join("/") - usbApi.cd(dname).then(() => { - this.loadData(); - this._setState(this.traversableRows[this.index] + `.${this.currentIndex}`)//focus on first element - }).catch(err => { - this.ERR("error while getting the usb contents; error = " + JSON.stringify(err)); - }); + // TODO: Integrate when USB drive support is available. } } else { this.index = 0; diff --git a/accelerator-home-ui/src/screens/VideoAndAudioScreens/ResolutionScreen.js b/accelerator-home-ui/src/screens/VideoAndAudioScreens/ResolutionScreen.js index 972a7f17..5869ac5c 100644 --- a/accelerator-home-ui/src/screens/VideoAndAudioScreens/ResolutionScreen.js +++ b/accelerator-home-ui/src/screens/VideoAndAudioScreens/ResolutionScreen.js @@ -20,8 +20,7 @@ import { Lightning, Router, Utils, Storage, Language, Settings } from '@lightnin import VideoAndAudioItem from '../../items/VideoAndAudioItem' import AppApi from '../../api/AppApi' import thunderJS from 'ThunderJS'; -import { CONFIG, GLOBALS } from '../../Config/Config'; -import FireBoltApi from '../../api/firebolt/FireBoltApi'; +import { CONFIG } from '../../Config/Config'; const thunder = thunderJS(CONFIG.thunderConfig) diff --git a/accelerator-home-ui/src/screens/VideoAndAudioScreens/VideoScreen.js b/accelerator-home-ui/src/screens/VideoAndAudioScreens/VideoScreen.js index d10164bc..2e74817e 100644 --- a/accelerator-home-ui/src/screens/VideoAndAudioScreens/VideoScreen.js +++ b/accelerator-home-ui/src/screens/VideoAndAudioScreens/VideoScreen.js @@ -21,7 +21,6 @@ import SettingsMainItem from '../../items/SettingsMainItem' import { COLORS } from '../../colors/Colors' import { CONFIG, GLOBALS } from '../../Config/Config' import AppApi from '../../api/AppApi' -import FireBoltApi from '../../api/firebolt/FireBoltApi' /** * Class for Video screen. @@ -193,44 +192,17 @@ export default class VideoScreen extends Lightning.Component { } _focus() { - if ("FireboltMainApp-refui" === GLOBALS.selfclientAppName) - { - FireBoltApi.get().deviceinfo.getscreenresolution().then(resolution =>{ - this.tag("Resolution.Title").text.text = Language.translate('Resolution: ') + `${JSON.stringify(resolution[0])} , ${JSON.stringify(resolution[1])}`; - }) - FireBoltApi.get().deviceinfo.gethdcp().then(res=>{ - let hdcp ="" - for (let key in res) - { - hdcp += `\t\t${key} : ${res[key]} ` - hdcp += "," - } - this.tag("HDCP.Title").text.text = `${Language.translate('HDCP Status: ')} ${hdcp.substring(0, hdcp.length -1)}` - }) - FireBoltApi.get().deviceinfo.gethdr().then(res=>{ - let hdr ="" - for (let key in res) - { - hdr += `\t\t${key} : ${res[key]}` - hdr += "," - } - this.tag("HDR.Title").text.text = `${Language.translate('High Dynamic Range: ')}${hdr.substring(0,hdr.length -1 )}` - }) - - } - else{ - this._appApi.getResolution().then(resolution => { - this.tag("Resolution.Title").text.text = Language.translate('Resolution: ') + resolution; - }).catch(err => { - this.ERR("Error fetching the Resolution: " + JSON.stringify(err)) - }) + this._appApi.getResolution().then(resolution => { + this.tag("Resolution.Title").text.text = Language.translate('Resolution: ') + resolution; + }).catch(err => { + this.ERR("Error fetching the Resolution: " + JSON.stringify(err)) + }) this._appApi.getHDCPStatus().then(result => { if (result.isHDCPCompliant && result.isHDCPEnabled) { this.tag("HDCP.Title").text.text = `${Language.translate('HDCP Status: ')}${Language.translate('Enabled')}, Version: ${result.currentHDCPVersion}`; } else { this.tag("HDCP.Title").text.text = `${Language.translate('HDCP Status: ')}${Language.translate('Not Supported')}`; } - }) this._appApi.getHDRSetting().then(result => { @@ -244,7 +216,6 @@ export default class VideoScreen extends Lightning.Component { } this.tag("HDR.Title").text.text = Language.translate('High Dynamic Range: ') + availableHDROptions[result]; }) - } this._setState(this.state) } @@ -332,7 +303,7 @@ export default class VideoScreen extends Lightning.Component { this._setState('OutputFormat') } _handleDown() { - // this._setState('HDCP') + // this._setState('HDCP') } _handleEnter() { // diff --git a/accelerator-home-ui/src/screens/WifiScreen.js b/accelerator-home-ui/src/screens/WifiScreen.js index 24776660..a64cde0d 100644 --- a/accelerator-home-ui/src/screens/WifiScreen.js +++ b/accelerator-home-ui/src/screens/WifiScreen.js @@ -149,7 +149,7 @@ export default class WiFiScreen extends Lightning.Component { await NetworkManager.GetInterfaceState("wlan0").then(enabled => { this.wifiStatus = enabled }); - this.onInterfaceStatusChangedCB = null + this.onInterfaceStatusChangeCB = null this.wifiEventHandlers(); } @@ -192,8 +192,8 @@ export default class WiFiScreen extends Lightning.Component { this.tag('Switch.Loader').visible = false } }); - if (this.onInterfaceStatusChangedCB) { - this.onInterfaceStatusChangedCB.dispose() + if (this.onInterfaceStatusChangeCB) { + this.onInterfaceStatusChangeCB.dispose() } } @@ -455,9 +455,9 @@ export default class WiFiScreen extends Lightning.Component { this.LOG('Enabling Wi-Fi.') await NetworkManager.GetInterfaceState("wlan0").then(ifaceStatus => { if (!ifaceStatus) { - this.onInterfaceStatusChangedCB = NetworkManager.thunder.on(NetworkManager.callsign, 'onInterfaceStatusChange', ifaceStatus => { + this.onInterfaceStatusChangeCB = NetworkManager.thunder.on(NetworkManager.callsign, 'onInterfaceStatusChange', ifaceStatus => { if ((ifaceStatus.interface === "wlan0") && ifaceStatus.enabled) { - this.onInterfaceStatusChangedCB.dispose(); + this.onInterfaceStatusChangeCB.dispose(); this.wifiStatus = true this.tag('Networks').visible = true this.tag('JoinAnotherNetwork').visible = true diff --git a/accelerator-home-ui/src/tvOverlay/TvOverlayScreen.js b/accelerator-home-ui/src/tvOverlay/TvOverlayScreen.js index bc591956..fd243f04 100644 --- a/accelerator-home-ui/src/tvOverlay/TvOverlayScreen.js +++ b/accelerator-home-ui/src/tvOverlay/TvOverlayScreen.js @@ -17,16 +17,11 @@ * limitations under the License. **/ -import { Lightning, Storage, Router, Registry } from "@lightningjs/sdk"; +import { Lightning, Router, Registry } from "@lightningjs/sdk"; import AppApi from "../api/AppApi"; -import RDKShellApis from "../api/RDKShellApis"; -import ThunderJS from "ThunderJS"; import TvOverlaySettingsScreen from "./components/TvOverlaySettingsScreen"; import TvOverlayInputScreen from "./components/TvOverlayInputScreen"; -import { CONFIG, GLOBALS } from '../Config/Config'; -import { Metrics } from "@firebolt-js/sdk"; - -var thunder = ThunderJS(CONFIG.thunderConfig); +import { GLOBALS } from '../Config/Config'; export default class TvOverlayScreen extends Lightning.Component { constructor(...args) { @@ -112,13 +107,8 @@ export default class TvOverlayScreen extends Lightning.Component { this.LOG("currentApp: " + JSON.stringify(GLOBALS.topmostApp)); setTimeout(() => { if (GLOBALS.topmostApp !== GLOBALS.selfClientName) { - RDKShellApis.setVisibility(GLOBALS.selfClientName, false); - RDKShellApis.moveToFront(GLOBALS.topmostApp).then(() => { - RDKShellApis.setFocus(GLOBALS.topmostApp).catch((err) => { - this.ERR("Error" + JSON.stringify(err)); - Metrics.error(Metrics.ErrorType.OTHER, 'pluginError', `Thunder RDKShell setfocus error ${JSON.stringify(err)}`, false, null) - }); - }); + // FIXME: use new AppManager APIs. + this.WARN("App : Are we missing any logic here when using AppManager APIs?"); } else { if (Router.getActiveHash() === "dtvplayer") { //don't navigate to menu if route is dtvplayer Router.focusPage(); diff --git a/accelerator-home-ui/src/views/AppInfoPage.js b/accelerator-home-ui/src/views/AppInfoPage.js index 5ed76dce..c1bddc96 100644 --- a/accelerator-home-ui/src/views/AppInfoPage.js +++ b/accelerator-home-ui/src/views/AppInfoPage.js @@ -34,7 +34,7 @@ export default class AppInfoPage extends Lightning.Component { h: 1080, w: 1920, color: CONFIG.theme.background, - + Header: { x: 200, y: 120, @@ -59,16 +59,16 @@ export default class AppInfoPage extends Lightning.Component { }, ListContainer: { - x: 200, + x: 200, y: 280, - w: 1680, + w: 1680, h: 680, clipping: true, AppList: { - x: 20, + x: 20, type: List, direction: 'column', - w: 1640, + w: 1640, h: 680, scroll: { after: 4 @@ -236,7 +236,7 @@ export default class AppInfoPage extends Lightning.Component { try { const installedApps = filterExcludedApps(await getInstalledDACApps()); console.log('Installed DAC Apps:', JSON.stringify(installedApps)); - + // Transform the data to match AppCard expected format const appData = installedApps.map(app => ({ id: app.id, @@ -246,7 +246,7 @@ export default class AppInfoPage extends Lightning.Component { installed: app.installed, hasUpdate: false // Can be updated based on app catalog comparison if needed })); - + this._loadAppData(appData); } catch (error) { console.error('Error fetching installed apps:', error); @@ -429,7 +429,7 @@ export default class AppInfoPage extends Lightning.Component { _updateScrollIndicator() { const totalItems = this._appData.length; const currentIndex = this._appList.index || 0; - + if (totalItems > 0) { const trackHeight = 680; const thumbHeight = Math.max(50, trackHeight / totalItems); @@ -487,7 +487,7 @@ export default class AppInfoPage extends Lightning.Component { _getFocused() { return this.tag('AppList'); } - + _handleUp() { if (this.tag('AppList').index === 0) { this.widgets.menu.notify('TopPanel'); diff --git a/accelerator-home-ui/src/views/MainView.js b/accelerator-home-ui/src/views/MainView.js index 80751843..cb4468a7 100644 --- a/accelerator-home-ui/src/views/MainView.js +++ b/accelerator-home-ui/src/views/MainView.js @@ -21,8 +21,6 @@ import ListItem from '../items/ListItem.js' import DacAppItem from '../items/DacAppItem.js' import ThunderJS from 'ThunderJS' import AppApi from '../api/AppApi.js' -import RDKShellApis from '../api/RDKShellApis.js' -import UsbApi from '../api/UsbApi.js' import { CONFIG, GLOBALS } from '../Config/Config.js' import XcastApi from '../api/XcastApi' import HomeApi from '../api/HomeApi.js' @@ -282,7 +280,6 @@ export default class MainView extends Lightning.Component { this.settingsScreen = false this.myAppsEmpty = true // Will be updated when appItems is set this.indexVal = 0 - this.usbApi = new UsbApi(); this.homeApi = new HomeApi(); this.xcastApi = new XcastApi(); this.hdmiApi = new HDMIApi() @@ -297,8 +294,6 @@ export default class MainView extends Lightning.Component { // Start loading animation this._showDacAppsLoader() - // for initially showing/hiding usb icon - let appItems = [] try { appItems = await this._buildInstalledAppsList() @@ -326,7 +321,6 @@ export default class MainView extends Lightning.Component { let prop_apptype = 'applicationType' let appdetails = [] let appdetails_format = [] - let usbAppsArr = []; try { if (data != null && Object.prototype.hasOwnProperty.call(JSON.parse(data), prop_apps)) { appdetails = JSON.parse(data).applications @@ -336,12 +330,9 @@ export default class MainView extends Lightning.Component { Object.prototype.hasOwnProperty.call(appdetails[i], prop_uri) && Object.prototype.hasOwnProperty.call(appdetails[i], prop_apptype) ) { - usbAppsArr.push(appdetails[i]) + appdetails_format.push(appdetails[i]) } } - for (let i = 0; i < usbAppsArr.length; i++) { - appdetails_format.push(usbAppsArr[i]) - } for (let i = 0; i < appItems.length; i++) { appdetails_format.push(appItems[i]) } @@ -353,11 +344,8 @@ export default class MainView extends Lightning.Component { appdetails_format = appItems this.LOG('Query data is not proper: ' + JSON.stringify(e)) } - this.firstRowItems = appdetails_format + this.firstRowItems = appdetails_format.filter(item => item.uri !== 'USB') this.tempRow = JSON.parse(JSON.stringify(this.firstRowItems)); - if (this.firstRowItems.length > 0 && this.firstRowItems[0].uri === 'USB') { - this.tempRow.shift() - } this.appItems = this.tempRow this.hdmiApi.activate() @@ -374,7 +362,7 @@ export default class MainView extends Lightning.Component { this.fireAncestors("$hideImage", 0); this.LOG('onSignalChanged ' + JSON.stringify(notification)) if (notification.signalStatus !== 'stableSignal') { - RDKShellApis.setVisibility(GLOBALS.selfClientName, true) + // FIXME: make the visibility change when graphics overlay is implemented for input select. this.widgets.fail.notify({ title: this.tag('Inputs.Slider').items[this.tag('Inputs.Slider').index].data.displayName, msg: Language.translate("Input disconnected") }) Router.focusWidget('Fail') } @@ -399,43 +387,6 @@ export default class MainView extends Lightning.Component { }) //get the available input methods from the api - - // for USB event - const registerListener = () => { - let listener; - - listener = thunder.on('org.rdk.UsbAccess', 'onUSBMountChanged', (notification) => { - this.LOG('onUsbMountChanged notification: ' + JSON.stringify(notification)) - Storage.set('UsbMountedStatus', notification.mounted ? 'mounted' : 'unmounted') - const currentPage = window.location.href.split('#').slice(-1)[0] - if (Storage.get('UsbMedia') === 'ON') { - - if (notification.mounted) { - this.appItems = this.firstRowItems - this._setState('AppList.0') - } else if (!notification.mounted) { - this.appItems = this.tempRow - this._setState('AppList.0') - } - this.LOG('app items = ' + JSON.stringify(this.appItems)); - - if (currentPage === 'menu') { //refresh page to hide or show usb icon - this.LOG('page refreshed on unplug/plug') - - } - - if (!notification.mounted) { //if mounted is false - if (currentPage === 'usb' || currentPage === 'usb/image' || currentPage === 'usb/player') { // hot exit if we are on usb screen or sub screens - // this.$changeHomeText('Home') - Router.navigate('menu'); - } - } - } - this.LOG('usb event successfully registered'); - }) - - return listener; - } this._onInternetStatusChangeCB = NetworkManager.thunder.on('org.rdk.NetworkManager', 'onInternetStatusChange', notification => { this.LOG('on InternetStatus Change' + JSON.stringify(notification)) if (notification.status === "FULLY_CONNECTED") { @@ -474,8 +425,6 @@ export default class MainView extends Lightning.Component { this.dacApps = dacCatalog - this.fireAncestors("$mountEventConstructor", registerListener.bind(this)) - this.refreshFirstRow() // this._setState('AppList.0') } @@ -493,24 +442,6 @@ export default class MainView extends Lightning.Component { } _firstActive() { - if (!Storage.get('UsbMedia')) { - this.usbApi.activate().then(() => { - Storage.set('UsbMedia', 'ON') - this.fireAncestors('$registerUsbMount') - }) - } else if (Storage.get('UsbMedia') === 'ON') { - this.usbApi.activate().then(() => { - this.fireAncestors('$registerUsbMount') - }) - } else if (Storage.get('UsbMedia') === 'OFF') { - // deactivate usb Plugin here - this.usbApi.deactivate().then(() => { - this.LOG(`disabled the Usb Plugin`); - }).catch(err => { - this.ERR(`error while disabling the usb plugin = ${err}`) - }) - } - if (this.gracenote) { this._setState("Gracenote") } else if (this.inputSelect) { @@ -559,30 +490,7 @@ export default class MainView extends Lightning.Component { } } refreshFirstRow() { - if (Storage.get('UsbMedia') === 'ON') { - this.usbApi.activate().then(() => { - this.usbApi.getMountedDevices().then(result => { - if (result.mounted.length === 1) { - this.appItems = this.firstRowItems - } else { - this.appItems = this.tempRow - } - }) - }) - } else if (Storage.get('UsbMedia') === 'OFF') { - this.appItems = this.tempRow - } else { - Storage.set('UsbMedia', 'ON') - this.usbApi.activate().then(() => { - this.usbApi.getMountedDevices().then(result => { - if (result.mounted.length === 1) { - this.appItems = this.firstRowItems - } else { - this.appItems = this.tempRow - } - }) - }) - } + this.appItems = this.tempRow } /** @@ -630,14 +538,14 @@ export default class MainView extends Lightning.Component { const safeItems = Array.isArray(items) ? items : [] this.currentItems = safeItems this.myAppsEmpty = safeItems.length === 0 - + // Hide My Apps row if empty this.tag('Text1').visible = !this.myAppsEmpty this.tag('AppList').visible = !this.myAppsEmpty - + // Update row positions based on My Apps visibility this._updateRowPositions() - + this.tag('AppList').items = safeItems.map((info, idx) => { return { w: 325, @@ -740,7 +648,7 @@ export default class MainView extends Lightning.Component { set dacApps(items) { // Hide loader and show content this._hideDacAppsLoader() - + this.tag('DacApps').items = items.map((info, index) => { return { w: 325, @@ -924,7 +832,7 @@ export default class MainView extends Lightning.Component { GLOBALS.topmostApp = 'HDMI'; const currentInput = this.tag('Inputs.Slider').items[this.tag('Inputs.Slider').index].data Storage.set("_currentInputMode", { id: currentInput.id, locator: currentInput.locator }); - RDKShellApis.setVisibility(GLOBALS.selfClientName, false) + // FIXME: make the visibility change when graphics overlay is implemented for input select. }) .catch(err => { this.ERR('failed' + JSON.stringify(err)) @@ -992,13 +900,7 @@ export default class MainView extends Lightning.Component { let applicationType = appData.applicationType; let uri = appData.uri; let appIdentifier = appData.appIdentifier; - if (uri === 'USB') { - this.usbApi.getMountedDevices().then(result => { - if (result.mounted.length === 1) { - Router.navigate('usb'); - } - }) - } else if (applicationType === 'DAC') { + if (applicationType === 'DAC') { // Launch DAC app using startDACApp if (!GLOBALS.IsConnectedToInternet) { console.log('No internet connection. Cannot launch DAC app.') diff --git a/accelerator-home-ui/src/views/TopPanel.js b/accelerator-home-ui/src/views/TopPanel.js index ed491694..614708c8 100644 --- a/accelerator-home-ui/src/views/TopPanel.js +++ b/accelerator-home-ui/src/views/TopPanel.js @@ -18,9 +18,8 @@ **/ import { Lightning, Utils, Router, Language, Registry } from '@lightningjs/sdk' import AppApi from '../api/AppApi' -import { CONFIG, GLOBALS } from '../Config/Config' +import { CONFIG } from '../Config/Config' import Keymap from '../Config/Keymap' -import FireBoltApi from '../api/firebolt/FireBoltApi' /** Class for top panel in home UI */ @@ -96,16 +95,9 @@ export default class TopPanel extends Lightning.Component { this.zone = null // declaring this variable to keep track of zone changes this.appApi = new AppApi() - if ("ResidentApp" === GLOBALS.selfClientName) { - this.appApi.getZone().then((res) => { - this.updateZone(res) - }) - }else { - FireBoltApi.get().localization.getTimeZone().then(timezone=>{ - this.updateZone(timezone) - }) - } - + this.appApi.getZone().then((res) => { + this.updateZone(res) + }).catch(err => console.warn('TopPanel.getZone failed:' + JSON.stringify(err))) this.zone = Intl.DateTimeFormat().resolvedOptions().timeZone; } diff --git a/accelerator-home-ui/static/moreChannels/ChannelData.json b/accelerator-home-ui/static/moreChannels/ChannelData.json index 4470d562..0a0d38ea 100644 --- a/accelerator-home-ui/static/moreChannels/ChannelData.json +++ b/accelerator-home-ui/static/moreChannels/ChannelData.json @@ -1,5 +1,5 @@ { - "readme": "This property is a comment for this JSON format and is functionality wise not necessary | serviceList is an array of channel objects | Each channel must have all four properties as mentioned in this sample | dvburi should start with a 'C_' (it can be any unique value following a 'C_' |dvburi of an app should be 'OTT' and that object should have a callsign(same rdkshell callsign for that particular app) property mentioned. | If the item is an app, Callsign is a requirement and url is optional depending on the app. | eventList is an object with all the custom dvburi s as keys and a list of shows in the channel as values | Schedule for an app is not currently supported, so event list only needs to contain program details of custom(iptv) channels | eventList needs to have the dvburi mapped to an array of program objects(object containing details of the particular program/show) | the format of the program object is similar to the data provided by scheduleEvents method in DTV Plugin .", + "readme": "This property is a comment for this JSON format and is functionality wise not necessary | serviceList is an array of channel objects | Each channel must have all four properties as mentioned in this sample | dvburi should start with a 'C_' (it can be any unique value following a 'C_' |dvburi of an app should be 'OTT' and that object should have a callsign(same app callsign for that particular app) property mentioned. | If the item is an app, Callsign is a requirement and url is optional depending on the app. | eventList is an object with all the custom dvburi s as keys and a list of shows in the channel as values | Schedule for an app is not currently supported, so event list only needs to contain program details of custom(iptv) channels | eventList needs to have the dvburi mapped to an array of program objects(object containing details of the particular program/show) | the format of the program object is similar to the data provided by scheduleEvents method in DTV Plugin .", "serviceList": [ { "shortname": "Xumo", @@ -55,4 +55,4 @@ } ] } -} \ No newline at end of file +}