Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 996b1fd8 authored by Mario Bertschler's avatar Mario Bertschler
Browse files

[automerger] Adjusting reflection api for color addOnColorsChangedListener...

[automerger] Adjusting reflection api for color addOnColorsChangedListener that caused reflection to break. The new api method is available in both DR and MR1. am: 78356a54

Change-Id: I6623a6bacab9fc1d409e62f5e1a4c7955a183af5
parents a7a7b63d 78356a54
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ import android.app.WallpaperManager;
import android.content.Context;
import android.graphics.Color;
import android.os.Build;
import android.os.Handler;
import android.support.annotation.Nullable;
import android.util.Log;

@@ -48,8 +49,7 @@ public class WallpaperManagerCompatVOMR1 extends WallpaperManagerCompat {

        mOCLClass = Class.forName("android.app.WallpaperManager$OnColorsChangedListener");
        mAddOCLMethod = WallpaperManager.class.getDeclaredMethod(
                "addOnColorsChangedListener", mOCLClass);

                "addOnColorsChangedListener", mOCLClass, Handler.class);
        mWCGetMethod = WallpaperManager.class.getDeclaredMethod("getWallpaperColors", int.class);
        Class wallpaperColorsClass = mWCGetMethod.getReturnType();
        mWCGetPrimaryColorMethod = wallpaperColorsClass.getDeclaredMethod("getPrimaryColor");
@@ -89,7 +89,7 @@ public class WallpaperManagerCompatVOMR1 extends WallpaperManagerCompat {
                    }
                });
        try {
            mAddOCLMethod.invoke(mWm, onChangeListener);
            mAddOCLMethod.invoke(mWm, onChangeListener, null);
        } catch (Exception e) {
            Log.e(TAG, "Error calling wallpaper API", e);
        }