use of android.util.MutableInt in project platform_frameworks_base by android.
the class SystemProperties method onKeyAccess.
private static void onKeyAccess(String key) {
if (!TRACK_KEY_ACCESS)
return;
if (key != null && key.startsWith("ro.")) {
synchronized (sRoReads) {
MutableInt numReads = sRoReads.getOrDefault(key, null);
if (numReads == null) {
numReads = new MutableInt(0);
sRoReads.put(key, numReads);
}
numReads.value++;
if (numReads.value > 3) {
Log.d(TAG, "Repeated read (count=" + numReads.value + ") of a read-only system property '" + key + "'", new Exception());
}
}
}
}
use of android.util.MutableInt in project android_frameworks_base by DirtyUnicorns.
the class SystemProperties method onKeyAccess.
private static void onKeyAccess(String key) {
if (!TRACK_KEY_ACCESS)
return;
if (key != null && key.startsWith("ro.")) {
synchronized (sRoReads) {
MutableInt numReads = sRoReads.getOrDefault(key, null);
if (numReads == null) {
numReads = new MutableInt(0);
sRoReads.put(key, numReads);
}
numReads.value++;
if (numReads.value > 3) {
Log.d(TAG, "Repeated read (count=" + numReads.value + ") of a read-only system property '" + key + "'", new Exception());
}
}
}
}
use of android.util.MutableInt in project android_frameworks_base by DirtyUnicorns.
the class IntentResolver method dumpMap.
boolean dumpMap(PrintWriter out, String titlePrefix, String title, String prefix, ArrayMap<String, F[]> map, String packageName, boolean printFilter, boolean collapseDuplicates) {
final String eprefix = prefix + " ";
final String fprefix = prefix + " ";
final ArrayMap<Object, MutableInt> found = new ArrayMap<>();
boolean printedSomething = false;
Printer printer = null;
for (int mapi = 0; mapi < map.size(); mapi++) {
F[] a = map.valueAt(mapi);
final int N = a.length;
boolean printedHeader = false;
F filter;
if (collapseDuplicates && !printFilter) {
found.clear();
for (int i = 0; i < N && (filter = a[i]) != null; i++) {
if (packageName != null && !isPackageForFilter(packageName, filter)) {
continue;
}
Object label = filterToLabel(filter);
int index = found.indexOfKey(label);
if (index < 0) {
found.put(label, new MutableInt(1));
} else {
found.valueAt(index).value++;
}
}
for (int i = 0; i < found.size(); i++) {
if (title != null) {
out.print(titlePrefix);
out.println(title);
title = null;
}
if (!printedHeader) {
out.print(eprefix);
out.print(map.keyAt(mapi));
out.println(":");
printedHeader = true;
}
printedSomething = true;
dumpFilterLabel(out, fprefix, found.keyAt(i), found.valueAt(i).value);
}
} else {
for (int i = 0; i < N && (filter = a[i]) != null; i++) {
if (packageName != null && !isPackageForFilter(packageName, filter)) {
continue;
}
if (title != null) {
out.print(titlePrefix);
out.println(title);
title = null;
}
if (!printedHeader) {
out.print(eprefix);
out.print(map.keyAt(mapi));
out.println(":");
printedHeader = true;
}
printedSomething = true;
dumpFilter(out, fprefix, filter);
if (printFilter) {
if (printer == null) {
printer = new PrintWriterPrinter(out);
}
filter.dump(printer, fprefix + " ");
}
}
}
}
return printedSomething;
}
use of android.util.MutableInt in project android_frameworks_base by ResurrectionRemix.
the class IntentResolver method dumpMap.
boolean dumpMap(PrintWriter out, String titlePrefix, String title, String prefix, ArrayMap<String, F[]> map, String packageName, boolean printFilter, boolean collapseDuplicates) {
final String eprefix = prefix + " ";
final String fprefix = prefix + " ";
final ArrayMap<Object, MutableInt> found = new ArrayMap<>();
boolean printedSomething = false;
Printer printer = null;
for (int mapi = 0; mapi < map.size(); mapi++) {
F[] a = map.valueAt(mapi);
final int N = a.length;
boolean printedHeader = false;
F filter;
if (collapseDuplicates && !printFilter) {
found.clear();
for (int i = 0; i < N && (filter = a[i]) != null; i++) {
if (packageName != null && !isPackageForFilter(packageName, filter)) {
continue;
}
Object label = filterToLabel(filter);
int index = found.indexOfKey(label);
if (index < 0) {
found.put(label, new MutableInt(1));
} else {
found.valueAt(index).value++;
}
}
for (int i = 0; i < found.size(); i++) {
if (title != null) {
out.print(titlePrefix);
out.println(title);
title = null;
}
if (!printedHeader) {
out.print(eprefix);
out.print(map.keyAt(mapi));
out.println(":");
printedHeader = true;
}
printedSomething = true;
dumpFilterLabel(out, fprefix, found.keyAt(i), found.valueAt(i).value);
}
} else {
for (int i = 0; i < N && (filter = a[i]) != null; i++) {
if (packageName != null && !isPackageForFilter(packageName, filter)) {
continue;
}
if (title != null) {
out.print(titlePrefix);
out.println(title);
title = null;
}
if (!printedHeader) {
out.print(eprefix);
out.print(map.keyAt(mapi));
out.println(":");
printedHeader = true;
}
printedSomething = true;
dumpFilter(out, fprefix, filter);
if (printFilter) {
if (printer == null) {
printer = new PrintWriterPrinter(out);
}
filter.dump(printer, fprefix + " ");
}
}
}
}
return printedSomething;
}
use of android.util.MutableInt in project android_frameworks_base by crdroidandroid.
the class IntentResolver method dumpMap.
boolean dumpMap(PrintWriter out, String titlePrefix, String title, String prefix, ArrayMap<String, F[]> map, String packageName, boolean printFilter, boolean collapseDuplicates) {
final String eprefix = prefix + " ";
final String fprefix = prefix + " ";
final ArrayMap<Object, MutableInt> found = new ArrayMap<>();
boolean printedSomething = false;
Printer printer = null;
for (int mapi = 0; mapi < map.size(); mapi++) {
F[] a = map.valueAt(mapi);
final int N = a.length;
boolean printedHeader = false;
F filter;
if (collapseDuplicates && !printFilter) {
found.clear();
for (int i = 0; i < N && (filter = a[i]) != null; i++) {
if (packageName != null && !isPackageForFilter(packageName, filter)) {
continue;
}
Object label = filterToLabel(filter);
int index = found.indexOfKey(label);
if (index < 0) {
found.put(label, new MutableInt(1));
} else {
found.valueAt(index).value++;
}
}
for (int i = 0; i < found.size(); i++) {
if (title != null) {
out.print(titlePrefix);
out.println(title);
title = null;
}
if (!printedHeader) {
out.print(eprefix);
out.print(map.keyAt(mapi));
out.println(":");
printedHeader = true;
}
printedSomething = true;
dumpFilterLabel(out, fprefix, found.keyAt(i), found.valueAt(i).value);
}
} else {
for (int i = 0; i < N && (filter = a[i]) != null; i++) {
if (packageName != null && !isPackageForFilter(packageName, filter)) {
continue;
}
if (title != null) {
out.print(titlePrefix);
out.println(title);
title = null;
}
if (!printedHeader) {
out.print(eprefix);
out.print(map.keyAt(mapi));
out.println(":");
printedHeader = true;
}
printedSomething = true;
dumpFilter(out, fprefix, filter);
if (printFilter) {
if (printer == null) {
printer = new PrintWriterPrinter(out);
}
filter.dump(printer, fprefix + " ");
}
}
}
}
return printedSomething;
}
Aggregations