From 1365db5de2fbb88ea572cb28745a71ed81a4fd66 Mon Sep 17 00:00:00 2001 From: "Restyled.io" Date: Tue, 9 Jul 2024 07:07:39 +0000 Subject: [PATCH] Restyled by google-java-format --- .../ContentAppEndpointManagerImpl.java | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/examples/tv-app/android/App/platform-app/src/main/java/com/matter/tv/server/handlers/ContentAppEndpointManagerImpl.java b/examples/tv-app/android/App/platform-app/src/main/java/com/matter/tv/server/handlers/ContentAppEndpointManagerImpl.java index 86576921c3d529..85fe7367944c74 100644 --- a/examples/tv-app/android/App/platform-app/src/main/java/com/matter/tv/server/handlers/ContentAppEndpointManagerImpl.java +++ b/examples/tv-app/android/App/platform-app/src/main/java/com/matter/tv/server/handlers/ContentAppEndpointManagerImpl.java @@ -23,10 +23,10 @@ public ContentAppEndpointManagerImpl(Context context) { } private boolean isForegroundCommand(long clusterId, long commandId) { - switch ((int)clusterId) { + switch ((int) clusterId) { case Clusters.ContentLauncher.Id: - return commandId == Clusters.ContentLauncher.Commands.LaunchContent.ID || - commandId == Clusters.ContentLauncher.Commands.LaunchURL.ID; + return commandId == Clusters.ContentLauncher.Commands.LaunchContent.ID + || commandId == Clusters.ContentLauncher.Commands.LaunchURL.ID; case Clusters.TargetNavigator.Id: return commandId == Clusters.TargetNavigator.Commands.NavigateTarget.ID; default: @@ -35,14 +35,15 @@ private boolean isForegroundCommand(long clusterId, long commandId) { } private boolean isAppInForeground(String contentAppPackageName) { - ActivityManager activityManager = - (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE); - List tasks = activityManager.getRunningTasks(1); - if (tasks != null && !tasks.isEmpty()) { - ActivityManager.RunningTaskInfo taskInfo = tasks.get(0); - String packageName = taskInfo.topActivity != null ? taskInfo.topActivity.getPackageName() : ""; - return packageName.equals(contentAppPackageName); - } + ActivityManager activityManager = + (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE); + List tasks = activityManager.getRunningTasks(1); + if (tasks != null && !tasks.isEmpty()) { + ActivityManager.RunningTaskInfo taskInfo = tasks.get(0); + String packageName = + taskInfo.topActivity != null ? taskInfo.topActivity.getPackageName() : ""; + return packageName.equals(contentAppPackageName); + } return false; }