summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Haoyu Zhang <haoyuchang@google.com> 2019-12-16 21:46:58 +0000
committer Haoyu Zhang <haoyuchang@google.com> 2019-12-16 22:25:02 +0000
commitfe7b206c8d00a44ff51901ea4f620fc2f29b84b3 (patch)
treebfbac3fb566208c604155d8854f6d63695291c65
parent351df0901d4e00d7360c5a94fe089db152aea6c4 (diff)
Revert "Rmove @UnsupportedAppUsage"
This reverts commit 351df0901d4e00d7360c5a94fe089db152aea6c4. Bug: 146181012 Bug: 145986883 Bug: 146318594 Bug: 146316215 Bug: 146315595 Reason for revert: This changed caused APP crash. Change-Id: I0a1863176bf80ba5ad044621b5a2ff72e0d57fa4
-rw-r--r--graphics/java/android/graphics/FontFamily.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/graphics/java/android/graphics/FontFamily.java b/graphics/java/android/graphics/FontFamily.java
index 2648008b8f80..5ad93f411393 100644
--- a/graphics/java/android/graphics/FontFamily.java
+++ b/graphics/java/android/graphics/FontFamily.java
@@ -17,6 +17,7 @@
package android.graphics;
import android.annotation.Nullable;
+import android.annotation.UnsupportedAppUsage;
import android.content.res.AssetManager;
import android.graphics.fonts.FontVariationAxis;
import android.text.TextUtils;
@@ -57,6 +58,7 @@ public class FontFamily {
*
* This cannot be deleted because it's in use by AndroidX.
*/
+ @UnsupportedAppUsage(trackingBug = 123768928)
public long mNativePtr;
// Points native font family builder. Must be zero after freezing this family.
@@ -65,6 +67,7 @@ public class FontFamily {
/**
* This cannot be deleted because it's in use by AndroidX.
*/
+ @UnsupportedAppUsage(trackingBug = 123768928)
public FontFamily() {
mBuilderPtr = nInitBuilder(null, 0);
mNativeBuilderCleaner = sBuilderRegistry.registerNativeAllocation(this, mBuilderPtr);
@@ -73,6 +76,7 @@ public class FontFamily {
/**
* This cannot be deleted because it's in use by AndroidX.
*/
+ @UnsupportedAppUsage(trackingBug = 123768928)
public FontFamily(@Nullable String[] langs, int variant) {
final String langsString;
if (langs == null || langs.length == 0) {
@@ -94,6 +98,7 @@ public class FontFamily {
*
* This cannot be deleted because it's in use by AndroidX.
*/
+ @UnsupportedAppUsage(trackingBug = 123768928)
public boolean freeze() {
if (mBuilderPtr == 0) {
throw new IllegalStateException("This FontFamily is already frozen");
@@ -110,6 +115,7 @@ public class FontFamily {
/**
* This cannot be deleted because it's in use by AndroidX.
*/
+ @UnsupportedAppUsage(trackingBug = 123768928)
public void abortCreation() {
if (mBuilderPtr == 0) {
throw new IllegalStateException("This FontFamily is already frozen or abandoned");
@@ -121,6 +127,7 @@ public class FontFamily {
/**
* This cannot be deleted because it's in use by AndroidX.
*/
+ @UnsupportedAppUsage(trackingBug = 123768928)
public boolean addFont(String path, int ttcIndex, FontVariationAxis[] axes, int weight,
int italic) {
if (mBuilderPtr == 0) {
@@ -144,6 +151,7 @@ public class FontFamily {
/**
* This cannot be deleted because it's in use by AndroidX.
*/
+ @UnsupportedAppUsage(trackingBug = 123768928)
public boolean addFontFromBuffer(ByteBuffer font, int ttcIndex, FontVariationAxis[] axes,
int weight, int italic) {
if (mBuilderPtr == 0) {
@@ -171,6 +179,7 @@ public class FontFamily {
*
* This cannot be deleted because it's in use by AndroidX.
*/
+ @UnsupportedAppUsage(trackingBug = 123768928)
public boolean addFontFromAssetManager(AssetManager mgr, String path, int cookie,
boolean isAsset, int ttcIndex, int weight, int isItalic,
FontVariationAxis[] axes) {