1 /* 2 * Copyright (C) 2019 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.om; 18 19 import android.annotation.NonNull; 20 import android.annotation.Nullable; 21 22 import com.android.internal.util.DataClass; 23 24 import java.util.Objects; 25 26 /** 27 * Immutable info on an overlayable defined inside a target package. 28 * 29 * @hide 30 */ 31 @DataClass(genSetters = false, genEqualsHashCode = true, genHiddenConstructor = true) 32 public final class OverlayableInfo { 33 34 /** 35 * The "name" attribute of the overlayable tag. Used to identify the set of resources overlaid. 36 */ 37 @NonNull 38 public final String name; 39 40 /** 41 * The "actor" attribute of the overlayable tag. Used to signal which apps are allowed to 42 * modify overlay state for this overlayable. 43 */ 44 @Nullable 45 public final String actor; 46 47 // CHECKSTYLE:OFF Generated code 48 // 49 50 51 52 // Code below generated by codegen v1.0.3. 53 // 54 // DO NOT MODIFY! 55 // CHECKSTYLE:OFF Generated code 56 // 57 // To regenerate run: 58 // $ codegen $ANDROID_BUILD_TOP/frameworks/base/core/java/android/content/om/OverlayableInfo.java 59 60 61 /** 62 * Creates a new OverlayableInfo. 63 * 64 * @param name 65 * The "name" attribute of the overlayable tag. Used to identify the set of resources overlaid. 66 * @param actor 67 * The "actor" attribute of the overlayable tag. Used to signal which apps are allowed to 68 * modify overlay state for this overlayable. 69 * @hide 70 */ 71 @DataClass.Generated.Member OverlayableInfo( @onNull String name, @Nullable String actor)72 public OverlayableInfo( 73 @NonNull String name, 74 @Nullable String actor) { 75 this.name = name; 76 com.android.internal.util.AnnotationValidations.validate( 77 NonNull.class, null, name); 78 this.actor = actor; 79 80 // onConstructed(); // You can define this method to get a callback 81 } 82 83 @Override 84 @DataClass.Generated.Member equals(@ullable Object o)85 public boolean equals(@Nullable Object o) { 86 // You can override field equality logic by defining either of the methods like: 87 // boolean fieldNameEquals(OverlayableInfo other) { ... } 88 // boolean fieldNameEquals(FieldType otherValue) { ... } 89 90 if (this == o) return true; 91 if (o == null || getClass() != o.getClass()) return false; 92 @SuppressWarnings("unchecked") 93 OverlayableInfo that = (OverlayableInfo) o; 94 //noinspection PointlessBooleanExpression 95 return true 96 && Objects.equals(name, that.name) 97 && Objects.equals(actor, that.actor); 98 } 99 100 @Override 101 @DataClass.Generated.Member hashCode()102 public int hashCode() { 103 // You can override field hashCode logic by defining methods like: 104 // int fieldNameHashCode() { ... } 105 106 int _hash = 1; 107 _hash = 31 * _hash + Objects.hashCode(name); 108 _hash = 31 * _hash + Objects.hashCode(actor); 109 return _hash; 110 } 111 112 @DataClass.Generated( 113 time = 1570059850579L, 114 codegenVersion = "1.0.3", 115 sourceFile = "frameworks/base/core/java/android/content/om/OverlayableInfo.java", 116 inputSignatures = "public final @android.annotation.NonNull java.lang.String name\npublic final @android.annotation.Nullable java.lang.String actor\nclass OverlayableInfo extends java.lang.Object implements []\n@com.android.internal.util.DataClass(genSetters=false, genEqualsHashCode=true, genHiddenConstructor=true)") 117 @Deprecated __metadata()118 private void __metadata() {} 119 120 } 121