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

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

Merge "WorkSource: Update serialization to worksource.proto."

parents a67d1076 80434a7b
Loading
Loading
Loading
Loading
+19 −0
Original line number Diff line number Diff line
@@ -1058,6 +1058,25 @@ public class WorkSource implements Parcelable {
            }
            proto.end(contentProto);
        }

        if (mChains != null) {
            for (int i = 0; i < mChains.size(); i++) {
                final WorkChain wc = mChains.get(i);
                final long workChain = proto.start(WorkSourceProto.WORK_CHAINS);

                final String[] tags = wc.getTags();
                final int[] uids = wc.getUids();
                for (int j = 0; j < tags.length; j++) {
                    final long contentProto = proto.start(WorkSourceProto.WORK_SOURCE_CONTENTS);
                    proto.write(WorkSourceProto.WorkSourceContentProto.UID, uids[j]);
                    proto.write(WorkSourceProto.WorkSourceContentProto.NAME, tags[j]);
                    proto.end(contentProto);
                }

                proto.end(workChain);
            }
        }

        proto.end(workSourceToken);
    }

+6 −1
Original line number Diff line number Diff line
@@ -25,5 +25,10 @@ message WorkSourceProto {
        optional string name = 2;
    }

    message WorkChain {
      repeated WorkSourceContentProto nodes = 1;
    }

    repeated WorkSourceContentProto work_source_contents = 1;
    repeated WorkChain work_chains = 2;
}