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

Commit 5233ca17 authored by Kenny Guy's avatar Kenny Guy Committed by Android Git Automerger
Browse files

am fbe543fd: am e50eceb1: am 19acab1f: Merge "Ignore badly formed...

am fbe543fd: am e50eceb1: am 19acab1f: Merge "Ignore badly formed ComponentNames when loading device_owner.xml" into lmp-dev

* commit 'fbe543fd1ce9ba4f775b166f301ff69457fb4565':
  Ignore badly formed ComponentNames when loading device_owner.xml
parents 40c82476 ec142f84
Loading
Loading
Loading
Loading
+13 −4
Original line number Diff line number Diff line
@@ -229,11 +229,20 @@ public class DeviceOwner {
                    String profileOwnerComponentStr =
                            parser.getAttributeValue(null, ATTR_COMPONENT_NAME);
                    int userId = Integer.parseInt(parser.getAttributeValue(null, ATTR_USERID));
                    OwnerInfo profileOwnerInfo;
                    OwnerInfo profileOwnerInfo = null;
                    if (profileOwnerComponentStr != null) {
                        profileOwnerInfo = new OwnerInfo(profileOwnerName,
                                ComponentName.unflattenFromString(profileOwnerComponentStr));
                        ComponentName admin = ComponentName.unflattenFromString(
                                profileOwnerComponentStr);
                        if (admin != null) {
                            profileOwnerInfo = new OwnerInfo(profileOwnerName, admin);
                        } else {
                            // This shouldn't happen but switch from package name -> component name
                            // might have written bad device owner files. b/17652534
                            Slog.e(TAG, "Error parsing device-owner file. Bad component name " +
                                    profileOwnerComponentStr);
                        }
                    }
                    if (profileOwnerInfo == null) {
                        profileOwnerInfo = new OwnerInfo(profileOwnerName, profileOwnerPackageName);
                    }
                    mProfileOwners.put(userId, profileOwnerInfo);