ExporterPreferences: disable control immediately
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
parent
c3246060f5
commit
9e278c88e6
@ -91,9 +91,9 @@ public class LogExporterPreference extends Preference {
|
|||||||
Snackbar.make(
|
Snackbar.make(
|
||||||
getPrefActivity(this).findViewById(android.R.id.content),
|
getPrefActivity(this).findViewById(android.R.id.content),
|
||||||
message, Snackbar.LENGTH_LONG).show();
|
message, Snackbar.LENGTH_LONG).show();
|
||||||
|
setEnabled(true);
|
||||||
} else {
|
} else {
|
||||||
exportedFilePath = filePath;
|
exportedFilePath = filePath;
|
||||||
setEnabled(false);
|
|
||||||
notifyChanged();
|
notifyChanged();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -115,8 +115,10 @@ public class LogExporterPreference extends Preference {
|
|||||||
getPrefActivity(this).ensurePermissions(
|
getPrefActivity(this).ensurePermissions(
|
||||||
new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE},
|
new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE},
|
||||||
(permissions, granted) -> {
|
(permissions, granted) -> {
|
||||||
if (granted.length > 0 && granted[0] == PackageManager.PERMISSION_GRANTED)
|
if (granted.length > 0 && granted[0] == PackageManager.PERMISSION_GRANTED) {
|
||||||
|
setEnabled(false);
|
||||||
exportLog();
|
exportLog();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -99,9 +99,9 @@ public class ZipExporterPreference extends Preference {
|
|||||||
Snackbar.make(
|
Snackbar.make(
|
||||||
getPrefActivity(this).findViewById(android.R.id.content),
|
getPrefActivity(this).findViewById(android.R.id.content),
|
||||||
message, Snackbar.LENGTH_LONG).show();
|
message, Snackbar.LENGTH_LONG).show();
|
||||||
|
setEnabled(true);
|
||||||
} else {
|
} else {
|
||||||
exportedFilePath = filePath;
|
exportedFilePath = filePath;
|
||||||
setEnabled(false);
|
|
||||||
notifyChanged();
|
notifyChanged();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -123,8 +123,10 @@ public class ZipExporterPreference extends Preference {
|
|||||||
getPrefActivity(this).ensurePermissions(
|
getPrefActivity(this).ensurePermissions(
|
||||||
new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE},
|
new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE},
|
||||||
(permissions, granted) -> {
|
(permissions, granted) -> {
|
||||||
if (granted.length > 0 && granted[0] == PackageManager.PERMISSION_GRANTED)
|
if (granted.length > 0 && granted[0] == PackageManager.PERMISSION_GRANTED) {
|
||||||
|
setEnabled(false);
|
||||||
exportZip();
|
exportZip();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user