public AwSettings(Context context) { mContext = context; mBlockNetworkLoads = mContext.checkPermission( android.Manifest.permission.INTERNET, Process.myPid(), Process.myUid()) != PackageManager.PERMISSION_GRANTED; }
/** See {@link android.webkit.WebSettings#setBlockNetworkLoads}. */ public void setBlockNetworkLoads(boolean flag) { synchronized (mXWalkSettingsLock) { if (!flag && mContext.checkPermission( android.Manifest.permission.INTERNET, Process.myPid(), Process.myUid()) != PackageManager.PERMISSION_GRANTED) { throw new SecurityException( "Permission denied - " + "application missing INTERNET permission"); } mBlockNetworkLoads = flag; } }
public XWalkSettings( Context context, long nativeWebContents, boolean isAccessFromFileURLsGrantedByDefault) { ThreadUtils.assertOnUiThread(); mContext = context; mBlockNetworkLoads = mContext.checkPermission( android.Manifest.permission.INTERNET, Process.myPid(), Process.myUid()) != PackageManager.PERMISSION_GRANTED; if (isAccessFromFileURLsGrantedByDefault) { mAllowUniversalAccessFromFileURLs = true; mAllowFileAccessFromFileURLs = true; } mUserAgent = LazyDefaultUserAgent.sInstance; mEventHandler = new EventHandler(); setWebContents(nativeWebContents); }
public static boolean havePermission(Context c) { return c.checkPermission(PERMISSION_RUN_TASKS, Process.myPid(), Process.myUid()) == PackageManager.PERMISSION_GRANTED; }
@CalledByNative private static boolean checkDebugPermission(Context context, int pid, int uid) { String debugPermissionName = context.getPackageName() + DEBUG_PERMISSION_SIFFIX; return context.checkPermission(debugPermissionName, pid, uid) == PackageManager.PERMISSION_GRANTED; }