// Path: library/src/main/java/com/oasisfeng/android/util/Consumer.java
// public interface Consumer<T> {
// 
// 	/**
// 	 * Performs this operation on the given argument.
// 	 *
// 	 * @param t the input argument
// 	 */
// 	void accept(T t);
// }


import android.annotation.SuppressLint;
import android.app.Activity;
import android.app.Fragment;
import android.app.FragmentManager;
import android.content.Context;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.os.Process;
import com.oasisfeng.android.util.Consumer;
import javax.annotation.ParametersAreNonnullByDefault;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi;
import static android.os.Build.VERSION_CODES.M;
package com.oasisfeng.android.content.pm;






/**
 * Permission-related helpers
 *
 * Created by Oasis on 2016/9/27.
 */
@ParametersAreNonnullByDefault
public class Permissions {

	public static final String INTERACT_ACROSS_USERS = "android.permission.INTERACT_ACROSS_USERS";

	public static boolean has(final Context context, final String permission) {
		return context.checkPermission(permission, Process.myPid(), Process.myUid()) == PackageManager.PERMISSION_GRANTED;
	}

	/** @param callback will be called if request is not canceled, with either {@link PackageManager#PERMISSION_GRANTED} or {@link PackageManager#PERMISSION_DENIED} */
// Path: library/src/main/java/com/oasisfeng/android/util/Consumer.java
// public interface Consumer<T> {
// 
// 	/**
// 	 * Performs this operation on the given argument.
// 	 *
// 	 * @param t the input argument
// 	 */
// 	void accept(T t);
// }


// Path: library/src/main/java/com/oasisfeng/android/content/pm/Permissions.java
import android.annotation.SuppressLint;
import android.app.Activity;
import android.app.Fragment;
import android.app.FragmentManager;
import android.content.Context;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.os.Process;
import com.oasisfeng.android.util.Consumer;
import javax.annotation.ParametersAreNonnullByDefault;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi;
import static android.os.Build.VERSION_CODES.M;

package com.oasisfeng.android.content.pm;






/**
 * Permission-related helpers
 *
 * Created by Oasis on 2016/9/27.
 */
@ParametersAreNonnullByDefault
public class Permissions {

	public static final String INTERACT_ACROSS_USERS = "android.permission.INTERACT_ACROSS_USERS";

	public static boolean has(final Context context, final String permission) {
		return context.checkPermission(permission, Process.myPid(), Process.myUid()) == PackageManager.PERMISSION_GRANTED;
	}

	/** @param callback will be called if request is not canceled, with either {@link PackageManager#PERMISSION_GRANTED} or {@link PackageManager#PERMISSION_DENIED} */
	@RequiresApi(M) public static void request(final Activity activity, final String permission, final Consumer<Integer> callback) {