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