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

Commit 325b033f authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Mark DataUsageState as nullable to avoid potential NPE risk" am: 0960af0b

parents ca3213bf 0960af0b
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ import android.graphics.drawable.Drawable;
import android.os.UserHandle;
import android.view.View;

import androidx.annotation.Nullable;
import androidx.preference.PreferenceViewHolder;

import com.android.settings.R;
@@ -152,6 +153,7 @@ public class UnrestrictedDataAccessPreference extends AppSwitchPreference implem
        }
    }

    @Nullable
    public AppStateDataUsageBridge.DataUsageState getDataUsageState() {
        return mDataUsageState;
    }
+3 −1
Original line number Diff line number Diff line
@@ -194,7 +194,9 @@ public class UnrestrictedDataAccessPreferenceController extends BasePreferenceCo
            logSpecialPermissionChange(allowlisted, accessPreference.getEntry().info.packageName);
            mDataSaverBackend.setIsAllowlisted(accessPreference.getEntry().info.uid,
                    accessPreference.getEntry().info.packageName, allowlisted);
            if (accessPreference.getDataUsageState() != null) {
                accessPreference.getDataUsageState().isDataSaverAllowlisted = allowlisted;
            }
            return true;
        }
        return false;