Skip to content

Commit

Permalink
Add getLastPendingIntentRequestCode and setLastPendingIntentRequestCo…
Browse files Browse the repository at this point in the history
…de to TermuxAPIAppSharedPreferences
  • Loading branch information
EduardDurech committed Oct 12, 2022
1 parent 3f7a939 commit dafa710
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,13 @@ public void setLogLevel(Context context, int logLevel, boolean commitToFile) {
SharedPreferenceUtils.setInt(mSharedPreferences, TERMUX_API_APP.KEY_LOG_LEVEL, logLevel, commitToFile);
}


public int getLastPendingIntentRequestCode() {
return SharedPreferenceUtils.getInt(mSharedPreferences, TERMUX_API_APP.KEY_LAST_PENDING_INTENT_REQUEST_CODE, TERMUX_API_APP.DEFAULT_VALUE_KEY_LAST_PENDING_INTENT_REQUEST_CODE);
}

public void setLastPendingIntentRequestCode(int lastPendingIntentRequestCode) {
SharedPreferenceUtils.setInt(mSharedPreferences, TERMUX_API_APP.KEY_LAST_PENDING_INTENT_REQUEST_CODE, lastPendingIntentRequestCode, false);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,13 @@ public static final class TERMUX_API_APP {
*/
public static final String KEY_LOG_LEVEL = "log_level";


/**
* Defines the key for last used PendingIntent request code.
*/
public static final String KEY_LAST_PENDING_INTENT_REQUEST_CODE = "last_pending_intent_request_code";
public static final int DEFAULT_VALUE_KEY_LAST_PENDING_INTENT_REQUEST_CODE = 0;

}


Expand Down

0 comments on commit dafa710

Please sign in to comment.