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

Commit 0eaa1252 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Update the Builder to add the title parameter checking"

parents f8d7fbcf 82986534
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -99,7 +99,7 @@ public class FooterPreference extends Preference {
         * To set the key value of the {@link FooterPreference}.
         * @param key The key value.
         */
        public Builder setKey(String key) {
        public Builder setKey(@NonNull String key) {
            mKey = key;
            return this;
        }
@@ -128,11 +128,12 @@ public class FooterPreference extends Preference {
        public FooterPreference build() {
            final FooterPreference footerPreference = new FooterPreference(mContext);
            footerPreference.setSelectable(false);
            if (!TextUtils.isEmpty(mKey)) {
                footerPreference.setKey(mKey);
            if (TextUtils.isEmpty(mTitle)) {
                throw new IllegalArgumentException("Footer title cannot be empty!");
            }
            if (!TextUtils.isEmpty(mTitle)) {
            footerPreference.setTitle(mTitle);
            if (!TextUtils.isEmpty(mKey)) {
                footerPreference.setKey(mKey);
            }
            return footerPreference;
        }