Merge pull request #367 from afischerdev/test-and11
Smaller changes for #312
This commit is contained in:
commit
43028e0722
7 changed files with 25 additions and 18 deletions
|
@ -533,14 +533,21 @@ public class BRouterActivity extends Activity implements ActivityCompat.OnReques
|
||||||
dirFreeSizes.add( Long.valueOf( size ) );
|
dirFreeSizes.add( Long.valueOf( size ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
basedirOptions = new String[items.size() + 1];
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
|
||||||
|
basedirOptions = new String[items.size()];
|
||||||
|
} else {
|
||||||
|
basedirOptions = new String[items.size() + 1];
|
||||||
|
}
|
||||||
|
|
||||||
int bdidx = 0;
|
int bdidx = 0;
|
||||||
DecimalFormat df = new DecimalFormat( "###0.00" );
|
DecimalFormat df = new DecimalFormat( "###0.00" );
|
||||||
for ( int idx = 0; idx < availableBasedirs.size(); idx++ )
|
for ( int idx = 0; idx < availableBasedirs.size(); idx++ )
|
||||||
{
|
{
|
||||||
basedirOptions[bdidx++] = availableBasedirs.get( idx ) + " (" + df.format( dirFreeSizes.get( idx ) / 1024. / 1024. / 1024. ) + " GB free)";
|
basedirOptions[bdidx++] = availableBasedirs.get( idx ) + " (" + df.format( dirFreeSizes.get( idx ) / 1024. / 1024. / 1024. ) + " GB free)";
|
||||||
}
|
}
|
||||||
basedirOptions[bdidx] = "Enter path manually";
|
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.Q) {
|
||||||
|
basedirOptions[bdidx] = "Enter path manually";
|
||||||
|
}
|
||||||
|
|
||||||
showDialog( DIALOG_SELECTBASEDIR_ID );
|
showDialog( DIALOG_SELECTBASEDIR_ID );
|
||||||
}
|
}
|
||||||
|
|
|
@ -214,7 +214,7 @@ public class BRouterView extends View
|
||||||
assertDirectoryExists( "modes directory", modesDir, "modes.zip", version );
|
assertDirectoryExists( "modes directory", modesDir, "modes.zip", version );
|
||||||
assertDirectoryExists( "readmes directory", new File (basedir, "brouter/readmes"), "readmes.zip", version );
|
assertDirectoryExists( "readmes directory", new File (basedir, "brouter/readmes"), "readmes.zip", version );
|
||||||
|
|
||||||
File inputDir = new File (basedir, "/import");
|
File inputDir = new File (basedir, "brouter/import");
|
||||||
assertDirectoryExists( "input directory", inputDir, null, version );
|
assertDirectoryExists( "input directory", inputDir, null, version );
|
||||||
|
|
||||||
// new init is done move old files
|
// new init is done move old files
|
||||||
|
|
|
@ -132,7 +132,7 @@ public class DownloadService extends Service implements ProgressListener {
|
||||||
|
|
||||||
public void downloadFiles() {
|
public void downloadFiles() {
|
||||||
|
|
||||||
// first check lookup table and prifles
|
// first check lookup table and profiles
|
||||||
String result = checkScripts();
|
String result = checkScripts();
|
||||||
if ( result != null) {
|
if ( result != null) {
|
||||||
if (DEBUG) Log.d("BR", "error: " + result);
|
if (DEBUG) Log.d("BR", "error: " + result);
|
||||||
|
@ -192,9 +192,7 @@ public class DownloadService extends Service implements ProgressListener {
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
|
TrafficStats.setThreadStatsTag(1);
|
||||||
TrafficStats.setThreadStatsTag(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
int slidx = surl.lastIndexOf( "segments4/" );
|
int slidx = surl.lastIndexOf( "segments4/" );
|
||||||
String name = surl.substring( slidx+10 );
|
String name = surl.substring( slidx+10 );
|
||||||
|
@ -397,17 +395,13 @@ public class DownloadService extends Service implements ProgressListener {
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
|
TrafficStats.setThreadStatsTag(1);
|
||||||
TrafficStats.setThreadStatsTag(1);
|
|
||||||
}
|
URL url = new URL(surl);
|
||||||
|
connection = (HttpURLConnection) url.openConnection();
|
||||||
|
connection.setConnectTimeout(5000);
|
||||||
|
connection.connect();
|
||||||
|
|
||||||
if ( connection == null )
|
|
||||||
{
|
|
||||||
URL url = new URL(surl);
|
|
||||||
connection = (HttpURLConnection) url.openConnection();
|
|
||||||
connection.setConnectTimeout(5000);
|
|
||||||
connection.connect();
|
|
||||||
}
|
|
||||||
// expect HTTP 200 OK, so we don't mistakenly save error report
|
// expect HTTP 200 OK, so we don't mistakenly save error report
|
||||||
// instead of the file
|
// instead of the file
|
||||||
if (connection.getResponseCode() == HttpURLConnection.HTTP_NOT_FOUND) {
|
if (connection.getResponseCode() == HttpURLConnection.HTTP_NOT_FOUND) {
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 11 KiB |
Binary file not shown.
Before Width: | Height: | Size: 3.2 KiB |
Binary file not shown.
Before Width: | Height: | Size: 5.4 KiB |
|
@ -1,4 +1,10 @@
|
||||||
NOTE:
|
NOTE:
|
||||||
|
|
||||||
Please copy a profile before you edit it.
|
Please copy a profile before you edit it.
|
||||||
The delivered profiles will be overwritten when the lookups.dat changes.
|
The delivered profiles will be overwritten when the lookups.dat changes.
|
||||||
|
|
||||||
|
|
||||||
|
WARNING:
|
||||||
|
|
||||||
|
Since Android Q (29) the storage folder for BRouter is a app specific folder.
|
||||||
|
It will be removed when BRouter is uninstalled or the data is cleared (system settings/apps).
|
||||||
|
|
Loading…
Reference in a new issue