Merge "Convert ashmem bitmap thresholds to constants." into mnc-dr-dev am: c8bb39d98d
am: 2c740f1dcf
* commit '2c740f1dcf7bfd75a1dde2f7403cb25ae6559556':
Convert ashmem bitmap thresholds to constants.
This commit is contained in:
@@ -3966,6 +3966,9 @@ public class Notification implements Parcelable
|
||||
return this;
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public static final int MIN_ASHMEM_BITMAP_SIZE = 128 * (1 << 10);
|
||||
|
||||
/**
|
||||
* @hide
|
||||
*/
|
||||
@@ -3974,7 +3977,7 @@ public class Notification implements Parcelable
|
||||
super.purgeResources();
|
||||
if (mPicture != null &&
|
||||
mPicture.isMutable() &&
|
||||
mPicture.getAllocationByteCount() >= (128 * (1 << 10))) {
|
||||
mPicture.getAllocationByteCount() >= MIN_ASHMEM_BITMAP_SIZE) {
|
||||
mPicture = mPicture.createAshmemBitmap();
|
||||
}
|
||||
if (mBigLargeIcon != null) {
|
||||
|
||||
@@ -377,6 +377,9 @@ public final class Icon implements Parcelable {
|
||||
return loadDrawable(context);
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public static final int MIN_ASHMEM_ICON_SIZE = 128 * (1 << 10);
|
||||
|
||||
/**
|
||||
* Puts the memory used by this instance into Ashmem memory, if possible.
|
||||
* @hide
|
||||
@@ -384,7 +387,7 @@ public final class Icon implements Parcelable {
|
||||
public void convertToAshmem() {
|
||||
if (mType == TYPE_BITMAP &&
|
||||
getBitmap().isMutable() &&
|
||||
getBitmap().getAllocationByteCount() >= (128 * (1 << 10))) {
|
||||
getBitmap().getAllocationByteCount() >= MIN_ASHMEM_ICON_SIZE) {
|
||||
setBitmap(getBitmap().createAshmemBitmap());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user