Permission fixes
This commit is contained in:
parent
255bd1e593
commit
b473f06033
2 changed files with 6 additions and 7 deletions
|
@ -87,8 +87,10 @@ public class DashChooseAppDirFragment {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void updateView() {
|
public void updateView() {
|
||||||
if (type == OsmandSettings.EXTERNAL_STORAGE_TYPE_DEFAULT) {
|
if (type == OsmandSettings.EXTERNAL_STORAGE_TYPE_INTERNAL_FILE) {
|
||||||
locationPath.setText(R.string.storage_directory_default);
|
locationPath.setText(R.string.storage_directory_internal_app);
|
||||||
|
} else if (type == OsmandSettings.EXTERNAL_STORAGE_TYPE_DEFAULT) {
|
||||||
|
locationPath.setText(R.string.storage_directory_shared);
|
||||||
} else if (type == OsmandSettings.EXTERNAL_STORAGE_TYPE_EXTERNAL_FILE) {
|
} else if (type == OsmandSettings.EXTERNAL_STORAGE_TYPE_EXTERNAL_FILE) {
|
||||||
locationPath.setText(R.string.storage_directory_external);
|
locationPath.setText(R.string.storage_directory_external);
|
||||||
} else if (type == OsmandSettings.EXTERNAL_STORAGE_TYPE_OBB) {
|
} else if (type == OsmandSettings.EXTERNAL_STORAGE_TYPE_OBB) {
|
||||||
|
@ -175,7 +177,7 @@ public class DashChooseAppDirFragment {
|
||||||
if (type == OsmandSettings.EXTERNAL_STORAGE_TYPE_DEFAULT) {
|
if (type == OsmandSettings.EXTERNAL_STORAGE_TYPE_DEFAULT) {
|
||||||
selected = items.size();
|
selected = items.size();
|
||||||
}
|
}
|
||||||
items.add(getString(R.string.storage_directory_default));
|
items.add(getString(R.string.storage_directory_shared));
|
||||||
paths.add(df.getAbsolutePath());
|
paths.add(df.getAbsolutePath());
|
||||||
types.add(OsmandSettings.EXTERNAL_STORAGE_TYPE_DEFAULT);
|
types.add(OsmandSettings.EXTERNAL_STORAGE_TYPE_DEFAULT);
|
||||||
}
|
}
|
||||||
|
|
|
@ -601,10 +601,7 @@ public class DownloadActivity extends AbstractDownloadActivity implements Downlo
|
||||||
|
|
||||||
private void showFirstTimeExternalStorage() {
|
private void showFirstTimeExternalStorage() {
|
||||||
final boolean firstTime = getMyApplication().getAppInitializer().isFirstTime();
|
final boolean firstTime = getMyApplication().getAppInitializer().isFirstTime();
|
||||||
final boolean externalExists =
|
if (firstTime && DataStoragePlaceDialogFragment.isInterestedInFirstTime) {
|
||||||
getMyApplication().getSettings().getSecondaryStorage() != null;
|
|
||||||
if (firstTime && (externalExists || !hasPermissionToWriteExternalStorage(this))
|
|
||||||
&& DataStoragePlaceDialogFragment.isInterestedInFirstTime) {
|
|
||||||
if (!hasPermissionToWriteExternalStorage(this)) {
|
if (!hasPermissionToWriteExternalStorage(this)) {
|
||||||
ActivityCompat.requestPermissions(this,
|
ActivityCompat.requestPermissions(this,
|
||||||
new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE},
|
new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE},
|
||||||
|
|
Loading…
Reference in a new issue