Skip to content

Commit

Permalink
FIX: Default app ops are not cleared in store as expected.
Browse files Browse the repository at this point in the history
  • Loading branch information
oasisfeng committed Mar 5, 2019
1 parent 604fd3b commit be1d265
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public static boolean saveAppOps(final Context context, final String pkg) throws
final String flat_pkg_ops = list == null || list.isEmpty() ? null : list.stream().filter(ops -> pkg.equals(ops.getPackageName()))
.flatMap(ops -> ops.getOps().stream()).filter(entry -> ! isDefaultMode(entry)).map(entry -> entry.getOp() + ":" + entry.getMode())
.collect(Collectors.joining(","));
if (flat_pkg_ops == null) store.remove(pkg).apply();
if (flat_pkg_ops == null || flat_pkg_ops.isEmpty()) store.remove(pkg).apply();
else store.putString(pkg, flat_pkg_ops).apply();
Log.d(TAG, "App ops saved for " + pkg + ": " + flat_pkg_ops);
return true;
Expand Down

0 comments on commit be1d265

Please sign in to comment.