Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit be5137f4 authored by Yi Kong's avatar Yi Kong Committed by android-build-merger
Browse files

Merge "Track getxattr API change" am: c4c4a1e7 am: f897e1c3

am: 2b5a0d29

Change-Id: I845657a3c8f14f38f0c3b490d16677620ba0bcc4
parents dbac6566 2b5a0d29
Loading
Loading
Loading
Loading
+2 −3
Original line number Original line Diff line number Diff line
@@ -331,9 +331,8 @@ public final class SELinuxMMAC {
        }
        }


        try {
        try {
            final byte[] buf = new byte[20];
            final byte[] buf = Os.getxattr(file.getAbsolutePath(), XATTR_SEAPP_HASH);
            final int len = Os.getxattr(file.getAbsolutePath(), XATTR_SEAPP_HASH, buf);
            if ((buf.length == 20) && Arrays.equals(SEAPP_CONTEXTS_HASH, buf)) {
            if ((len == 20) && Arrays.equals(SEAPP_CONTEXTS_HASH, buf)) {
                return false;
                return false;
            }
            }
        } catch (ErrnoException e) {
        } catch (ErrnoException e) {
+2 −3
Original line number Original line Diff line number Diff line
@@ -3023,9 +3023,8 @@ public class UserManagerService extends IUserManager.Stub {
     */
     */
    private static int getSerialNumber(File file) throws IOException {
    private static int getSerialNumber(File file) throws IOException {
        try {
        try {
            final byte[] buf = new byte[256];
            final byte[] buf = Os.getxattr(file.getAbsolutePath(), XATTR_SERIAL);
            final int len = Os.getxattr(file.getAbsolutePath(), XATTR_SERIAL, buf);
            final String serial = new String(buf);
            final String serial = new String(buf, 0, len);
            try {
            try {
                return Integer.parseInt(serial);
                return Integer.parseInt(serial);
            } catch (NumberFormatException e) {
            } catch (NumberFormatException e) {