Commit 5d0e66cf authored by Ankriti Sachan's avatar Ankriti Sachan Committed by Jeffrey I. Schiller

Add field to specify maximum permission request code

The value of this variable can be changed if any class other than Activity is used as base class for Form.
parent 59f8089e
......@@ -251,6 +251,10 @@ public class Form extends AppInventorCompatActivity
private ProgressDialog progress;
private static boolean _initialized = false;
// It should be changed from 100000 to 65535 if the functionality to extend
// FragmentActivity is added in future.
public static final int MAX_PERMISSION_NONCE = 100000;
public static class PercentStorageRecord {
public enum Dim {
HEIGHT, WIDTH };
......@@ -2522,7 +2526,7 @@ public class Form extends AppInventorCompatActivity
androidUIHandler.post(new Runnable() {
@Override
public void run() {
int nonce = permissionRandom.nextInt(100000);
int nonce = permissionRandom.nextInt(MAX_PERMISSION_NONCE);
Log.d(LOG_TAG, "askPermission: permission = " + permission +
" requestCode = " + nonce);
permissionHandlers.put(nonce, responseRequestor);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment