diff options
author | Jim Miller <jaggies@google.com> | 2010-08-20 19:25:39 -0700 |
---|---|---|
committer | Jim Miller <jaggies@google.com> | 2010-08-25 20:43:00 -0700 |
commit | e6ad1a8ba29bdd5d61ad1c91146def582c8c0334 (patch) | |
tree | 38f2fc4e2e1914d9e788022f44ec9e4cffa52e32 /policy | |
parent | a0b436234d999a05b1ddb571dea3956ad5139a4c (diff) | |
download | frameworks_base-e6ad1a8ba29bdd5d61ad1c91146def582c8c0334.zip frameworks_base-e6ad1a8ba29bdd5d61ad1c91146def582c8c0334.tar.gz frameworks_base-e6ad1a8ba29bdd5d61ad1c91146def582c8c0334.tar.bz2 |
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
Diffstat (limited to 'policy')
-rwxr-xr-x | policy/src/com/android/internal/policy/impl/PhoneWindowManager.java | 24 |
1 files changed, 24 insertions, 0 deletions
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"); |