Skip to content

Commit

Permalink
Changed: Automatically use default properties file and client for Ter…
Browse files Browse the repository at this point in the history
…muxSharedProperties.getTermuxInternalPropertyValue()
  • Loading branch information
agnostic-apollo committed Jan 22, 2022
1 parent 5d64f12 commit 28ecb64
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ public ExtraKeysInfo getExtraKeysInfo() {
* Load the {@link TermuxPropertyConstants#KEY_TERMINAL_TRANSCRIPT_ROWS} value from termux properties file on disk.
*/
public static int getTerminalTranscriptRows(Context context) {
return (int) TermuxSharedProperties.getInternalPropertyValue(context, TermuxPropertyConstants.getTermuxPropertiesFile(),
TermuxPropertyConstants.KEY_TERMINAL_TRANSCRIPT_ROWS, new SharedPropertiesParserClient());
return (int) TermuxSharedProperties.getTermuxInternalPropertyValue(context,
TermuxPropertyConstants.KEY_TERMINAL_TRANSCRIPT_ROWS);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -167,17 +167,16 @@ public Object getInternalPropertyValue(String key, boolean cached) {

/**
* Get the internal {@link Object} value for the key passed from the file returned by
* {@code propertiesFile}. The {@link Properties} object is
* {@link TermuxPropertyConstants#getTermuxPropertiesFile()}. The {@link Properties} object is
* read directly from the file and internal value is returned for the property value against the key.
*
* @param context The context for operations.
* @param key The key for which the internal object is required.
* @return Returns the {@link Object} object. This will be {@code null} if key is not found or
* the object stored against the key is {@code null}.
*/
public static Object getInternalPropertyValue(Context context, File propertiesFile, String key,
@NonNull SharedPropertiesParser sharedPropertiesParser) {
return SharedProperties.getInternalProperty(context, propertiesFile, key, sharedPropertiesParser);
public static Object getTermuxInternalPropertyValue(Context context, String key) {
return SharedProperties.getInternalProperty(context, TermuxPropertyConstants.getTermuxPropertiesFile(), key, new SharedPropertiesParserClient());
}

/**
Expand Down

0 comments on commit 28ecb64

Please sign in to comment.