Merge "Make private, single-assignment fields "final" in android.content."

This commit is contained in:
Treehugger Robot
2023-06-22 00:32:51 +00:00
committed by Gerrit Code Review
12 changed files with 22 additions and 20 deletions

View File

@@ -445,7 +445,7 @@ public class AppSearchShortcutInfo extends GenericDocument {
@VisibleForTesting @VisibleForTesting
public static class Builder extends GenericDocument.Builder<Builder> { public static class Builder extends GenericDocument.Builder<Builder> {
private List<String> mFlags = new ArrayList<>(1); private final List<String> mFlags = new ArrayList<>(1);
public Builder(String packageName, String id) { public Builder(String packageName, String id) {
super(/*namespace=*/ packageName, id, SCHEMA_TYPE); super(/*namespace=*/ packageName, id, SCHEMA_TYPE);

View File

@@ -66,7 +66,7 @@ import java.util.UUID;
* &lt;application&gt; tag. * &lt;application&gt; tag.
*/ */
public class ApplicationInfo extends PackageItemInfo implements Parcelable { public class ApplicationInfo extends PackageItemInfo implements Parcelable {
private static ForBoolean sForBoolean = Parcelling.Cache.getOrCreate(ForBoolean.class); private static final ForBoolean sForBoolean = Parcelling.Cache.getOrCreate(ForBoolean.class);
private static final Parcelling.BuiltIn.ForStringSet sForStringSet = private static final Parcelling.BuiltIn.ForStringSet sForStringSet =
Parcelling.Cache.getOrCreate(Parcelling.BuiltIn.ForStringSet.class); Parcelling.Cache.getOrCreate(Parcelling.BuiltIn.ForStringSet.class);
@@ -1862,7 +1862,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023) @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023)
private final Collator sCollator = Collator.getInstance(); private final Collator sCollator = Collator.getInstance();
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023) @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023)
private PackageManager mPM; private final PackageManager mPM;
} }
public ApplicationInfo() { public ApplicationInfo() {

View File

@@ -33,7 +33,7 @@ public final class Attribution implements Parcelable {
/** /**
* The tag of this attribution. From the &lt;manifest&gt; tag's "tag" attribute * The tag of this attribution. From the &lt;manifest&gt; tag's "tag" attribute
*/ */
private @NonNull String mTag; private final @NonNull String mTag;
/** /**
* The resource ID of the label of the attribution From the &lt;manifest&gt; tag's "label" * The resource ID of the label of the attribution From the &lt;manifest&gt; tag's "label"
@@ -43,7 +43,7 @@ public final class Attribution implements Parcelable {
// Code below generated by codegen v1.0.22. // Code below generated by codegen v1.0.23.
// //
// DO NOT MODIFY! // DO NOT MODIFY!
// CHECKSTYLE:OFF Generated code // CHECKSTYLE:OFF Generated code
@@ -146,10 +146,10 @@ public final class Attribution implements Parcelable {
}; };
@DataClass.Generated( @DataClass.Generated(
time = 1608139558081L, time = 1683311736586L,
codegenVersion = "1.0.22", codegenVersion = "1.0.23",
sourceFile = "frameworks/base/core/java/android/content/pm/Attribution.java", sourceFile = "frameworks/base/core/java/android/content/pm/Attribution.java",
inputSignatures = "private @android.annotation.NonNull java.lang.String mTag\nprivate final @android.annotation.IdRes int mLabel\nclass Attribution extends java.lang.Object implements [android.os.Parcelable]\n@com.android.internal.util.DataClass(genHiddenConstructor=true)") inputSignatures = "private final @android.annotation.NonNull java.lang.String mTag\nprivate final @android.annotation.IdRes int mLabel\nclass Attribution extends java.lang.Object implements [android.os.Parcelable]\n@com.android.internal.util.DataClass(genHiddenConstructor=true)")
@Deprecated @Deprecated
private void __metadata() {} private void __metadata() {}

View File

@@ -41,8 +41,8 @@ import java.util.List;
* @hide * @hide
*/ */
abstract class BaseParceledListSlice<T> implements Parcelable { abstract class BaseParceledListSlice<T> implements Parcelable {
private static String TAG = "ParceledListSlice"; private static final String TAG = "ParceledListSlice";
private static boolean DEBUG = false; private static final boolean DEBUG = false;
/* /*
* TODO get this number from somewhere else. For now set it to a quarter of * TODO get this number from somewhere else. For now set it to a quarter of

View File

@@ -172,7 +172,7 @@ public final class CapabilityParams implements Parcelable {
@NonNull @NonNull
private final String mKey; private final String mKey;
@NonNull @NonNull
private String mPrimaryValue; private final String mPrimaryValue;
@NonNull @NonNull
private Set<String> mAliases; private Set<String> mAliases;

View File

@@ -24,8 +24,8 @@ import android.os.Parcelable;
* @hide * @hide
*/ */
public class IncrementalStatesInfo implements Parcelable { public class IncrementalStatesInfo implements Parcelable {
private boolean mIsLoading; private final boolean mIsLoading;
private float mProgress; private final float mProgress;
public IncrementalStatesInfo(boolean isLoading, float progress) { public IncrementalStatesInfo(boolean isLoading, float progress) {
mIsLoading = isLoading; mIsLoading = isLoading;

View File

@@ -29,7 +29,7 @@ import android.os.Parcelable;
*/ */
public class KeySet implements Parcelable { public class KeySet implements Parcelable {
private IBinder token; private final IBinder token;
/** @hide */ /** @hide */
public KeySet(IBinder token) { public KeySet(IBinder token) {

View File

@@ -1680,7 +1680,8 @@ public class LauncherApps {
mCallbacks.add(toAdd); mCallbacks.add(toAdd);
} }
private IOnAppsChangedListener.Stub mAppsChangedListener = new IOnAppsChangedListener.Stub() { private final IOnAppsChangedListener.Stub mAppsChangedListener =
new IOnAppsChangedListener.Stub() {
@Override @Override
public void onPackageRemoved(UserHandle user, String packageName) public void onPackageRemoved(UserHandle user, String packageName)
@@ -1815,7 +1816,7 @@ public class LauncherApps {
private static final int MSG_SHORTCUT_CHANGED = 8; private static final int MSG_SHORTCUT_CHANGED = 8;
private static final int MSG_LOADING_PROGRESS_CHANGED = 9; private static final int MSG_LOADING_PROGRESS_CHANGED = 9;
private LauncherApps.Callback mCallback; private final LauncherApps.Callback mCallback;
private static class CallbackInfo { private static class CallbackInfo {
String[] packageNames; String[] packageNames;

View File

@@ -502,6 +502,6 @@ public class PackageItemInfo {
} }
private final Collator sCollator = Collator.getInstance(); private final Collator sCollator = Collator.getInstance();
private PackageManager mPM; private final PackageManager mPM;
} }
} }

View File

@@ -477,7 +477,8 @@ public class PermissionInfo extends PackageItemInfo implements Parcelable {
*/ */
public @Nullable CharSequence nonLocalizedDescription; public @Nullable CharSequence nonLocalizedDescription;
private static ForStringSet sForStringSet = Parcelling.Cache.getOrCreate(ForStringSet.class); private static final ForStringSet sForStringSet =
Parcelling.Cache.getOrCreate(ForStringSet.class);
/** /**
* A {@link Set} of trusted signing certificate digests. If this permission has the {@link * A {@link Set} of trusted signing certificate digests. If this permission has the {@link

View File

@@ -558,6 +558,6 @@ public class ResolveInfo implements Parcelable {
} }
private final Collator mCollator = Collator.getInstance(); private final Collator mCollator = Collator.getInstance();
private PackageManager mPM; private final PackageManager mPM;
} }
} }

View File

@@ -41,7 +41,7 @@ public class ParseTypeImpl implements ParseInput, ParseResult<Object> {
public static final boolean DEBUG_THROW_ALL_ERRORS = false; public static final boolean DEBUG_THROW_ALL_ERRORS = false;
@NonNull @NonNull
private Callback mCallback; private final Callback mCallback;
private Object mResult; private Object mResult;