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

Commit 476da95b authored by Sudheer Shanka's avatar Sudheer Shanka Committed by Android (Google) Code Review
Browse files

Merge "Check for null values when copying enforcedAdmin in QSTile.State."

parents 2435f342 1c09db21
Loading
Loading
Loading
Loading
+11 −3
Original line number Diff line number Diff line
@@ -233,6 +233,16 @@ public class RestrictedLockUtils {
            this.userId = userId;
        }

        public EnforcedAdmin(EnforcedAdmin other) {
            if (other == null) {
                throw new IllegalArgumentException();
            }
            this.component = other.component;
            this.userId = other.userId;
        }

        public EnforcedAdmin() {}

        @Override
        public boolean equals(Object object) {
            if (object == this) return true;
@@ -255,12 +265,10 @@ public class RestrictedLockUtils {

        public void copyTo(EnforcedAdmin other) {
            if (other == null) {
                other = new EnforcedAdmin();
                throw new IllegalArgumentException();
            }
            other.component = component;
            other.userId = userId;
        }

        public EnforcedAdmin() {}
    }
}
 No newline at end of file
+7 −1
Original line number Diff line number Diff line
@@ -480,7 +480,13 @@ public abstract class QSTile<TState extends State> implements Listenable {
            other.dualLabelContentDescription = dualLabelContentDescription;
            other.autoMirrorDrawable = autoMirrorDrawable;
            other.disabledByPolicy = disabledByPolicy;
            if (enforcedAdmin == null) {
                other.enforcedAdmin = null;
            } else if (other.enforcedAdmin == null) {
                other.enforcedAdmin = new EnforcedAdmin(enforcedAdmin);
            } else {
                enforcedAdmin.copyTo(other.enforcedAdmin);
            }
            return changed;
        }