2 * Copyright (c) 2017 Samsung Electronics Co., Ltd
4 * Licensed under the Flora License, Version 1.1 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://floralicense.org/license/
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 using System.Collections.Generic;
20 namespace LibTVRefCommonPortable.Utils
23 /// A class provides App Control utility APIs.
25 public sealed class AppControlUtils
28 /// A method makes the package ID's app to be launched.
30 /// <param name="pkgID">A package ID of the targeted application.</param>
31 public static void SendLaunchRequest(string pkgID)
33 if (DependencyService.Get<IAppControl>() == null)
38 DependencyService.Get<IAppControl>().SendLaunchRequest(pkgID);
42 /// A method makes the package ID's app to be launched.
44 /// <param name="pkgID">A package ID of the targeted application.</param>
45 /// <param name="extraData">A extra data for App Control invoking.</param>
46 public static void SendLaunchRequest(string pkgID, IDictionary<string, string> extraData)
48 if (DependencyService.Get<IAppControl>() == null)
53 DependencyService.Get<IAppControl>().SendLaunchRequest(pkgID, extraData);
57 /// A method sends a add pin request App Control to TVApps app.
59 public static void SendAddAppRequestToApps()
61 if (DependencyService.Get<IAppControl>() == null)
66 DependencyService.Get<IAppControl>().SendAddAppRequestToApps();
70 /// A method sends a pin added notification App control to TVHome app.
72 /// <param name="addedAddID">A app ID of newly added.</param>
73 public static void SendAppAddedNotificationToHome(string addedAddID)
75 if (DependencyService.Get<IAppControl>() == null)
80 DependencyService.Get<IAppControl>().SendAppAddedNotificationToHome(addedAddID);
84 /// A method terminates caller application.
86 public static void SelfTerminate()
88 if (DependencyService.Get<IAppLifeControl>() == null)
93 DependencyService.Get<IAppLifeControl>().SelfTerminate();