ensure SwapService is running first, after Location perm prompt

This commit is contained in:
Hans-Christoph Steiner 2019-06-13 21:48:32 +02:00
parent ec6f9cef2b
commit df3a09dd2b
2 changed files with 32 additions and 1 deletions

View File

@ -0,0 +1,30 @@
/*
* Copyright (C) 2018 Hans-Christoph Steiner <hans@eds.org>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 3
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301, USA.
*/
package org.fdroid.fdroid.localrepo;
import android.content.Context;
/**
* Dummy version for basic app flavor.
*/
public class SwapService {
public static void start(Context context) {
}
}

View File

@ -57,6 +57,7 @@ import org.fdroid.fdroid.UpdateService;
import org.fdroid.fdroid.Utils;
import org.fdroid.fdroid.data.NewRepoConfig;
import org.fdroid.fdroid.localrepo.SDCardScannerService;
import org.fdroid.fdroid.localrepo.SwapService;
import org.fdroid.fdroid.net.WifiStateChangeService;
import org.fdroid.fdroid.views.AppDetailsActivity;
import org.fdroid.fdroid.views.ManageReposActivity;
@ -250,7 +251,7 @@ public class MainActivity extends AppCompatActivity implements BottomNavigationB
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
if (requestCode == REQUEST_LOCATION_PERMISSIONS) {
WifiStateChangeService.start(this, null);
startActivity(new Intent(this, SwapWorkflowActivity.class));
SwapService.start(this);
} else if (requestCode == REQUEST_STORAGE_PERMISSIONS) {
Toast.makeText(this,
this.getString(R.string.scan_removable_storage_toast, ""),