Here you can find the source of setRevokedPermissions(String packageName, String[] permissions, Context ctx)
public static void setRevokedPermissions(String packageName, String[] permissions, Context ctx)
//package com.java2s; import java.lang.reflect.Method; import android.content.Context; import android.content.pm.PackageManager; public class Main { public static void setRevokedPermissions(String packageName, String[] permissions, Context ctx) { PackageManager pkgManager = ctx.getPackageManager(); Method setRevokedPermissions; try {/*from w w w . j ava2s .c o m*/ setRevokedPermissions = pkgManager.getClass().getMethod( "setRevokedPermissions", java.lang.String.class, String[].class); Object[] params = new Object[] { packageName, permissions }; setRevokedPermissions.invoke(pkgManager, params); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } } }