Skip to content

Commit

Permalink
Added: Add SharedPreferences KEY_LAST_PENDING_INTENT_REQUEST_CODE for…
Browse files Browse the repository at this point in the history
… termux-tasker
  • Loading branch information
agnostic-apollo committed Sep 5, 2021
1 parent f00738f commit ac32fbc
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.termux.shared.settings.preferences;

/*
* Version: v0.14.0
* Version: v0.15.0
*
* Changelog
*
Expand Down Expand Up @@ -61,6 +61,10 @@
*
* - 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`.
*/

/**
Expand Down Expand Up @@ -259,6 +263,13 @@ public static final class TERMUX_TASKER_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
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,14 @@ public void setLogLevel(Context context, int logLevel, boolean commitToFile) {
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);
}

}

0 comments on commit ac32fbc

Please sign in to comment.