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:
Gabriele M
2017-07-07 22:05:23 +02:00
parent 89cb51e3dd
commit e6a061c090
3 changed files with 2 additions and 9 deletions

View File

@@ -1,4 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<bool name="download_in_cache">false</bool>
</resources>

View File

@@ -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>

View File

@@ -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) {