Merge "Fix mute icon for streams routed to bluetooth"
diff --git a/Android.bp b/Android.bp
index 7687270..4ef6c5e 100644
--- a/Android.bp
+++ b/Android.bp
@@ -798,7 +798,10 @@
"--multi-dex",
],
- plugins: ["view-inspector-annotation-processor"],
+ plugins: [
+ "view-inspector-annotation-processor",
+ "staledataclass-annotation-processor",
+ ],
}
filegroup {
@@ -838,14 +841,26 @@
name: "framework",
defaults: ["framework-defaults"],
javac_shard_size: 150,
+ required: [
+ "framework-platform-compat-config",
+ "libcore-platform-compat-config",
+ ],
}
java_library {
name: "framework-annotation-proc",
defaults: ["framework-defaults"],
installable: false,
- // Use UsedByApps annotation processor
- plugins: ["unsupportedappusage-annotation-processor"],
+ plugins: [
+ "unsupportedappusage-annotation-processor",
+ "compat-changeid-annotation-processor",
+ ],
+}
+
+platform_compat_config {
+ name: "framework-platform-compat-config",
+ prefix: "framework",
+ src: ":framework-annotation-proc",
}
// A library including just UnsupportedAppUsage.java classes.
diff --git a/api/test-current.txt b/api/test-current.txt
index 46a0e1b..b43917d 100644
--- a/api/test-current.txt
+++ b/api/test-current.txt
@@ -3042,6 +3042,7 @@
field public static final String SCREENRECORD_LONG_PRESS = "settings_screenrecord_long_press";
field public static final String SEAMLESS_TRANSFER = "settings_seamless_transfer";
field public static final String SETTINGS_WIFITRACKER2 = "settings_wifitracker2";
+ field public static final String USE_BUGREPORT_API = "settings_use_bugreport_api";
}
public class TimeUtils {
diff --git a/core/java/android/app/Activity.java b/core/java/android/app/Activity.java
index 61e2ae9..f4df6b7 100644
--- a/core/java/android/app/Activity.java
+++ b/core/java/android/app/Activity.java
@@ -808,7 +808,9 @@
/*package*/ ActivityInfo mActivityInfo;
@UnsupportedAppUsage
/*package*/ ActivityThread mMainThread;
- @UnsupportedAppUsage
+ @UnsupportedAppUsage(trackingBug = 137825207, maxTargetSdk = Build.VERSION_CODES.Q,
+ publicAlternatives = "Use {@code androidx.fragment.app.Fragment} and "
+ + "{@code androidx.fragment.app.FragmentManager} instead")
Activity mParent;
@UnsupportedAppUsage
boolean mCalled;
diff --git a/core/java/android/hardware/radio/TunerAdapter.java b/core/java/android/hardware/radio/TunerAdapter.java
index be2846f..aa5480a 100644
--- a/core/java/android/hardware/radio/TunerAdapter.java
+++ b/core/java/android/hardware/radio/TunerAdapter.java
@@ -271,6 +271,8 @@
mCallback.setProgramListObserver(list, () -> {
try {
mTuner.stopProgramListUpdates();
+ } catch (IllegalStateException ex) {
+ // it's fine to not stop updates if tuner is already closed
} catch (RemoteException ex) {
Log.e(TAG, "Couldn't stop program list updates", ex);
}
diff --git a/core/java/android/os/ZygoteProcess.java b/core/java/android/os/ZygoteProcess.java
index cdd0d45..eaf9929 100644
--- a/core/java/android/os/ZygoteProcess.java
+++ b/core/java/android/os/ZygoteProcess.java
@@ -738,6 +738,31 @@
}
/**
+ * Notify the Zygote processes that boot completed.
+ */
+ public void bootCompleted() {
+ // Notify both the 32-bit and 64-bit zygote.
+ if (Build.SUPPORTED_32_BIT_ABIS.length > 0) {
+ bootCompleted(Build.SUPPORTED_32_BIT_ABIS[0]);
+ }
+ if (Build.SUPPORTED_64_BIT_ABIS.length > 0) {
+ bootCompleted(Build.SUPPORTED_64_BIT_ABIS[0]);
+ }
+ }
+
+ private void bootCompleted(String abi) {
+ try {
+ synchronized (mLock) {
+ ZygoteState state = openZygoteSocketIfNeeded(abi);
+ state.mZygoteOutputWriter.write("1\n--boot-completed\n");
+ state.mZygoteOutputWriter.flush();
+ }
+ } catch (Exception ex) {
+ throw new RuntimeException("Failed to inform zygote of boot_completed", ex);
+ }
+ }
+
+ /**
* Push hidden API blacklisting exemptions into the zygote process(es).
*
* <p>The list of exemptions will take affect for all new processes forked from the zygote after
diff --git a/core/java/android/os/image/DynamicSystemManager.java b/core/java/android/os/image/DynamicSystemManager.java
index cec1945..e4f88c5 100644
--- a/core/java/android/os/image/DynamicSystemManager.java
+++ b/core/java/android/os/image/DynamicSystemManager.java
@@ -76,7 +76,7 @@
@RequiresPermission(android.Manifest.permission.MANAGE_DYNAMIC_SYSTEM)
public boolean commit() {
try {
- return mService.commit();
+ return mService.setEnable(true, true);
} catch (RemoteException e) {
throw new RuntimeException(e.toString());
}
@@ -188,9 +188,9 @@
* @return {@code true} if the call succeeds. {@code false} if there is no installed image.
*/
@RequiresPermission(android.Manifest.permission.MANAGE_DYNAMIC_SYSTEM)
- public boolean setEnable(boolean enable) {
+ public boolean setEnable(boolean enable, boolean oneShot) {
try {
- return mService.setEnable(enable);
+ return mService.setEnable(enable, oneShot);
} catch (RemoteException e) {
throw new RuntimeException(e.toString());
}
diff --git a/core/java/android/os/image/IDynamicSystemService.aidl b/core/java/android/os/image/IDynamicSystemService.aidl
index a34daca..2f4ab2d 100644
--- a/core/java/android/os/image/IDynamicSystemService.aidl
+++ b/core/java/android/os/image/IDynamicSystemService.aidl
@@ -72,9 +72,11 @@
/**
* Enable or disable DynamicSystem.
*
+ * @param oneShot If true, the GSI will boot once and then disable itself.
+ *
* @return true if the call succeeds
*/
- boolean setEnable(boolean enable);
+ boolean setEnable(boolean enable, boolean oneShot);
/**
* Write a chunk of the DynamicSystem system image
@@ -83,10 +85,4 @@
*/
boolean write(in byte[] buf);
- /**
- * Finish write and make device to boot into the it after reboot.
- *
- * @return true if the call succeeds
- */
- boolean commit();
}
diff --git a/core/java/android/provider/ContactsContract.java b/core/java/android/provider/ContactsContract.java
index 81e1eb9..af3a16c 100644
--- a/core/java/android/provider/ContactsContract.java
+++ b/core/java/android/provider/ContactsContract.java
@@ -870,8 +870,8 @@
protected interface ContactOptionsColumns {
/**
* The number of times a contact has been contacted.
- * <p class="caution"><b>Caution: </b>As of January 7, 2019, this field is obsolete. For
- * more information, see the
+ * <p class="caution"><b>Caution: </b>If you publish your app to the Google Play Store,
+ * this field is obsolete, regardless of Android version. For more information, see the
* <a href="/guide/topics/providers/contacts-provider#ObsoleteData">Contacts Provider</a>
* page.</p>
* <P>Type: INTEGER</P>
@@ -885,8 +885,8 @@
/**
* The last time a contact was contacted.
- * <p class="caution"><b>Caution: </b>As of January 7, 2019, this field is obsolete. For
- * more information, see the
+ * <p class="caution"><b>Caution: </b>If you publish your app to the Google Play Store,
+ * this field is obsolete, regardless of Android version. For more information, see the
* <a href="/guide/topics/providers/contacts-provider#ObsoleteData">Contacts Provider</a>
* page.</p>
* <P>Type: INTEGER</P>
@@ -1691,10 +1691,10 @@
* TIMES_CONTACTED field is incremented by 1 and the LAST_TIME_CONTACTED
* field is populated with the current system time.
*
- * <p class="caution"><b>Caution: </b>As of January 7, 2019, this method is obsolete. For
- * more information, see the
+ * <p class="caution"><b>Caution: </b>If you publish your app to the Google Play Store,
+ * this field is obsolete, regardless of Android version. For more information, see the
* <a href="/guide/topics/providers/contacts-provider#ObsoleteData">Contacts Provider</a>
- * page.
+ * page.</p>
*
* @param resolver the ContentResolver to use
* @param contactId the person who was contacted
@@ -1730,8 +1730,8 @@
* Frequent contacts are no longer included in the result as of
* Android version {@link android.os.Build.VERSION_CODES#Q}.
*
- * <p class="caution"><b>Caution: </b>As of January 7, 2019, this field no longer sorts
- * results based on contacts frequency. For more information, see the
+ * <p class="caution"><b>Caution: </b>If you publish your app to the Google Play Store, this
+ * field doesn't sort results based on contacts frequency. For more information, see the
* <a href="/guide/topics/providers/contacts-provider#ObsoleteData">Contacts Provider</a>
* page.
*/
@@ -1745,8 +1745,8 @@
* Android version {@link android.os.Build.VERSION_CODES#Q}.
* This URI always returns an empty cursor.
*
- * <p class="caution"><b>Caution: </b>As of January 7, 2019, this field no longer sorts
- * results based on contacts frequency. For more information, see the
+ * <p class="caution"><b>Caution: </b>If you publish your app to the Google Play Store, this
+ * field doesn't sort results based on contacts frequency. For more information, see the
* <a href="/guide/topics/providers/contacts-provider#ObsoleteData">Contacts Provider</a>
* page.
*/
@@ -1760,8 +1760,8 @@
* various parts of the contact name. The filter argument should be passed
* as an additional path segment after this URI.
*
- * <p class="caution"><b>Caution: </b>As of January 7, 2019, this field no longer sorts
- * results based on contacts frequency. For more information, see the
+ * <p class="caution"><b>Caution: </b>If you publish your app to the Google Play Store, this
+ * field doesn't sort results based on contacts frequency. For more information, see the
* <a href="/guide/topics/providers/contacts-provider#ObsoleteData">Contacts Provider</a>
* page.
*/
@@ -4292,10 +4292,10 @@
* Android version {@link android.os.Build.VERSION_CODES#Q}.
* This column always contains 0.
*
- * <p class="caution"><b>Caution: </b>As of January 7, 2019, this field is obsolete.
- * For more information, see the
+ * <p class="caution"><b>Caution: </b>If you publish your app to the Google Play Store,
+ * this field is obsolete, regardless of Android version. For more information, see the
* <a href="/guide/topics/providers/contacts-provider#ObsoleteData">Contacts Provider</a>
- * page.
+ * page.</p>
*/
@Deprecated
public static final String LAST_TIME_USED = "last_time_used";
@@ -4306,10 +4306,10 @@
* Android version {@link android.os.Build.VERSION_CODES#Q}.
* This column always contains 0.
*
- * <p class="caution"><b>Caution: </b>As of January 7, 2019, this field is obsolete.
- * For more information, see the
+ * <p class="caution"><b>Caution: </b>If you publish your app to the Google Play Store,
+ * this field is obsolete, regardless of Android version. For more information, see the
* <a href="/guide/topics/providers/contacts-provider#ObsoleteData">Contacts Provider</a>
- * page.
+ * page.</p>
*/
@Deprecated
public static final String TIMES_USED = "times_used";
@@ -5259,8 +5259,8 @@
/**
* The content:// style URI for this table.
*
- * <p class="caution"><b>Caution: </b>As of January 7, 2019, this field no longer
- * sorts results based on contacts frequency. For more information, see the
+ * <p class="caution"><b>Caution: </b>If you publish your app to the Google Play Store, this
+ * field doesn't sort results based on contacts frequency. For more information, see the
* <a href="/guide/topics/providers/contacts-provider#ObsoleteData">Contacts Provider</a>
* page.
*
@@ -5277,8 +5277,8 @@
/**
* <p>URI used for the "enterprise caller-id".</p>
*
- * <p class="caution"><b>Caution: </b>As of January 7, 2019, this field no longer
- * sorts results based on contacts frequency. For more information, see the
+ * <p class="caution"><b>Caution: </b>If you publish your app to the Google Play Store, this
+ * field doesn't sort results based on contacts frequency. For more information, see the
* <a href="/guide/topics/providers/contacts-provider#ObsoleteData">Contacts Provider</a>
* page.
*
@@ -6079,8 +6079,8 @@
* to display names as well as phone numbers. The filter argument should be passed
* as an additional path segment after this URI.
*
- * <p class="caution"><b>Caution: </b>As of January 7, 2019, this field no longer
- * sorts results based on contacts frequency. For more information, see the
+ * <p class="caution"><b>Caution: </b>This field deosn't sort results based on contacts
+ * frequency. For more information, see the
* <a href="/guide/topics/providers/contacts-provider#ObsoleteData">Contacts Provider</a>
* page.
*/
@@ -6092,8 +6092,9 @@
* same columns. This URI requires {@link ContactsContract#DIRECTORY_PARAM_KEY} in
* parameters, otherwise it will throw IllegalArgumentException.
*
- * <p class="caution"><b>Caution: </b>As of January 7, 2019, this field no longer sorts
- * results based on contacts frequency. For more information, see the
+ * <p class="caution"><b>Caution: </b>If you publish your app to the Google Play Store,
+ * this field doesn't sort results based on contacts frequency. For more information,
+ * see the
* <a href="/guide/topics/providers/contacts-provider#ObsoleteData">Contacts Provider</a>
* page.
*/
@@ -6360,8 +6361,9 @@
* as an additional path segment after this URI.
* </p>
*
- * <p class="caution"><b>Caution: </b>As of January 7, 2019, this field no longer sorts
- * results based on contacts frequency. For more information, see the
+ * <p class="caution"><b>Caution: </b>If you publish your app to the Google Play Store,
+ * this field doesn't sort results based on contacts frequency. For more information,
+ * see the
* <a href="/guide/topics/providers/contacts-provider#ObsoleteData">Contacts Provider</a>
* page.</p>
*
@@ -6383,8 +6385,9 @@
* same columns. This URI requires {@link ContactsContract#DIRECTORY_PARAM_KEY} in
* parameters, otherwise it will throw IllegalArgumentException.
*
- * <p class="caution"><b>Caution: </b>As of January 7, 2019, this field no longer
- * sorts results based on contacts frequency. For more information, see the
+ * <p class="caution"><b>Caution: </b>If you publish your app to the Google Play Store,
+ * this field doesn't sort results based on contacts frequency. For more information,
+ * see the
* <a href="/guide/topics/providers/contacts-provider#ObsoleteData">Contacts Provider</a>
* page.
*/
@@ -7602,8 +7605,8 @@
* <p>Similar to {@link Phone#CONTENT_FILTER_URI}, but allows users to filter callable
* data.
*
- * <p class="caution"><b>Caution: </b>As of January 7, 2019, this field no longer
- * sorts results based on contacts frequency. For more information, see the
+ * <p class="caution"><b>Caution: </b>This field no longer sorts results based on
+ * contacts frequency. For more information, see the
* <a href="/guide/topics/providers/contacts-provider#ObsoleteData">Contacts Provider</a>
* page.
*/
@@ -7615,8 +7618,9 @@
* callable data. This URI requires {@link ContactsContract#DIRECTORY_PARAM_KEY} in
* parameters, otherwise it will throw IllegalArgumentException.
*
- * <p class="caution"><b>Caution: </b>As of January 7, 2019, this field no longer
- * sorts results based on contacts frequency. For more information, see the
+ * <p class="caution"><b>Caution: </b>If you publish your app to the Google Play Store,
+ * this field doesn't sort results based on contacts frequency. For more information,
+ * see the
* <a href="/guide/topics/providers/contacts-provider#ObsoleteData">Contacts Provider</a>
* page.</p>
*/
@@ -7646,8 +7650,9 @@
* <p>The content:// style URI for these data items, which allows for a query parameter
* to be appended onto the end to filter for data items matching the query.
*
- * <p class="caution"><b>Caution: </b>As of January 7, 2019, this field no longer
- * sorts results based on contacts frequency. For more information, see the
+ * <p class="caution"><b>Caution: </b>If you publish your app to the Google Play Store,
+ * this field doesn't sort results based on contacts frequency. For more information,
+ * see the
* <a href="/guide/topics/providers/contacts-provider#ObsoleteData">Contacts Provider</a>
* page.
*/
@@ -8298,15 +8303,14 @@
}
/**
- * <p class="caution"><b>Caution: </b>As of January 7, 2019, this class is obsolete. For
- * more information, see the
- * <a href="/guide/topics/providers/contacts-provider#ObsoleteData">Contacts Provider</a>
- * page.
- * </p>
* <p>
* API allowing applications to send usage information for each {@link Data} row to the
* Contacts Provider. Applications can also clear all usage information.
* </p>
+ * <p class="caution"><b>Caution: </b>If you publish your app to the Google Play Store,
+ * this field is obsolete, regardless of Android version. For more information, see the
+ * <a href="/guide/topics/providers/contacts-provider#ObsoleteData">Contacts Provider</a>
+ * page.</p>
* <p>
* With the feedback, Contacts Provider may return more contextually appropriate results for
* Data listing, typically supplied with
diff --git a/core/java/android/service/autofill/FillContext.java b/core/java/android/service/autofill/FillContext.java
index 70f434c..8331550 100644
--- a/core/java/android/service/autofill/FillContext.java
+++ b/core/java/android/service/autofill/FillContext.java
@@ -30,6 +30,8 @@
import android.util.SparseIntArray;
import android.view.autofill.AutofillId;
+import com.android.internal.util.DataClass;
+
import java.util.LinkedList;
/**
@@ -46,58 +48,36 @@
* to {@link FillResponse.Builder#setClientState(Bundle)} to avoid interpreting
* the UI state again while saving.
*/
+@DataClass(
+ genHiddenConstructor = true,
+ genAidl = false)
public final class FillContext implements Parcelable {
+
+ /**
+ * The id of the {@link FillRequest fill request} this context
+ * corresponds to. This is useful to associate your custom client
+ * state with every request to avoid reinterpreting the UI when saving
+ * user data.
+ */
private final int mRequestId;
+
+ /**
+ * The screen content.
+ */
private final @NonNull AssistStructure mStructure;
+
+ /**
+ * The AutofillId of the view that triggered autofill.
+ */
private final @NonNull AutofillId mFocusedId;
/**
* Lookup table AutofillId->ViewNode to speed up {@link #findViewNodesByAutofillIds}
* This is purely a cache and can be deleted at any time
*/
- @Nullable private ArrayMap<AutofillId, AssistStructure.ViewNode> mViewNodeLookupTable;
+ private transient @Nullable ArrayMap<AutofillId, AssistStructure.ViewNode> mViewNodeLookupTable;
- /** @hide */
- public FillContext(int requestId, @NonNull AssistStructure structure,
- @NonNull AutofillId autofillId) {
- mRequestId = requestId;
- mStructure = structure;
- mFocusedId = autofillId;
- }
-
- private FillContext(Parcel parcel) {
- this(parcel.readInt(), parcel.readParcelable(null), parcel.readParcelable(null));
- }
-
- /**
- * Gets the id of the {@link FillRequest fill request} this context
- * corresponds to. This is useful to associate your custom client
- * state with every request to avoid reinterpreting the UI when saving
- * user data.
- *
- * @return The request id.
- */
- public int getRequestId() {
- return mRequestId;
- }
-
- /**
- * @return The screen content.
- */
- @NonNull
- public AssistStructure getStructure() {
- return mStructure;
- }
-
- /**
- * @return the AutofillId of the view that triggered autofill.
- */
- @NonNull
- public AutofillId getFocusedId() {
- return mFocusedId;
- }
-
@Override
public String toString() {
if (!sDebug) return super.toString();
@@ -105,18 +85,6 @@
return "FillContext [reqId=" + mRequestId + ", focusedId=" + mFocusedId + "]";
}
- @Override
- public int describeContents() {
- return 0;
- }
-
- @Override
- public void writeToParcel(Parcel parcel, int flags) {
- parcel.writeInt(mRequestId);
- parcel.writeParcelable(mStructure, flags);
- parcel.writeParcelable(mFocusedId, flags);
- }
-
/**
* Finds {@link ViewNode ViewNodes} that have the requested ids.
*
@@ -190,18 +158,119 @@
return foundNodes;
}
- public static final @android.annotation.NonNull Parcelable.Creator<FillContext> CREATOR =
- new Parcelable.Creator<FillContext>() {
- @Override
- @NonNull
- public FillContext createFromParcel(Parcel parcel) {
- return new FillContext(parcel);
- }
+
+ // Code below generated by codegen v1.0.0.
+ //
+ // DO NOT MODIFY!
+ //
+ // To regenerate run:
+ // $ codegen $ANDROID_BUILD_TOP/frameworks/base/core/java/android/service/autofill/FillContext.java
+ //
+ // CHECKSTYLE:OFF Generated code
+
+ /**
+ * Creates a new FillContext.
+ *
+ * @param requestId
+ * The id of the {@link FillRequest fill request} this context
+ * corresponds to. This is useful to associate your custom client
+ * state with every request to avoid reinterpreting the UI when saving
+ * user data.
+ * @param structure
+ * The screen content.
+ * @param focusedId
+ * The AutofillId of the view that triggered autofill.
+ * @hide
+ */
+ @DataClass.Generated.Member
+ public FillContext(
+ int requestId,
+ @NonNull AssistStructure structure,
+ @NonNull AutofillId focusedId) {
+ this.mRequestId = requestId;
+ this.mStructure = structure;
+ com.android.internal.util.AnnotationValidations.validate(
+ NonNull.class, null, mStructure);
+ this.mFocusedId = focusedId;
+ com.android.internal.util.AnnotationValidations.validate(
+ NonNull.class, null, mFocusedId);
+
+ // onConstructed(); // You can define this method to get a callback
+ }
+
+ /**
+ * The id of the {@link FillRequest fill request} this context
+ * corresponds to. This is useful to associate your custom client
+ * state with every request to avoid reinterpreting the UI when saving
+ * user data.
+ */
+ @DataClass.Generated.Member
+ public int getRequestId() {
+ return mRequestId;
+ }
+
+ /**
+ * The screen content.
+ */
+ @DataClass.Generated.Member
+ public @NonNull AssistStructure getStructure() {
+ return mStructure;
+ }
+
+ /**
+ * The AutofillId of the view that triggered autofill.
+ */
+ @DataClass.Generated.Member
+ public @NonNull AutofillId getFocusedId() {
+ return mFocusedId;
+ }
+
+ @Override
+ @DataClass.Generated.Member
+ public void writeToParcel(Parcel dest, int flags) {
+ // You can override field parcelling by defining methods like:
+ // void parcelFieldName(Parcel dest, int flags) { ... }
+
+ dest.writeInt(mRequestId);
+ dest.writeTypedObject(mStructure, flags);
+ dest.writeTypedObject(mFocusedId, flags);
+ }
+
+ @Override
+ @DataClass.Generated.Member
+ public int describeContents() { return 0; }
+
+ @DataClass.Generated.Member
+ public static final @NonNull Parcelable.Creator<FillContext> CREATOR
+ = new Parcelable.Creator<FillContext>() {
@Override
- @NonNull
public FillContext[] newArray(int size) {
return new FillContext[size];
}
+
+ @Override
+ @SuppressWarnings({"unchecked", "RedundantCast"})
+ public FillContext createFromParcel(Parcel in) {
+ // You can override field unparcelling by defining methods like:
+ // static FieldType unparcelFieldName(Parcel in) { ... }
+
+ int requestId = in.readInt();
+ AssistStructure structure = (AssistStructure) in.readTypedObject(AssistStructure.CREATOR);
+ AutofillId focusedId = (AutofillId) in.readTypedObject(AutofillId.CREATOR);
+ return new FillContext(
+ requestId,
+ structure,
+ focusedId);
+ }
};
+
+ @DataClass.Generated(
+ time = 1565152135263L,
+ codegenVersion = "1.0.0",
+ sourceFile = "frameworks/base/core/java/android/service/autofill/FillContext.java",
+ inputSignatures = "private final int mRequestId\nprivate final @android.annotation.NonNull android.app.assist.AssistStructure mStructure\nprivate final @android.annotation.NonNull android.view.autofill.AutofillId mFocusedId\nprivate transient @android.annotation.Nullable android.util.ArrayMap<android.view.autofill.AutofillId,android.app.assist.AssistStructure.ViewNode> mViewNodeLookupTable\npublic @java.lang.Override java.lang.String toString()\npublic @android.annotation.NonNull android.app.assist.AssistStructure.ViewNode[] findViewNodesByAutofillIds(android.view.autofill.AutofillId[])\nclass FillContext extends java.lang.Object implements [android.os.Parcelable]\n@com.android.internal.util.DataClass(genHiddenConstructor=true, genAidl=false)")
+ @Deprecated
+ private void __metadata() {}
+
}
diff --git a/core/java/android/service/autofill/FillRequest.java b/core/java/android/service/autofill/FillRequest.java
index 91f77ea..e53ebad 100644
--- a/core/java/android/service/autofill/FillRequest.java
+++ b/core/java/android/service/autofill/FillRequest.java
@@ -24,6 +24,7 @@
import android.os.Parcelable;
import android.view.View;
+import com.android.internal.util.DataClass;
import com.android.internal.util.Preconditions;
import java.lang.annotation.Retention;
@@ -39,6 +40,10 @@
*
* @see AutofillService#onFillRequest(FillRequest, android.os.CancellationSignal, FillCallback)
*/
+@DataClass(
+ genToString = true,
+ genHiddenConstructor = true,
+ genHiddenConstDefs = true)
public final class FillRequest implements Parcelable {
/**
@@ -63,54 +68,45 @@
* is called. For example, standard {@link android.widget.TextView} views show an
* {@code AUTOFILL} option in the overflow menu that triggers such request.
*/
- public static final int FLAG_MANUAL_REQUEST = 0x1;
+ public static final @RequestFlags int FLAG_MANUAL_REQUEST = 0x1;
/**
* Indicates this request was made using
* <a href="AutofillService.html#CompatibilityMode">compatibility mode</a>.
*/
- public static final int FLAG_COMPATIBILITY_MODE_REQUEST = 0x2;
+ public static final @RequestFlags int FLAG_COMPATIBILITY_MODE_REQUEST = 0x2;
/** @hide */
public static final int INVALID_REQUEST_ID = Integer.MIN_VALUE;
- /** @hide */
- @IntDef(flag = true, prefix = { "FLAG_" }, value = {
- FLAG_MANUAL_REQUEST, FLAG_COMPATIBILITY_MODE_REQUEST
- })
- @Retention(RetentionPolicy.SOURCE)
- @interface RequestFlags{}
-
- private final int mId;
- private final @RequestFlags int mFlags;
- private final @NonNull ArrayList<FillContext> mContexts;
- private final @Nullable Bundle mClientState;
-
- private FillRequest(@NonNull Parcel parcel) {
- mId = parcel.readInt();
- mContexts = new ArrayList<>();
- parcel.readParcelableList(mContexts, null);
-
- mClientState = parcel.readBundle();
- mFlags = parcel.readInt();
- }
-
- /** @hide */
- public FillRequest(int id, @NonNull ArrayList<FillContext> contexts,
- @Nullable Bundle clientState, @RequestFlags int flags) {
- mId = id;
- mFlags = Preconditions.checkFlagsArgument(flags,
- FLAG_MANUAL_REQUEST | FLAG_COMPATIBILITY_MODE_REQUEST);
- mContexts = Preconditions.checkCollectionElementsNotNull(contexts, "contexts");
- mClientState = clientState;
- }
-
/**
* Gets the unique id of this request.
*/
- public int getId() {
- return mId;
- }
+ private final int mId;
+
+ /**
+ * Gets the contexts associated with each previous fill request.
+ *
+ * <p><b>Note:</b> Starting on Android {@link android.os.Build.VERSION_CODES#Q}, it could also
+ * include contexts from requests whose {@link SaveInfo} had the
+ * {@link SaveInfo#FLAG_DELAY_SAVE} flag.
+ */
+ private final @NonNull List<FillContext> mFillContexts;
+
+ /**
+ * Gets the latest client state bundle set by the service in a
+ * {@link FillResponse.Builder#setClientState(Bundle) fill response}.
+ *
+ * <p><b>Note:</b> Prior to Android {@link android.os.Build.VERSION_CODES#P}, only client state
+ * bundles set by {@link FillResponse.Builder#setClientState(Bundle)} were considered. On
+ * Android {@link android.os.Build.VERSION_CODES#P} and higher, bundles set in the result of
+ * an authenticated request through the
+ * {@link android.view.autofill.AutofillManager#EXTRA_CLIENT_STATE} extra are
+ * also considered (and take precedence when set).
+ *
+ * @return The client state.
+ */
+ private final @Nullable Bundle mClientState;
/**
* Gets the flags associated with this request.
@@ -118,8 +114,105 @@
* @return any combination of {@link #FLAG_MANUAL_REQUEST} and
* {@link #FLAG_COMPATIBILITY_MODE_REQUEST}.
*/
- public @RequestFlags int getFlags() {
- return mFlags;
+ private final @RequestFlags int mFlags;
+
+ private void onConstructed() {
+ Preconditions.checkCollectionElementsNotNull(mFillContexts, "contexts");
+ }
+
+
+
+ // Code below generated by codegen v1.0.0.
+ //
+ // DO NOT MODIFY!
+ //
+ // To regenerate run:
+ // $ codegen $ANDROID_BUILD_TOP/frameworks/base/core/java/android/service/autofill/FillRequest.java
+ //
+ // CHECKSTYLE:OFF Generated code
+
+ /** @hide */
+ @IntDef(flag = true, prefix = "FLAG_", value = {
+ FLAG_MANUAL_REQUEST,
+ FLAG_COMPATIBILITY_MODE_REQUEST
+ })
+ @Retention(RetentionPolicy.SOURCE)
+ @DataClass.Generated.Member
+ public @interface RequestFlags {}
+
+ /** @hide */
+ @DataClass.Generated.Member
+ public static String requestFlagsToString(@RequestFlags int value) {
+ return com.android.internal.util.BitUtils.flagsToString(
+ value, FillRequest::singleRequestFlagsToString);
+ }
+
+ @DataClass.Generated.Member
+ static String singleRequestFlagsToString(@RequestFlags int value) {
+ switch (value) {
+ case FLAG_MANUAL_REQUEST:
+ return "FLAG_MANUAL_REQUEST";
+ case FLAG_COMPATIBILITY_MODE_REQUEST:
+ return "FLAG_COMPATIBILITY_MODE_REQUEST";
+ default: return Integer.toHexString(value);
+ }
+ }
+
+ /**
+ * Creates a new FillRequest.
+ *
+ * @param id
+ * Gets the unique id of this request.
+ * @param fillContexts
+ * Gets the contexts associated with each previous fill request.
+ *
+ * <p><b>Note:</b> Starting on Android {@link android.os.Build.VERSION_CODES#Q}, it could also
+ * include contexts from requests whose {@link SaveInfo} had the
+ * {@link SaveInfo#FLAG_DELAY_SAVE} flag.
+ * @param clientState
+ * Gets the latest client state bundle set by the service in a
+ * {@link FillResponse.Builder#setClientState(Bundle) fill response}.
+ *
+ * <p><b>Note:</b> Prior to Android {@link android.os.Build.VERSION_CODES#P}, only client state
+ * bundles set by {@link FillResponse.Builder#setClientState(Bundle)} were considered. On
+ * Android {@link android.os.Build.VERSION_CODES#P} and higher, bundles set in the result of
+ * an authenticated request through the
+ * {@link android.view.autofill.AutofillManager#EXTRA_CLIENT_STATE} extra are
+ * also considered (and take precedence when set).
+ * @param flags
+ * Gets the flags associated with this request.
+ *
+ * @return any combination of {@link #FLAG_MANUAL_REQUEST} and
+ * {@link #FLAG_COMPATIBILITY_MODE_REQUEST}.
+ * @hide
+ */
+ @DataClass.Generated.Member
+ public FillRequest(
+ int id,
+ @NonNull List<FillContext> fillContexts,
+ @Nullable Bundle clientState,
+ @RequestFlags int flags) {
+ this.mId = id;
+ this.mFillContexts = fillContexts;
+ com.android.internal.util.AnnotationValidations.validate(
+ NonNull.class, null, mFillContexts);
+ this.mClientState = clientState;
+ this.mFlags = flags;
+
+ Preconditions.checkFlagsArgument(
+ mFlags,
+ FLAG_MANUAL_REQUEST
+ | FLAG_COMPATIBILITY_MODE_REQUEST);
+
+ onConstructed();
+ }
+
+ /**
+ * Gets the unique id of this request.
+ */
+ @DataClass.Generated.Member
+ public int getId() {
+ return mId;
}
/**
@@ -129,13 +222,9 @@
* include contexts from requests whose {@link SaveInfo} had the
* {@link SaveInfo#FLAG_DELAY_SAVE} flag.
*/
+ @DataClass.Generated.Member
public @NonNull List<FillContext> getFillContexts() {
- return mContexts;
- }
-
- @Override
- public String toString() {
- return "FillRequest: [id=" + mId + ", flags=" + mFlags + ", ctxts= " + mContexts + "]";
+ return mFillContexts;
}
/**
@@ -151,33 +240,89 @@
*
* @return The client state.
*/
+ @DataClass.Generated.Member
public @Nullable Bundle getClientState() {
return mClientState;
}
- @Override
- public int describeContents() {
- return 0;
+ /**
+ * Gets the flags associated with this request.
+ *
+ * @return any combination of {@link #FLAG_MANUAL_REQUEST} and
+ * {@link #FLAG_COMPATIBILITY_MODE_REQUEST}.
+ */
+ @DataClass.Generated.Member
+ public @RequestFlags int getFlags() {
+ return mFlags;
}
@Override
- public void writeToParcel(Parcel parcel, int flags) {
- parcel.writeInt(mId);
- parcel.writeParcelableList(mContexts, flags);
- parcel.writeBundle(mClientState);
- parcel.writeInt(mFlags);
+ @DataClass.Generated.Member
+ public String toString() {
+ // You can override field toString logic by defining methods like:
+ // String fieldNameToString() { ... }
+
+ return "FillRequest { " +
+ "id = " + mId + ", " +
+ "fillContexts = " + mFillContexts + ", " +
+ "clientState = " + mClientState + ", " +
+ "flags = " + requestFlagsToString(mFlags) +
+ " }";
}
- public static final @android.annotation.NonNull Parcelable.Creator<FillRequest> CREATOR =
- new Parcelable.Creator<FillRequest>() {
- @Override
- public FillRequest createFromParcel(Parcel parcel) {
- return new FillRequest(parcel);
- }
+ @Override
+ @DataClass.Generated.Member
+ public void writeToParcel(Parcel dest, int flags) {
+ // You can override field parcelling by defining methods like:
+ // void parcelFieldName(Parcel dest, int flags) { ... }
+ byte flg = 0;
+ if (mClientState != null) flg |= 0x4;
+ dest.writeByte(flg);
+ dest.writeInt(mId);
+ dest.writeParcelableList(mFillContexts, flags);
+ if (mClientState != null) dest.writeBundle(mClientState);
+ dest.writeInt(mFlags);
+ }
+
+ @Override
+ @DataClass.Generated.Member
+ public int describeContents() { return 0; }
+
+ @DataClass.Generated.Member
+ public static final @NonNull Parcelable.Creator<FillRequest> CREATOR
+ = new Parcelable.Creator<FillRequest>() {
@Override
public FillRequest[] newArray(int size) {
return new FillRequest[size];
}
+
+ @Override
+ @SuppressWarnings({"unchecked", "RedundantCast"})
+ public FillRequest createFromParcel(Parcel in) {
+ // You can override field unparcelling by defining methods like:
+ // static FieldType unparcelFieldName(Parcel in) { ... }
+
+ byte flg = in.readByte();
+ int id = in.readInt();
+ List<FillContext> fillContexts = new ArrayList<>();
+ in.readParcelableList(fillContexts, FillContext.class.getClassLoader());
+ Bundle clientState = (flg & 0x4) == 0 ? null : in.readBundle();
+ int flags = in.readInt();
+ return new FillRequest(
+ id,
+ fillContexts,
+ clientState,
+ flags);
+ }
};
+
+ @DataClass.Generated(
+ time = 1565152134349L,
+ codegenVersion = "1.0.0",
+ sourceFile = "frameworks/base/core/java/android/service/autofill/FillRequest.java",
+ inputSignatures = "public static final @android.service.autofill.FillRequest.RequestFlags int FLAG_MANUAL_REQUEST\npublic static final @android.service.autofill.FillRequest.RequestFlags int FLAG_COMPATIBILITY_MODE_REQUEST\npublic static final int INVALID_REQUEST_ID\nprivate final int mId\nprivate final @android.annotation.NonNull java.util.List<android.service.autofill.FillContext> mFillContexts\nprivate final @android.annotation.Nullable android.os.Bundle mClientState\nprivate final @android.service.autofill.FillRequest.RequestFlags int mFlags\nprivate void onConstructed()\nclass FillRequest extends java.lang.Object implements [android.os.Parcelable]\n@com.android.internal.util.DataClass(genToString=true, genHiddenConstructor=true, genHiddenConstDefs=true)")
+ @Deprecated
+ private void __metadata() {}
+
}
diff --git a/core/java/android/service/notification/NotificationAssistantService.java b/core/java/android/service/notification/NotificationAssistantService.java
index 12d3228..da40254 100644
--- a/core/java/android/service/notification/NotificationAssistantService.java
+++ b/core/java/android/service/notification/NotificationAssistantService.java
@@ -293,6 +293,11 @@
Log.w(TAG, "onNotificationEnqueued: Error receiving StatusBarNotification", e);
return;
}
+ if (sbn == null) {
+ Log.w(TAG, "onNotificationEnqueuedWithChannel: "
+ + "Error receiving StatusBarNotification");
+ return;
+ }
SomeArgs args = SomeArgs.obtain();
args.arg1 = sbn;
@@ -311,6 +316,10 @@
Log.w(TAG, "onNotificationSnoozed: Error receiving StatusBarNotification", e);
return;
}
+ if (sbn == null) {
+ Log.w(TAG, "onNotificationSnoozed: Error receiving StatusBarNotification");
+ return;
+ }
SomeArgs args = SomeArgs.obtain();
args.arg1 = sbn;
diff --git a/core/java/android/service/notification/NotificationListenerService.java b/core/java/android/service/notification/NotificationListenerService.java
index b44c9d5..78e30ab 100644
--- a/core/java/android/service/notification/NotificationListenerService.java
+++ b/core/java/android/service/notification/NotificationListenerService.java
@@ -1272,6 +1272,10 @@
Log.w(TAG, "onNotificationPosted: Error receiving StatusBarNotification", e);
return;
}
+ if (sbn == null) {
+ Log.w(TAG, "onNotificationPosted: Error receiving StatusBarNotification");
+ return;
+ }
try {
// convert icon metadata to legacy format for older clients
@@ -1313,6 +1317,10 @@
Log.w(TAG, "onNotificationRemoved: Error receiving StatusBarNotification", e);
return;
}
+ if (sbn == null) {
+ Log.w(TAG, "onNotificationRemoved: Error receiving StatusBarNotification");
+ return;
+ }
// protect subclass from concurrent modifications of (@link mNotificationKeys}.
synchronized (mLock) {
applyUpdateLocked(update);
diff --git a/core/java/android/util/FeatureFlagUtils.java b/core/java/android/util/FeatureFlagUtils.java
index 6aef5a5..a3ee3ad 100644
--- a/core/java/android/util/FeatureFlagUtils.java
+++ b/core/java/android/util/FeatureFlagUtils.java
@@ -41,13 +41,14 @@
public static final String SCREENRECORD_LONG_PRESS = "settings_screenrecord_long_press";
public static final String DYNAMIC_SYSTEM = "settings_dynamic_system";
public static final String SETTINGS_WIFITRACKER2 = "settings_wifitracker2";
+ public static final String USE_BUGREPORT_API = "settings_use_bugreport_api";
private static final Map<String, String> DEFAULT_FLAGS;
static {
DEFAULT_FLAGS = new HashMap<>();
DEFAULT_FLAGS.put("settings_audio_switcher", "true");
- DEFAULT_FLAGS.put("settings_call_bugreport_api", "false");
+ DEFAULT_FLAGS.put("settings_use_bugreport_api", "false");
DEFAULT_FLAGS.put("settings_mobile_network_v2", "true");
DEFAULT_FLAGS.put("settings_network_and_internet_v2", "true");
DEFAULT_FLAGS.put("settings_systemui_theme", "true");
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index 1779a80..6d4128b 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -13386,10 +13386,10 @@
if ((mPrivateFlags2 & PFLAG2_SUBTREE_ACCESSIBILITY_STATE_CHANGED) == 0) {
mPrivateFlags2 |= PFLAG2_SUBTREE_ACCESSIBILITY_STATE_CHANGED;
- if (mParent != null) {
+ if (mParent != null && mParent instanceof View) {
try {
mParent.notifySubtreeAccessibilityStateChanged(
- this, this, AccessibilityEvent.CONTENT_CHANGE_TYPE_SUBTREE);
+ this, (View) mParent, AccessibilityEvent.CONTENT_CHANGE_TYPE_SUBTREE);
} catch (AbstractMethodError e) {
Log.e(VIEW_LOG_TAG, mParent.getClass().getSimpleName() +
" does not fully implement ViewParent", e);
diff --git a/core/java/android/view/ViewGroup.java b/core/java/android/view/ViewGroup.java
index 82a5fa9..7ee8865 100644
--- a/core/java/android/view/ViewGroup.java
+++ b/core/java/android/view/ViewGroup.java
@@ -5144,7 +5144,7 @@
}
if (child.getVisibility() != View.GONE) {
- notifySubtreeAccessibilityStateChangedIfNeeded();
+ child.notifySubtreeAccessibilityStateChangedIfNeeded();
}
if (mTransientIndices != null) {
@@ -5432,7 +5432,7 @@
dispatchViewRemoved(view);
if (view.getVisibility() != View.GONE) {
- notifySubtreeAccessibilityStateChangedIfNeeded();
+ view.notifySubtreeAccessibilityStateChangedIfNeeded();
}
int transientCount = mTransientIndices == null ? 0 : mTransientIndices.size();
@@ -5740,7 +5740,7 @@
}
dispatchVisibilityAggregated(isAttachedToWindow() && getWindowVisibility() == VISIBLE
&& isShown());
- notifySubtreeAccessibilityStateChangedIfNeeded();
+ child.notifySubtreeAccessibilityStateChangedIfNeeded();
}
/**
@@ -6146,7 +6146,8 @@
if (invalidate) {
invalidateViewProperty(false, false);
}
- notifySubtreeAccessibilityStateChangedIfNeeded();
+ notifySubtreeAccessibilityStateChanged(
+ this, this, AccessibilityEvent.CONTENT_CHANGE_TYPE_SUBTREE);
}
@Override
diff --git a/core/java/android/widget/AdapterView.java b/core/java/android/widget/AdapterView.java
index c55f7d6..5359e27 100644
--- a/core/java/android/widget/AdapterView.java
+++ b/core/java/android/widget/AdapterView.java
@@ -1106,7 +1106,8 @@
checkSelectionChanged();
}
- notifySubtreeAccessibilityStateChangedIfNeeded();
+ notifySubtreeAccessibilityStateChanged(
+ this, this, AccessibilityEvent.CONTENT_CHANGE_TYPE_SUBTREE);
}
/**
diff --git a/core/java/android/widget/TabHost.java b/core/java/android/widget/TabHost.java
index 90cb1c8..45e635ebe 100644
--- a/core/java/android/widget/TabHost.java
+++ b/core/java/android/widget/TabHost.java
@@ -59,13 +59,21 @@
private static final int TABWIDGET_LOCATION_BOTTOM = 3;
private TabWidget mTabWidget;
private FrameLayout mTabContent;
- @UnsupportedAppUsage
+ @UnsupportedAppUsage(trackingBug = 137825207, maxTargetSdk = Build.VERSION_CODES.Q,
+ publicAlternatives = "Use {@code androidx.viewpager.widget.ViewPager} and "
+ + "{@code com.google.android.material.tabs.TabLayout} instead.\n"
+ + "See <a href=\"{@docRoot}guide/navigation/navigation-swipe-view"
+ + "\">TabLayout and ViewPager</a>")
private List<TabSpec> mTabSpecs = new ArrayList<TabSpec>(2);
/**
* This field should be made private, so it is hidden from the SDK.
* {@hide}
*/
- @UnsupportedAppUsage
+ @UnsupportedAppUsage(trackingBug = 137825207, maxTargetSdk = Build.VERSION_CODES.Q,
+ publicAlternatives = "Use {@code androidx.viewpager.widget.ViewPager} and "
+ + "{@code com.google.android.material.tabs.TabLayout} instead.\n"
+ + "See <a href=\"{@docRoot}guide/navigation/navigation-swipe-view"
+ + "\">TabLayout and ViewPager</a>")
protected int mCurrentTab = -1;
private View mCurrentView = null;
/**
@@ -73,7 +81,11 @@
* {@hide}
*/
protected LocalActivityManager mLocalActivityManager = null;
- @UnsupportedAppUsage
+ @UnsupportedAppUsage(trackingBug = 137825207, maxTargetSdk = Build.VERSION_CODES.Q,
+ publicAlternatives = "Use {@code androidx.viewpager.widget.ViewPager} and "
+ + "{@code com.google.android.material.tabs.TabLayout} instead.\n"
+ + "See <a href=\"{@docRoot}guide/navigation/navigation-swipe-view"
+ + "\">TabLayout and ViewPager</a>")
private OnTabChangeListener mOnTabChangeListener;
private OnKeyListener mTabKeyListener;
@@ -514,9 +526,17 @@
private final @NonNull String mTag;
- @UnsupportedAppUsage
+ @UnsupportedAppUsage(trackingBug = 137825207, maxTargetSdk = Build.VERSION_CODES.Q,
+ publicAlternatives = "Use {@code androidx.viewpager.widget.ViewPager} and "
+ + "{@code com.google.android.material.tabs.TabLayout} instead.\n"
+ + "See <a href=\"{@docRoot}guide/navigation/navigation-swipe-view"
+ + "\">TabLayout and ViewPager</a>")
private IndicatorStrategy mIndicatorStrategy;
- @UnsupportedAppUsage
+ @UnsupportedAppUsage(trackingBug = 137825207, maxTargetSdk = Build.VERSION_CODES.Q,
+ publicAlternatives = "Use {@code androidx.viewpager.widget.ViewPager} and "
+ + "{@code com.google.android.material.tabs.TabLayout} instead.\n"
+ + "See <a href=\"{@docRoot}guide/navigation/navigation-swipe-view"
+ + "\">TabLayout and ViewPager</a>")
private ContentStrategy mContentStrategy;
/**
@@ -779,7 +799,11 @@
mIntent = intent;
}
- @UnsupportedAppUsage
+ @UnsupportedAppUsage(trackingBug = 137825207, maxTargetSdk = Build.VERSION_CODES.Q,
+ publicAlternatives = "Use {@code androidx.viewpager.widget.ViewPager} and "
+ + "{@code com.google.android.material.tabs.TabLayout} instead.\n"
+ + "See <a href=\"{@docRoot}guide/navigation/navigation-swipe-view"
+ + "\">TabLayout and ViewPager</a>")
public View getContentView() {
if (mLocalActivityManager == null) {
throw new IllegalStateException("Did you forget to call 'public void setup(LocalActivityManager activityGroup)'?");
@@ -809,7 +833,11 @@
return mLaunchedView;
}
- @UnsupportedAppUsage
+ @UnsupportedAppUsage(trackingBug = 137825207, maxTargetSdk = Build.VERSION_CODES.Q,
+ publicAlternatives = "Use {@code androidx.viewpager.widget.ViewPager} and "
+ + "{@code com.google.android.material.tabs.TabLayout} instead.\n"
+ + "See <a href=\"{@docRoot}guide/navigation/navigation-swipe-view"
+ + "\">TabLayout and ViewPager</a>")
public void tabClosed() {
if (mLaunchedView != null) {
mLaunchedView.setVisibility(View.GONE);
diff --git a/core/java/android/widget/TabWidget.java b/core/java/android/widget/TabWidget.java
index 434a799..bd0d039 100644
--- a/core/java/android/widget/TabWidget.java
+++ b/core/java/android/widget/TabWidget.java
@@ -65,7 +65,11 @@
private OnTabSelectionChanged mSelectionChangedListener;
// This value will be set to 0 as soon as the first tab is added to TabHost.
- @UnsupportedAppUsage
+ @UnsupportedAppUsage(trackingBug = 137825207, maxTargetSdk = Build.VERSION_CODES.Q,
+ publicAlternatives = "Use {@code androidx.viewpager.widget.ViewPager} and "
+ + "{@code com.google.android.material.tabs.TabLayout} instead.\n"
+ + "See <a href=\"{@docRoot}guide/navigation/navigation-swipe-view"
+ + "\">TabLayout and ViewPager</a>")
private int mSelectedTab = -1;
@Nullable
@@ -74,7 +78,11 @@
@Nullable
private Drawable mRightStrip;
- @UnsupportedAppUsage
+ @UnsupportedAppUsage(trackingBug = 137825207, maxTargetSdk = Build.VERSION_CODES.Q,
+ publicAlternatives = "Use {@code androidx.viewpager.widget.ViewPager} and "
+ + "{@code com.google.android.material.tabs.TabLayout} instead.\n"
+ + "See <a href=\"{@docRoot}guide/navigation/navigation-swipe-view"
+ + "\">TabLayout and ViewPager</a>")
private boolean mDrawBottomStrips = true;
private boolean mStripMoved;
@@ -551,7 +559,11 @@
* Provides a way for {@link TabHost} to be notified that the user clicked
* on a tab indicator.
*/
- @UnsupportedAppUsage
+ @UnsupportedAppUsage(trackingBug = 137825207, maxTargetSdk = Build.VERSION_CODES.Q,
+ publicAlternatives = "Use {@code androidx.viewpager.widget.ViewPager} and "
+ + "{@code com.google.android.material.tabs.TabLayout} instead.\n"
+ + "See <a href=\"{@docRoot}guide/navigation/navigation-swipe-view"
+ + "\">TabLayout and ViewPager</a>")
void setTabSelectionListener(OnTabSelectionChanged listener) {
mSelectionChangedListener = listener;
}
diff --git a/core/java/com/android/internal/os/ZygoteArguments.java b/core/java/com/android/internal/os/ZygoteArguments.java
index 6d40266..abc4160 100644
--- a/core/java/com/android/internal/os/ZygoteArguments.java
+++ b/core/java/com/android/internal/os/ZygoteArguments.java
@@ -187,6 +187,11 @@
boolean mPidQuery;
/**
+ * Whether the current arguments constitute a notification that boot completed.
+ */
+ boolean mBootCompleted;
+
+ /**
* Exemptions from API blacklisting. These are sent to the pre-forked zygote at boot time, or
* when they change, via --set-api-blacklist-exemptions.
*/
@@ -361,6 +366,8 @@
mAbiListQuery = true;
} else if (arg.equals("--get-pid")) {
mPidQuery = true;
+ } else if (arg.equals("--boot-completed")) {
+ mBootCompleted = true;
} else if (arg.startsWith("--instruction-set=")) {
mInstructionSet = getAssignmentValue(arg);
} else if (arg.startsWith("--app-data-dir=")) {
@@ -417,7 +424,11 @@
}
}
- if (mAbiListQuery || mPidQuery) {
+ if (mBootCompleted) {
+ if (args.length - curArg > 0) {
+ throw new IllegalArgumentException("Unexpected arguments after --boot-completed");
+ }
+ } else if (mAbiListQuery || mPidQuery) {
if (args.length - curArg > 0) {
throw new IllegalArgumentException("Unexpected arguments after --query-abi-list.");
}
diff --git a/core/java/com/android/internal/os/ZygoteConnection.java b/core/java/com/android/internal/os/ZygoteConnection.java
index 06a14f0..b3ec5f5 100644
--- a/core/java/com/android/internal/os/ZygoteConnection.java
+++ b/core/java/com/android/internal/os/ZygoteConnection.java
@@ -140,6 +140,11 @@
ZygoteArguments parsedArgs = new ZygoteArguments(args);
+ if (parsedArgs.mBootCompleted) {
+ handleBootCompleted();
+ return null;
+ }
+
if (parsedArgs.mAbiListQuery) {
handleAbiListQuery();
return null;
@@ -300,6 +305,10 @@
}
}
+ private void handleBootCompleted() {
+ VMRuntime.bootCompleted();
+ }
+
/**
* Preloads resources if the zygote is in lazily preload mode. Writes the result of the
* preload operation; {@code 0} when a preload was initiated due to this request and {@code 1}
diff --git a/core/java/com/android/internal/util/DataClass.java b/core/java/com/android/internal/util/DataClass.java
index da33f99..43539c7 100644
--- a/core/java/com/android/internal/util/DataClass.java
+++ b/core/java/com/android/internal/util/DataClass.java
@@ -65,11 +65,21 @@
boolean genGetters() default true;
/**
+ * {@link #genGetters} with @hide
+ */
+ boolean genHiddenGetters() default false;
+
+ /**
* Generates setters for each field.
*/
boolean genSetters() default false;
/**
+ * {@link #genSetters} with @hide
+ */
+ boolean genHiddenSetters() default false;
+
+ /**
* Generates a public constructor with each field initialized from a parameter and optionally
* some user-defined state validation at the end.
*
@@ -85,6 +95,11 @@
boolean genConstructor() default true;
/**
+ * {@link #genConstructor} with @hide
+ */
+ boolean genHiddenConstructor() default false;
+
+ /**
* Generates a Builder for your class.
*
* Uses a package-private constructor under the hood, so same rules hold as for
@@ -93,6 +108,11 @@
boolean genBuilder() default false;
/**
+ * {@link #genBuilder} with @hide
+ */
+ boolean genHiddenBuilder() default false;
+
+ /**
* Generates a structural {@link Object#equals} + {@link Object#hashCode}.
*
* You can customize individual fields' logic by declaring methods like:
@@ -126,6 +146,11 @@
boolean genCopyConstructor() default false;
/**
+ * {@link #genCopyConstructor} with @hide
+ */
+ boolean genHiddenCopyConstructor() default false;
+
+ /**
* Generates constant annotations({@link IntDef}/{@link StringDef}) for any constant groups
* with common prefix.
* The annotation names are based on the common prefix.
@@ -146,6 +171,11 @@
*/
boolean genConstDefs() default true;
+ /**
+ * {@link #genConstDefs} with @hide
+ */
+ boolean genHiddenConstDefs() default false;
+
/**
* Allows specifying custom parcelling logic based on reusable
diff --git a/core/jni/android_app_ActivityThread.cpp b/core/jni/android_app_ActivityThread.cpp
index 3a08148..5f83038 100644
--- a/core/jni/android_app_ActivityThread.cpp
+++ b/core/jni/android_app_ActivityThread.cpp
@@ -36,7 +36,6 @@
android_app_ActivityThread_dumpGraphics(JNIEnv* env, jobject clazz, jobject javaFileDescriptor) {
int fd = jniGetFDFromFileDescriptor(env, javaFileDescriptor);
android::uirenderer::renderthread::RenderProxy::dumpGraphicsMemory(fd);
- minikin::Layout::dumpMinikinStats(fd);
}
static void android_app_ActivityThread_initZygoteChildHeapProfiling(JNIEnv* env, jobject clazz) {
diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml
index 4d6e7da..ee0d595 100644
--- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml
@@ -3483,6 +3483,9 @@
<!-- True if home app should be pinned via Pinner Service -->
<bool name="config_pinnerHomeApp">false</bool>
+ <!-- True if assistant app should be pinned via Pinner Service -->
+ <bool name="config_pinnerAssistantApp">false</bool>
+
<!-- List of files pinned by the Pinner Service with the apex boot image b/119800099 -->
<string-array translatable="false" name="config_apexBootImagePinnerServiceFiles">
</string-array>
diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml
index a4a3863..1b35b9d 100644
--- a/core/res/res/values/symbols.xml
+++ b/core/res/res/values/symbols.xml
@@ -3118,6 +3118,7 @@
<java-symbol type="array" name="config_defaultPinnerServiceFiles" />
<java-symbol type="bool" name="config_pinnerCameraApp" />
<java-symbol type="bool" name="config_pinnerHomeApp" />
+ <java-symbol type="bool" name="config_pinnerAssistantApp" />
<java-symbol type="array" name="config_apexBootImagePinnerServiceFiles" />
<java-symbol type="string" name="config_doubleTouchGestureEnableFile" />
diff --git a/packages/DynamicSystemInstallationService/src/com/android/dynsystem/DynamicSystemInstallationService.java b/packages/DynamicSystemInstallationService/src/com/android/dynsystem/DynamicSystemInstallationService.java
index e731b45..142078e 100644
--- a/packages/DynamicSystemInstallationService/src/com/android/dynsystem/DynamicSystemInstallationService.java
+++ b/packages/DynamicSystemInstallationService/src/com/android/dynsystem/DynamicSystemInstallationService.java
@@ -291,7 +291,7 @@
if (mInstallTask != null && mInstallTask.getResult() == RESULT_OK) {
enabled = mInstallTask.commit();
} else if (isDynamicSystemInstalled()) {
- enabled = mDynSystem.setEnable(true);
+ enabled = mDynSystem.setEnable(true, true);
} else {
Log.e(TAG, "Trying to reboot to AOT while there is no complete installation");
return;
diff --git a/services/core/java/com/android/server/DynamicSystemService.java b/services/core/java/com/android/server/DynamicSystemService.java
index 173d5b0..e531412 100644
--- a/services/core/java/com/android/server/DynamicSystemService.java
+++ b/services/core/java/com/android/server/DynamicSystemService.java
@@ -181,18 +181,16 @@
@Override
public boolean remove() throws RemoteException {
- return getGsiService().removeGsiInstall();
+ return getGsiService().removeGsi();
}
@Override
- public boolean setEnable(boolean enable) throws RemoteException {
+ public boolean setEnable(boolean enable, boolean oneShot) throws RemoteException {
IGsiService gsiService = getGsiService();
if (enable) {
- final int status = gsiService.getGsiBootStatus();
- final boolean singleBoot = (status == IGsiService.BOOT_STATUS_SINGLE_BOOT);
- return gsiService.setGsiBootable(singleBoot) == 0;
+ return gsiService.enableGsi(oneShot) == 0;
} else {
- return gsiService.disableGsiInstall();
+ return gsiService.disableGsi();
}
}
@@ -200,9 +198,4 @@
public boolean write(byte[] buf) throws RemoteException {
return getGsiService().commitGsiChunkFromMemory(buf);
}
-
- @Override
- public boolean commit() throws RemoteException {
- return getGsiService().setGsiBootable(true) == 0;
- }
}
diff --git a/services/core/java/com/android/server/PinnerService.java b/services/core/java/com/android/server/PinnerService.java
index 80facbb..49ef164 100644
--- a/services/core/java/com/android/server/PinnerService.java
+++ b/services/core/java/com/android/server/PinnerService.java
@@ -25,6 +25,7 @@
import android.app.ActivityManagerInternal;
import android.app.IActivityManager;
import android.app.IUidObserver;
+import android.app.SearchManager;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
@@ -94,6 +95,7 @@
private static final int KEY_CAMERA = 0;
private static final int KEY_HOME = 1;
+ private static final int KEY_ASSISTANT = 2;
// Pin the camera application.
private static boolean PROP_PIN_CAMERA = SystemProperties.getBoolean(
@@ -107,8 +109,9 @@
private static final int MAX_CAMERA_PIN_SIZE = 80 * (1 << 20); // 80MB max for camera app.
private static final int MAX_HOME_PIN_SIZE = 6 * (1 << 20); // 6MB max for home app.
+ private static final int MAX_ASSISTANT_PIN_SIZE = 60 * (1 << 20); // 60MB max for assistant app.
- @IntDef({KEY_CAMERA, KEY_HOME})
+ @IntDef({KEY_CAMERA, KEY_HOME, KEY_ASSISTANT})
@Retention(RetentionPolicy.SOURCE)
public @interface AppKey {}
@@ -117,6 +120,7 @@
private final ActivityManagerInternal mAmInternal;
private final IActivityManager mAm;
private final UserManager mUserManager;
+ private SearchManager mSearchManager;
/** The list of the statically pinned files. */
@GuardedBy("this")
@@ -167,6 +171,8 @@
com.android.internal.R.bool.config_pinnerCameraApp);
boolean shouldPinHome = context.getResources().getBoolean(
com.android.internal.R.bool.config_pinnerHomeApp);
+ boolean shouldPinAssistant = context.getResources().getBoolean(
+ com.android.internal.R.bool.config_pinnerAssistantApp);
if (shouldPinCamera) {
if (PROP_PIN_CAMERA) {
mPinKeys.add(KEY_CAMERA);
@@ -177,6 +183,9 @@
if (shouldPinHome) {
mPinKeys.add(KEY_HOME);
}
+ if (shouldPinAssistant) {
+ mPinKeys.add(KEY_ASSISTANT);
+ }
mPinnerHandler = new PinnerHandler(BackgroundThread.get().getLooper());
mAtmInternal = LocalServices.getService(ActivityTaskManagerInternal.class);
@@ -207,6 +216,15 @@
sendPinAppsMessage(UserHandle.USER_SYSTEM);
}
+ @Override
+ public void onBootPhase(int phase) {
+ // SearchManagerService is started after PinnerService, wait for PHASE_SYSTEM_SERVICES_READY
+ if (phase == SystemService.PHASE_SYSTEM_SERVICES_READY) {
+ mSearchManager = (SearchManager) mContext.getSystemService(Context.SEARCH_SERVICE);
+ sendPinAppsMessage(UserHandle.USER_SYSTEM);
+ }
+ }
+
/**
* Repin apps on user switch.
* <p>
@@ -408,6 +426,14 @@
return getApplicationInfoForIntent(intent, userHandle, false);
}
+ private ApplicationInfo getAssistantInfo(int userHandle) {
+ if (mSearchManager != null) {
+ Intent intent = mSearchManager.getAssistIntent(false);
+ return getApplicationInfoForIntent(intent, userHandle, true);
+ }
+ return null;
+ }
+
private ApplicationInfo getApplicationInfoForIntent(Intent intent, int userHandle,
boolean defaultToSystemApp) {
if (intent == null) {
@@ -520,6 +546,8 @@
return getCameraInfo(userHandle);
case KEY_HOME:
return getHomeInfo(userHandle);
+ case KEY_ASSISTANT:
+ return getAssistantInfo(userHandle);
default:
return null;
}
@@ -534,6 +562,8 @@
return "Camera";
case KEY_HOME:
return "Home";
+ case KEY_ASSISTANT:
+ return "Assistant";
default:
return null;
}
@@ -548,6 +578,8 @@
return MAX_CAMERA_PIN_SIZE;
case KEY_HOME:
return MAX_HOME_PIN_SIZE;
+ case KEY_ASSISTANT:
+ return MAX_ASSISTANT_PIN_SIZE;
default:
return 0;
}
diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java
index f731a6d..dba63ab 100644
--- a/services/core/java/com/android/server/am/ActivityManagerService.java
+++ b/services/core/java/com/android/server/am/ActivityManagerService.java
@@ -5213,6 +5213,10 @@
}
}
+ // Let the ART runtime in zygote and system_server know that the boot completed.
+ ZYGOTE_PROCESS.bootCompleted();
+ VMRuntime.bootCompleted();
+
IntentFilter pkgFilter = new IntentFilter();
pkgFilter.addAction(Intent.ACTION_QUERY_PACKAGE_RESTART);
pkgFilter.addDataScheme("package");
diff --git a/services/net/java/android/net/dhcp/DhcpServerCallbacks.java b/services/net/java/android/net/dhcp/DhcpServerCallbacks.java
index bb56876..7c413779 100644
--- a/services/net/java/android/net/dhcp/DhcpServerCallbacks.java
+++ b/services/net/java/android/net/dhcp/DhcpServerCallbacks.java
@@ -21,13 +21,11 @@
* @hide
*/
public abstract class DhcpServerCallbacks extends IDhcpServerCallbacks.Stub {
- // TODO: add @Override here once the API is versioned
-
/**
* Get the version of the aidl interface implemented by the callbacks.
*/
+ @Override
public int getInterfaceVersion() {
- // TODO: return IDhcpServerCallbacks.VERSION;
- return 0;
+ return IDhcpServerCallbacks.VERSION;
}
}
diff --git a/services/robotests/backup/src/com/android/server/backup/BackupManagerServiceTest.java b/services/robotests/backup/src/com/android/server/backup/BackupManagerServiceTest.java
index e55c4a6..a65d1dc 100644
--- a/services/robotests/backup/src/com/android/server/backup/BackupManagerServiceTest.java
+++ b/services/robotests/backup/src/com/android/server/backup/BackupManagerServiceTest.java
@@ -53,6 +53,7 @@
import com.android.server.backup.testing.TransportData;
import com.android.server.testing.shadows.ShadowApplicationPackageManager;
import com.android.server.testing.shadows.ShadowBinder;
+import com.android.server.testing.shadows.ShadowSystemServiceRegistry;
import org.junit.After;
import org.junit.Before;
@@ -73,7 +74,12 @@
/** Tests for the user-aware backup/restore system service {@link BackupManagerService}. */
@RunWith(RobolectricTestRunner.class)
-@Config(shadows = {ShadowApplicationPackageManager.class, ShadowBinder.class})
+@Config(
+ shadows = {
+ ShadowApplicationPackageManager.class,
+ ShadowBinder.class,
+ ShadowSystemServiceRegistry.class
+ })
@Presubmit
public class BackupManagerServiceTest {
private static final String TEST_PACKAGE = "package";
diff --git a/services/robotests/backup/src/com/android/server/backup/FullBackupJobTest.java b/services/robotests/backup/src/com/android/server/backup/FullBackupJobTest.java
index 9a78d0b3..dbc0da7 100644
--- a/services/robotests/backup/src/com/android/server/backup/FullBackupJobTest.java
+++ b/services/robotests/backup/src/com/android/server/backup/FullBackupJobTest.java
@@ -25,6 +25,8 @@
import android.os.UserHandle;
import android.platform.test.annotations.Presubmit;
+import com.android.server.testing.shadows.ShadowSystemServiceRegistry;
+
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
@@ -36,7 +38,7 @@
import org.robolectric.shadows.ShadowJobScheduler;
@RunWith(RobolectricTestRunner.class)
-@Config(shadows = {ShadowJobScheduler.class})
+@Config(shadows = {ShadowJobScheduler.class, ShadowSystemServiceRegistry.class})
@Presubmit
public class FullBackupJobTest {
private Context mContext;
diff --git a/services/robotests/backup/src/com/android/server/backup/KeyValueBackupJobTest.java b/services/robotests/backup/src/com/android/server/backup/KeyValueBackupJobTest.java
index 8d9e44f..1c5fac2 100644
--- a/services/robotests/backup/src/com/android/server/backup/KeyValueBackupJobTest.java
+++ b/services/robotests/backup/src/com/android/server/backup/KeyValueBackupJobTest.java
@@ -24,14 +24,18 @@
import android.os.UserHandle;
import android.platform.test.annotations.Presubmit;
+import com.android.server.testing.shadows.ShadowSystemServiceRegistry;
+
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.RuntimeEnvironment;
+import org.robolectric.annotation.Config;
@RunWith(RobolectricTestRunner.class)
+@Config(shadows = {ShadowSystemServiceRegistry.class})
@Presubmit
public class KeyValueBackupJobTest {
private Context mContext;
diff --git a/services/robotests/backup/src/com/android/server/backup/UserBackupManagerServiceTest.java b/services/robotests/backup/src/com/android/server/backup/UserBackupManagerServiceTest.java
index 74fe81c..84e810d 100644
--- a/services/robotests/backup/src/com/android/server/backup/UserBackupManagerServiceTest.java
+++ b/services/robotests/backup/src/com/android/server/backup/UserBackupManagerServiceTest.java
@@ -63,6 +63,7 @@
import com.android.server.testing.shadows.ShadowBinder;
import com.android.server.testing.shadows.ShadowKeyValueBackupJob;
import com.android.server.testing.shadows.ShadowKeyValueBackupTask;
+import com.android.server.testing.shadows.ShadowSystemServiceRegistry;
import org.junit.After;
import org.junit.Before;
@@ -88,7 +89,12 @@
* UserBackupManagerService} that performs operations for its target user.
*/
@RunWith(RobolectricTestRunner.class)
-@Config(shadows = {ShadowAppBackupUtils.class, ShadowApplicationPackageManager.class})
+@Config(
+ shadows = {
+ ShadowAppBackupUtils.class,
+ ShadowApplicationPackageManager.class,
+ ShadowSystemServiceRegistry.class
+ })
@Presubmit
public class UserBackupManagerServiceTest {
private static final String TAG = "BMSTest";
diff --git a/services/robotests/backup/src/com/android/server/backup/internal/SetupObserverTest.java b/services/robotests/backup/src/com/android/server/backup/internal/SetupObserverTest.java
index 44e9e6a..e49425b 100644
--- a/services/robotests/backup/src/com/android/server/backup/internal/SetupObserverTest.java
+++ b/services/robotests/backup/src/com/android/server/backup/internal/SetupObserverTest.java
@@ -32,6 +32,7 @@
import com.android.server.backup.UserBackupManagerService;
import com.android.server.backup.testing.BackupManagerServiceTestUtils;
import com.android.server.testing.shadows.ShadowApplicationPackageManager;
+import com.android.server.testing.shadows.ShadowSystemServiceRegistry;
import org.junit.Before;
import org.junit.Test;
@@ -51,7 +52,12 @@
* UserBackupManagerService}.
*/
@RunWith(RobolectricTestRunner.class)
-@Config(shadows = {ShadowApplicationPackageManager.class, ShadowJobScheduler.class})
+@Config(
+ shadows = {
+ ShadowApplicationPackageManager.class,
+ ShadowJobScheduler.class,
+ ShadowSystemServiceRegistry.class
+ })
@Presubmit
public class SetupObserverTest {
private static final String TAG = "SetupObserverTest";
diff --git a/services/robotests/backup/src/com/android/server/backup/keyvalue/KeyValueBackupTaskTest.java b/services/robotests/backup/src/com/android/server/backup/keyvalue/KeyValueBackupTaskTest.java
index 4aba1f4..6a90d0b 100644
--- a/services/robotests/backup/src/com/android/server/backup/keyvalue/KeyValueBackupTaskTest.java
+++ b/services/robotests/backup/src/com/android/server/backup/keyvalue/KeyValueBackupTaskTest.java
@@ -120,6 +120,7 @@
import com.android.server.testing.shadows.ShadowBackupDataInput;
import com.android.server.testing.shadows.ShadowBackupDataOutput;
import com.android.server.testing.shadows.ShadowEventLog;
+import com.android.server.testing.shadows.ShadowSystemServiceRegistry;
import com.google.common.truth.IterableSubject;
@@ -163,10 +164,11 @@
ShadowBackupDataInput.class,
ShadowBackupDataOutput.class,
ShadowEventLog.class,
- ShadowQueuedWork.class
+ ShadowQueuedWork.class,
+ ShadowSystemServiceRegistry.class
})
@Presubmit
-public class KeyValueBackupTaskTest {
+public class KeyValueBackupTaskTest {
private static final PackageData PACKAGE_1 = keyValuePackage(1);
private static final PackageData PACKAGE_2 = keyValuePackage(2);
private static final String BACKUP_AGENT_SHARED_PREFS_SYNCHRONIZER_CLASS =
diff --git a/services/robotests/src/com/android/server/testing/shadows/ShadowSystemServiceRegistry.java b/services/robotests/src/com/android/server/testing/shadows/ShadowSystemServiceRegistry.java
new file mode 100644
index 0000000..c59798fc92
--- /dev/null
+++ b/services/robotests/src/com/android/server/testing/shadows/ShadowSystemServiceRegistry.java
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.server.testing.shadows;
+
+import android.app.SystemServiceRegistry;
+import android.app.job.JobSchedulerFrameworkInitializer;
+
+import org.robolectric.annotation.Implementation;
+import org.robolectric.annotation.Implements;
+import org.robolectric.util.ReflectionHelpers;
+
+/**
+ * Shadow of {@link SystemServiceRegistry}
+ *
+ * <p>JobSchedulerFrameworkInitializer contains a static initializer registering JobScheduler as a
+ * system service. We need to make sure the initializer is run before the tests that use
+ * JobScheduler. And we're putting this on the static initializer of SystemServiceRegistry since
+ * other services are registered here.
+ */
+@Implements(className = "android.app.SystemServiceRegistry")
+public class ShadowSystemServiceRegistry {
+ @Implementation
+ protected static void __staticInitializer__() {
+ // Make sure the static init in the real class is still executed.
+ ReflectionHelpers.callStaticMethod(SystemServiceRegistry.class, "__staticInitializer__");
+ try {
+ Class.forName(JobSchedulerFrameworkInitializer.class.getCanonicalName());
+ } catch (ClassNotFoundException e) {
+ // Rethrowing as an unchecked exception because checked exceptions are not allowed in
+ // static blocks.
+ throw new ExceptionInInitializerError(e);
+ }
+ }
+}
diff --git a/services/usage/java/com/android/server/usage/UsageStatsService.java b/services/usage/java/com/android/server/usage/UsageStatsService.java
index 2298aa1..2bdeddf 100644
--- a/services/usage/java/com/android/server/usage/UsageStatsService.java
+++ b/services/usage/java/com/android/server/usage/UsageStatsService.java
@@ -830,6 +830,9 @@
mUserState.get(user).dumpDatabaseInfo(ipw);
}
return;
+ } else if ("appstandby".equals(arg)) {
+ mAppStandby.dumpState(args, pw);
+ return;
} else if (arg != null && !arg.startsWith("-")) {
// Anything else that doesn't start with '-' is a pkg to filter
pkg = arg;
diff --git a/tools/codegen/src/com/android/codegen/ClassPrinter.kt b/tools/codegen/src/com/android/codegen/ClassPrinter.kt
index 22b5d88..1f0d4b8 100644
--- a/tools/codegen/src/com/android/codegen/ClassPrinter.kt
+++ b/tools/codegen/src/com/android/codegen/ClassPrinter.kt
@@ -122,9 +122,13 @@
if (cliArgs.contains("--$kebabCase")) return true
val annotationKey = "gen$upperCamelCase"
+ val annotationHiddenKey = "genHidden$upperCamelCase"
if (dataClassAnnotationFeatures.containsKey(annotationKey)) {
return dataClassAnnotationFeatures[annotationKey]!!
}
+ if (dataClassAnnotationFeatures.containsKey(annotationHiddenKey)) {
+ return dataClassAnnotationFeatures[annotationHiddenKey]!!
+ }
if (cliArgs.contains("--all")) return true
if (hidden) return true
@@ -144,11 +148,17 @@
}
}
- val FeatureFlag.hidden
- get(): Boolean = when {
- cliArgs.contains("--hidden-$kebabCase") -> true
- this == FeatureFlag.BUILD_UPON -> FeatureFlag.BUILDER.hidden
- else -> false
+ val FeatureFlag.hidden: Boolean
+ get(): Boolean {
+ val annotationHiddenKey = "genHidden$upperCamelCase"
+ if (dataClassAnnotationFeatures.containsKey(annotationHiddenKey)) {
+ return dataClassAnnotationFeatures[annotationHiddenKey]!!
+ }
+ return when {
+ cliArgs.contains("--hidden-$kebabCase") -> true
+ this == FeatureFlag.BUILD_UPON -> FeatureFlag.BUILDER.hidden
+ else -> false
+ }
}
var currentIndent = INDENT_SINGLE
diff --git a/tools/codegen/src/com/android/codegen/FieldInfo.kt b/tools/codegen/src/com/android/codegen/FieldInfo.kt
index 6b0009c..ba00264 100644
--- a/tools/codegen/src/com/android/codegen/FieldInfo.kt
+++ b/tools/codegen/src/com/android/codegen/FieldInfo.kt
@@ -84,7 +84,6 @@
classInfo.classAst.methods.find {
it.nameAsString == "default$NameUpperCamel" && it.parameters.isEmpty()
}?.run { return "$nameAsString()" }
- if (FieldClass == "List") return "${classPrinter.memberRef("java.util.Collections.emptyList")}()"
return null
}
val hasDefault get() = defaultExpr != null
diff --git a/tools/codegen/src/com/android/codegen/Generators.kt b/tools/codegen/src/com/android/codegen/Generators.kt
index c6e0a06..914e475 100644
--- a/tools/codegen/src/com/android/codegen/Generators.kt
+++ b/tools/codegen/src/com/android/codegen/Generators.kt
@@ -68,12 +68,15 @@
}
}
- val visibility = if (consts[0].second.isPublic) "public" else "/* package-*/"
+ val visibility = if (consts[0].second.isPublic) "public" else "/* package-private */"
val Retention = classRef("java.lang.annotation.Retention")
val RetentionPolicySource = memberRef("java.lang.annotation.RetentionPolicy.SOURCE")
val ConstDef = classRef("android.annotation.${type.capitalize()}Def")
+ if (FeatureFlag.CONST_DEFS.hidden) {
+ +"/** @hide */"
+ }
"@$ConstDef(${if_(flag, "flag = true, ")}prefix = \"${prefix}_\", value = {" {
names.forEachLastAware { name, isLast ->
+"$name${if_(!isLast, ",")}"
@@ -85,6 +88,9 @@
+""
if (type == "int") {
+ if (FeatureFlag.CONST_DEFS.hidden) {
+ +"/** @hide */"
+ }
+GENERATED_MEMBER_HEADER
val methodDefLine = "$visibility static String ${AnnotationName.decapitalize()}ToString(" +
"@$AnnotationName int value)"
diff --git a/tools/codegen/src/com/android/codegen/InputSignaturesComputation.kt b/tools/codegen/src/com/android/codegen/InputSignaturesComputation.kt
index 1b514d7..24cf469 100644
--- a/tools/codegen/src/com/android/codegen/InputSignaturesComputation.kt
+++ b/tools/codegen/src/com/android/codegen/InputSignaturesComputation.kt
@@ -97,7 +97,7 @@
getFullClassName(buildString {
type.scope.ifPresent { append(it).append(".") }
append(type.nameAsString)
- }) + (type.typeArguments.orElse(null)?.let { args -> args.joinToString(", ") {getFullClassName(it)}}?.let { "<$it>" } ?: "")
+ }) + (type.typeArguments.orElse(null)?.let { args -> args.joinToString(",") {getFullClassName(it)}}?.let { "<$it>" } ?: "")
} else getFullClassName(type.asString())
}
diff --git a/tools/processors/staledataclass/src/android/processor/staledataclass/StaleDataclassProcessor.kt b/tools/processors/staledataclass/src/android/processor/staledataclass/StaleDataclassProcessor.kt
index 26b15ae..d00def6 100644
--- a/tools/processors/staledataclass/src/android/processor/staledataclass/StaleDataclassProcessor.kt
+++ b/tools/processors/staledataclass/src/android/processor/staledataclass/StaleDataclassProcessor.kt
@@ -66,10 +66,14 @@
if (dataClassAnnotation == null) {
dataClassAnnotation = annotations.find {
it.qualifiedName.toString() == DATACLASS_ANNOTATION_NAME
- }
+ } ?: return true
}
- val generatedAnnotatedElements = roundEnv.getElementsAnnotatedWith(generatedAnnotation)
+ val generatedAnnotatedElements = if (generatedAnnotation != null) {
+ roundEnv.getElementsAnnotatedWith(generatedAnnotation)
+ } else {
+ emptySet()
+ }
generatedAnnotatedElements.forEach {
processSingleFile(it)
}