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

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

am 6667168a: am 07f86bcb: am fbe543fd: am e50eceb1: am 19acab1f: Merge "Ignore...

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

* commit '6667168ab0330cf74b016df89210150d1a517ac5':
  Ignore badly formed ComponentNames when loading device_owner.xml
parents aa062ff3 b09cdd0a
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);