am beb8be60
: Merge "Fixing crash when taking screenshot over secure window." into ics-mr1
* commit 'beb8be60d157e4812e0195c2e445aa0abb82d9a2': Fixing crash when taking screenshot over secure window.
This commit is contained in:
@ -358,7 +358,15 @@ class GlobalScreenshot {
|
|||||||
dims[0] = Math.abs(dims[0]);
|
dims[0] = Math.abs(dims[0]);
|
||||||
dims[1] = Math.abs(dims[1]);
|
dims[1] = Math.abs(dims[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Take the screenshot
|
||||||
mScreenBitmap = Surface.screenshot((int) dims[0], (int) dims[1]);
|
mScreenBitmap = Surface.screenshot((int) dims[0], (int) dims[1]);
|
||||||
|
if (mScreenBitmap == null) {
|
||||||
|
notifyScreenshotError(mContext, mNotificationManager);
|
||||||
|
finisher.run();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (requiresRotation) {
|
if (requiresRotation) {
|
||||||
// Rotate the screenshot to the current orientation
|
// Rotate the screenshot to the current orientation
|
||||||
Bitmap ss = Bitmap.createBitmap(mDisplayMetrics.widthPixels,
|
Bitmap ss = Bitmap.createBitmap(mDisplayMetrics.widthPixels,
|
||||||
@ -372,13 +380,6 @@ class GlobalScreenshot {
|
|||||||
mScreenBitmap = ss;
|
mScreenBitmap = ss;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we couldn't take the screenshot, notify the user
|
|
||||||
if (mScreenBitmap == null) {
|
|
||||||
notifyScreenshotError(mContext, mNotificationManager);
|
|
||||||
finisher.run();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Optimizations
|
// Optimizations
|
||||||
mScreenBitmap.setHasAlpha(false);
|
mScreenBitmap.setHasAlpha(false);
|
||||||
mScreenBitmap.prepareToDraw();
|
mScreenBitmap.prepareToDraw();
|
||||||
|
Reference in New Issue
Block a user