From 40434c6b608a22ec0b8703754e9e1372a9fa4f97 Mon Sep 17 00:00:00 2001 From: Naomi Musgrave Date: Wed, 6 Apr 2022 12:35:17 +0100 Subject: "Revert "Temporarily exclude Launcher from sandboxing; to be reverted once"" This reverts commit 5824b897630b58453ee1098b70f08be2c2809a66. Reason for revert: Launcher has removed their dependency on Display#getRealSize Bug: 181219241 Test: atest FrameworksMockingCoreTests:android.view.DisplayTest Change-Id: I9bbf2b511a5b92eea6365bbd2a594238e01f1b36 Merged In: I9bbf2b511a5b92eea6365bbd2a594238e01f1b36 --- core/java/android/view/Display.java | 42 +------------------------------------ 1 file changed, 1 insertion(+), 41 deletions(-) diff --git a/core/java/android/view/Display.java b/core/java/android/view/Display.java index 0c4d9bf08583..f8a848ed8c25 100644 --- a/core/java/android/view/Display.java +++ b/core/java/android/view/Display.java @@ -26,11 +26,9 @@ import android.annotation.Nullable; import android.annotation.RequiresPermission; import android.annotation.SuppressLint; import android.annotation.TestApi; -import android.app.ActivityThread; import android.app.KeyguardManager; import android.app.WindowConfiguration; import android.compat.annotation.UnsupportedAppUsage; -import android.content.ComponentName; import android.content.res.CompatibilityInfo; import android.content.res.Configuration; import android.content.res.Resources; @@ -52,14 +50,11 @@ import android.util.ArraySet; import android.util.DisplayMetrics; import android.util.Log; -import com.android.internal.R; - import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import java.util.Optional; /** * Provides information about the size and density of a logical display. @@ -115,12 +110,6 @@ public final class Display { private int mCachedAppWidthCompat; private int mCachedAppHeightCompat; - /** - * Cache if the application is the recents component. - * TODO(b/179308296) Remove once Launcher addresses issue - */ - private Optional mIsRecentsComponent = Optional.empty(); - /** * The default Display id, which is the id of the primary display assuming there is one. */ @@ -1584,36 +1573,7 @@ public final class Display { return false; } final Configuration config = mResources.getConfiguration(); - // TODO(b/179308296) Temporarily exclude Launcher from being given max bounds, by checking - // if the caller is the recents component. - return config != null && !config.windowConfiguration.getMaxBounds().isEmpty() - && !isRecentsComponent(); - } - - /** - * Returns {@code true} when the calling package is the recents component. - * TODO(b/179308296) Remove once Launcher addresses issue - */ - boolean isRecentsComponent() { - if (mIsRecentsComponent.isPresent()) { - return mIsRecentsComponent.get(); - } - if (mResources == null) { - return false; - } - try { - String recentsComponent = mResources.getString(R.string.config_recentsComponentName); - if (recentsComponent == null) { - return false; - } - String recentsPackage = ComponentName.unflattenFromString(recentsComponent) - .getPackageName(); - mIsRecentsComponent = Optional.of(recentsPackage != null - && recentsPackage.equals(ActivityThread.currentPackageName())); - return mIsRecentsComponent.get(); - } catch (Resources.NotFoundException e) { - return false; - } + return config != null && !config.windowConfiguration.getMaxBounds().isEmpty(); } /** -- cgit v1.2.3-59-g8ed1b