Skip to content

Commit

Permalink
Fix OutOfMemory when Building Icon Request, Minor Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
sarsamurmu committed Aug 11, 2019
1 parent 84382e4 commit 0c67ea1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
7 changes: 4 additions & 3 deletions library/src/main/java/candybar/lib/helpers/DeviceHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,13 @@ public static String getDeviceInfo(@NonNull Context context) {
} catch (PackageManager.NameNotFoundException ignored) {
}


String installationFlag;

if (installerPackage == "com.android.vending") {
installationFlag = "R";
installationFlag = " R";
} else {
installationFlag = "";
installationFlag = " ";
}

sb.append("Manufacturer : ").append(Build.MANUFACTURER)
Expand All @@ -60,7 +61,7 @@ public static String getDeviceInfo(@NonNull Context context) {
.append("\nScreen Resolution : ")
.append(width).append(" x ").append(height).append(" pixels")
.append("\nAndroid Version : ").append(Build.VERSION.RELEASE)
.append("\nApp Version : ").append(appVersion).append(" ").append(installationFlag)
.append("\nApp Version : ").append(appVersion).append(installationFlag)
.append("\nCandyBar Version : ").append(BuildConfig.VERSION_NAME)
.append("\n");
return sb.toString();
Expand Down
3 changes: 2 additions & 1 deletion library/src/main/java/candybar/lib/helpers/IconsHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,8 @@ public static String saveIcon(List<String> files, File directory, Drawable drawa
}

FileOutputStream outStream = new FileOutputStream(file);
bitmap = Bitmap.createScaledBitmap(bitmap, 192, 192, false);
// Disabled Because of OutOfMemory
//bitmap = Bitmap.createScaledBitmap(bitmap, 192, 192, false);
bitmap.compress(Bitmap.CompressFormat.PNG, 100, outStream);
outStream.flush();
outStream.close();
Expand Down

0 comments on commit 0c67ea1

Please sign in to comment.