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

Commit a52b601e authored by Mike Ma's avatar Mike Ma Committed by Gerrit Code Review
Browse files

Merge "Avoiding potential NPE when dumping to proto."

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

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