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 com.android.server.pm.pkg.mutate; 18 19 import android.annotation.NonNull; 20 import android.annotation.Nullable; 21 import android.annotation.UserIdInt; 22 import android.content.pm.ApplicationInfo; 23 import android.content.pm.PackageManager; 24 import android.util.ArraySet; 25 26 public interface PackageStateWrite { 27 onChanged()28 void onChanged(); 29 30 @NonNull userState(@serIdInt int userId)31 PackageUserStateWrite userState(@UserIdInt int userId); 32 33 @NonNull setLastPackageUsageTime(@ackageManager.NotifyReason int reason, long timeInMillis)34 PackageStateWrite setLastPackageUsageTime(@PackageManager.NotifyReason int reason, 35 long timeInMillis); 36 37 @NonNull setHiddenUntilInstalled(boolean hiddenUntilInstalled)38 PackageStateWrite setHiddenUntilInstalled(boolean hiddenUntilInstalled); 39 40 @NonNull setRequiredForSystemUser(boolean requiredForSystemUser)41 PackageStateWrite setRequiredForSystemUser(boolean requiredForSystemUser); 42 43 @NonNull setMimeGroup(@onNull String mimeGroup, @NonNull ArraySet<String> mimeTypes)44 PackageStateWrite setMimeGroup(@NonNull String mimeGroup, @NonNull ArraySet<String> mimeTypes); 45 46 @NonNull setCategoryOverride(@pplicationInfo.Category int category)47 PackageStateWrite setCategoryOverride(@ApplicationInfo.Category int category); 48 49 /** set 16Kb App compat mode. @see ApplicationInfo.PageSizeAppCompatFlags */ 50 @NonNull setPageSizeAppCompatFlags(@pplicationInfo.PageSizeAppCompatFlags int mode)51 PackageStateWrite setPageSizeAppCompatFlags(@ApplicationInfo.PageSizeAppCompatFlags int mode); 52 53 @NonNull setUpdateAvailable(boolean updateAvailable)54 PackageStateWrite setUpdateAvailable(boolean updateAvailable); 55 56 @NonNull setLoadingProgress(float progress)57 PackageStateWrite setLoadingProgress(float progress); 58 59 @NonNull setLoadingCompletedTime(long loadingCompletedTime)60 PackageStateWrite setLoadingCompletedTime(long loadingCompletedTime); 61 62 @NonNull setOverrideSeInfo(@ullable String newSeInfo)63 PackageStateWrite setOverrideSeInfo(@Nullable String newSeInfo); 64 65 @NonNull setInstaller(@ullable String installerPackageName, int installerPackageUid)66 PackageStateWrite setInstaller(@Nullable String installerPackageName, int installerPackageUid); 67 68 @NonNull setUpdateOwner(@ullable String updateOwnerPackageName)69 PackageStateWrite setUpdateOwner(@Nullable String updateOwnerPackageName); 70 } 71