Revert "Revert "Rounded corners on app transitions""

This reverts commit 2c9b1043a6.

Reason for revert: Most test devices have the platform changes

Change-Id: I1e608395b186df3148562afa7c1d791e3c9e2eb5
This commit is contained in:
Winson Chung committed 2018-12-06 19:36:10 +00:00
1 parent 2c9b1043a6
commit c7565862e2
9 files changed
+73 -15

No files matched your search

@@ -45,6 +45,9 @@ import androidx.annotation.WorkerThread;
*/
@TargetApi(Build.VERSION_CODES.O)
public class RecentsModel extends TaskStackChangeListener {
private static final String TAG = "RecentsModel";
// We do not need any synchronization for this variable as its only written on UI thread.
public static final MainThreadInitializedObject<RecentsModel> INSTANCE =
new MainThreadInitializedObject<>(c -> new RecentsModel(c));
@@ -62,6 +65,9 @@ public class RecentsModel extends TaskStackChangeListener {
private final TaskIconCache mIconCache;
private final TaskThumbnailCache mThumbnailCache;
private float mWindowCornerRadius = -1;
private RecentsModel(Context context) {
mContext = context;
@@ -174,6 +180,26 @@ public class RecentsModel extends TaskStackChangeListener {
return mSystemUiProxy;
}
public float getWindowCornerRadius() {
// The window corner radius is expressed in pixels and won't change if the
// display density changes. It's safe to cache the value.
if (mWindowCornerRadius == -1) {
if (mSystemUiProxy != null) {
try {
mWindowCornerRadius = mSystemUiProxy.getWindowCornerRadius();
} catch (RemoteException e) {
Log.w(TAG, "Connection to ISystemUIProxy was lost, ignoring window corner "
+ "radius");
return 0;
}
} else {
Log.w(TAG, "ISystemUIProxy is null, ignoring window corner radius");
return 0;
}
}
return mWindowCornerRadius;
}
public void onTrimMemory(int level) {
if (level == ComponentCallbacks2.TRIM_MEMORY_UI_HIDDEN) {
mThumbnailCache.getHighResLoadingState().setVisible(false);