Loading packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java +20 −8 Original line number Diff line number Diff line Loading @@ -77,6 +77,7 @@ import com.android.systemui.recents.model.TaskStack; import com.android.systemui.recents.views.RecentsView; import com.android.systemui.recents.views.SystemBarScrimViews; import com.android.systemui.recents.views.ViewAnimation; import com.android.systemui.statusbar.BaseStatusBar; import java.util.ArrayList; Loading Loading @@ -298,12 +299,23 @@ public class RecentsActivity extends Activity implements ViewTreeObserver.OnPreD */ void dismissRecentsToHome(boolean animated) { if (animated) { ReferenceCountedTrigger exitTrigger = new ReferenceCountedTrigger(null, mFinishLaunchHomeRunnable, null); ReferenceCountedTrigger exitTrigger = new ReferenceCountedTrigger(); exitTrigger.increment(); exitTrigger.addLastDecrementRunnable(mFinishLaunchHomeRunnable); exitTrigger.addLastDecrementRunnable(new Runnable() { @Override public void run() { Recents.getSystemServices().sendCloseSystemWindows( BaseStatusBar.SYSTEM_DIALOG_REASON_HOME_KEY); } }); mRecentsView.startExitToHomeAnimation( new ViewAnimation.TaskViewExitContext(exitTrigger)); exitTrigger.decrement(); } else { mFinishLaunchHomeRunnable.run(); Recents.getSystemServices().sendCloseSystemWindows( BaseStatusBar.SYSTEM_DIALOG_REASON_HOME_KEY); } } Loading Loading @@ -343,7 +355,7 @@ public class RecentsActivity extends Activity implements ViewTreeObserver.OnPreD EventBus.getDefault().register(this, EVENT_BUS_PRIORITY); // Initialize the widget host (the host id is static and does not change) if (!RecentsDebugFlags.Static.DisableSearchBar) { if (RecentsDebugFlags.Static.EnableSearchBar) { mAppWidgetHost = new RecentsAppWidgetHost(this, RecentsAppWidgetHost.HOST_ID); } mPackageMonitor = new RecentsPackageMonitor(); Loading @@ -368,14 +380,14 @@ public class RecentsActivity extends Activity implements ViewTreeObserver.OnPreD mFinishLaunchHomeRunnable = new FinishRecentsRunnable(homeIntent); // Bind the search app widget when we first start up if (!RecentsDebugFlags.Static.DisableSearchBar) { if (RecentsDebugFlags.Static.EnableSearchBar) { mSearchWidgetInfo = ssp.getOrBindSearchAppWidget(this, mAppWidgetHost); } // Register the broadcast receiver to handle messages when the screen is turned off IntentFilter filter = new IntentFilter(); filter.addAction(Intent.ACTION_SCREEN_OFF); if (!RecentsDebugFlags.Static.DisableSearchBar) { if (RecentsDebugFlags.Static.EnableSearchBar) { filter.addAction(SearchManager.INTENT_GLOBAL_SEARCH_ACTIVITY_CHANGED); } registerReceiver(mSystemBroadcastReceiver, filter); Loading Loading @@ -475,7 +487,7 @@ public class RecentsActivity extends Activity implements ViewTreeObserver.OnPreD mPackageMonitor.unregister(); // Stop listening for widget package changes if there was one bound if (!RecentsDebugFlags.Static.DisableSearchBar) { if (RecentsDebugFlags.Static.EnableSearchBar) { mAppWidgetHost.stopListening(); } Loading Loading @@ -656,8 +668,8 @@ public class RecentsActivity extends Activity implements ViewTreeObserver.OnPreD ReferenceCountedTrigger t = new ReferenceCountedTrigger(); ViewAnimation.TaskViewEnterContext ctx = new ViewAnimation.TaskViewEnterContext(t); ctx.postAnimationTrigger.increment(); if (RecentsDebugFlags.Static.EnableSearchBar) { if (mSearchWidgetInfo != null) { if (!RecentsDebugFlags.Static.DisableSearchBar) { ctx.postAnimationTrigger.addLastDecrementRunnable(new Runnable() { @Override public void run() { Loading packages/SystemUI/src/com/android/systemui/recents/RecentsDebugFlags.java +2 −2 Original line number Diff line number Diff line Loading @@ -32,8 +32,8 @@ public class RecentsDebugFlags implements TunerService.Tunable { public static class Static { // Enables debug drawing for the transition thumbnail public static final boolean EnableTransitionThumbnailDebugMode = false; // This disables the search bar integration public static final boolean DisableSearchBar = true; // This enables the search bar integration public static final boolean EnableSearchBar = false; // This disables the bitmap and icon caches public static final boolean DisableBackgroundCache = false; // Enables the simulated task affiliations Loading packages/SystemUI/src/com/android/systemui/recents/RecentsImpl.java +17 −4 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package com.android.systemui.recents; import android.app.ActivityManager; import android.app.ActivityOptions; import android.app.ITaskStackListener; import android.appwidget.AppWidgetProviderInfo; import android.content.ActivityNotFoundException; import android.content.Context; import android.content.Intent; Loading Loading @@ -60,6 +61,7 @@ import com.android.systemui.recents.views.TaskStackLayoutAlgorithm; import com.android.systemui.recents.views.TaskStackView; import com.android.systemui.recents.views.TaskViewHeader; import com.android.systemui.recents.views.TaskViewTransform; import com.android.systemui.statusbar.BaseStatusBar; import com.android.systemui.statusbar.phone.PhoneStatusBar; import java.util.ArrayList; Loading Loading @@ -364,6 +366,9 @@ public class RecentsImpl extends IRecentsNonSystemUserCallbacks.Stub implements // Otherwise, start the recents activity startRecentsActivity(topTask, isTopTaskHome.value, true /* animate */); // Only close the other system windows if we are actually showing recents ssp.sendCloseSystemWindows(BaseStatusBar.SYSTEM_DIALOG_REASON_RECENT_APPS); mLastToggleTime = SystemClock.elapsedRealtime(); } } catch (ActivityNotFoundException e) { Loading Loading @@ -578,7 +583,7 @@ public class RecentsImpl extends IRecentsNonSystemUserCallbacks.Stub implements // Update the configuration for the current state config.update(windowRect); if (!RecentsDebugFlags.Static.DisableSearchBar && tryAndBindSearchWidget) { if (RecentsDebugFlags.Static.EnableSearchBar && tryAndBindSearchWidget) { // Try and pre-emptively bind the search widget on startup to ensure that we // have the right thumbnail bounds to animate to. // Note: We have to reload the widget id before we get the task stack bounds below Loading Loading @@ -854,11 +859,19 @@ public class RecentsImpl extends IRecentsNonSystemUserCallbacks.Stub implements if (!useThumbnailTransition) { // If there is no thumbnail transition, but is launching from home into recents, then // use a quick home transition and do the animation from home if (!RecentsDebugFlags.Static.DisableSearchBar && hasRecentTasks) { if (hasRecentTasks) { SystemServicesProxy ssp = Recents.getSystemServices(); String homeActivityPackage = ssp.getHomeActivityPackageName(); String searchWidgetPackage = Prefs.getString(mContext, String searchWidgetPackage = null; if (RecentsDebugFlags.Static.EnableSearchBar) { searchWidgetPackage = Prefs.getString(mContext, Prefs.Key.OVERVIEW_SEARCH_APP_WIDGET_PACKAGE, null); } else { AppWidgetProviderInfo searchWidgetInfo = ssp.resolveSearchAppWidget(); if (searchWidgetInfo != null) { searchWidgetPackage = searchWidgetInfo.provider.getPackageName(); } } // Determine whether we are coming from a search owned home activity boolean fromSearchHome = (homeActivityPackage != null) && Loading packages/SystemUI/src/com/android/systemui/recents/misc/SystemServicesProxy.java +15 −2 Original line number Diff line number Diff line Loading @@ -68,6 +68,7 @@ import com.android.systemui.Prefs; import com.android.systemui.R; import com.android.systemui.recents.RecentsDebugFlags; import com.android.systemui.recents.RecentsImpl; import com.android.systemui.statusbar.BaseStatusBar; import java.io.IOException; import java.util.ArrayList; Loading Loading @@ -501,6 +502,18 @@ public class SystemServicesProxy { }); } /** * Sends a message to close other system windows. */ public void sendCloseSystemWindows(String reason) { if (ActivityManagerNative.isSystemReady()) { try { ActivityManagerNative.getDefault().closeSystemDialogs(reason); } catch (RemoteException e) { } } } /** * Returns the activity info for a given component name. * Loading Loading @@ -638,7 +651,7 @@ public class SystemServicesProxy { if (mPm == null) return null; if (RecentsDebugFlags.Static.EnableSystemServicesProxy) return null; ArrayList<ResolveInfo> homeActivities = new ArrayList<ResolveInfo>(); ArrayList<ResolveInfo> homeActivities = new ArrayList<>(); ComponentName defaultHomeActivity = mPm.getHomeActivities(homeActivities); if (defaultHomeActivity != null) { return defaultHomeActivity.getPackageName(); Loading Loading @@ -726,7 +739,7 @@ public class SystemServicesProxy { /** * Returns the first Recents widget from the same package as the global assist activity. */ private AppWidgetProviderInfo resolveSearchAppWidget() { public AppWidgetProviderInfo resolveSearchAppWidget() { if (mAssistComponent == null) return null; List<AppWidgetProviderInfo> widgets = mAwm.getInstalledProviders( AppWidgetProviderInfo.WIDGET_CATEGORY_SEARCHBOX); Loading packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java +2 −2 Original line number Diff line number Diff line Loading @@ -317,7 +317,7 @@ public class RecentsView extends FrameLayout { * Hides the task stack and shows the empty view. */ public void showEmptyView() { if (!RecentsDebugFlags.Static.DisableSearchBar && (mSearchBar != null)) { if (RecentsDebugFlags.Static.EnableSearchBar && (mSearchBar != null)) { mSearchBar.setVisibility(View.INVISIBLE); } mTaskStackView.setVisibility(View.INVISIBLE); Loading @@ -332,7 +332,7 @@ public class RecentsView extends FrameLayout { public void hideEmptyView() { mEmptyView.setVisibility(View.INVISIBLE); mTaskStackView.setVisibility(View.VISIBLE); if (!RecentsDebugFlags.Static.DisableSearchBar && (mSearchBar != null)) { if (RecentsDebugFlags.Static.EnableSearchBar && (mSearchBar != null)) { mSearchBar.setVisibility(View.VISIBLE); } mTaskStackView.bringToFront(); Loading Loading
packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java +20 −8 Original line number Diff line number Diff line Loading @@ -77,6 +77,7 @@ import com.android.systemui.recents.model.TaskStack; import com.android.systemui.recents.views.RecentsView; import com.android.systemui.recents.views.SystemBarScrimViews; import com.android.systemui.recents.views.ViewAnimation; import com.android.systemui.statusbar.BaseStatusBar; import java.util.ArrayList; Loading Loading @@ -298,12 +299,23 @@ public class RecentsActivity extends Activity implements ViewTreeObserver.OnPreD */ void dismissRecentsToHome(boolean animated) { if (animated) { ReferenceCountedTrigger exitTrigger = new ReferenceCountedTrigger(null, mFinishLaunchHomeRunnable, null); ReferenceCountedTrigger exitTrigger = new ReferenceCountedTrigger(); exitTrigger.increment(); exitTrigger.addLastDecrementRunnable(mFinishLaunchHomeRunnable); exitTrigger.addLastDecrementRunnable(new Runnable() { @Override public void run() { Recents.getSystemServices().sendCloseSystemWindows( BaseStatusBar.SYSTEM_DIALOG_REASON_HOME_KEY); } }); mRecentsView.startExitToHomeAnimation( new ViewAnimation.TaskViewExitContext(exitTrigger)); exitTrigger.decrement(); } else { mFinishLaunchHomeRunnable.run(); Recents.getSystemServices().sendCloseSystemWindows( BaseStatusBar.SYSTEM_DIALOG_REASON_HOME_KEY); } } Loading Loading @@ -343,7 +355,7 @@ public class RecentsActivity extends Activity implements ViewTreeObserver.OnPreD EventBus.getDefault().register(this, EVENT_BUS_PRIORITY); // Initialize the widget host (the host id is static and does not change) if (!RecentsDebugFlags.Static.DisableSearchBar) { if (RecentsDebugFlags.Static.EnableSearchBar) { mAppWidgetHost = new RecentsAppWidgetHost(this, RecentsAppWidgetHost.HOST_ID); } mPackageMonitor = new RecentsPackageMonitor(); Loading @@ -368,14 +380,14 @@ public class RecentsActivity extends Activity implements ViewTreeObserver.OnPreD mFinishLaunchHomeRunnable = new FinishRecentsRunnable(homeIntent); // Bind the search app widget when we first start up if (!RecentsDebugFlags.Static.DisableSearchBar) { if (RecentsDebugFlags.Static.EnableSearchBar) { mSearchWidgetInfo = ssp.getOrBindSearchAppWidget(this, mAppWidgetHost); } // Register the broadcast receiver to handle messages when the screen is turned off IntentFilter filter = new IntentFilter(); filter.addAction(Intent.ACTION_SCREEN_OFF); if (!RecentsDebugFlags.Static.DisableSearchBar) { if (RecentsDebugFlags.Static.EnableSearchBar) { filter.addAction(SearchManager.INTENT_GLOBAL_SEARCH_ACTIVITY_CHANGED); } registerReceiver(mSystemBroadcastReceiver, filter); Loading Loading @@ -475,7 +487,7 @@ public class RecentsActivity extends Activity implements ViewTreeObserver.OnPreD mPackageMonitor.unregister(); // Stop listening for widget package changes if there was one bound if (!RecentsDebugFlags.Static.DisableSearchBar) { if (RecentsDebugFlags.Static.EnableSearchBar) { mAppWidgetHost.stopListening(); } Loading Loading @@ -656,8 +668,8 @@ public class RecentsActivity extends Activity implements ViewTreeObserver.OnPreD ReferenceCountedTrigger t = new ReferenceCountedTrigger(); ViewAnimation.TaskViewEnterContext ctx = new ViewAnimation.TaskViewEnterContext(t); ctx.postAnimationTrigger.increment(); if (RecentsDebugFlags.Static.EnableSearchBar) { if (mSearchWidgetInfo != null) { if (!RecentsDebugFlags.Static.DisableSearchBar) { ctx.postAnimationTrigger.addLastDecrementRunnable(new Runnable() { @Override public void run() { Loading
packages/SystemUI/src/com/android/systemui/recents/RecentsDebugFlags.java +2 −2 Original line number Diff line number Diff line Loading @@ -32,8 +32,8 @@ public class RecentsDebugFlags implements TunerService.Tunable { public static class Static { // Enables debug drawing for the transition thumbnail public static final boolean EnableTransitionThumbnailDebugMode = false; // This disables the search bar integration public static final boolean DisableSearchBar = true; // This enables the search bar integration public static final boolean EnableSearchBar = false; // This disables the bitmap and icon caches public static final boolean DisableBackgroundCache = false; // Enables the simulated task affiliations Loading
packages/SystemUI/src/com/android/systemui/recents/RecentsImpl.java +17 −4 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package com.android.systemui.recents; import android.app.ActivityManager; import android.app.ActivityOptions; import android.app.ITaskStackListener; import android.appwidget.AppWidgetProviderInfo; import android.content.ActivityNotFoundException; import android.content.Context; import android.content.Intent; Loading Loading @@ -60,6 +61,7 @@ import com.android.systemui.recents.views.TaskStackLayoutAlgorithm; import com.android.systemui.recents.views.TaskStackView; import com.android.systemui.recents.views.TaskViewHeader; import com.android.systemui.recents.views.TaskViewTransform; import com.android.systemui.statusbar.BaseStatusBar; import com.android.systemui.statusbar.phone.PhoneStatusBar; import java.util.ArrayList; Loading Loading @@ -364,6 +366,9 @@ public class RecentsImpl extends IRecentsNonSystemUserCallbacks.Stub implements // Otherwise, start the recents activity startRecentsActivity(topTask, isTopTaskHome.value, true /* animate */); // Only close the other system windows if we are actually showing recents ssp.sendCloseSystemWindows(BaseStatusBar.SYSTEM_DIALOG_REASON_RECENT_APPS); mLastToggleTime = SystemClock.elapsedRealtime(); } } catch (ActivityNotFoundException e) { Loading Loading @@ -578,7 +583,7 @@ public class RecentsImpl extends IRecentsNonSystemUserCallbacks.Stub implements // Update the configuration for the current state config.update(windowRect); if (!RecentsDebugFlags.Static.DisableSearchBar && tryAndBindSearchWidget) { if (RecentsDebugFlags.Static.EnableSearchBar && tryAndBindSearchWidget) { // Try and pre-emptively bind the search widget on startup to ensure that we // have the right thumbnail bounds to animate to. // Note: We have to reload the widget id before we get the task stack bounds below Loading Loading @@ -854,11 +859,19 @@ public class RecentsImpl extends IRecentsNonSystemUserCallbacks.Stub implements if (!useThumbnailTransition) { // If there is no thumbnail transition, but is launching from home into recents, then // use a quick home transition and do the animation from home if (!RecentsDebugFlags.Static.DisableSearchBar && hasRecentTasks) { if (hasRecentTasks) { SystemServicesProxy ssp = Recents.getSystemServices(); String homeActivityPackage = ssp.getHomeActivityPackageName(); String searchWidgetPackage = Prefs.getString(mContext, String searchWidgetPackage = null; if (RecentsDebugFlags.Static.EnableSearchBar) { searchWidgetPackage = Prefs.getString(mContext, Prefs.Key.OVERVIEW_SEARCH_APP_WIDGET_PACKAGE, null); } else { AppWidgetProviderInfo searchWidgetInfo = ssp.resolveSearchAppWidget(); if (searchWidgetInfo != null) { searchWidgetPackage = searchWidgetInfo.provider.getPackageName(); } } // Determine whether we are coming from a search owned home activity boolean fromSearchHome = (homeActivityPackage != null) && Loading
packages/SystemUI/src/com/android/systemui/recents/misc/SystemServicesProxy.java +15 −2 Original line number Diff line number Diff line Loading @@ -68,6 +68,7 @@ import com.android.systemui.Prefs; import com.android.systemui.R; import com.android.systemui.recents.RecentsDebugFlags; import com.android.systemui.recents.RecentsImpl; import com.android.systemui.statusbar.BaseStatusBar; import java.io.IOException; import java.util.ArrayList; Loading Loading @@ -501,6 +502,18 @@ public class SystemServicesProxy { }); } /** * Sends a message to close other system windows. */ public void sendCloseSystemWindows(String reason) { if (ActivityManagerNative.isSystemReady()) { try { ActivityManagerNative.getDefault().closeSystemDialogs(reason); } catch (RemoteException e) { } } } /** * Returns the activity info for a given component name. * Loading Loading @@ -638,7 +651,7 @@ public class SystemServicesProxy { if (mPm == null) return null; if (RecentsDebugFlags.Static.EnableSystemServicesProxy) return null; ArrayList<ResolveInfo> homeActivities = new ArrayList<ResolveInfo>(); ArrayList<ResolveInfo> homeActivities = new ArrayList<>(); ComponentName defaultHomeActivity = mPm.getHomeActivities(homeActivities); if (defaultHomeActivity != null) { return defaultHomeActivity.getPackageName(); Loading Loading @@ -726,7 +739,7 @@ public class SystemServicesProxy { /** * Returns the first Recents widget from the same package as the global assist activity. */ private AppWidgetProviderInfo resolveSearchAppWidget() { public AppWidgetProviderInfo resolveSearchAppWidget() { if (mAssistComponent == null) return null; List<AppWidgetProviderInfo> widgets = mAwm.getInstalledProviders( AppWidgetProviderInfo.WIDGET_CATEGORY_SEARCHBOX); Loading
packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java +2 −2 Original line number Diff line number Diff line Loading @@ -317,7 +317,7 @@ public class RecentsView extends FrameLayout { * Hides the task stack and shows the empty view. */ public void showEmptyView() { if (!RecentsDebugFlags.Static.DisableSearchBar && (mSearchBar != null)) { if (RecentsDebugFlags.Static.EnableSearchBar && (mSearchBar != null)) { mSearchBar.setVisibility(View.INVISIBLE); } mTaskStackView.setVisibility(View.INVISIBLE); Loading @@ -332,7 +332,7 @@ public class RecentsView extends FrameLayout { public void hideEmptyView() { mEmptyView.setVisibility(View.INVISIBLE); mTaskStackView.setVisibility(View.VISIBLE); if (!RecentsDebugFlags.Static.DisableSearchBar && (mSearchBar != null)) { if (RecentsDebugFlags.Static.EnableSearchBar && (mSearchBar != null)) { mSearchBar.setVisibility(View.VISIBLE); } mTaskStackView.bringToFront(); Loading