Use a single config to define the download path
There's no point in using a bool, just define the path.
This commit is contained in:
@@ -1,4 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<resources>
|
|
||||||
<bool name="download_in_cache">false</bool>
|
|
||||||
</resources>
|
|
||||||
@@ -18,8 +18,7 @@
|
|||||||
<string name="app_name">Updater</string>
|
<string name="app_name">Updater</string>
|
||||||
<string name="display_name">Updater</string>
|
<string name="display_name">Updater</string>
|
||||||
|
|
||||||
<string name="download_path_cache" translatable="false">/cache/ota_package/</string>
|
<string name="download_path" translatable="false">/data/ota_package/</string>
|
||||||
<string name="download_path_data" translatable="false">/data/ota_package/</string>
|
|
||||||
<string name="conf_update_server_url_def" translatable="false">https://download.lineageos.org/api</string>
|
<string name="conf_update_server_url_def" translatable="false">https://download.lineageos.org/api</string>
|
||||||
|
|
||||||
<string name="verification_failed_notification">Verification failed</string>
|
<string name="verification_failed_notification">Verification failed</string>
|
||||||
|
|||||||
@@ -49,9 +49,7 @@ public class Utils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static File getDownloadPath(Context context) {
|
public static File getDownloadPath(Context context) {
|
||||||
boolean useCache = context.getResources().getBoolean(R.bool.download_in_cache);
|
return new File(context.getString(R.string.download_path));
|
||||||
int id = useCache ? R.string.download_path_cache : R.string.download_path_data;
|
|
||||||
return new File(context.getString(id));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static File getCachedUpdateList(Context context) {
|
public static File getCachedUpdateList(Context context) {
|
||||||
|
|||||||
Reference in New Issue
Block a user