Loading core/java/android/view/IWindowManager.aidl +3 −0 Original line number Original line Diff line number Diff line Loading @@ -149,6 +149,9 @@ interface IWindowManager void stopAppFreezingScreen(IBinder token, boolean force); void stopAppFreezingScreen(IBinder token, boolean force); void removeAppToken(IBinder token); void removeAppToken(IBinder token); /** Used by system ui to report that recents has shown itself. */ void endProlongedAnimations(); // Re-evaluate the current orientation from the caller's state. // Re-evaluate the current orientation from the caller's state. // If there is a change, the new Configuration is returned and the // If there is a change, the new Configuration is returned and the // caller must call setNewConfiguration() sometime later. // caller must call setNewConfiguration() sometime later. Loading core/java/android/view/WindowManagerPolicy.java +1 −1 Original line number Original line Diff line number Diff line Loading @@ -335,7 +335,7 @@ public interface WindowManagerPolicy { * Return true if this window (or a window it is attached to, but not * Return true if this window (or a window it is attached to, but not * considering its app token) is currently animating. * considering its app token) is currently animating. */ */ public boolean isAnimatingLw(); boolean isAnimatingLw(); /** /** * Is this window considered to be gone for purposes of layout? * Is this window considered to be gone for purposes of layout? Loading packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java +21 −3 Original line number Original line Diff line number Diff line Loading @@ -35,6 +35,8 @@ import android.provider.Settings; import android.view.KeyEvent; import android.view.KeyEvent; import android.view.View; import android.view.View; import android.view.ViewStub; import android.view.ViewStub; import android.view.ViewTreeObserver; import com.android.internal.logging.MetricsLogger; import com.android.internal.logging.MetricsLogger; import com.android.systemui.R; import com.android.systemui.R; import com.android.systemui.recents.events.EventBus; import com.android.systemui.recents.events.EventBus; Loading Loading @@ -73,7 +75,8 @@ import java.util.ArrayList; /** /** * The main Recents activity that is started from AlternateRecentsComponent. * The main Recents activity that is started from AlternateRecentsComponent. */ */ public class RecentsActivity extends Activity implements RecentsView.RecentsViewCallbacks { public class RecentsActivity extends Activity implements RecentsView.RecentsViewCallbacks, ViewTreeObserver.OnPreDrawListener { private final static String TAG = "RecentsActivity"; private final static String TAG = "RecentsActivity"; private final static boolean DEBUG = false; private final static boolean DEBUG = false; Loading Loading @@ -425,7 +428,7 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView final RecentsActivityLaunchState state = Recents.getConfiguration().getLaunchState(); final RecentsActivityLaunchState state = Recents.getConfiguration().getLaunchState(); if (state.startHidden) { if (state.startHidden) { state.startHidden = false; state.startHidden = false; mRecentsView.setVisibility(View.INVISIBLE); mRecentsView.setStackViewVisibility(View.INVISIBLE); } } } } Loading Loading @@ -666,7 +669,8 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView } } public final void onBusEvent(EnterRecentsWindowLastAnimationFrameEvent event) { public final void onBusEvent(EnterRecentsWindowLastAnimationFrameEvent event) { mRecentsView.setVisibility(View.VISIBLE); mRecentsView.setStackViewVisibility(View.VISIBLE); mRecentsView.getViewTreeObserver().addOnPreDrawListener(this); } } public final void onBusEvent(AppWidgetProviderChangedEvent event) { public final void onBusEvent(AppWidgetProviderChangedEvent event) { Loading Loading @@ -733,4 +737,18 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView mRecentsView.setSearchBar(null); mRecentsView.setSearchBar(null); } } } } @Override public boolean onPreDraw() { mRecentsView.getViewTreeObserver().removeOnPreDrawListener(this); // We post to make sure that this information is delivered after this traversals is // finished. mRecentsView.post(new Runnable() { @Override public void run() { Recents.getSystemServices().endProlongedAnimations(); } }); return true; } } } packages/SystemUI/src/com/android/systemui/recents/misc/SystemServicesProxy.java +11 −0 Original line number Original line Diff line number Diff line Loading @@ -787,4 +787,15 @@ public class SystemServicesProxy { e.printStackTrace(); e.printStackTrace(); } } } } public void endProlongedAnimations() { if (mWm == null) { return; } try { WindowManagerGlobal.getWindowManagerService().endProlongedAnimations(); } catch (Exception e) { e.printStackTrace(); } } } } packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java +10 −0 Original line number Original line Diff line number Diff line Loading @@ -75,6 +75,7 @@ public class RecentsView extends FrameLayout implements TaskStackView.TaskStackV private static final boolean DEBUG = false; private static final boolean DEBUG = false; private static final boolean ADD_HEADER_BITMAP = true; private static final boolean ADD_HEADER_BITMAP = true; private int mStackViewVisibility = View.VISIBLE; /** The RecentsView callbacks */ /** The RecentsView callbacks */ public interface RecentsViewCallbacks { public interface RecentsViewCallbacks { Loading Loading @@ -151,6 +152,7 @@ public class RecentsView extends FrameLayout implements TaskStackView.TaskStackV mTaskStackView.setCallbacks(this); mTaskStackView.setCallbacks(this); addView(mTaskStackView); addView(mTaskStackView); } } mTaskStackView.setVisibility(mStackViewVisibility); // Trigger a new layout // Trigger a new layout requestLayout(); requestLayout(); Loading Loading @@ -861,4 +863,12 @@ public class RecentsView extends FrameLayout implements TaskStackView.TaskStackV } } } } } } public void setStackViewVisibility(int stackViewVisibility) { mStackViewVisibility = stackViewVisibility; if (mTaskStackView != null) { mTaskStackView.setVisibility(stackViewVisibility); invalidate(); } } } } Loading
core/java/android/view/IWindowManager.aidl +3 −0 Original line number Original line Diff line number Diff line Loading @@ -149,6 +149,9 @@ interface IWindowManager void stopAppFreezingScreen(IBinder token, boolean force); void stopAppFreezingScreen(IBinder token, boolean force); void removeAppToken(IBinder token); void removeAppToken(IBinder token); /** Used by system ui to report that recents has shown itself. */ void endProlongedAnimations(); // Re-evaluate the current orientation from the caller's state. // Re-evaluate the current orientation from the caller's state. // If there is a change, the new Configuration is returned and the // If there is a change, the new Configuration is returned and the // caller must call setNewConfiguration() sometime later. // caller must call setNewConfiguration() sometime later. Loading
core/java/android/view/WindowManagerPolicy.java +1 −1 Original line number Original line Diff line number Diff line Loading @@ -335,7 +335,7 @@ public interface WindowManagerPolicy { * Return true if this window (or a window it is attached to, but not * Return true if this window (or a window it is attached to, but not * considering its app token) is currently animating. * considering its app token) is currently animating. */ */ public boolean isAnimatingLw(); boolean isAnimatingLw(); /** /** * Is this window considered to be gone for purposes of layout? * Is this window considered to be gone for purposes of layout? Loading
packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java +21 −3 Original line number Original line Diff line number Diff line Loading @@ -35,6 +35,8 @@ import android.provider.Settings; import android.view.KeyEvent; import android.view.KeyEvent; import android.view.View; import android.view.View; import android.view.ViewStub; import android.view.ViewStub; import android.view.ViewTreeObserver; import com.android.internal.logging.MetricsLogger; import com.android.internal.logging.MetricsLogger; import com.android.systemui.R; import com.android.systemui.R; import com.android.systemui.recents.events.EventBus; import com.android.systemui.recents.events.EventBus; Loading Loading @@ -73,7 +75,8 @@ import java.util.ArrayList; /** /** * The main Recents activity that is started from AlternateRecentsComponent. * The main Recents activity that is started from AlternateRecentsComponent. */ */ public class RecentsActivity extends Activity implements RecentsView.RecentsViewCallbacks { public class RecentsActivity extends Activity implements RecentsView.RecentsViewCallbacks, ViewTreeObserver.OnPreDrawListener { private final static String TAG = "RecentsActivity"; private final static String TAG = "RecentsActivity"; private final static boolean DEBUG = false; private final static boolean DEBUG = false; Loading Loading @@ -425,7 +428,7 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView final RecentsActivityLaunchState state = Recents.getConfiguration().getLaunchState(); final RecentsActivityLaunchState state = Recents.getConfiguration().getLaunchState(); if (state.startHidden) { if (state.startHidden) { state.startHidden = false; state.startHidden = false; mRecentsView.setVisibility(View.INVISIBLE); mRecentsView.setStackViewVisibility(View.INVISIBLE); } } } } Loading Loading @@ -666,7 +669,8 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView } } public final void onBusEvent(EnterRecentsWindowLastAnimationFrameEvent event) { public final void onBusEvent(EnterRecentsWindowLastAnimationFrameEvent event) { mRecentsView.setVisibility(View.VISIBLE); mRecentsView.setStackViewVisibility(View.VISIBLE); mRecentsView.getViewTreeObserver().addOnPreDrawListener(this); } } public final void onBusEvent(AppWidgetProviderChangedEvent event) { public final void onBusEvent(AppWidgetProviderChangedEvent event) { Loading Loading @@ -733,4 +737,18 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView mRecentsView.setSearchBar(null); mRecentsView.setSearchBar(null); } } } } @Override public boolean onPreDraw() { mRecentsView.getViewTreeObserver().removeOnPreDrawListener(this); // We post to make sure that this information is delivered after this traversals is // finished. mRecentsView.post(new Runnable() { @Override public void run() { Recents.getSystemServices().endProlongedAnimations(); } }); return true; } } }
packages/SystemUI/src/com/android/systemui/recents/misc/SystemServicesProxy.java +11 −0 Original line number Original line Diff line number Diff line Loading @@ -787,4 +787,15 @@ public class SystemServicesProxy { e.printStackTrace(); e.printStackTrace(); } } } } public void endProlongedAnimations() { if (mWm == null) { return; } try { WindowManagerGlobal.getWindowManagerService().endProlongedAnimations(); } catch (Exception e) { e.printStackTrace(); } } } }
packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java +10 −0 Original line number Original line Diff line number Diff line Loading @@ -75,6 +75,7 @@ public class RecentsView extends FrameLayout implements TaskStackView.TaskStackV private static final boolean DEBUG = false; private static final boolean DEBUG = false; private static final boolean ADD_HEADER_BITMAP = true; private static final boolean ADD_HEADER_BITMAP = true; private int mStackViewVisibility = View.VISIBLE; /** The RecentsView callbacks */ /** The RecentsView callbacks */ public interface RecentsViewCallbacks { public interface RecentsViewCallbacks { Loading Loading @@ -151,6 +152,7 @@ public class RecentsView extends FrameLayout implements TaskStackView.TaskStackV mTaskStackView.setCallbacks(this); mTaskStackView.setCallbacks(this); addView(mTaskStackView); addView(mTaskStackView); } } mTaskStackView.setVisibility(mStackViewVisibility); // Trigger a new layout // Trigger a new layout requestLayout(); requestLayout(); Loading Loading @@ -861,4 +863,12 @@ public class RecentsView extends FrameLayout implements TaskStackView.TaskStackV } } } } } } public void setStackViewVisibility(int stackViewVisibility) { mStackViewVisibility = stackViewVisibility; if (mTaskStackView != null) { mTaskStackView.setVisibility(stackViewVisibility); invalidate(); } } } }