Set stability for unset interfaces.
This specifically has handwritten interfaces in mind. This CL ensures
that if there is a handwritten interface, it'll be marked with 'local'
stability before it is sent out. This means that a handwritten interface
won't accidentally be interpretted as a stable interface.
Bug: 136027762
Test: boot
Merged-In: I97e3e7c72f99e12dbf00996ff0c68fb683f3c494
Change-Id: I97e3e7c72f99e12dbf00996ff0c68fb683f3c494
diff --git a/libs/binder/Parcel.cpp b/libs/binder/Parcel.cpp
index 51ca7b4..a2333ae 100644
--- a/libs/binder/Parcel.cpp
+++ b/libs/binder/Parcel.cpp
@@ -167,6 +167,8 @@
 status_t Parcel::finishFlattenBinder(
     const sp<IBinder>& /*binder*/, const flat_binder_object& flat)
 {
+    // internal::Stability::tryMarkCompilationUnit(binder.get());
+
     status_t status = writeObject(flat, false);
     if (status != OK) return status;
 
@@ -183,11 +185,11 @@
     // status_t status = readInt32(&stability);
     // if (status != OK) return status;
 
-    // if (!internal::Stability::check(stability, mRequiredStability)) {
+    // if (binder != nullptr && !internal::Stability::check(stability, mRequiredStability)) {
     //     return BAD_TYPE;
     // }
 
-    // status = internal::Stability::set(binder.get(), stability);
+    // status = internal::Stability::set(binder.get(), stability, true /*log*/);
     // if (status != OK) return status;
 
     *out = binder;