Friday, January 29, 2016

Module memory question

Hi, I have xposed module which makes statusbar icons smaller.
PHP Code:

XposedHelpers.findAndHookMethod("com.android.systemui.statusbar.StatusBarIconView"lpparam.classLoader"getIconMz"Context.class, "com.android.internal.statusbar.StatusBarIcon",  new XC_MethodHook() {
                      @
Override
                      
protected void afterHookedMethod(MethodHookParam paramthrows Throwable {
                          
super.afterHookedMethod(param);                          
                          
context = (Contextparam.args[0];
                          ...
                           
param.setResult(scaleIcon(context, (Drawableparam.getResult(), scale)); 
                      } }); 

This is the scaling function:
PHP Code:

public static BitmapDrawable scaleIcon(Context ctxDrawable iconint scale){
        
Bitmap src = ((BitmapDrawableicon).getBitmap();
       
Bitmap dest Bitmap.createScaledBitmap(srcscalescaletrue);        
       return new 
BitmapDrawable(context.getResources(), dest);      
           } 

And since I'm not recycling any resource I got a question. What will be with memory?
Is memory for Bitmaps being reused or is it just accumulating?
If I try to recycle any resource I got "Canvas: trying to use a recycled bitmap" error in log and watch statusbar FC.
I've red this article but still have a doubt about memory...
Thanks in advance.


via xda-developers http://ift.tt/1nrRdGS

IFTTT

Put the internet to work for you.

Turn off or edit this Recipe

No comments:

Post a Comment