Debian Codegraph @

core/java/com/android/internal/compat/CompatibilityOverridesToRemoveConfig.java

raw symbols SCIP
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.internal.compat;
18
19
20 import android.os.Parcel;
21 import android.os.Parcelable;
22
23 import java.util.HashSet;
24 import java.util.Set;
25
26 /**
27 * Parcelable containing compat config change IDs for which to remove overrides for a given
28 * application.
29 *
30 * <p>This class is separate from CompatibilityOverrideConfig since we only need change IDs.
31 * @hide
32 */
33 public final class CompatibilityOverridesToRemoveConfig implements Parcelable {
34 public final Set<Long> changeIds;
35
36 public CompatibilityOverridesToRemoveConfig(Set<Long> changeIds) {
37 this.changeIds = changeIds;
38 }
39
40 private CompatibilityOverridesToRemoveConfig(Parcel in) {
41 int keyCount = in.readInt();
42 changeIds = new HashSet<>();
43 for (int i = 0; i < keyCount; i++) {
44 changeIds.add(in.readLong());
45 }
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.writeInt(changeIds.size());
56 for (Long changeId : changeIds) {
57 dest.writeLong(changeId);
58 }
59 }
60
61 public static final Creator<CompatibilityOverridesToRemoveConfig> CREATOR =
62 new Creator<CompatibilityOverridesToRemoveConfig>() {
63
64 @Override
65 public CompatibilityOverridesToRemoveConfig createFromParcel(Parcel in) {
66 return new CompatibilityOverridesToRemoveConfig(in);
67 }
68
69 @Override
70 public CompatibilityOverridesToRemoveConfig[] newArray(int size) {
71 return new CompatibilityOverridesToRemoveConfig[size];
72 }
73 };
74 }