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

Commit 43908f11 authored by Mike Ma's avatar Mike Ma Committed by android-build-merger
Browse files

Merge "Avoiding potential NPE when dumping to proto." am: a52b601e

am: 8964390d

Change-Id: Ie9dc401990b4267b9bcf0469a3526db93dc438d2
parents e02cb469 8964390d
Loading
Loading
Loading
Loading
+3 −2
Original line number Original line Diff line number Diff line
@@ -29,7 +29,6 @@ import android.os.Handler;
import android.os.Parcel;
import android.os.Parcel;
import android.os.Parcelable;
import android.os.Parcelable;
import android.os.RemoteException;
import android.os.RemoteException;
import android.os.UserHandle;
import android.os.WorkSource;
import android.os.WorkSource;
import android.text.TextUtils;
import android.text.TextUtils;
import android.util.ArrayMap;
import android.util.ArrayMap;
@@ -1150,7 +1149,9 @@ public class AlarmManager {
        public void writeToProto(ProtoOutputStream proto, long fieldId) {
        public void writeToProto(ProtoOutputStream proto, long fieldId) {
            final long token = proto.start(fieldId);
            final long token = proto.start(fieldId);
            proto.write(AlarmClockInfoProto.TRIGGER_TIME_MS, mTriggerTime);
            proto.write(AlarmClockInfoProto.TRIGGER_TIME_MS, mTriggerTime);
            if (mShowIntent != null) {
                mShowIntent.writeToProto(proto, AlarmClockInfoProto.SHOW_INTENT);
                mShowIntent.writeToProto(proto, AlarmClockInfoProto.SHOW_INTENT);
            }
            proto.end(token);
            proto.end(token);
        }
        }
    }
    }
+6 −2
Original line number Original line Diff line number Diff line
@@ -1096,7 +1096,9 @@ public final class Configuration implements Parcelable, Comparable<Configuration
        protoOutputStream.write(FONT_SCALE, fontScale);
        protoOutputStream.write(FONT_SCALE, fontScale);
        protoOutputStream.write(MCC, mcc);
        protoOutputStream.write(MCC, mcc);
        protoOutputStream.write(MNC, mnc);
        protoOutputStream.write(MNC, mnc);
        if (mLocaleList != null) {
            mLocaleList.writeToProto(protoOutputStream, LOCALES);
            mLocaleList.writeToProto(protoOutputStream, LOCALES);
        }
        protoOutputStream.write(SCREEN_LAYOUT, screenLayout);
        protoOutputStream.write(SCREEN_LAYOUT, screenLayout);
        protoOutputStream.write(COLOR_MODE, colorMode);
        protoOutputStream.write(COLOR_MODE, colorMode);
        protoOutputStream.write(TOUCHSCREEN, touchscreen);
        protoOutputStream.write(TOUCHSCREEN, touchscreen);
@@ -1111,7 +1113,9 @@ public final class Configuration implements Parcelable, Comparable<Configuration
        protoOutputStream.write(SCREEN_HEIGHT_DP, screenHeightDp);
        protoOutputStream.write(SCREEN_HEIGHT_DP, screenHeightDp);
        protoOutputStream.write(SMALLEST_SCREEN_WIDTH_DP, smallestScreenWidthDp);
        protoOutputStream.write(SMALLEST_SCREEN_WIDTH_DP, smallestScreenWidthDp);
        protoOutputStream.write(DENSITY_DPI, densityDpi);
        protoOutputStream.write(DENSITY_DPI, densityDpi);
        if (windowConfiguration != null) {
            windowConfiguration.writeToProto(protoOutputStream, WINDOW_CONFIGURATION);
            windowConfiguration.writeToProto(protoOutputStream, WINDOW_CONFIGURATION);
        }
        protoOutputStream.end(token);
        protoOutputStream.end(token);
    }
    }


+3 −1
Original line number Original line Diff line number Diff line
@@ -386,7 +386,9 @@ public final class Looper {
        final long looperToken = proto.start(fieldId);
        final long looperToken = proto.start(fieldId);
        proto.write(LooperProto.THREAD_NAME, mThread.getName());
        proto.write(LooperProto.THREAD_NAME, mThread.getName());
        proto.write(LooperProto.THREAD_ID, mThread.getId());
        proto.write(LooperProto.THREAD_ID, mThread.getId());
        if (mQueue != null) {
            mQueue.writeToProto(proto, LooperProto.QUEUE);
            mQueue.writeToProto(proto, LooperProto.QUEUE);
        }
        proto.end(looperToken);
        proto.end(looperToken);
    }
    }