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;
|
||||
|
||||
ParcelFileDescriptor pfd = null;
|
||||
try {
|
||||
try {
|
||||
pfd = getContentResolver().openFileDescriptor(data.getData(), "r");
|
||||
} catch (FileNotFoundException e) {
|
||||
|
@ -264,6 +265,13 @@ public class BlacklistActivity extends AppCompatActivity {
|
|||
error = true;
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
if (pfd != null) {
|
||||
try {
|
||||
pfd.close();
|
||||
} catch (IOException ignored) {}
|
||||
}
|
||||
}
|
||||
|
||||
if (error) {
|
||||
Toast.makeText(this, R.string.error, Toast.LENGTH_SHORT).show();
|
||||
|
|
Loading…
Reference in New Issue