Follow minikin library update for preventing copy-and-move Font

Bug: 169871852
Test: minikin_tests
Test: hwui_unit_tests
Test: atst CtsGraphicsTestCases
Change-Id: Ic8a272e5dec9feacf5e1c49542a0623782950108
diff --git a/libs/hwui/jni/FontUtils.h b/libs/hwui/jni/FontUtils.h
index f93a0da..ba4e56e 100644
--- a/libs/hwui/jni/FontUtils.h
+++ b/libs/hwui/jni/FontUtils.h
@@ -19,6 +19,7 @@
 
 #include <jni.h>
 #include <memory>
+#include <utility>
 
 #include <minikin/Font.h>
 
@@ -34,18 +35,10 @@
 };
 
 struct FontWrapper {
-  FontWrapper(minikin::Font&& font) : font(std::move(font)) {}
-  minikin::Font font;
+  explicit FontWrapper(std::shared_ptr<minikin::Font>&& font) : font(font) {}
+  std::shared_ptr<minikin::Font> font;
 };
 
-// We assume FontWrapper's address is the same as underlying Font's address.
-// This assumption is used for looking up Java font object from native address.
-// The Font object can be created without Java's Font object but all Java's Font objects point to
-// the native FontWrapper. So when looking up Java object from minikin::Layout which gives us Font
-// address, we lookup Font Java object from Font address with assumption that it is the same as
-// FontWrapper address.
-static_assert(offsetof(FontWrapper, font) == 0);
-
 // Utility wrapper for java.util.List
 class ListHelper {
 public: