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

Commit 80434a7b authored by Narayan Kamath's avatar Narayan Kamath
Browse files

WorkSource: Update serialization to worksource.proto.

Now includes WorkChains.

Bug: 62390666
Test: manual
Change-Id: Idf3f9f3df86fb51ebcc938d7feb891789e16b68a
parent bbab9c4e
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;
}