From 091440a9cb9d4f42406631004aa484cbb79214ca Mon Sep 17 00:00:00 2001 From: Adam Cohen Date: Wed, 18 Mar 2015 14:16:05 -0700 Subject: Reducing method count by eliminating synthetic accessors Elimates 304 methods based on dex analysis The java compiler generates sythetic accessor methods for all private fields, methods and contructors accessed from inner classes. By marking them package-private and @Thunk instead, sythentic accessor methods are no longer needeed. These annotated elements should be treated as private. Change-Id: Id0dc2c92733474250d8ff12fa793d3a8adeb1f26 --- src/com/android/launcher3/WidgetPreviewLoader.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/com/android/launcher3/WidgetPreviewLoader.java') diff --git a/src/com/android/launcher3/WidgetPreviewLoader.java b/src/com/android/launcher3/WidgetPreviewLoader.java index 3d57acca4..0a5f0af4e 100644 --- a/src/com/android/launcher3/WidgetPreviewLoader.java +++ b/src/com/android/launcher3/WidgetPreviewLoader.java @@ -30,6 +30,7 @@ import android.os.Build; import android.util.Log; import com.android.launcher3.compat.AppWidgetManagerCompat; +import com.android.launcher3.util.Thunk; import java.io.ByteArrayOutputStream; import java.io.File; @@ -50,7 +51,7 @@ public class WidgetPreviewLoader { private static final String ANDROID_INCREMENTAL_VERSION_NAME_KEY = "android.incremental.version"; private static final float WIDGET_PREVIEW_ICON_PADDING_PERCENTAGE = 0.25f; - private static final HashSet sInvalidPackages = new HashSet(); + @Thunk static final HashSet sInvalidPackages = new HashSet(); private final HashMap> mLoadedPreviews = new HashMap<>(); private final ArrayList> mUnusedBitmaps = new ArrayList<>(); @@ -275,7 +276,7 @@ public class WidgetPreviewLoader { } } - private void writeToDb(Object o, Bitmap preview) { + @Thunk void writeToDb(Object o, Bitmap preview) { String name = getObjectName(o); SQLiteDatabase db = mDb.getWritableDatabase(); ContentValues values = new ContentValues(); @@ -590,7 +591,7 @@ public class WidgetPreviewLoader { /** * Dumps all files that are open in this process without allocating a file descriptor. */ - private static void dumpOpenFiles() { + @Thunk static void dumpOpenFiles() { try { Log.i(TAG, "DUMP OF OPEN FILES (sample rate: 1 every " + SAMPLE_RATE + "):"); final String TYPE_APK = "apk"; -- cgit v1.2.3