Add serialization methods to whitelist not light greylist

Checked the contents of the hiddenapi lists before and after the change
and the methods were definitely moved from light greylist to the
whitelist.

Flashed the device and checked the log and did not see anything out of
the ordinary.

Test: frameworks/base/tools/hiddenapi/generate_hiddenapi_lists_test.py
Change-Id: I9b4b2426251e99495f65ae02a3c2c32ce6966625
diff --git a/tools/hiddenapi/generate_hiddenapi_lists_test.py b/tools/hiddenapi/generate_hiddenapi_lists_test.py
index 8f79318..4716241 100755
--- a/tools/hiddenapi/generate_hiddenapi_lists_test.py
+++ b/tools/hiddenapi/generate_hiddenapi_lists_test.py
@@ -85,5 +85,23 @@
         self.assertEqual(
             dst, set([ "Lfoo/bar/ClassA;->abc()J", "Lfoo/bar/ClassA;->def()J" ]))
 
+    def test_move_serialization(self):
+        # All the entries should be moved apart from the last one
+        src = set([ "Lfoo/bar/ClassA;->readObject(Ljava/io/ObjectInputStream;)V",
+                    "Lfoo/bar/ClassA;->readObjectNoData()V",
+                    "Lfoo/bar/ClassA;->readResolve()Ljava/lang/Object;",
+                    "Lfoo/bar/ClassA;->serialVersionUID:J",
+                    "Lfoo/bar/ClassA;->serialPersistentFields:[Ljava/io/ObjectStreamField;",
+                    "Lfoo/bar/ClassA;->writeObject(Ljava/io/ObjectOutputStream;)V",
+                    "Lfoo/bar/ClassA;->writeReplace()Ljava/lang/Object;",
+                    # Should not be moved as signature does not match
+                    "Lfoo/bar/ClassA;->readObject(Ljava/io/ObjectInputStream;)I"])
+        expectedToMove = len(src) - 1
+        dst = set()
+        packages = set([ "Lfoo/bar/" ])
+        move_serialization(src, dst)
+        self.assertEqual(len(src), 1)
+        self.assertEqual(len(dst), expectedToMove)
+
 if __name__ == '__main__':
     unittest.main()