Close ParcelFileDescriptor after improting blacklist
This commit is contained in:
parent
787ca3c94a
commit
29f7d7b5b5
|
@ -248,6 +248,7 @@ public class BlacklistActivity extends AppCompatActivity {
|
||||||
boolean error = false;
|
boolean error = false;
|
||||||
|
|
||||||
ParcelFileDescriptor pfd = null;
|
ParcelFileDescriptor pfd = null;
|
||||||
|
try {
|
||||||
try {
|
try {
|
||||||
pfd = getContentResolver().openFileDescriptor(data.getData(), "r");
|
pfd = getContentResolver().openFileDescriptor(data.getData(), "r");
|
||||||
} catch (FileNotFoundException e) {
|
} catch (FileNotFoundException e) {
|
||||||
|
@ -264,6 +265,13 @@ public class BlacklistActivity extends AppCompatActivity {
|
||||||
error = true;
|
error = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} finally {
|
||||||
|
if (pfd != null) {
|
||||||
|
try {
|
||||||
|
pfd.close();
|
||||||
|
} catch (IOException ignored) {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (error) {
|
if (error) {
|
||||||
Toast.makeText(this, R.string.error, Toast.LENGTH_SHORT).show();
|
Toast.makeText(this, R.string.error, Toast.LENGTH_SHORT).show();
|
||||||
|
|
Loading…
Reference in New Issue