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

Commit af160a03 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "[MediaQuality] Add null pointer checks" into main

parents 1b4b7f61 cde1b7ba
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -1160,6 +1160,9 @@ public class MediaQualityService extends SystemService {

        private Bundle convertToCaps(ParameterRange range) {
            Bundle bundle = new Bundle();
            if (range == null || range.numRange == null) {
                return bundle;
            }
            bundle.putObject("INT_MIN_MAX", range.numRange.getIntMinMax());
            bundle.putObject("INT_VALUES_SUPPORTED", range.numRange.getIntValuesSupported());
            bundle.putObject("DOUBLE_MIN_MAX", range.numRange.getDoubleMinMax());
@@ -1351,7 +1354,7 @@ public class MediaQualityService extends SystemService {
            RemoteCallbackList<IPictureProfileCallback> {
        @Override
        public void onCallbackDied(IPictureProfileCallback callback) {
            synchronized ("mPictureProfileLock") {    //TODO: Change to lock
            synchronized (mPictureProfileLock) {
                for (int i = 0; i < mUserStates.size(); i++) {
                    int userId = mUserStates.keyAt(i);
                    UserState userState = getOrCreateUserStateLocked(userId);
@@ -1365,7 +1368,7 @@ public class MediaQualityService extends SystemService {
            RemoteCallbackList<ISoundProfileCallback> {
        @Override
        public void onCallbackDied(ISoundProfileCallback callback) {
            synchronized ("mSoundProfileLock") {    //TODO: Change to lock
            synchronized (mSoundProfileLock) {
                for (int i = 0; i < mUserStates.size(); i++) {
                    int userId = mUserStates.keyAt(i);
                    UserState userState = getOrCreateUserStateLocked(userId);
+6 −0
Original line number Diff line number Diff line
@@ -357,6 +357,9 @@ public final class MediaQualityUtils {
     */
    public static PictureParameter[] convertPersistableBundleToPictureParameterList(
            PersistableBundle params) {
        if (params == null) {
            return null;
        }
        List<PictureParameter> pictureParams = new ArrayList<>();
        if (params.containsKey(PictureQuality.PARAMETER_BRIGHTNESS)) {
            pictureParams.add(PictureParameter.brightness(params.getLong(
@@ -784,6 +787,9 @@ public final class MediaQualityUtils {
     */
    public static SoundParameter[] convertPersistableBundleToSoundParameterList(
            PersistableBundle params) {
        if (params == null) {
            return null;
        }
        //TODO: set EqualizerDetail
        List<SoundParameter> soundParams = new ArrayList<>();
        if (params.containsKey(SoundQuality.PARAMETER_BALANCE)) {