Debian Codegraph @

core/java/android/content/pm/IncrementalStatesInfo.java

raw symbols SCIP
1 /*
2 * Copyright (C) 2020 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.content.pm;
18
19 import android.os.Parcel;
20 import android.os.Parcelable;
21
22 /**
23 * Info about a package's states in Parcelable format.
24 * @hide
25 */
26 public class IncrementalStatesInfo implements Parcelable {
27 private boolean mIsLoading;
28 private float mProgress;
29
30 public IncrementalStatesInfo(boolean isLoading, float progress) {
31 mIsLoading = isLoading;
32 mProgress = progress;
33 }
34
35 private IncrementalStatesInfo(Parcel source) {
36 mIsLoading = source.readBoolean();
37 mProgress = source.readFloat();
38 }
39
40 public boolean isLoading() {
41 return mIsLoading;
42 }
43
44 public float getProgress() {
45 return mProgress;
46 }
47
48 @Override
49 public int describeContents() {
50 return 0;
51 }
52
53 @Override
54 public void writeToParcel(Parcel dest, int flags) {
55 dest.writeBoolean(mIsLoading);
56 dest.writeFloat(mProgress);
57 }
58
59 public static final @android.annotation.NonNull Creator<IncrementalStatesInfo> CREATOR =
60 new Creator<IncrementalStatesInfo>() {
61 public IncrementalStatesInfo createFromParcel(Parcel source) {
62 return new IncrementalStatesInfo(source);
63 }
64 public IncrementalStatesInfo[] newArray(int size) {
65 return new IncrementalStatesInfo[size];
66 }
67 };
68 }