diff options
author | Adam Cohen <adamcohen@google.com> | 2015-03-18 14:16:05 -0700 |
---|---|---|
committer | Adam Cohen <adamcohen@google.com> | 2015-03-20 11:15:54 -0700 |
commit | 091440a9cb9d4f42406631004aa484cbb79214ca (patch) | |
tree | 828aaa4033c73fe84a2e7e567c9cc4909c5a014f /src/com/android/launcher3/WidgetPreviewLoader.java | |
parent | f846b9054c90e73cb824310e75ea904b5a459c01 (diff) | |
download | android_packages_apps_Trebuchet-091440a9cb9d4f42406631004aa484cbb79214ca.tar.gz android_packages_apps_Trebuchet-091440a9cb9d4f42406631004aa484cbb79214ca.tar.bz2 android_packages_apps_Trebuchet-091440a9cb9d4f42406631004aa484cbb79214ca.zip |
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
Diffstat (limited to 'src/com/android/launcher3/WidgetPreviewLoader.java')
-rw-r--r-- | src/com/android/launcher3/WidgetPreviewLoader.java | 7 |
1 files changed, 4 insertions, 3 deletions
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<String> sInvalidPackages = new HashSet<String>(); + @Thunk static final HashSet<String> sInvalidPackages = new HashSet<String>(); private final HashMap<String, WeakReference<Bitmap>> mLoadedPreviews = new HashMap<>(); private final ArrayList<SoftReference<Bitmap>> 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"; |