Changed: Automatically use default properties file and client for TermuxSharedProperties.getTermuxInternalPropertyValue()

This commit is contained in:
agnostic-apollo
2021-10-22 00:32:38 +05:00
parent 5d64f1225c
commit 28ecb64992
2 changed files with 5 additions and 6 deletions

View File

@@ -112,8 +112,8 @@ public class TermuxAppSharedProperties extends TermuxSharedProperties {
* Load the {@link TermuxPropertyConstants#KEY_TERMINAL_TRANSCRIPT_ROWS} value from termux properties file on disk. * Load the {@link TermuxPropertyConstants#KEY_TERMINAL_TRANSCRIPT_ROWS} value from termux properties file on disk.
*/ */
public static int getTerminalTranscriptRows(Context context) { public static int getTerminalTranscriptRows(Context context) {
return (int) TermuxSharedProperties.getInternalPropertyValue(context, TermuxPropertyConstants.getTermuxPropertiesFile(), return (int) TermuxSharedProperties.getTermuxInternalPropertyValue(context,
TermuxPropertyConstants.KEY_TERMINAL_TRANSCRIPT_ROWS, new SharedPropertiesParserClient()); TermuxPropertyConstants.KEY_TERMINAL_TRANSCRIPT_ROWS);
} }
} }

View File

@@ -167,7 +167,7 @@ public abstract class TermuxSharedProperties {
/** /**
* Get the internal {@link Object} value for the key passed from the file returned by * 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. * read directly from the file and internal value is returned for the property value against the key.
* *
* @param context The context for operations. * @param context The context for operations.
@@ -175,9 +175,8 @@ public abstract class TermuxSharedProperties {
* @return Returns the {@link Object} object. This will be {@code null} if key is not found or * @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}. * the object stored against the key is {@code null}.
*/ */
public static Object getInternalPropertyValue(Context context, File propertiesFile, String key, public static Object getTermuxInternalPropertyValue(Context context, String key) {
@NonNull SharedPropertiesParser sharedPropertiesParser) { return SharedProperties.getInternalProperty(context, TermuxPropertyConstants.getTermuxPropertiesFile(), key, new SharedPropertiesParserClient());
return SharedProperties.getInternalProperty(context, propertiesFile, key, sharedPropertiesParser);
} }
/** /**