Package com.breautek.fuse
Class RequestCodeManager
java.lang.Object
com.breautek.fuse.RequestCodeManager
-
Method Summary
Modifier and TypeMethodDescriptionstatic RequestCodeManager
int
Returns a request code, skipping over any configured forbidden codes.void
reset()
void
setForbiddenCode
(int code, boolean isForbidden) If third-party libraries use permissions/request codes that you don't want the Fuse framework to become confused with, you can forbid the codes they use so that this manager won't ever return them.void
setNextRequestCode
(int code)
-
Method Details
-
getInstance
-
setForbiddenCode
public void setForbiddenCode(int code, boolean isForbidden) If third-party libraries use permissions/request codes that you don't want the Fuse framework to become confused with, you can forbid the codes they use so that this manager won't ever return them.- Parameters:
code
- the forbidden (or not forbidden) code to modify.isForbidden
- If true, set the forbidden code, if false, remove it.
-
getRequestCode
public int getRequestCode()Returns a request code, skipping over any configured forbidden codes. The request code starts at 0 and increments on every call. If a forbidden code is encountered, it will be incremented again. The code is mostly unique, in the sense that it will roll back to MIN_VALUE once you reach MAX_VALUE.- Returns:
- requestCode
-
reset
@VisibleForTesting public void reset() -
setNextRequestCode
@VisibleForTesting public void setNextRequestCode(int code)
-