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

Commit 686bb222 authored by Haofan Wang's avatar Haofan Wang
Browse files

Handle int array for picture profile parameter

The type of the parameter elevenPointRed, elevenPointGreen and elevenPointBlue is int[].
Currently in json to bundle conversion doesn't handle int[].

Bug: 425305953
Test: m
Flag: EXEMPT bugfix
Change-Id: I0ad61f8858dd2d617ca84b340c67460533778641
parent 59510327
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -50,6 +50,7 @@ import android.os.Parcel;
import android.os.PersistableBundle;
import android.util.Log;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

@@ -1457,6 +1458,8 @@ public final class MediaQualityUtils {
                    json.put(key, bundle.getBoolean(key));
                } else if (value instanceof Double) {
                    json.put(key, Double.toString(bundle.getDouble(key)));
                } else if (value instanceof int[]) {
                    json.put(key, new JSONArray(bundle.getIntArray(key)));
                }
            } catch (JSONException e) {
                Log.e(TAG, "Unable to serialize ", e);
@@ -1495,6 +1498,8 @@ public final class MediaQualityUtils {
                        bundle.putDouble(key, (Double) value);
                    } else if (value instanceof Long) {
                        bundle.putLong(key, (Long) value);
                    } else if (value instanceof int[]) {
                        bundle.putIntArray(key, (int[]) value);
                    }
                }
            } catch (JSONException e) {