1 /* 2 * Copyright (C) 2021 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package android.graphics.fonts; 18 19 import android.annotation.NonNull; 20 import android.annotation.SystemApi; 21 import android.os.ParcelFileDescriptor; 22 23 import java.util.Objects; 24 25 /** 26 * Request for updating a font file on the system. 27 * 28 * @hide 29 */ 30 @SystemApi 31 @android.ravenwood.annotation.RavenwoodKeepWholeClass 32 public final class FontFileUpdateRequest { 33 34 private final ParcelFileDescriptor mParcelFileDescriptor; 35 private final byte[] mSignature; 36 37 /** 38 * Creates a FontFileUpdateRequest with the given file and signature. 39 * 40 * @param parcelFileDescriptor A file descriptor of the font file. 41 * @param signature A PKCS#7 detached signature for verifying the font file. 42 */ FontFileUpdateRequest(@onNull ParcelFileDescriptor parcelFileDescriptor, @NonNull byte[] signature)43 public FontFileUpdateRequest(@NonNull ParcelFileDescriptor parcelFileDescriptor, 44 @NonNull byte[] signature) { 45 Objects.requireNonNull(parcelFileDescriptor); 46 Objects.requireNonNull(signature); 47 mParcelFileDescriptor = parcelFileDescriptor; 48 mSignature = signature; 49 } 50 51 /** 52 * Returns the file descriptor of the font file. 53 */ 54 @NonNull getParcelFileDescriptor()55 public ParcelFileDescriptor getParcelFileDescriptor() { 56 return mParcelFileDescriptor; 57 } 58 59 /** 60 * Returns the PKCS#7 detached signature for verifying the font file. 61 */ 62 @NonNull getSignature()63 public byte[] getSignature() { 64 return mSignature; 65 } 66 } 67