From e6ad1a8ba29bdd5d61ad1c91146def582c8c0334 Mon Sep 17 00:00:00 2001 From: Jim Miller Date: Fri, 20 Aug 2010 19:25:39 -0700 Subject: Fix 2797185: Integrate 3D RecentApps View into system. This adds 3D recents to the platform. Enabling it is a matter of setting 'config_enableRecentApps3D' on devices capable of supporting it (those with OGLES2.0 at the moment). Change-Id: Ife7bfe8ca02e7657821b68f915e31b0dab50cd2c --- .../internal/policy/impl/PhoneWindowManager.java | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'policy/src') diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java index ecba1fe..4d4c799 100755 --- a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java +++ b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java @@ -46,6 +46,7 @@ import android.os.SystemProperties; import android.os.Vibrator; import android.provider.Settings; +import com.android.internal.R; import com.android.internal.policy.PolicyManager; import com.android.internal.statusbar.IStatusBarService; import com.android.internal.telephony.ITelephony; @@ -269,6 +270,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { Intent mHomeIntent; Intent mCarDockIntent; Intent mDeskDockIntent; + Intent mRecentAppsIntent; boolean mSearchKeyPressed; boolean mConsumeSearchKeyUp; @@ -491,6 +493,16 @@ public class PhoneWindowManager implements WindowManagerPolicy { * Create (if necessary) and launch the recent apps dialog */ void showRecentAppsDialog() { + if (mRecentAppsIntent != null) { + try { + mContext.startActivity(mRecentAppsIntent); + return; + } catch (ActivityNotFoundException e) { + Log.e(TAG, "Failed to launch RecentAppsIntent", e); + } + } + + // Fallback to dialog if we fail to launch the above. if (mRecentAppsDialog == null) { mRecentAppsDialog = new RecentApplicationsDialog(mContext); } @@ -522,6 +534,18 @@ public class PhoneWindowManager implements WindowManagerPolicy { mDeskDockIntent.addCategory(Intent.CATEGORY_DESK_DOCK); mDeskDockIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED); + + boolean use3dRecents = mContext.getResources().getBoolean(R.bool.config_enableRecentApps3D); + if (use3dRecents) { + mRecentAppsIntent = new Intent(); + mRecentAppsIntent.setClassName("com.android.systemui", + "com.android.systemui.statusbar.RecentApplicationsActivity"); + mRecentAppsIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK + | Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS); + } else { + mRecentAppsIntent = null; + } + PowerManager pm = (PowerManager)context.getSystemService(Context.POWER_SERVICE); mBroadcastWakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "PhoneWindowManager.mBroadcastWakeLock"); -- cgit v1.1