Skip to content
Merged

fix lint #17933

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import android.content.ActivityNotFoundException
import android.content.Context
import android.content.Intent
import android.content.Intent.FLAG_ACTIVITY_NEW_TASK
import android.content.Intent.FLAG_GRANT_READ_URI_PERMISSION
import android.net.Uri
import android.os.Build
import android.widget.Toast
Expand Down Expand Up @@ -152,7 +153,7 @@ class LogsEmailSender(private val context: Context, private val clock: Clock, pr

intent.putExtra(Intent.EXTRA_TEXT, getPhoneInfo())

intent.flags = FLAG_ACTIVITY_NEW_TASK
intent.flags = FLAG_ACTIVITY_NEW_TASK or FLAG_GRANT_READ_URI_PERMISSION
intent.type = LOGS_MIME_TYPE
intent.putParcelableArrayListExtra(Intent.EXTRA_STREAM, arrayListOf(uri))
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public void setData(Template template) {
new Thread(() -> {{
try {
final var client = OwnCloudClientManagerFactory.getDefaultSingleton().getNextcloudClientFor(Optional.of(currentAccountProvider.getUser().toOwnCloudAccount()).get(), context);
GlideHelper.INSTANCE.loadIntoImageView(context, client, template.getPreview(), binding.template, placeholder, false);
binding.template.post(() -> GlideHelper.INSTANCE.loadIntoImageView(context, client, template.getPreview(), binding.template, placeholder, false));
} catch (Exception e) {
Log_OC.e("TemplateAdapter", "Exception setData: " + e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ protected Boolean doInBackground(Void... voids) {
backgroundJobManager.startAccountRemovalJob(account.name, true);
} else {
Log_OC.e(this, "Check for remote wipe not needed -> update credentials");
fileActivity.performCredentialsUpdate(account);
fileActivity.runOnUiThread(() -> fileActivity.performCredentialsUpdate(account));
}

return Boolean.TRUE;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ public void startSyncForFileAndIntent(OCFile file, Intent intent) {

// if offline or walled garden, show old version with warning
if (!connectivityService.getConnectivity().isConnected() || connectivityService.isInternetWalled()) {
SnackbarUtil.show(fileActivity, R.string.file_not_synced);
fileActivity.runOnUiThread(() -> SnackbarUtil.show(fileActivity, R.string.file_not_synced));
EventBus.getDefault().post(new SyncEventFinished(intent));

return;
Expand Down Expand Up @@ -249,7 +249,7 @@ private void syncFileOrFolder(OCFile file, User user, FileDataStorageManager sto
if (file.isDown()) {
FileStorageUtils.checkIfFileFinishedSaving(file);
if (!result.isSuccess()) {
SnackbarUtil.show(fileActivity, R.string.file_not_synced);
fileActivity.runOnUiThread(() -> SnackbarUtil.show(fileActivity, R.string.file_not_synced));
try {
Thread.sleep(3000);
} catch (InterruptedException e) {
Expand Down Expand Up @@ -456,7 +456,7 @@ public void streamMediaFile(OCFile file) {
fileActivity.dismissLoadingDialog();

if (!result.isSuccess()) {
SnackbarUtil.show(fileActivity, R.string.stream_not_possible_headline);
fileActivity.runOnUiThread(() -> SnackbarUtil.show(fileActivity, R.string.stream_not_possible_headline));
return;
}

Expand Down Expand Up @@ -1207,6 +1207,7 @@ public void uploadFromCamera(Activity activity, int requestCode, boolean isVideo
Uri cameraUri = FileProvider.getUriForFile(activity.getApplicationContext(),
activity.getResources().getString(R.string.file_provider_authority), cameraFile);
intent.putExtra(MediaStore.EXTRA_OUTPUT, cameraUri);
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION | Intent.FLAG_GRANT_WRITE_URI_PERMISSION);

if (intent.resolveActivity(activity.getPackageManager()) != null) {
activity.startActivityForResult(intent, requestCode);
Expand Down
Loading