Merge "Track getxattr API change" am: c4c4a1e76e am: f897e1c3b6

am: 2b5a0d299d

Change-Id: I845657a3c8f14f38f0c3b490d16677620ba0bcc4
This commit is contained in:
Yi Kong
2016-08-29 08:15:53 +00:00
committed by android-build-merger
2 changed files with 4 additions and 6 deletions

View File

@@ -331,9 +331,8 @@ public final class SELinuxMMAC {
}
try {
final byte[] buf = new byte[20];
final int len = Os.getxattr(file.getAbsolutePath(), XATTR_SEAPP_HASH, buf);
if ((len == 20) && Arrays.equals(SEAPP_CONTEXTS_HASH, buf)) {
final byte[] buf = Os.getxattr(file.getAbsolutePath(), XATTR_SEAPP_HASH);
if ((buf.length == 20) && Arrays.equals(SEAPP_CONTEXTS_HASH, buf)) {
return false;
}
} catch (ErrnoException e) {

View File

@@ -3023,9 +3023,8 @@ public class UserManagerService extends IUserManager.Stub {
*/
private static int getSerialNumber(File file) throws IOException {
try {
final byte[] buf = new byte[256];
final int len = Os.getxattr(file.getAbsolutePath(), XATTR_SERIAL, buf);
final String serial = new String(buf, 0, len);
final byte[] buf = Os.getxattr(file.getAbsolutePath(), XATTR_SERIAL);
final String serial = new String(buf);
try {
return Integer.parseInt(serial);
} catch (NumberFormatException e) {