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 @NonNull setUpdateAvailable(boolean updateAvailable)50 PackageStateWrite setUpdateAvailable(boolean updateAvailable); 51 52 @NonNull setLoadingProgress(float progress)53 PackageStateWrite setLoadingProgress(float progress); 54 55 @NonNull setLoadingCompletedTime(long loadingCompletedTime)56 PackageStateWrite setLoadingCompletedTime(long loadingCompletedTime); 57 58 @NonNull setOverrideSeInfo(@ullable String newSeInfo)59 PackageStateWrite setOverrideSeInfo(@Nullable String newSeInfo); 60 61 @NonNull setInstaller(@ullable String installerPackageName, int installerPackageUid)62 PackageStateWrite setInstaller(@Nullable String installerPackageName, int installerPackageUid); 63 64 @NonNull setUpdateOwner(@ullable String updateOwnerPackageName)65 PackageStateWrite setUpdateOwner(@Nullable String updateOwnerPackageName); 66 } 67