Example usage for android.app WallpaperManager getClass

List of usage examples for android.app WallpaperManager getClass

Introduction

In this page you can find the example usage for android.app WallpaperManager getClass.

Prototype

@HotSpotIntrinsicCandidate
public final native Class<?> getClass();

Source Link

Document

Returns the runtime class of this Object .

Usage

From source file:com.android.launcher3.Utilities.java

public static boolean isWallapaperAllowed(Context context) {
    if (isNycOrAbove()) {
        try {//from ww w .j a  v a 2 s  . c om
            WallpaperManager wm = context.getSystemService(WallpaperManager.class);
            return (Boolean) wm.getClass().getDeclaredMethod("isSetWallpaperAllowed").invoke(wm);
        } catch (Exception e) {
        }
    }
    return true;
}