Commit 3eab954b authored by Daniel Xie's avatar Daniel Xie Committed by Gerrit Code Review
Browse files

Merge "DO NOT MERGE, re-apply, Adjust testAppFailAccessPrivateData to fail on...

Merge "DO NOT MERGE, re-apply, Adjust testAppFailAccessPrivateData to fail on non-tagged sockets" into marshmallow-cts-release
parents 9f2e0bee 3762c5d5
......@@ -103,24 +103,19 @@ public class AccessPrivateDataTest extends AndroidTestCase {
} catch (SecurityException e) {
fail("Was not able to access another app's public file: " + e);
}
boolean foundOtherStats = false;
try {
BufferedReader qtaguidReader = new BufferedReader(new FileReader("/proc/net/xt_qtaguid/stats"));
String line;
while ((line = qtaguidReader.readLine()) != null) {
String tokens[] = line.split(" ");
if (tokens.length > 3 && tokens[3].equals(String.valueOf(otherAppUid))) {
foundOtherStats = true;
if (!tokens[2].equals("0x0")) {
fail("Other apps detailed traffic stats leaked");
}
// CreatePrivateDataTest:testCreatePrivateData ensures we can access our own stats data
fail("Other apps detailed traffic stats leaked");
}
}
qtaguidReader.close();
} catch (FileNotFoundException e) {
fail("Was not able to access qtaguid/stats: " + e);
}
assertTrue("Was expecting to find other apps' traffic stats", foundOtherStats);
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment