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.content.ComponentName;
22 import android.content.pm.PackageManager;
23 import android.content.pm.UserPackage;
24 import android.content.pm.overlay.OverlayPaths;
25 
26 import com.android.server.pm.pkg.PackageUserStateImpl;
27 import com.android.server.pm.pkg.SuspendParams;
28 
29 public interface PackageUserStateWrite {
30 
31     @NonNull
setInstalled(boolean installed)32     PackageUserStateWrite setInstalled(boolean installed);
33 
34     @NonNull
setUninstallReason(@ackageManager.UninstallReason int reason)35     PackageUserStateWrite setUninstallReason(@PackageManager.UninstallReason int reason);
36 
37     @NonNull
setDistractionFlags( @ackageManager.DistractionRestriction int restrictionFlags)38     PackageUserStateWrite setDistractionFlags(
39             @PackageManager.DistractionRestriction int restrictionFlags);
40 
41     @NonNull
putSuspendParams(@onNull UserPackage suspendingPackage, @Nullable SuspendParams suspendParams)42     PackageUserStateWrite putSuspendParams(@NonNull UserPackage suspendingPackage,
43             @Nullable SuspendParams suspendParams);
44 
45     @NonNull
removeSuspension(@onNull UserPackage suspendingPackage)46     PackageUserStateWrite removeSuspension(@NonNull UserPackage suspendingPackage);
47 
48     @NonNull
setHidden(boolean hidden)49     PackageUserStateWrite setHidden(boolean hidden);
50 
51     @NonNull
setStopped(boolean stopped)52     PackageUserStateWrite setStopped(boolean stopped);
53 
54     @NonNull
setNotLaunched(boolean notLaunched)55     PackageUserStateWrite setNotLaunched(boolean notLaunched);
56 
57     @NonNull
setOverlayPaths(@ullable OverlayPaths overlayPaths)58     PackageUserStateWrite setOverlayPaths(@Nullable OverlayPaths overlayPaths);
59 
60     @NonNull
setOverlayPathsForLibrary(@onNull String libraryName, @Nullable OverlayPaths overlayPaths)61     PackageUserStateWrite setOverlayPathsForLibrary(@NonNull String libraryName,
62             @Nullable OverlayPaths overlayPaths);
63 
64     @NonNull
setHarmfulAppWarning(@ullable String warning)65     PackageUserStateWrite setHarmfulAppWarning(@Nullable String warning);
66 
67     @NonNull
setSplashScreenTheme(@ullable String theme)68     PackageUserStateWrite setSplashScreenTheme(@Nullable String theme);
69 
70     @NonNull
setComponentLabelIcon(@onNull ComponentName componentName, @Nullable String nonLocalizedLabel, @Nullable Integer icon)71     PackageUserStateWrite setComponentLabelIcon(@NonNull ComponentName componentName,
72             @Nullable String nonLocalizedLabel, @Nullable Integer icon);
73 
74     /** @see PackageUserStateImpl#setMinAspectRatio(int) */
75     @NonNull
setMinAspectRatio(@ackageManager.UserMinAspectRatio int aspectRatio)76     PackageUserStateWrite setMinAspectRatio(@PackageManager.UserMinAspectRatio int aspectRatio);
77 }
78