Added: Add SharedPreferences KEY_LAST_PENDING_INTENT_REQUEST_CODE for termux-tasker

This commit is contained in:
agnostic-apollo
2021-09-05 14:52:53 +05:00
parent f00738fe3a
commit ac32fbc53d
2 changed files with 22 additions and 1 deletions

View File

@@ -1,7 +1,7 @@
package com.termux.shared.settings.preferences;
/*
* Version: v0.14.0
* Version: v0.15.0
*
* Changelog
*
@@ -61,6 +61,10 @@ package com.termux.shared.settings.preferences;
*
* - 0.14.0 (2021-09-04)
* - Added `TERMUX_WIDGET_APP.KEY_TOKEN`.
*
* - 0.15.0 (2021-09-05)
* - Added following to `TERMUX_TASKER_APP`:
* `KEY_LAST_PENDING_INTENT_REQUEST_CODE` and `DEFAULT_VALUE_KEY_LAST_PENDING_INTENT_REQUEST_CODE`.
*/
/**
@@ -259,6 +263,13 @@ public final class TermuxPreferenceConstants {
*/
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;
}

View File

@@ -84,4 +84,14 @@ public class TermuxTaskerAppSharedPreferences {
SharedPreferenceUtils.setInt(mSharedPreferences, TERMUX_TASKER_APP.KEY_LOG_LEVEL, logLevel, commitToFile);
}
public int getLastPendingIntentRequestCode() {
return SharedPreferenceUtils.getInt(mSharedPreferences, TERMUX_TASKER_APP.KEY_LAST_PENDING_INTENT_REQUEST_CODE, TERMUX_TASKER_APP.DEFAULT_VALUE_KEY_LAST_PENDING_INTENT_REQUEST_CODE);
}
public void setLastPendingIntentRequestCode(int lastPendingIntentRequestCode) {
SharedPreferenceUtils.setInt(mSharedPreferences, TERMUX_TASKER_APP.KEY_LAST_PENDING_INTENT_REQUEST_CODE, lastPendingIntentRequestCode, false);
}
}