Close slice cursor when done using.
Change-Id: I22f2d5fe990fb43e1694879f27d7c0be26675d2b Fixes: 123878106 Test: manual
This commit is contained in:
@@ -75,8 +75,9 @@ public class SlicesDatabaseAccessor {
|
|||||||
if (pathData == null) {
|
if (pathData == null) {
|
||||||
throw new IllegalStateException("Invalid Slices uri: " + uri);
|
throw new IllegalStateException("Invalid Slices uri: " + uri);
|
||||||
}
|
}
|
||||||
Cursor cursor = getIndexedSliceData(pathData.second /* key */);
|
try (Cursor cursor = getIndexedSliceData(pathData.second /* key */)) {
|
||||||
return buildSliceData(cursor, uri, pathData.first /* isIntentOnly */);
|
return buildSliceData(cursor, uri, pathData.first /* isIntentOnly */);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -85,8 +86,9 @@ public class SlicesDatabaseAccessor {
|
|||||||
* Used when handling the action of the {@link Slice}.
|
* Used when handling the action of the {@link Slice}.
|
||||||
*/
|
*/
|
||||||
public SliceData getSliceDataFromKey(String key) {
|
public SliceData getSliceDataFromKey(String key) {
|
||||||
Cursor cursor = getIndexedSliceData(key);
|
try (Cursor cursor = getIndexedSliceData(key)) {
|
||||||
return buildSliceData(cursor, null /* uri */, false /* isIntentOnly */);
|
return buildSliceData(cursor, null /* uri */, false /* isIntentOnly */);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user