diff options
| -rw-r--r-- | api/current.txt | 2 | ||||
| -rw-r--r-- | core/java/android/app/Activity.java | 27 | ||||
| -rw-r--r-- | core/java/android/app/ActivityThread.java | 56 |
3 files changed, 6 insertions, 79 deletions
diff --git a/api/current.txt b/api/current.txt index f503874da103..042360e6ff1b 100644 --- a/api/current.txt +++ b/api/current.txt @@ -3695,7 +3695,7 @@ package android.app { method public boolean onCreateOptionsMenu(android.view.Menu); method public boolean onCreatePanelMenu(int, android.view.Menu); method public android.view.View onCreatePanelView(int); - method public boolean onCreateThumbnail(android.graphics.Bitmap, android.graphics.Canvas); + method public deprecated boolean onCreateThumbnail(android.graphics.Bitmap, android.graphics.Canvas); method public android.view.View onCreateView(java.lang.String, android.content.Context, android.util.AttributeSet); method public android.view.View onCreateView(android.view.View, java.lang.String, android.content.Context, android.util.AttributeSet); method protected void onDestroy(); diff --git a/core/java/android/app/Activity.java b/core/java/android/app/Activity.java index 0bc510a13ba6..bcd88fee6720 100644 --- a/core/java/android/app/Activity.java +++ b/core/java/android/app/Activity.java @@ -1733,7 +1733,7 @@ public class Activity extends ContextThemeWrapper * * <p>This callback and {@link #onUserInteraction} are intended to help * activities manage status bar notifications intelligently; specifically, - * for helping activities determine the proper time to cancel a notfication. + * for helping activities determine the proper time to cancel a notification. * * @see #onUserInteraction() */ @@ -1741,32 +1741,16 @@ public class Activity extends ContextThemeWrapper } /** - * Generate a new thumbnail for this activity. This method is called before - * pausing the activity, and should draw into <var>outBitmap</var> the - * imagery for the desired thumbnail in the dimensions of that bitmap. It - * can use the given <var>canvas</var>, which is configured to draw into the - * bitmap, for rendering if desired. - * - * <p>The default implementation returns fails and does not draw a thumbnail; - * this will result in the platform creating its own thumbnail if needed. - * - * @param outBitmap The bitmap to contain the thumbnail. - * @param canvas Can be used to render into the bitmap. - * - * @return Return true if you have drawn into the bitmap; otherwise after - * you return it will be filled with a default thumbnail. - * - * @see #onCreateDescription - * @see #onSaveInstanceState - * @see #onPause + * @deprecated Method doesn't do anything and will be removed in the future. */ + @Deprecated public boolean onCreateThumbnail(Bitmap outBitmap, Canvas canvas) { return false; } /** * Generate a new description for this activity. This method is called - * before pausing the activity and can, if desired, return some textual + * before stopping the activity and can, if desired, return some textual * description of its current state to be displayed to the user. * * <p>The default implementation returns null, which will cause you to @@ -1777,9 +1761,8 @@ public class Activity extends ContextThemeWrapper * @return A description of what the user is doing. It should be short and * sweet (only a few words). * - * @see #onCreateThumbnail * @see #onSaveInstanceState - * @see #onPause + * @see #onStop */ @Nullable public CharSequence onCreateDescription() { diff --git a/core/java/android/app/ActivityThread.java b/core/java/android/app/ActivityThread.java index 5a6331919d76..a69b0ee70f4d 100644 --- a/core/java/android/app/ActivityThread.java +++ b/core/java/android/app/ActivityThread.java @@ -3904,62 +3904,6 @@ public final class ActivityThread extends ClientTransactionHandler { } } - private int mThumbnailWidth = -1; - private int mThumbnailHeight = -1; - private Bitmap mAvailThumbnailBitmap = null; - private Canvas mThumbnailCanvas = null; - - private Bitmap createThumbnailBitmap(ActivityClientRecord r) { - Bitmap thumbnail = mAvailThumbnailBitmap; - try { - if (thumbnail == null) { - int w = mThumbnailWidth; - int h; - if (w < 0) { - Resources res = r.activity.getResources(); - int wId = com.android.internal.R.dimen.thumbnail_width; - int hId = com.android.internal.R.dimen.thumbnail_height; - mThumbnailWidth = w = res.getDimensionPixelSize(wId); - mThumbnailHeight = h = res.getDimensionPixelSize(hId); - } else { - h = mThumbnailHeight; - } - - // On platforms where we don't want thumbnails, set dims to (0,0) - if ((w > 0) && (h > 0)) { - thumbnail = Bitmap.createBitmap(r.activity.getResources().getDisplayMetrics(), - w, h, THUMBNAIL_FORMAT); - thumbnail.eraseColor(0); - } - } - - if (thumbnail != null) { - Canvas cv = mThumbnailCanvas; - if (cv == null) { - mThumbnailCanvas = cv = new Canvas(); - } - - cv.setBitmap(thumbnail); - if (!r.activity.onCreateThumbnail(thumbnail, cv)) { - mAvailThumbnailBitmap = thumbnail; - thumbnail = null; - } - cv.setBitmap(null); - } - - } catch (Exception e) { - if (!mInstrumentation.onException(r.activity, e)) { - throw new RuntimeException( - "Unable to create thumbnail of " - + r.intent.getComponent().toShortString() - + ": " + e.toString(), e); - } - thumbnail = null; - } - - return thumbnail; - } - @Override public void handlePauseActivity(IBinder token, boolean finished, boolean userLeaving, int configChanges, boolean dontReport, PendingTransactionActions pendingActions) { |