|
|
@@ -1,7 +1,12 @@
|
|
|
package com.usai.util;
|
|
|
|
|
|
+import android.app.AlertDialog;
|
|
|
import android.content.Context;
|
|
|
+import android.content.DialogInterface;
|
|
|
+import android.content.Intent;
|
|
|
import android.content.pm.PackageManager;
|
|
|
+import android.net.Uri;
|
|
|
+import android.provider.Settings;
|
|
|
|
|
|
/**
|
|
|
* Created by ray on 27/06/2017.
|
|
|
@@ -16,7 +21,25 @@ public class RAUtil {
|
|
|
|
|
|
|
|
|
|
|
|
+ new AlertDialog.Builder(context)
|
|
|
+ .setTitle("Warning")
|
|
|
+ .setMessage("RA Image need camera permission")
|
|
|
+ .setPositiveButton("OK", new DialogInterface.OnClickListener() {
|
|
|
+ @Override
|
|
|
+ public void onClick(DialogInterface dialog, int which) {
|
|
|
+ Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
|
|
|
+ intent.setData(Uri.parse("package:" + context.getPackageName()));
|
|
|
+ context.startActivity(intent);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .show();
|
|
|
+
|
|
|
return false;
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+// throw new SecurityException("Access denied to process: " + Binder.getCallingPid()
|
|
|
+// + ", must have permission " + permission);
|
|
|
}
|
|
|
return true;
|
|
|
}
|