Merge "Fix deadlock between Tuner.requestDescrambler() and resource reclaim" into main
diff --git a/AconfigFlags.bp b/AconfigFlags.bp
index a271d06..08a09e1 100644
--- a/AconfigFlags.bp
+++ b/AconfigFlags.bp
@@ -15,6 +15,7 @@
aconfig_srcjars = [
":android.app.usage.flags-aconfig-java{.generated_srcjars}",
":android.content.pm.flags-aconfig-java{.generated_srcjars}",
+ ":android.hardware.radio.flags-aconfig-java{.generated_srcjars}",
":android.nfc.flags-aconfig-java{.generated_srcjars}",
":android.os.flags-aconfig-java{.generated_srcjars}",
":android.os.vibrator.flags-aconfig-java{.generated_srcjars}",
@@ -36,6 +37,7 @@
":hwui_flags_java_lib{.generated_srcjars}",
":display_flags_lib{.generated_srcjars}",
":android.multiuser.flags-aconfig-java{.generated_srcjars}",
+ ":android.app.flags-aconfig-java{.generated_srcjars}",
]
filegroup {
@@ -327,3 +329,29 @@
aconfig_declarations: "android.multiuser.flags-aconfig",
defaults: ["framework-minus-apex-aconfig-java-defaults"],
}
+
+// Activity Manager
+aconfig_declarations {
+ name: "android.app.flags-aconfig",
+ package: "android.app",
+ srcs: ["core/java/android/app/activity_manager.aconfig"],
+}
+
+java_aconfig_library {
+ name: "android.app.flags-aconfig-java",
+ aconfig_declarations: "android.app.flags-aconfig",
+ defaults: ["framework-minus-apex-aconfig-java-defaults"],
+}
+
+// Broadcast Radio
+aconfig_declarations {
+ name: "android.hardware.radio.flags-aconfig",
+ package: "android.hardware.radio",
+ srcs: ["core/java/android/hardware/radio/*.aconfig"],
+}
+
+java_aconfig_library {
+ name: "android.hardware.radio.flags-aconfig-java",
+ aconfig_declarations: "android.hardware.radio.flags-aconfig",
+ defaults: ["framework-minus-apex-aconfig-java-defaults"],
+}
diff --git a/core/api/current.txt b/core/api/current.txt
index 22b1ef8..d8e3abf 100644
--- a/core/api/current.txt
+++ b/core/api/current.txt
@@ -4616,9 +4616,9 @@
public class ActivityManager {
method public int addAppTask(@NonNull android.app.Activity, @NonNull android.content.Intent, @Nullable android.app.ActivityManager.TaskDescription, @NonNull android.graphics.Bitmap);
- method public void addStartInfoTimestamp(@IntRange(from=android.app.ApplicationStartInfo.START_TIMESTAMP_RESERVED_RANGE_DEVELOPER_START, to=android.app.ApplicationStartInfo.START_TIMESTAMP_RESERVED_RANGE_DEVELOPER) int, long);
+ method @FlaggedApi("android.app.app_start_info") public void addStartInfoTimestamp(@IntRange(from=android.app.ApplicationStartInfo.START_TIMESTAMP_RESERVED_RANGE_DEVELOPER_START, to=android.app.ApplicationStartInfo.START_TIMESTAMP_RESERVED_RANGE_DEVELOPER) int, long);
method public void appNotResponding(@NonNull String);
- method public void clearApplicationStartInfoCompletionListener();
+ method @FlaggedApi("android.app.app_start_info") public void clearApplicationStartInfoCompletionListener();
method public boolean clearApplicationUserData();
method public void clearWatchHeapLimit();
method @RequiresPermission(android.Manifest.permission.DUMP) public void dumpPackageState(java.io.FileDescriptor, String);
@@ -4626,7 +4626,7 @@
method public java.util.List<android.app.ActivityManager.AppTask> getAppTasks();
method public android.content.pm.ConfigurationInfo getDeviceConfigurationInfo();
method @NonNull public java.util.List<android.app.ApplicationExitInfo> getHistoricalProcessExitReasons(@Nullable String, @IntRange(from=0) int, @IntRange(from=0) int);
- method @NonNull public java.util.List<android.app.ApplicationStartInfo> getHistoricalProcessStartReasons(@IntRange(from=0) int);
+ method @FlaggedApi("android.app.app_start_info") @NonNull public java.util.List<android.app.ApplicationStartInfo> getHistoricalProcessStartReasons(@IntRange(from=0) int);
method public int getLargeMemoryClass();
method public int getLauncherLargeIconDensity();
method public int getLauncherLargeIconSize();
@@ -4653,7 +4653,7 @@
method @RequiresPermission(android.Manifest.permission.REORDER_TASKS) public void moveTaskToFront(int, int);
method @RequiresPermission(android.Manifest.permission.REORDER_TASKS) public void moveTaskToFront(int, int, android.os.Bundle);
method @Deprecated public void restartPackage(String);
- method public void setApplicationStartInfoCompletionListener(@NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer<android.app.ApplicationStartInfo>);
+ method @FlaggedApi("android.app.app_start_info") public void setApplicationStartInfoCompletionListener(@NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer<android.app.ApplicationStartInfo>);
method public void setProcessStateSummary(@Nullable byte[]);
method public static void setVrThread(int);
method public void setWatchHeapLimit(long);
@@ -5234,7 +5234,7 @@
field public static final int REASON_USER_STOPPED = 11; // 0xb
}
- public final class ApplicationStartInfo implements android.os.Parcelable {
+ @FlaggedApi("android.app.app_start_info") public final class ApplicationStartInfo implements android.os.Parcelable {
method public int describeContents();
method public int getDefiningUid();
method @Nullable public android.content.Intent getIntent();
diff --git a/core/api/system-current.txt b/core/api/system-current.txt
index c3c3882..220482d 100644
--- a/core/api/system-current.txt
+++ b/core/api/system-current.txt
@@ -540,7 +540,7 @@
method @RequiresPermission(android.Manifest.permission.PACKAGE_USAGE_STATS) public void addOnUidImportanceListener(android.app.ActivityManager.OnUidImportanceListener, int);
method @RequiresPermission(android.Manifest.permission.FORCE_STOP_PACKAGES) public void forceStopPackage(String);
method @RequiresPermission(anyOf={"android.permission.INTERACT_ACROSS_USERS", "android.permission.INTERACT_ACROSS_USERS_FULL"}) public static int getCurrentUser();
- method @NonNull @RequiresPermission(android.Manifest.permission.DUMP) public java.util.List<android.app.ApplicationStartInfo> getExternalHistoricalProcessStartReasons(@NonNull String, @IntRange(from=0) int);
+ method @FlaggedApi(Flags.FLAG_APP_START_INFO) @NonNull @RequiresPermission(android.Manifest.permission.DUMP) public java.util.List<android.app.ApplicationStartInfo> getExternalHistoricalProcessStartReasons(@NonNull String, @IntRange(from=0) int);
method @RequiresPermission(android.Manifest.permission.PACKAGE_USAGE_STATS) public int getPackageImportance(String);
method @NonNull public java.util.Collection<java.util.Locale> getSupportedLocales();
method @RequiresPermission(android.Manifest.permission.PACKAGE_USAGE_STATS) public int getUidImportance(int);
@@ -9843,7 +9843,6 @@
field public static final int BUGREPORT_FLAG_USE_PREDUMPED_UI_DATA = 1; // 0x1
field public static final int BUGREPORT_MODE_FULL = 0; // 0x0
field public static final int BUGREPORT_MODE_INTERACTIVE = 1; // 0x1
- field public static final int BUGREPORT_MODE_ONBOARDING = 7; // 0x7
field public static final int BUGREPORT_MODE_REMOTE = 2; // 0x2
field public static final int BUGREPORT_MODE_TELEPHONY = 4; // 0x4
field public static final int BUGREPORT_MODE_WEAR = 3; // 0x3
diff --git a/core/java/android/app/ActivityManager.java b/core/java/android/app/ActivityManager.java
index 4f45691..3bf2cca 100644
--- a/core/java/android/app/ActivityManager.java
+++ b/core/java/android/app/ActivityManager.java
@@ -24,6 +24,7 @@
import android.Manifest;
import android.annotation.ColorInt;
import android.annotation.DrawableRes;
+import android.annotation.FlaggedApi;
import android.annotation.IntDef;
import android.annotation.IntRange;
import android.annotation.NonNull;
@@ -3982,6 +3983,7 @@
* the order from most recent to least recent.
*/
@NonNull
+ @FlaggedApi(Flags.FLAG_APP_START_INFO)
public List<ApplicationStartInfo> getHistoricalProcessStartReasons(
@IntRange(from = 0) int maxNum) {
try {
@@ -4012,6 +4014,7 @@
*/
@NonNull
@SystemApi
+ @FlaggedApi(Flags.FLAG_APP_START_INFO)
@RequiresPermission(Manifest.permission.DUMP)
public List<ApplicationStartInfo> getExternalHistoricalProcessStartReasons(
@NonNull String packageName, @IntRange(from = 0) int maxNum) {
@@ -4044,6 +4047,7 @@
*
* @throws IllegalArgumentException if executor or listener are null.
*/
+ @FlaggedApi(Flags.FLAG_APP_START_INFO)
public void setApplicationStartInfoCompletionListener(@NonNull final Executor executor,
@NonNull final Consumer<ApplicationStartInfo> listener) {
Preconditions.checkNotNull(executor, "executor cannot be null");
@@ -4065,6 +4069,7 @@
/**
* Removes the callback set by {@link #setApplicationStartInfoCompletionListener} if there is one.
*/
+ @FlaggedApi(Flags.FLAG_APP_START_INFO)
public void clearApplicationStartInfoCompletionListener() {
try {
getService().clearApplicationStartInfoCompleteListener(mContext.getUserId());
@@ -4089,6 +4094,7 @@
* Will thow {@link java.lang.IllegalArgumentException} if not in range.
* @param timestampNs Clock monotonic time in nanoseconds of event to be recorded.
*/
+ @FlaggedApi(Flags.FLAG_APP_START_INFO)
public void addStartInfoTimestamp(@IntRange(
from = ApplicationStartInfo.START_TIMESTAMP_RESERVED_RANGE_DEVELOPER_START,
to = ApplicationStartInfo.START_TIMESTAMP_RESERVED_RANGE_DEVELOPER) int key,
diff --git a/core/java/android/app/ApplicationStartInfo.java b/core/java/android/app/ApplicationStartInfo.java
index f5fb6ed..a6a57cd 100644
--- a/core/java/android/app/ApplicationStartInfo.java
+++ b/core/java/android/app/ApplicationStartInfo.java
@@ -16,6 +16,7 @@
package android.app;
+import android.annotation.FlaggedApi;
import android.annotation.IntDef;
import android.annotation.NonNull;
import android.annotation.Nullable;
@@ -37,6 +38,7 @@
/**
* Provide information related to a processes startup.
*/
+@FlaggedApi(Flags.FLAG_APP_START_INFO)
public final class ApplicationStartInfo implements Parcelable {
/**
diff --git a/core/java/android/app/INotificationManager.aidl b/core/java/android/app/INotificationManager.aidl
index 7f38b27..ec5effd 100644
--- a/core/java/android/app/INotificationManager.aidl
+++ b/core/java/android/app/INotificationManager.aidl
@@ -98,6 +98,7 @@
ParceledListSlice getNotificationChannelGroupsForPackage(String pkg, int uid, boolean includeDeleted);
NotificationChannelGroup getNotificationChannelGroupForPackage(String groupId, String pkg, int uid);
NotificationChannelGroup getPopulatedNotificationChannelGroupForPackage(String pkg, int uid, String groupId, boolean includeDeleted);
+ ParceledListSlice getRecentBlockedNotificationChannelGroupsForPackage(String pkg, int uid);
void updateNotificationChannelGroupForPackage(String pkg, int uid, in NotificationChannelGroup group);
void updateNotificationChannelForPackage(String pkg, int uid, in NotificationChannel channel);
void unlockNotificationChannel(String pkg, int uid, String channelId);
diff --git a/core/java/android/app/activity_manager.aconfig b/core/java/android/app/activity_manager.aconfig
new file mode 100644
index 0000000..2076e85
--- /dev/null
+++ b/core/java/android/app/activity_manager.aconfig
@@ -0,0 +1,8 @@
+package: "android.app"
+
+flag {
+ namespace: "system_performance"
+ name: "app_start_info"
+ description: "Control collecting of ApplicationStartInfo records and APIs."
+ bug: "247814855"
+}
\ No newline at end of file
diff --git a/core/java/android/app/assist/AssistStructure.java b/core/java/android/app/assist/AssistStructure.java
index ed0f872..15bd1dc 100644
--- a/core/java/android/app/assist/AssistStructure.java
+++ b/core/java/android/app/assist/AssistStructure.java
@@ -22,8 +22,10 @@
import android.os.RemoteException;
import android.os.SystemClock;
import android.service.autofill.FillRequest;
+import android.text.InputType;
import android.text.Spanned;
import android.text.TextUtils;
+import android.util.ArrayMap;
import android.util.Log;
import android.util.Pair;
import android.view.View;
@@ -2452,7 +2454,7 @@
+ node.getTextStyle());
Log.i(TAG, prefix + " Text color fg: #" + Integer.toHexString(node.getTextColor())
+ ", bg: #" + Integer.toHexString(node.getTextBackgroundColor()));
- Log.i(TAG, prefix + " Input type: " + node.getInputType());
+ Log.i(TAG, prefix + " Input type: " + getInputTypeString(node.getInputType()));
Log.i(TAG, prefix + " Resource id: " + node.getTextIdEntry());
}
String webDomain = node.getWebDomain();
@@ -2664,4 +2666,33 @@
return new AssistStructure[size];
}
};
+
+ private static final ArrayMap<Integer, String> INPUT_TYPE_VARIATIONS = new ArrayMap<>();
+ static {
+ INPUT_TYPE_VARIATIONS.put(InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS, "EmailSubject");
+ INPUT_TYPE_VARIATIONS.put(InputType.TYPE_TEXT_VARIATION_POSTAL_ADDRESS, "PostalAddress");
+ INPUT_TYPE_VARIATIONS.put(InputType.TYPE_TEXT_VARIATION_PERSON_NAME, "PersonName");
+ INPUT_TYPE_VARIATIONS.put(InputType.TYPE_TEXT_VARIATION_PASSWORD, "Password");
+ INPUT_TYPE_VARIATIONS.put(InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD, "VisiblePassword");
+ INPUT_TYPE_VARIATIONS.put(InputType.TYPE_TEXT_VARIATION_URI, "URI");
+ INPUT_TYPE_VARIATIONS.put(InputType.TYPE_TEXT_VARIATION_WEB_EMAIL_ADDRESS, "WebEmailAddress");
+ INPUT_TYPE_VARIATIONS.put(InputType.TYPE_TEXT_VARIATION_WEB_PASSWORD, "WebPassword");
+ INPUT_TYPE_VARIATIONS.put(InputType.TYPE_TEXT_VARIATION_LONG_MESSAGE, "LongMessage");
+ INPUT_TYPE_VARIATIONS.put(InputType.TYPE_TEXT_VARIATION_SHORT_MESSAGE, "ShortMessage");
+ INPUT_TYPE_VARIATIONS.put(InputType.TYPE_TEXT_FLAG_MULTI_LINE, "MultiLine");
+ INPUT_TYPE_VARIATIONS.put(InputType.TYPE_TEXT_FLAG_IME_MULTI_LINE, "ImeMultiLine");
+ INPUT_TYPE_VARIATIONS.put(InputType.TYPE_TEXT_VARIATION_FILTER, "Filter");
+ }
+
+ private static String getInputTypeString(int inputType) {
+ StringBuilder sb = new StringBuilder();
+ sb.append(inputType);
+ sb.append("(class=").append(inputType & InputType.TYPE_MASK_CLASS).append(')');
+ for (int variation : INPUT_TYPE_VARIATIONS.keySet()) {
+ if ((variation & inputType) == variation) {
+ sb.append('|').append(INPUT_TYPE_VARIATIONS.get(variation));
+ }
+ }
+ return sb.toString();
+ }
}
diff --git a/core/java/android/hardware/radio/flags.aconfig b/core/java/android/hardware/radio/flags.aconfig
new file mode 100644
index 0000000..dbc1a4b
--- /dev/null
+++ b/core/java/android/hardware/radio/flags.aconfig
@@ -0,0 +1,8 @@
+package: "android.hardware.radio"
+
+flag {
+ name: "hd_radio_improved"
+ namespace: "car_framework"
+ description: "Feature flag for improved HD radio support with less vendor extensions"
+ bug: "280300929"
+}
diff --git a/core/java/android/net/network-policy-restrictions.md b/core/java/android/net/network-policy-restrictions.md
index 04c658c..20f3d74 100644
--- a/core/java/android/net/network-policy-restrictions.md
+++ b/core/java/android/net/network-policy-restrictions.md
@@ -29,8 +29,8 @@
| **DS** | *AL* | ok | blk | ok | ok |
| **ON** | *!AL* | blk | blk | blk | blk |
| | *DL* | blk | blk | blk | blk |
-| **DS** | *AL* | blk | blk | ok | ok |
-| **OFF** | *!AL* | blk | blk | ok | ok |
+| **DS** | *AL* | ok | blk | ok | ok |
+| **OFF** | *!AL* | ok | blk | ok | ok |
| | *DL* | blk | blk | blk | blk |
diff --git a/core/java/android/os/BinderProxy.java b/core/java/android/os/BinderProxy.java
index ada5532..f817fb8 100644
--- a/core/java/android/os/BinderProxy.java
+++ b/core/java/android/os/BinderProxy.java
@@ -32,7 +32,9 @@
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.Collections;
import java.util.HashMap;
+import java.util.List;
import java.util.Map;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
@@ -613,15 +615,35 @@
*/
public native boolean transactNative(int code, Parcel data, Parcel reply,
int flags) throws RemoteException;
+
+ /* This list is to hold strong reference to the death recipients that are waiting for the death
+ * of binder that this proxy references. Previously, the death recipients were strongy
+ * referenced from JNI, but that can cause memory leak (b/298374304) when the application has a
+ * strong reference from the death recipient to the proxy object. The JNI reference is now weak.
+ * And this strong reference is to keep death recipients at least until the proxy is GC'ed. */
+ private List<DeathRecipient> mDeathRecipients = Collections.synchronizedList(new ArrayList<>());
+
/**
* See {@link IBinder#linkToDeath(DeathRecipient, int)}
*/
- public native void linkToDeath(DeathRecipient recipient, int flags)
- throws RemoteException;
+ public void linkToDeath(DeathRecipient recipient, int flags)
+ throws RemoteException {
+ linkToDeathNative(recipient, flags);
+ mDeathRecipients.add(recipient);
+ }
+
/**
* See {@link IBinder#unlinkToDeath}
*/
- public native boolean unlinkToDeath(DeathRecipient recipient, int flags);
+ public boolean unlinkToDeath(DeathRecipient recipient, int flags) {
+ mDeathRecipients.remove(recipient);
+ return unlinkToDeathNative(recipient, flags);
+ }
+
+ private native void linkToDeathNative(DeathRecipient recipient, int flags)
+ throws RemoteException;
+
+ private native boolean unlinkToDeathNative(DeathRecipient recipient, int flags);
/**
* Perform a dump on the remote object
diff --git a/core/java/android/os/BugreportParams.java b/core/java/android/os/BugreportParams.java
index f10467f..47ad72f 100644
--- a/core/java/android/os/BugreportParams.java
+++ b/core/java/android/os/BugreportParams.java
@@ -124,6 +124,8 @@
/**
* Options for a lightweight bugreport intended to be taken for onboarding-related flows.
+ *
+ * @hide
*/
public static final int BUGREPORT_MODE_ONBOARDING = IDumpstate.BUGREPORT_MODE_ONBOARDING;
diff --git a/core/java/android/security/FileIntegrityManager.java b/core/java/android/security/FileIntegrityManager.java
index 2dbb5da..dae3202 100644
--- a/core/java/android/security/FileIntegrityManager.java
+++ b/core/java/android/security/FileIntegrityManager.java
@@ -76,28 +76,38 @@
* Enables fs-verity to the owned file under the calling app's private directory. It always uses
* the common configuration, i.e. SHA-256 digest algorithm, 4K block size, and without salt.
*
- * The operation can only succeed when the file is not opened as writable by any process.
+ * <p>For enabling fs-verity to succeed, the device must support fs-verity, the file must be
+ * writable by the app and not already have fs-verity enabled, and the file must not currently
+ * be open for writing by any process. To check whether the device supports fs-verity, use
+ * {@link #isApkVeritySupported()}.
*
- * It takes O(file size) time to build the underlying data structure for continuous
+ * <p>It takes O(file size) time to build the underlying data structure for continuous
* verification. The operation is atomic, i.e. it's either enabled or not, even in case of
* power failure during or after the call.
*
- * Note for the API users: When the file's authenticity is crucial, the app typical needs to
+ * <p>Note for the API users: When the file's authenticity is crucial, the app typical needs to
* perform a signature check by itself before using the file. The signature is often delivered
* as a separate file and stored next to the targeting file in the filesystem. The public key of
* the signer (normally the same app developer) can be put in the APK, and the app can use the
* public key to verify the signature to the file's actual fs-verity digest (from {@link
- * #getFsVerityDigest}) before using the file. The exact format is not prescribed by the
+ * #getFsVerityDigest(File)}) before using the file. The exact format is not prescribed by the
* framework. App developers may choose to use common practices like JCA for the signing and
* verification, or their own preferred approach.
*
- * @param file The file to enable fs-verity. It should be an absolute path.
+ * @param file The file to enable fs-verity. It must represent an absolute path.
+ * @throws IllegalArgumentException If the provided file is not an absolute path.
+ * @throws IOException If the operation failed.
*
* @see <a href="https://www.kernel.org/doc/html/next/filesystems/fsverity.html">Kernel doc</a>
*/
@FlaggedApi(Flags.FLAG_FSVERITY_API)
public void setupFsVerity(@NonNull File file) throws IOException {
if (!file.isAbsolute()) {
+ // fs-verity is to be enabled by installd, which enforces the validation to the
+ // (untrusted) file path passed from here. To make this less error prone, installd
+ // accepts only absolute path. When a relative path is provided, we fail with an
+ // explicit exception to help developers understand the requirement to use an absolute
+ // path.
throw new IllegalArgumentException("Expect an absolute path");
}
IFsveritySetupAuthToken authToken;
@@ -121,11 +131,12 @@
}
/**
- * Returns the fs-verity digest for the owned file under the calling app's
- * private directory, or null when the file does not have fs-verity enabled.
+ * Returns the fs-verity digest for the owned file under the calling app's private directory, or
+ * null when the file does not have fs-verity enabled (including when fs-verity is not supported
+ * on older devices).
*
* @param file The file to measure the fs-verity digest.
- * @return The fs-verity digeset in byte[], null if none.
+ * @return The fs-verity digest in byte[], null if none.
* @see <a href="https://www.kernel.org/doc/html/next/filesystems/fsverity.html">Kernel doc</a>
*/
@FlaggedApi(Flags.FLAG_FSVERITY_API)
diff --git a/core/java/android/view/DisplayEventReceiver.java b/core/java/android/view/DisplayEventReceiver.java
index a46136a..31d759e 100644
--- a/core/java/android/view/DisplayEventReceiver.java
+++ b/core/java/android/view/DisplayEventReceiver.java
@@ -264,6 +264,16 @@
}
/**
+ * Called when a display hotplug event with connection error is received.
+ *
+ * @param timestampNanos The timestamp of the event, in the {@link System#nanoTime()}
+ * timebase.
+ * @param connectionError the hotplug connection error code.
+ */
+ public void onHotplugConnectionError(long timestampNanos, int connectionError) {
+ }
+
+ /**
* Called when a display mode changed event is received.
*
* @param timestampNanos The timestamp of the event, in the {@link System#nanoTime()}
@@ -345,6 +355,11 @@
onHotplug(timestampNanos, physicalDisplayId, connected);
}
+ @SuppressWarnings("unused")
+ private void dispatchHotplugConnectionError(long timestampNanos, int connectionError) {
+ onHotplugConnectionError(timestampNanos, connectionError);
+ }
+
// Called from native code.
@SuppressWarnings("unused")
private void dispatchModeChanged(long timestampNanos, long physicalDisplayId, int modeId,
diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java
index 0ba5d06..f421351 100644
--- a/core/java/android/view/ViewRootImpl.java
+++ b/core/java/android/view/ViewRootImpl.java
@@ -3858,9 +3858,7 @@
mPendingTransitions.clear();
}
- if (mActiveSurfaceSyncGroup != null) {
- mActiveSurfaceSyncGroup.markSyncReady();
- }
+ handleSyncRequestWhenNoAsyncDraw(mActiveSurfaceSyncGroup, mPendingTransaction);
} else if (cancelAndRedraw) {
mLastPerformTraversalsSkipDrawReason = cancelDueToPreDrawListener
? "predraw_" + mAttachInfo.mTreeObserver.getLastDispatchOnPreDrawCanceledReason()
@@ -3874,8 +3872,8 @@
}
mPendingTransitions.clear();
}
- if (!performDraw(mActiveSurfaceSyncGroup) && mActiveSurfaceSyncGroup != null) {
- mActiveSurfaceSyncGroup.markSyncReady();
+ if (!performDraw(mActiveSurfaceSyncGroup)) {
+ handleSyncRequestWhenNoAsyncDraw(mActiveSurfaceSyncGroup, mPendingTransaction);
}
}
@@ -3890,6 +3888,7 @@
mReportNextDraw = false;
mLastReportNextDrawReason = null;
mActiveSurfaceSyncGroup = null;
+ mHasPendingTransactions = false;
mSyncBuffer = false;
if (isInWMSRequestedSync()) {
mWmsRequestSyncGroup.markSyncReady();
@@ -4688,7 +4687,8 @@
return false;
}
- final boolean fullRedrawNeeded = mFullRedrawNeeded || surfaceSyncGroup != null;
+ final boolean fullRedrawNeeded =
+ mFullRedrawNeeded || surfaceSyncGroup != null || mHasPendingTransactions;
mFullRedrawNeeded = false;
mIsDrawing = true;
@@ -4718,8 +4718,15 @@
mAttachInfo.mPendingAnimatingRenderNodes.clear();
}
- if (mReportNextDraw) {
+ final Transaction pendingTransaction;
+ if (!usingAsyncReport && mHasPendingTransactions) {
+ pendingTransaction = new Transaction();
+ pendingTransaction.merge(mPendingTransaction);
+ } else {
+ pendingTransaction = null;
+ }
+ if (mReportNextDraw) {
// if we're using multi-thread renderer, wait for the window frame draws
if (mWindowDrawCountDown != null) {
try {
@@ -4741,9 +4748,7 @@
if (mSurfaceHolder != null && mSurface.isValid()) {
usingAsyncReport = true;
SurfaceCallbackHelper sch = new SurfaceCallbackHelper(() -> {
- if (surfaceSyncGroup != null) {
- surfaceSyncGroup.markSyncReady();
- }
+ handleSyncRequestWhenNoAsyncDraw(surfaceSyncGroup, pendingTransaction);
});
SurfaceHolder.Callback callbacks[] = mSurfaceHolder.getCallbacks();
@@ -4756,15 +4761,27 @@
}
}
- if (surfaceSyncGroup != null && !usingAsyncReport) {
- surfaceSyncGroup.markSyncReady();
+ if (!usingAsyncReport) {
+ handleSyncRequestWhenNoAsyncDraw(surfaceSyncGroup, pendingTransaction);
}
+
if (mPerformContentCapture) {
performContentCaptureInitialReport();
}
return true;
}
+ private void handleSyncRequestWhenNoAsyncDraw(SurfaceSyncGroup surfaceSyncGroup,
+ @Nullable Transaction pendingTransaction) {
+ if (surfaceSyncGroup != null) {
+ if (pendingTransaction != null) {
+ surfaceSyncGroup.addTransaction(pendingTransaction);
+ }
+ surfaceSyncGroup.markSyncReady();
+ } else if (pendingTransaction != null) {
+ pendingTransaction.apply();
+ }
+ }
/**
* Checks (and caches) if content capture is enabled for this context.
*/
@@ -4850,8 +4867,8 @@
}
}
- private boolean draw(boolean fullRedrawNeeded,
- @Nullable SurfaceSyncGroup activeSyncGroup, boolean syncBuffer) {
+ private boolean draw(boolean fullRedrawNeeded, @Nullable SurfaceSyncGroup activeSyncGroup,
+ boolean syncBuffer) {
Surface surface = mSurface;
if (!surface.isValid()) {
return false;
@@ -4995,12 +5012,11 @@
mAttachInfo.mThreadedRenderer.forceDrawNextFrame();
}
} else if (mHasPendingTransactions) {
- // Register a calback if there's no sync involved but there were calls to
+ // Register a callback if there's no sync involved but there were calls to
// applyTransactionOnDraw. If there is a sync involved, the sync callback will
// handle merging the pending transaction.
registerCallbackForPendingTransactions();
}
- mHasPendingTransactions = false;
mAttachInfo.mThreadedRenderer.draw(mView, mAttachInfo, this);
} else {
@@ -8977,13 +8993,7 @@
mAdded = false;
AnimationHandler.removeRequestor(this);
}
- if (mActiveSurfaceSyncGroup != null) {
- mActiveSurfaceSyncGroup.markSyncReady();
- mActiveSurfaceSyncGroup = null;
- }
- if (mHasPendingTransactions) {
- mPendingTransaction.apply();
- }
+ handleSyncRequestWhenNoAsyncDraw(mActiveSurfaceSyncGroup, mPendingTransaction);
WindowManagerGlobal.getInstance().doRemoveView(this);
}
@@ -11502,9 +11512,7 @@
Log.d(mTag, "registerCallbacksForSync syncBuffer=" + syncBuffer);
}
- Transaction t = new Transaction();
- t.merge(mPendingTransaction);
-
+ surfaceSyncGroup.addTransaction(mPendingTransaction);
mAttachInfo.mThreadedRenderer.registerRtFrameCallback(new FrameDrawingCallback() {
@Override
public void onFrameDraw(long frame) {
@@ -11518,7 +11526,6 @@
+ frame + ".");
}
- mergeWithNextTransaction(t, frame);
// If the syncResults are SYNC_LOST_SURFACE_REWARD_IF_FOUND or
// SYNC_CONTEXT_IS_STOPPED it means nothing will draw. There's no need to set up
// any blast sync or commit callback, and the code should directly call
diff --git a/core/java/android/window/TransitionRequestInfo.java b/core/java/android/window/TransitionRequestInfo.java
index 9b10a7f..932608a3 100644
--- a/core/java/android/window/TransitionRequestInfo.java
+++ b/core/java/android/window/TransitionRequestInfo.java
@@ -16,6 +16,8 @@
package android.window;
+import static android.view.WindowManager.transitTypeToString;
+
import android.annotation.Nullable;
import android.app.ActivityManager;
import android.app.WindowConfiguration;
@@ -88,6 +90,11 @@
this(type, triggerTask, null /* pipTask */, remoteTransition, displayChange, flags);
}
+ /** @hide */
+ String typeToString() {
+ return transitTypeToString(mType);
+ }
+
/** Requested change to a display. */
@DataClass(genToString = true, genSetters = true, genBuilder = false, genConstructor = false)
public static class DisplayChange implements Parcelable {
@@ -263,7 +270,7 @@
};
@DataClass.Generated(
- time = 1693425051905L,
+ time = 1695667226050L,
codegenVersion = "1.0.23",
sourceFile = "frameworks/base/core/java/android/window/TransitionRequestInfo.java",
inputSignatures = "private final int mDisplayId\nprivate @android.annotation.Nullable android.graphics.Rect mStartAbsBounds\nprivate @android.annotation.Nullable android.graphics.Rect mEndAbsBounds\nprivate int mStartRotation\nprivate int mEndRotation\nprivate boolean mPhysicalDisplayChanged\nclass DisplayChange extends java.lang.Object implements [android.os.Parcelable]\n@com.android.internal.util.DataClass(genToString=true, genSetters=true, genBuilder=false, genConstructor=false)")
@@ -298,11 +305,11 @@
* @param type
* The type of the transition being requested.
* @param triggerTask
- * If non-null, If non-null, the task containing the activity whose lifecycle change (start or
+ * If non-null, the task containing the activity whose lifecycle change (start or
* finish) has caused this transition to occur.
* @param pipTask
- * If non-null, If non-null, the task containing the activity whose lifecycle change (start or
- * finish) has caused this transition to occur.
+ * If non-null, the task containing the pip activity that participates in this
+ * transition.
* @param remoteTransition
* If non-null, a remote-transition associated with the source of this transition.
* @param displayChange
@@ -431,7 +438,7 @@
// String fieldNameToString() { ... }
return "TransitionRequestInfo { " +
- "type = " + mType + ", " +
+ "type = " + typeToString() + ", " +
"triggerTask = " + mTriggerTask + ", " +
"pipTask = " + mPipTask + ", " +
"remoteTransition = " + mRemoteTransition + ", " +
@@ -506,10 +513,10 @@
};
@DataClass.Generated(
- time = 1693425051928L,
+ time = 1695667226088L,
codegenVersion = "1.0.23",
sourceFile = "frameworks/base/core/java/android/window/TransitionRequestInfo.java",
- inputSignatures = "private final @android.view.WindowManager.TransitionType int mType\nprivate @android.annotation.Nullable android.app.ActivityManager.RunningTaskInfo mTriggerTask\nprivate @android.annotation.Nullable android.app.ActivityManager.RunningTaskInfo mPipTask\nprivate @android.annotation.Nullable android.window.RemoteTransition mRemoteTransition\nprivate @android.annotation.Nullable android.window.TransitionRequestInfo.DisplayChange mDisplayChange\nprivate final int mFlags\nclass TransitionRequestInfo extends java.lang.Object implements [android.os.Parcelable]\n@com.android.internal.util.DataClass(genToString=true, genSetters=true, genAidl=true)")
+ inputSignatures = "private final @android.view.WindowManager.TransitionType int mType\nprivate @android.annotation.Nullable android.app.ActivityManager.RunningTaskInfo mTriggerTask\nprivate @android.annotation.Nullable android.app.ActivityManager.RunningTaskInfo mPipTask\nprivate @android.annotation.Nullable android.window.RemoteTransition mRemoteTransition\nprivate @android.annotation.Nullable android.window.TransitionRequestInfo.DisplayChange mDisplayChange\nprivate final int mFlags\n java.lang.String typeToString()\nclass TransitionRequestInfo extends java.lang.Object implements [android.os.Parcelable]\n@com.android.internal.util.DataClass(genToString=true, genSetters=true, genAidl=true)")
@Deprecated
private void __metadata() {}
diff --git a/core/java/com/android/internal/content/PackageMonitor.java b/core/java/com/android/internal/content/PackageMonitor.java
index 0d1871d..663067c 100644
--- a/core/java/com/android/internal/content/PackageMonitor.java
+++ b/core/java/com/android/internal/content/PackageMonitor.java
@@ -203,14 +203,22 @@
}
return false;
}
-
+
+ /**
+ * Direct reflection of {@link Intent#ACTION_PACKAGE_CHANGED
+ * Intent.ACTION_PACKAGE_CHANGED} being received, this callback
+ * has extras passed in.
+ */
+ public void onPackageChangedWithExtras(String packageName, Bundle extras) {
+ }
+
public boolean onHandleForceStop(Intent intent, String[] packages, int uid, boolean doit) {
return false;
}
public void onHandleUserStop(Intent intent, int userHandle) {
}
-
+
public void onUidRemoved(int uid) {
}
@@ -238,21 +246,34 @@
}
/**
+ * Called when a package disappears with extras passed in.
+ */
+ public void onPackageDisappearedWithExtras(String packageName, Bundle extras) {
+ }
+
+ /**
* Called when a package appears for any reason.
*/
public void onPackageAppeared(String packageName, int reason) {
}
+
+ /**
+ * Called when a package appears with extras passed in.
+ */
+ public void onPackageAppearedWithExtras(String packageName, Bundle extras) {
+ }
+
/**
* Called when an existing package is updated or its disabled state changes.
*/
public void onPackageModified(@NonNull String packageName) {
}
-
+
public boolean didSomePackagesChange() {
return mSomePackagesChanged;
}
-
+
public int isPackageAppearing(String packageName) {
if (mAppearingPackages != null) {
for (int i=mAppearingPackages.length-1; i>=0; i--) {
@@ -381,6 +402,7 @@
mChangeType = PACKAGE_PERMANENT_CHANGE;
onPackageAdded(pkg, uid);
}
+ onPackageAppearedWithExtras(pkg, intent.getExtras());
onPackageAppeared(pkg, mChangeType);
}
} else if (Intent.ACTION_PACKAGE_REMOVED.equals(action)) {
@@ -403,6 +425,7 @@
onPackageRemovedAllUsers(pkg, uid);
}
}
+ onPackageDisappearedWithExtras(pkg, intent.getExtras());
onPackageDisappeared(pkg, mChangeType);
}
} else if (Intent.ACTION_PACKAGE_CHANGED.equals(action)) {
@@ -417,6 +440,7 @@
if (onPackageChanged(pkg, uid, mModifiedComponents)) {
mSomePackagesChanged = true;
}
+ onPackageChangedWithExtras(pkg, intent.getExtras());
onPackageModified(pkg);
}
} else if (Intent.ACTION_PACKAGE_DATA_CLEARED.equals(action)) {
diff --git a/core/jni/Android.bp b/core/jni/Android.bp
index ad196c0..9ed4155 100644
--- a/core/jni/Android.bp
+++ b/core/jni/Android.bp
@@ -15,7 +15,19 @@
],
}
-cc_library_shared {
+soong_config_module_type {
+ name: "cc_library_shared_for_libandroid_runtime",
+ module_type: "cc_library_shared",
+ config_namespace: "ANDROID",
+ bool_variables: [
+ "release_binder_death_recipient_weak_from_jni",
+ ],
+ properties: [
+ "cflags",
+ ],
+}
+
+cc_library_shared_for_libandroid_runtime {
name: "libandroid_runtime",
host_supported: true,
cflags: [
@@ -46,6 +58,12 @@
},
},
+ soong_config_variables: {
+ release_binder_death_recipient_weak_from_jni: {
+ cflags: ["-DBINDER_DEATH_RECIPIENT_WEAK_FROM_JNI"],
+ },
+ },
+
cpp_std: "gnu++20",
srcs: [
diff --git a/core/jni/android_util_Binder.cpp b/core/jni/android_util_Binder.cpp
index 041f9c7..bfd80a9e 100644
--- a/core/jni/android_util_Binder.cpp
+++ b/core/jni/android_util_Binder.cpp
@@ -17,19 +17,8 @@
#define LOG_TAG "JavaBinder"
//#define LOG_NDEBUG 0
-#include "android_os_Parcel.h"
#include "android_util_Binder.h"
-#include <atomic>
-#include <fcntl.h>
-#include <inttypes.h>
-#include <mutex>
-#include <stdio.h>
-#include <string>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <unistd.h>
-
#include <android-base/stringprintf.h>
#include <binder/BpBinder.h>
#include <binder/IInterface.h>
@@ -40,7 +29,16 @@
#include <binder/Stability.h>
#include <binderthreadstate/CallerUtils.h>
#include <cutils/atomic.h>
+#include <fcntl.h>
+#include <inttypes.h>
#include <log/log.h>
+#include <nativehelper/JNIHelp.h>
+#include <nativehelper/ScopedLocalRef.h>
+#include <nativehelper/ScopedUtfChars.h>
+#include <stdio.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <unistd.h>
#include <utils/KeyedVector.h>
#include <utils/List.h>
#include <utils/Log.h>
@@ -48,10 +46,11 @@
#include <utils/SystemClock.h>
#include <utils/threads.h>
-#include <nativehelper/JNIHelp.h>
-#include <nativehelper/ScopedLocalRef.h>
-#include <nativehelper/ScopedUtfChars.h>
+#include <atomic>
+#include <mutex>
+#include <string>
+#include "android_os_Parcel.h"
#include "core_jni_helpers.h"
//#undef ALOGV
@@ -553,14 +552,48 @@
};
// ----------------------------------------------------------------------------
+#ifdef BINDER_DEATH_RECIPIENT_WEAK_FROM_JNI
+#if __BIONIC__
+#include <android/api-level.h>
+static bool target_sdk_is_at_least_vic() {
+ return android_get_application_target_sdk_version() >= __ANDROID_API_V__;
+}
+#else
+static constexpr bool target_sdk_is_at_least_vic() {
+ // If not built for Android (i.e. glibc host), follow the latest behavior as there's no compat
+ // requirement there.
+ return true;
+}
+#endif // __BIONIC__
+#endif // BINDER_DEATH_RECIPIENT_WEAK_FROM_JNI
class JavaDeathRecipient : public IBinder::DeathRecipient
{
public:
JavaDeathRecipient(JNIEnv* env, jobject object, const sp<DeathRecipientList>& list)
- : mVM(jnienv_to_javavm(env)), mObject(env->NewGlobalRef(object)),
- mObjectWeak(NULL), mList(list)
- {
+ : mVM(jnienv_to_javavm(env)), mObject(NULL), mObjectWeak(NULL), mList(list) {
+ // b/298374304: For apps targeting Android V or beyond, we no longer hold the global JNI ref
+ // to the death recipient objects. This is to prevent the memory leak which can happen when
+ // the death recipient object internally has a strong reference to the proxy object. Under
+ // the old behavior, you were unable to kill the binder service by dropping all references
+ // to the proxy object - because it is still strong referenced from JNI (here). The only way
+ // to cut the strong reference was to call unlinkDeath(), but it was easy to forget.
+ //
+ // Now, the strong reference to the death recipient is held in the Java-side proxy object.
+ // See BinderProxy.mDeathRecipients. From JNI, only the weak reference is kept. An
+ // implication of this is that you may not receive binderDied() if you drop all references
+ // to the proxy object before the service dies. This should be okay for most cases because
+ // you normally are not interested in the death of a binder service which you don't have any
+ // reference to. If however you want to get binderDied() regardless of the proxy object's
+ // lifecycle, keep a strong reference to the death recipient object by yourself.
+#ifdef BINDER_DEATH_RECIPIENT_WEAK_FROM_JNI
+ if (target_sdk_is_at_least_vic()) {
+ mObjectWeak = env->NewWeakGlobalRef(object);
+ } else
+#endif
+ {
+ mObject = env->NewGlobalRef(object);
+ }
// These objects manage their own lifetimes so are responsible for final bookkeeping.
// The list holds a strong reference to this object.
LOGDEATH("Adding JDR %p to DRL %p", this, list.get());
@@ -573,26 +606,49 @@
void binderDied(const wp<IBinder>& who)
{
LOGDEATH("Receiving binderDied() on JavaDeathRecipient %p\n", this);
- if (mObject != NULL) {
- JNIEnv* env = javavm_to_jnienv(mVM);
- ScopedLocalRef<jobject> jBinderProxy(env, javaObjectForIBinder(env, who.promote()));
- env->CallStaticVoidMethod(gBinderProxyOffsets.mClass,
- gBinderProxyOffsets.mSendDeathNotice, mObject,
- jBinderProxy.get());
- if (env->ExceptionCheck()) {
- jthrowable excep = env->ExceptionOccurred();
- binder_report_exception(env, excep,
- "*** Uncaught exception returned from death notification!");
- }
+ if (mObject == NULL && mObjectWeak == NULL) {
+ return;
+ }
+ JNIEnv* env = javavm_to_jnienv(mVM);
+ ScopedLocalRef<jobject> jBinderProxy(env, javaObjectForIBinder(env, who.promote()));
- // Serialize with our containing DeathRecipientList so that we can't
- // delete the global ref on mObject while the list is being iterated.
+ // Hold a local reference to the recipient. This may fail if the recipient is weakly
+ // referenced, in which case we can't deliver the death notice.
+ ScopedLocalRef<jobject> jRecipient(env,
+ env->NewLocalRef(mObject != NULL ? mObject
+ : mObjectWeak));
+ if (jRecipient.get() == NULL) {
+ ALOGW("Binder died, but death recipient is already garbage collected. If your target "
+ "sdk level is at or above 35, this can happen when you dropped all references to "
+ "the binder service before it died. If you want to get a death notice for a "
+ "binder service which you have no reference to, keep a strong reference to the "
+ "death recipient by yourself.");
+ return;
+ }
+
+ if (mFired) {
+ ALOGW("Received multiple death notices for the same binder object. Binder driver bug?");
+ return;
+ }
+ mFired = true;
+
+ env->CallStaticVoidMethod(gBinderProxyOffsets.mClass, gBinderProxyOffsets.mSendDeathNotice,
+ jRecipient.get(), jBinderProxy.get());
+ if (env->ExceptionCheck()) {
+ jthrowable excep = env->ExceptionOccurred();
+ binder_report_exception(env, excep,
+ "*** Uncaught exception returned from death notification!");
+ }
+
+ // Demote from strong ref (if exists) to weak after binderDied() has been delivered, to
+ // allow the DeathRecipient and BinderProxy to be GC'd if no longer needed. Do this in sync
+ // with our containing DeathRecipientList so that we can't delete the global ref on mObject
+ // while the list is being iterated.
+ if (mObject != NULL) {
sp<DeathRecipientList> list = mList.promote();
if (list != NULL) {
AutoMutex _l(list->lock());
- // Demote from strong ref to weak after binderDied() has been delivered,
- // to allow the DeathRecipient and BinderProxy to be GC'd if no longer needed.
mObjectWeak = env->NewWeakGlobalRef(mObject);
env->DeleteGlobalRef(mObject);
mObject = NULL;
@@ -659,9 +715,19 @@
private:
JavaVM* const mVM;
- jobject mObject; // Initial strong ref to Java-side DeathRecipient. Cleared on binderDied().
- jweak mObjectWeak; // Weak ref to the same Java-side DeathRecipient after binderDied().
+
+ // If target sdk version < 35, the Java-side DeathRecipient is strongly referenced from mObject
+ // upon linkToDeath() and then after binderDied() is called, the strong reference is demoted to
+ // a weak reference (mObjectWeak).
+ // If target sdk version >= 35, the strong reference is never made here (i.e. mObject == NULL
+ // always). Instead, the strong reference to the Java-side DeathRecipient is made in
+ // BinderProxy.mDeathRecipients. In the native world, only the weak reference is kept.
+ jobject mObject;
+ jweak mObjectWeak;
wp<DeathRecipientList> mList;
+
+ // Whether binderDied was called or not.
+ bool mFired = false;
};
// ----------------------------------------------------------------------------
@@ -1435,17 +1501,19 @@
// ----------------------------------------------------------------------------
+// clang-format off
static const JNINativeMethod gBinderProxyMethods[] = {
/* name, signature, funcPtr */
{"pingBinder", "()Z", (void*)android_os_BinderProxy_pingBinder},
{"isBinderAlive", "()Z", (void*)android_os_BinderProxy_isBinderAlive},
{"getInterfaceDescriptor", "()Ljava/lang/String;", (void*)android_os_BinderProxy_getInterfaceDescriptor},
{"transactNative", "(ILandroid/os/Parcel;Landroid/os/Parcel;I)Z", (void*)android_os_BinderProxy_transact},
- {"linkToDeath", "(Landroid/os/IBinder$DeathRecipient;I)V", (void*)android_os_BinderProxy_linkToDeath},
- {"unlinkToDeath", "(Landroid/os/IBinder$DeathRecipient;I)Z", (void*)android_os_BinderProxy_unlinkToDeath},
+ {"linkToDeathNative", "(Landroid/os/IBinder$DeathRecipient;I)V", (void*)android_os_BinderProxy_linkToDeath},
+ {"unlinkToDeathNative", "(Landroid/os/IBinder$DeathRecipient;I)Z", (void*)android_os_BinderProxy_unlinkToDeath},
{"getNativeFinalizer", "()J", (void*)android_os_BinderProxy_getNativeFinalizer},
{"getExtension", "()Landroid/os/IBinder;", (void*)android_os_BinderProxy_getExtension},
};
+// clang-format on
const char* const kBinderProxyPathName = "android/os/BinderProxy";
diff --git a/core/jni/android_view_DisplayEventReceiver.cpp b/core/jni/android_view_DisplayEventReceiver.cpp
index 69fc515..41c65ae 100644
--- a/core/jni/android_view_DisplayEventReceiver.cpp
+++ b/core/jni/android_view_DisplayEventReceiver.cpp
@@ -38,6 +38,7 @@
jmethodID dispatchVsync;
jmethodID dispatchHotplug;
+ jmethodID dispatchHotplugConnectionError;
jmethodID dispatchModeChanged;
jmethodID dispatchFrameRateOverrides;
@@ -89,6 +90,7 @@
void dispatchVsync(nsecs_t timestamp, PhysicalDisplayId displayId, uint32_t count,
VsyncEventData vsyncEventData) override;
void dispatchHotplug(nsecs_t timestamp, PhysicalDisplayId displayId, bool connected) override;
+ void dispatchHotplugConnectionError(nsecs_t timestamp, int errorCode) override;
void dispatchModeChanged(nsecs_t timestamp, PhysicalDisplayId displayId, int32_t modeId,
nsecs_t renderPeriod) override;
void dispatchFrameRateOverrides(nsecs_t timestamp, PhysicalDisplayId displayId,
@@ -230,6 +232,22 @@
mMessageQueue->raiseAndClearException(env, "dispatchHotplug");
}
+void NativeDisplayEventReceiver::dispatchHotplugConnectionError(nsecs_t timestamp,
+ int connectionError) {
+ JNIEnv* env = AndroidRuntime::getJNIEnv();
+
+ ScopedLocalRef<jobject> receiverObj(env, GetReferent(env, mReceiverWeakGlobal));
+ if (receiverObj.get()) {
+ ALOGV("receiver %p ~ Invoking hotplug dispatchHotplugConnectionError handler.", this);
+ env->CallVoidMethod(receiverObj.get(),
+ gDisplayEventReceiverClassInfo.dispatchHotplugConnectionError,
+ timestamp, connectionError);
+ ALOGV("receiver %p ~ Returned from hotplug dispatchHotplugConnectionError handler.", this);
+ }
+
+ mMessageQueue->raiseAndClearException(env, "dispatchHotplugConnectionError");
+}
+
void NativeDisplayEventReceiver::dispatchModeChanged(nsecs_t timestamp, PhysicalDisplayId displayId,
int32_t modeId, nsecs_t renderPeriod) {
JNIEnv* env = AndroidRuntime::getJNIEnv();
@@ -354,8 +372,12 @@
gDisplayEventReceiverClassInfo.dispatchVsync =
GetMethodIDOrDie(env, gDisplayEventReceiverClassInfo.clazz, "dispatchVsync", "(JJI)V");
- gDisplayEventReceiverClassInfo.dispatchHotplug = GetMethodIDOrDie(env,
- gDisplayEventReceiverClassInfo.clazz, "dispatchHotplug", "(JJZ)V");
+ gDisplayEventReceiverClassInfo.dispatchHotplug =
+ GetMethodIDOrDie(env, gDisplayEventReceiverClassInfo.clazz, "dispatchHotplug",
+ "(JJZ)V");
+ gDisplayEventReceiverClassInfo.dispatchHotplugConnectionError =
+ GetMethodIDOrDie(env, gDisplayEventReceiverClassInfo.clazz,
+ "dispatchHotplugConnectionError", "(JI)V");
gDisplayEventReceiverClassInfo.dispatchModeChanged =
GetMethodIDOrDie(env, gDisplayEventReceiverClassInfo.clazz, "dispatchModeChanged",
"(JJIJ)V");
diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml
index a1adfc3..c00a776f 100644
--- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml
@@ -4830,7 +4830,7 @@
<string translatable="false" name="config_deviceSpecificInputMethodManagerService"></string>
<!-- Component name of media projection permission dialog -->
- <string name="config_mediaProjectionPermissionDialogComponent" translatable="false">com.android.systemui/com.android.systemui.mediaprojection.MediaProjectionPermissionActivity</string>
+ <string name="config_mediaProjectionPermissionDialogComponent" translatable="false">com.android.systemui/com.android.systemui.media.MediaProjectionPermissionActivity</string>
<!-- Corner radius of system dialogs -->
<dimen name="config_dialogCornerRadius">28dp</dimen>
diff --git a/core/tests/packagemonitortests/src/com/android/internal/content/PackageMonitorTest.java b/core/tests/packagemonitortests/src/com/android/internal/content/PackageMonitorTest.java
index e082c25..c7eddabe 100644
--- a/core/tests/packagemonitortests/src/com/android/internal/content/PackageMonitorTest.java
+++ b/core/tests/packagemonitortests/src/com/android/internal/content/PackageMonitorTest.java
@@ -17,7 +17,6 @@
package com.android.internal.content;
import static com.google.common.truth.Truth.assertThat;
-
import static org.junit.Assert.assertThrows;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
@@ -28,6 +27,7 @@
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
+import android.os.Bundle;
import android.os.Handler;
import android.os.UserHandle;
@@ -36,6 +36,7 @@
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
+import org.mockito.ArgumentCaptor;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
@@ -45,6 +46,7 @@
@RunWith(AndroidJUnit4.class)
public class PackageMonitorTest {
private static final String FAKE_PACKAGE_NAME = "com.android.internal.content.fakeapp";
+ private static final String FAKE_EXTRA_REASON = "android.intent.extra.fakereason";
private static final int FAKE_PACKAGE_UID = 123;
private static final int FAKE_USER_ID = 0;
private static final int WAIT_CALLBACK_CALLED_IN_MS = 300;
@@ -245,6 +247,7 @@
intent.setData(Uri.fromParts("package", FAKE_PACKAGE_NAME, null));
intent.putExtra(Intent.EXTRA_USER_HANDLE, FAKE_USER_ID);
intent.putExtra(Intent.EXTRA_UID, FAKE_PACKAGE_UID);
+ intent.putExtra(Intent.EXTRA_REASON, FAKE_EXTRA_REASON);
String [] packageList = new String[]{FAKE_PACKAGE_NAME};
intent.putExtra(Intent.EXTRA_CHANGED_COMPONENT_NAME_LIST, packageList);
spyPackageMonitor.doHandlePackageEvent(intent);
@@ -253,6 +256,20 @@
verify(spyPackageMonitor, times(1))
.onPackageChanged(eq(FAKE_PACKAGE_NAME), eq(FAKE_PACKAGE_UID), eq(packageList));
verify(spyPackageMonitor, times(1)).onPackageModified(eq(FAKE_PACKAGE_NAME));
+
+ ArgumentCaptor<Bundle> argumentCaptor = ArgumentCaptor.forClass(Bundle.class);
+ verify(spyPackageMonitor, times(1)).onPackageChangedWithExtras(eq(FAKE_PACKAGE_NAME),
+ argumentCaptor.capture());
+
+ Bundle capturedExtras = argumentCaptor.getValue();
+ Bundle expectedExtras = intent.getExtras();
+ assertThat(capturedExtras.getInt(Intent.EXTRA_USER_HANDLE))
+ .isEqualTo(expectedExtras.getInt(Intent.EXTRA_USER_HANDLE));
+ assertThat(capturedExtras.getInt(Intent.EXTRA_UID))
+ .isEqualTo(expectedExtras.getInt(Intent.EXTRA_UID));
+ assertThat(capturedExtras.getInt(Intent.EXTRA_REASON))
+ .isEqualTo(expectedExtras.getInt(Intent.EXTRA_REASON));
+
verify(spyPackageMonitor, times(1)).onSomePackagesChanged();
verify(spyPackageMonitor, times(1)).onFinishPackageChanges();
}
@@ -272,6 +289,21 @@
verify(spyPackageMonitor, times(1)).onBeginPackageChanges();
verify(spyPackageMonitor, times(1))
.onPackageUpdateStarted(eq(FAKE_PACKAGE_NAME), eq(FAKE_PACKAGE_UID));
+
+ ArgumentCaptor<Bundle> argumentCaptor = ArgumentCaptor.forClass(Bundle.class);
+ verify(spyPackageMonitor, times(1)).onPackageDisappearedWithExtras(eq(FAKE_PACKAGE_NAME),
+ argumentCaptor.capture());
+ Bundle capturedExtras = argumentCaptor.getValue();
+ Bundle expectedExtras = intent.getExtras();
+ assertThat(capturedExtras.getInt(Intent.EXTRA_USER_HANDLE))
+ .isEqualTo(expectedExtras.getInt(Intent.EXTRA_USER_HANDLE));
+ assertThat(capturedExtras.getInt(Intent.EXTRA_UID))
+ .isEqualTo(expectedExtras.getInt(Intent.EXTRA_UID));
+ assertThat(capturedExtras.getInt(Intent.EXTRA_REPLACING))
+ .isEqualTo(expectedExtras.getInt(Intent.EXTRA_REPLACING));
+ assertThat(capturedExtras.getInt(Intent.EXTRA_REMOVED_FOR_ALL_USERS))
+ .isEqualTo(expectedExtras.getInt(Intent.EXTRA_REMOVED_FOR_ALL_USERS));
+
verify(spyPackageMonitor, times(1))
.onPackageDisappeared(eq(FAKE_PACKAGE_NAME), eq(PackageMonitor.PACKAGE_UPDATING));
verify(spyPackageMonitor, times(1)).onFinishPackageChanges();
@@ -295,6 +327,21 @@
.onPackageRemoved(eq(FAKE_PACKAGE_NAME), eq(FAKE_PACKAGE_UID));
verify(spyPackageMonitor, times(1))
.onPackageRemovedAllUsers(eq(FAKE_PACKAGE_NAME), eq(FAKE_PACKAGE_UID));
+
+ ArgumentCaptor<Bundle> argumentCaptor = ArgumentCaptor.forClass(Bundle.class);
+ verify(spyPackageMonitor, times(1)).onPackageDisappearedWithExtras(eq(FAKE_PACKAGE_NAME),
+ argumentCaptor.capture());
+ Bundle capturedExtras = argumentCaptor.getValue();
+ Bundle expectedExtras = intent.getExtras();
+ assertThat(capturedExtras.getInt(Intent.EXTRA_USER_HANDLE))
+ .isEqualTo(expectedExtras.getInt(Intent.EXTRA_USER_HANDLE));
+ assertThat(capturedExtras.getInt(Intent.EXTRA_UID))
+ .isEqualTo(expectedExtras.getInt(Intent.EXTRA_UID));
+ assertThat(capturedExtras.getInt(Intent.EXTRA_REPLACING))
+ .isEqualTo(expectedExtras.getInt(Intent.EXTRA_REPLACING));
+ assertThat(capturedExtras.getInt(Intent.EXTRA_REMOVED_FOR_ALL_USERS))
+ .isEqualTo(expectedExtras.getInt(Intent.EXTRA_REMOVED_FOR_ALL_USERS));
+
verify(spyPackageMonitor, times(1)).onPackageDisappeared(eq(FAKE_PACKAGE_NAME),
eq(PackageMonitor.PACKAGE_PERMANENT_CHANGE));
verify(spyPackageMonitor, times(1)).onSomePackagesChanged();
@@ -316,6 +363,19 @@
verify(spyPackageMonitor, times(1))
.onPackageUpdateFinished(eq(FAKE_PACKAGE_NAME), eq(FAKE_PACKAGE_UID));
verify(spyPackageMonitor, times(1)).onPackageModified(eq(FAKE_PACKAGE_NAME));
+
+ ArgumentCaptor<Bundle> argumentCaptor = ArgumentCaptor.forClass(Bundle.class);
+ verify(spyPackageMonitor, times(1)).onPackageAppearedWithExtras(eq(FAKE_PACKAGE_NAME),
+ argumentCaptor.capture());
+ Bundle capturedExtras = argumentCaptor.getValue();
+ Bundle expectedExtras = intent.getExtras();
+ assertThat(capturedExtras.getInt(Intent.EXTRA_USER_HANDLE))
+ .isEqualTo(expectedExtras.getInt(Intent.EXTRA_USER_HANDLE));
+ assertThat(capturedExtras.getInt(Intent.EXTRA_UID))
+ .isEqualTo(expectedExtras.getInt(Intent.EXTRA_UID));
+ assertThat(capturedExtras.getInt(Intent.EXTRA_REPLACING))
+ .isEqualTo(expectedExtras.getInt(Intent.EXTRA_REPLACING));
+
verify(spyPackageMonitor, times(1))
.onPackageAppeared(eq(FAKE_PACKAGE_NAME), eq(PackageMonitor.PACKAGE_UPDATING));
verify(spyPackageMonitor, times(1)).onSomePackagesChanged();
@@ -336,6 +396,19 @@
verify(spyPackageMonitor, times(1)).onBeginPackageChanges();
verify(spyPackageMonitor, times(1))
.onPackageAdded(eq(FAKE_PACKAGE_NAME), eq(FAKE_PACKAGE_UID));
+
+ ArgumentCaptor<Bundle> argumentCaptor = ArgumentCaptor.forClass(Bundle.class);
+ verify(spyPackageMonitor, times(1)).onPackageAppearedWithExtras(eq(FAKE_PACKAGE_NAME),
+ argumentCaptor.capture());
+ Bundle capturedExtras = argumentCaptor.getValue();
+ Bundle expectedExtras = intent.getExtras();
+ assertThat(capturedExtras.getInt(Intent.EXTRA_USER_HANDLE))
+ .isEqualTo(expectedExtras.getInt(Intent.EXTRA_USER_HANDLE));
+ assertThat(capturedExtras.getInt(Intent.EXTRA_UID))
+ .isEqualTo(expectedExtras.getInt(Intent.EXTRA_UID));
+ assertThat(capturedExtras.getInt(Intent.EXTRA_REPLACING))
+ .isEqualTo(expectedExtras.getInt(Intent.EXTRA_REPLACING));
+
verify(spyPackageMonitor, times(1)).onPackageAppeared(eq(FAKE_PACKAGE_NAME),
eq(PackageMonitor.PACKAGE_PERMANENT_CHANGE));
verify(spyPackageMonitor, times(1)).onSomePackagesChanged();
diff --git a/libs/hwui/Mesh.h b/libs/hwui/Mesh.h
index 764d1ef..69fda34 100644
--- a/libs/hwui/Mesh.h
+++ b/libs/hwui/Mesh.h
@@ -166,11 +166,12 @@
#endif
mMesh = SkMesh::MakeIndexed(mMeshSpec, meshMode, vb, mVertexCount, mVertexOffset,
ib, mIndexCount, mIndexOffset, mBuilder->fUniforms,
- mBounds)
+ SkSpan<SkRuntimeEffect::ChildPtr>(), mBounds)
.mesh;
} else {
mMesh = SkMesh::Make(mMeshSpec, meshMode, vb, mVertexCount, mVertexOffset,
- mBuilder->fUniforms, mBounds)
+ mBuilder->fUniforms, SkSpan<SkRuntimeEffect::ChildPtr>(),
+ mBounds)
.mesh;
}
mIsDirty = false;
diff --git a/libs/hwui/RecordingCanvas.cpp b/libs/hwui/RecordingCanvas.cpp
index 71f47e9..ff0d8d74 100644
--- a/libs/hwui/RecordingCanvas.cpp
+++ b/libs/hwui/RecordingCanvas.cpp
@@ -539,7 +539,7 @@
if (!cpuMesh.indexBuffer()) {
gpuMesh = SkMesh::Make(cpuMesh.refSpec(), cpuMesh.mode(), vb, cpuMesh.vertexCount(),
cpuMesh.vertexOffset(), cpuMesh.refUniforms(),
- cpuMesh.bounds())
+ SkSpan<SkRuntimeEffect::ChildPtr>(), cpuMesh.bounds())
.mesh;
} else {
sk_sp<SkMesh::IndexBuffer> ib =
@@ -547,7 +547,8 @@
gpuMesh = SkMesh::MakeIndexed(cpuMesh.refSpec(), cpuMesh.mode(), vb,
cpuMesh.vertexCount(), cpuMesh.vertexOffset(), ib,
cpuMesh.indexCount(), cpuMesh.indexOffset(),
- cpuMesh.refUniforms(), cpuMesh.bounds())
+ cpuMesh.refUniforms(),
+ SkSpan<SkRuntimeEffect::ChildPtr>(), cpuMesh.bounds())
.mesh;
}
diff --git a/packages/CredentialManager/src/com/android/credentialmanager/autofill/CredentialAutofillService.kt b/packages/CredentialManager/src/com/android/credentialmanager/autofill/CredentialAutofillService.kt
index 943c2b4..ba88484 100644
--- a/packages/CredentialManager/src/com/android/credentialmanager/autofill/CredentialAutofillService.kt
+++ b/packages/CredentialManager/src/com/android/credentialmanager/autofill/CredentialAutofillService.kt
@@ -16,23 +16,183 @@
package com.android.credentialmanager.autofill
+import android.app.assist.AssistStructure
+import android.content.Context
+import android.credentials.GetCredentialRequest
+import android.credentials.CredentialManager
+import android.credentials.GetCandidateCredentialsResponse
+import android.credentials.CredentialOption
+import android.credentials.GetCandidateCredentialsException
+import android.os.Bundle
import android.os.CancellationSignal
-import android.service.autofill.AutofillService
-import android.service.autofill.FillCallback
+import android.os.OutcomeReceiver
import android.service.autofill.FillRequest
+import android.service.autofill.AutofillService
+import android.service.autofill.FillResponse
+import android.service.autofill.FillCallback
import android.service.autofill.SaveRequest
import android.service.autofill.SaveCallback
+import android.util.Log
+import org.json.JSONObject
+import java.util.concurrent.Executors
class CredentialAutofillService : AutofillService() {
+
+ companion object {
+ private const val TAG = "CredAutofill"
+
+ private const val CRED_HINT_PREFIX = "credential="
+ private const val REQUEST_DATA_KEY = "requestData"
+ private const val CANDIDATE_DATA_KEY = "candidateQueryData"
+ private const val SYS_PROVIDER_REQ_KEY = "isSystemProviderRequired"
+ private const val CRED_OPTIONS_KEY = "credentialOptions"
+ private const val TYPE_KEY = "type"
+ }
+
+ private val credentialManager: CredentialManager =
+ getSystemService(Context.CREDENTIAL_SERVICE) as CredentialManager
+
override fun onFillRequest(
request: FillRequest,
cancellationSignal: CancellationSignal,
callback: FillCallback
) {
+ val context = request.fillContexts
+ val structure = context[context.size - 1].structure
+ val callingPackage = structure.activityComponent.packageName
+ Log.i(TAG, "onFillRequest called for $callingPackage")
+
+ val getCredRequest: GetCredentialRequest? = getCredManRequest(structure)
+ if (getCredRequest == null) {
+ callback.onFailure("No credential manager request found")
+ return
+ }
+
+ val outcome = object : OutcomeReceiver<GetCandidateCredentialsResponse,
+ GetCandidateCredentialsException> {
+ override fun onResult(result: GetCandidateCredentialsResponse) {
+ Log.i(TAG, "getCandidateCredentials onResponse")
+ val fillResponse: FillResponse? = convertToFillResponse(result, request)
+ callback.onSuccess(fillResponse)
+ }
+
+ override fun onError(error: GetCandidateCredentialsException) {
+ Log.i(TAG, "getCandidateCredentials onError")
+ callback.onFailure("error received from credential manager ${error.message}")
+ }
+ }
+
+ credentialManager.getCandidateCredentials(
+ getCredRequest,
+ callingPackage,
+ CancellationSignal(),
+ Executors.newSingleThreadExecutor(),
+ outcome
+ )
+ }
+
+ private fun convertToFillResponse(
+ getCredResponse: GetCandidateCredentialsResponse,
+ filLRequest: FillRequest
+ ): FillResponse? {
TODO("Not yet implemented")
}
override fun onSaveRequest(request: SaveRequest, callback: SaveCallback) {
TODO("Not yet implemented")
}
+
+ private fun getCredManRequest(structure: AssistStructure): GetCredentialRequest? {
+ val credentialOptions: MutableList<CredentialOption> = mutableListOf()
+ traverseStructure(structure, credentialOptions)
+
+ if (credentialOptions.isNotEmpty()) {
+ return GetCredentialRequest.Builder(Bundle.EMPTY)
+ .setCredentialOptions(credentialOptions)
+ .build()
+ }
+ return null
+ }
+
+ private fun traverseStructure(
+ structure: AssistStructure,
+ cmRequests: MutableList<CredentialOption>
+ ) {
+ val windowNodes: List<AssistStructure.WindowNode> =
+ structure.run {
+ (0 until windowNodeCount).map { getWindowNodeAt(it) }
+ }
+
+ windowNodes.forEach { windowNode: AssistStructure.WindowNode ->
+ traverseNode(windowNode.rootViewNode, cmRequests)
+ }
+ }
+
+ private fun traverseNode(
+ viewNode: AssistStructure.ViewNode?,
+ cmRequests: MutableList<CredentialOption>
+ ) {
+ val options = getCredentialOptionsFromViewNode(viewNode)
+ cmRequests.addAll(options)
+
+ val children: List<AssistStructure.ViewNode>? =
+ viewNode?.run {
+ (0 until childCount).map { getChildAt(it) }
+ }
+
+ children?.forEach { childNode: AssistStructure.ViewNode ->
+ traverseNode(childNode, cmRequests)
+ }
+ }
+
+ private fun getCredentialOptionsFromViewNode(viewNode: AssistStructure.ViewNode?):
+ List<CredentialOption> {
+ // TODO(b/293945193) Replace with isCredential check from viewNode
+ val credentialHints: MutableList<String> = mutableListOf()
+ if (viewNode != null && viewNode.autofillHints != null) {
+ for (hint in viewNode.autofillHints!!) {
+ if (hint.startsWith(CRED_HINT_PREFIX)) {
+ credentialHints.add(hint.substringAfter(CRED_HINT_PREFIX))
+ }
+ }
+ }
+
+ val credentialOptions: MutableList<CredentialOption> = mutableListOf()
+ for (credentialHint in credentialHints) {
+ convertJsonToCredentialOption(credentialHint).let { credentialOptions.addAll(it) }
+ }
+ return credentialOptions
+ }
+
+ private fun convertJsonToCredentialOption(jsonString: String): List<CredentialOption> {
+ // TODO(b/302000646) Move this logic to jetpack so that is consistent
+ // with building the json
+ val credentialOptions: MutableList<CredentialOption> = mutableListOf()
+
+ val json = JSONObject(jsonString)
+ val options = json.getJSONArray(CRED_OPTIONS_KEY)
+ for (i in 0 until options.length()) {
+ val option = options.getJSONObject(i)
+
+ credentialOptions.add(CredentialOption(
+ option.getString(TYPE_KEY),
+ convertJsonToBundle(option.getJSONObject(REQUEST_DATA_KEY)),
+ convertJsonToBundle(option.getJSONObject(CANDIDATE_DATA_KEY)),
+ option.getBoolean(SYS_PROVIDER_REQ_KEY),
+ ))
+ }
+ return credentialOptions
+ }
+
+ private fun convertJsonToBundle(json: JSONObject): Bundle {
+ val result = Bundle()
+ json.keys().forEach {
+ val v = json.get(it)
+ when (v) {
+ is String -> result.putString(it, v)
+ is Boolean -> result.putBoolean(it, v)
+ }
+ }
+ return result
+ }
}
\ No newline at end of file
diff --git a/packages/SystemUI/AndroidManifest.xml b/packages/SystemUI/AndroidManifest.xml
index 9bfc4be..b5b873c 100644
--- a/packages/SystemUI/AndroidManifest.xml
+++ b/packages/SystemUI/AndroidManifest.xml
@@ -634,7 +634,7 @@
<!-- started from MediaProjectionManager -->
<activity
- android:name=".mediaprojection.permission.MediaProjectionPermissionActivity"
+ android:name=".media.MediaProjectionPermissionActivity"
android:exported="true"
android:theme="@style/Theme.SystemUI.MediaProjectionAlertDialog"
android:finishOnCloseSystemDialogs="true"
@@ -643,7 +643,7 @@
android:visibleToInstantApps="true"/>
<activity
- android:name=".mediaprojection.appselector.MediaProjectionAppSelectorActivity"
+ android:name=".media.MediaProjectionAppSelectorActivity"
android:theme="@style/Theme.SystemUI.MediaProjectionAppSelector"
android:finishOnCloseSystemDialogs="true"
android:excludeFromRecents="true"
diff --git a/packages/SystemUI/TEST_MAPPING b/packages/SystemUI/TEST_MAPPING
index af6fa86..5c2f979 100644
--- a/packages/SystemUI/TEST_MAPPING
+++ b/packages/SystemUI/TEST_MAPPING
@@ -131,5 +131,22 @@
}
]
}
+ ],
+ // v2/sysui/suite/test-mapping-sysui-screenshot-test
+ "sysui-screenshot-test": [
+ {
+ "name": "SystemUIGoogleScreenshotTests",
+ "options": [
+ {
+ "exclude-annotation": "org.junit.Ignore"
+ },
+ {
+ "exclude-annotation": "androidx.test.filters.FlakyTest"
+ },
+ {
+ "exclude-annotation": "android.platform.test.annotations.Postsubmit"
+ }
+ ]
+ }
]
}
diff --git a/packages/SystemUI/compose/features/src/com/android/systemui/shade/ui/composable/ShadeHeader.kt b/packages/SystemUI/compose/features/src/com/android/systemui/shade/ui/composable/ShadeHeader.kt
index 8e34008..519c0a9 100644
--- a/packages/SystemUI/compose/features/src/com/android/systemui/shade/ui/composable/ShadeHeader.kt
+++ b/packages/SystemUI/compose/features/src/com/android/systemui/shade/ui/composable/ShadeHeader.kt
@@ -39,7 +39,9 @@
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.TransformOrigin
import androidx.compose.ui.graphics.graphicsLayer
+import androidx.compose.ui.platform.LocalLayoutDirection
import androidx.compose.ui.res.stringResource
+import androidx.compose.ui.unit.LayoutDirection
import androidx.compose.ui.unit.dp
import androidx.compose.ui.viewinterop.AndroidView
import com.android.compose.animation.scene.ElementKey
@@ -166,11 +168,18 @@
modifier =
Modifier.align(Alignment.CenterVertically)
// use graphicsLayer instead of Modifier.scale to anchor transform to
- // top left corner
+ // the (start, top) corner
.graphicsLayer(
scaleX = 2.57f,
scaleY = 2.57f,
- transformOrigin = TransformOrigin(0f, 0.5f)
+ transformOrigin =
+ TransformOrigin(
+ when (LocalLayoutDirection.current) {
+ LayoutDirection.Ltr -> 0f
+ LayoutDirection.Rtl -> 1f
+ },
+ 0.5f
+ )
),
)
Spacer(modifier = Modifier.weight(1f))
diff --git a/packages/SystemUI/res/layout/notif_half_shelf.xml b/packages/SystemUI/res/layout/notif_half_shelf.xml
index 37b8ae0..c70f8e2 100644
--- a/packages/SystemUI/res/layout/notif_half_shelf.xml
+++ b/packages/SystemUI/res/layout/notif_half_shelf.xml
@@ -22,8 +22,7 @@
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal|bottom"
android:paddingStart="4dp"
- android:paddingEnd="4dp"
->
+ android:paddingEnd="4dp">
<LinearLayout
android:id="@+id/half_shelf"
@@ -82,11 +81,21 @@
android:theme="@style/MainSwitch.Settingslib"/>
</com.android.systemui.statusbar.notification.row.AppControlView>
- <!-- ChannelRows get added dynamically -->
-
+ <ScrollView
+ android:layout_width="match_parent"
+ android:layout_height="@dimen/notification_blocker_channel_list_height"
+ android:clipToPadding="false">
+ <LinearLayout
+ android:id="@+id/scrollView"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical">
+ <!-- ChannelRows get added dynamically -->
+ </LinearLayout>
+ </ScrollView>
</com.android.systemui.statusbar.notification.row.ChannelEditorListView>
- <RelativeLayout
+ <LinearLayout
android:id="@+id/bottom_actions"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@@ -98,25 +107,23 @@
android:text="@string/see_more_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_alignParentStart="true"
- android:layout_centerVertical="true"
- android:gravity="start|center_vertical"
android:minWidth="@dimen/notification_importance_toggle_size"
android:minHeight="@dimen/notification_importance_toggle_size"
android:maxWidth="200dp"
style="@style/Widget.Dialog.Button"/>
+ <Space
+ android:layout_width="0dp"
+ android:layout_height="match_parent"
+ android:layout_weight="1" />
<TextView
android:id="@+id/done_button"
android:text="@string/inline_ok_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_centerVertical="true"
- android:gravity="end|center_vertical"
android:maxWidth="125dp"
android:minWidth="@dimen/notification_importance_toggle_size"
android:minHeight="@dimen/notification_importance_toggle_size"
- android:layout_alignParentEnd="true"
style="@style/Widget.Dialog.Button"/>
- </RelativeLayout>
+ </LinearLayout>
</LinearLayout>
</FrameLayout>
diff --git a/packages/SystemUI/res/values-land/dimens.xml b/packages/SystemUI/res/values-land/dimens.xml
index 259b9ad..cfb4017 100644
--- a/packages/SystemUI/res/values-land/dimens.xml
+++ b/packages/SystemUI/res/values-land/dimens.xml
@@ -89,6 +89,9 @@
<dimen name="global_actions_button_size">72dp</dimen>
<dimen name="global_actions_button_padding">26dp</dimen>
+ <!-- scroll view the size of 2 channel rows -->
+ <dimen name="notification_blocker_channel_list_height">128dp</dimen>
+
<dimen name="keyguard_indication_margin_bottom">8dp</dimen>
<dimen name="lock_icon_margin_bottom">24dp</dimen>
</resources>
diff --git a/packages/SystemUI/res/values/dimens.xml b/packages/SystemUI/res/values/dimens.xml
index d5658dc..0ee5da2 100644
--- a/packages/SystemUI/res/values/dimens.xml
+++ b/packages/SystemUI/res/values/dimens.xml
@@ -313,6 +313,8 @@
<!-- The space around a notification menu item -->
<dimen name="notification_menu_icon_padding">20dp</dimen>
+ <!-- scroll view the size of 3 channel rows -->
+ <dimen name="notification_blocker_channel_list_height">192dp</dimen>
<!-- The vertical space around the buttons in the inline settings -->
<dimen name="notification_guts_button_spacing">12dp</dimen>
diff --git a/packages/SystemUI/src/com/android/systemui/bouncer/domain/interactor/BouncerInteractor.kt b/packages/SystemUI/src/com/android/systemui/bouncer/domain/interactor/BouncerInteractor.kt
index bae0ac7..f3a463b 100644
--- a/packages/SystemUI/src/com/android/systemui/bouncer/domain/interactor/BouncerInteractor.kt
+++ b/packages/SystemUI/src/com/android/systemui/bouncer/domain/interactor/BouncerInteractor.kt
@@ -235,17 +235,16 @@
repository.setMessage(errorMessage(authenticationInteractor.getAuthenticationMethod()))
}
- /** If the bouncer is showing, hides the bouncer and return to the lockscreen scene. */
- fun hide(
- loggingReason: String,
- ) {
+ /** Notifies the interactor that the input method editor has been hidden. */
+ fun onImeHidden() {
+ // If the bouncer is showing, hide it and return to the lockscreen scene.
if (sceneInteractor.desiredScene.value.key != SceneKey.Bouncer) {
return
}
sceneInteractor.changeScene(
scene = SceneModel(SceneKey.Lockscreen),
- loggingReason = loggingReason,
+ loggingReason = "IME hidden",
)
}
diff --git a/packages/SystemUI/src/com/android/systemui/bouncer/ui/viewmodel/AuthMethodBouncerViewModel.kt b/packages/SystemUI/src/com/android/systemui/bouncer/ui/viewmodel/AuthMethodBouncerViewModel.kt
index 0b0a8f5..66c6162 100644
--- a/packages/SystemUI/src/com/android/systemui/bouncer/ui/viewmodel/AuthMethodBouncerViewModel.kt
+++ b/packages/SystemUI/src/com/android/systemui/bouncer/ui/viewmodel/AuthMethodBouncerViewModel.kt
@@ -78,10 +78,7 @@
*/
fun onImeVisibilityChanged(isVisible: Boolean) {
if (isImeVisible && !isVisible) {
- // The IME has gone from visible to invisible, dismiss the bouncer.
- interactor.hide(
- loggingReason = "IME hidden",
- )
+ interactor.onImeHidden()
}
isImeVisible = isVisible
diff --git a/packages/SystemUI/src/com/android/systemui/flags/Flags.kt b/packages/SystemUI/src/com/android/systemui/flags/Flags.kt
index 4b38267..3b70555 100644
--- a/packages/SystemUI/src/com/android/systemui/flags/Flags.kt
+++ b/packages/SystemUI/src/com/android/systemui/flags/Flags.kt
@@ -298,6 +298,11 @@
@JvmField val MIGRATE_KEYGUARD_STATUS_BAR_VIEW =
unreleasedFlag("migrate_keyguard_status_bar_view")
+ /** Migrate clocks from keyguard status view to keyguard root view*/
+ // TODO(b/301502635): Tracking Bug.
+ @JvmField val MIGRATE_CLOCKS_TO_BLUEPRINT =
+ unreleasedFlag("migrate_clocks_to_blueprint")
+
/** Enables preview loading animation in the wallpaper picker. */
// TODO(b/274443705): Tracking Bug
@JvmField
@@ -763,6 +768,9 @@
// TODO(b/289573946): Tracking Bug
@JvmField val PRECOMPUTED_TEXT = unreleasedFlag("precomputed_text", teamfood = true)
+ // TODO(b/302087895): Tracking Bug
+ @JvmField val CALL_LAYOUT_ASYNC_SET_DATA = unreleasedFlag("call_layout_async_set_data")
+
// 2900 - CentralSurfaces-related flags
// TODO(b/285174336): Tracking Bug
diff --git a/packages/SystemUI/src/com/android/systemui/mediaprojection/appselector/MediaProjectionAppSelectorActivity.kt b/packages/SystemUI/src/com/android/systemui/media/MediaProjectionAppSelectorActivity.kt
similarity index 97%
rename from packages/SystemUI/src/com/android/systemui/mediaprojection/appselector/MediaProjectionAppSelectorActivity.kt
rename to packages/SystemUI/src/com/android/systemui/media/MediaProjectionAppSelectorActivity.kt
index b5d3e91..88bc064 100644
--- a/packages/SystemUI/src/com/android/systemui/mediaprojection/appselector/MediaProjectionAppSelectorActivity.kt
+++ b/packages/SystemUI/src/com/android/systemui/media/MediaProjectionAppSelectorActivity.kt
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.android.systemui.mediaprojection.appselector
+package com.android.systemui.media
import android.app.ActivityOptions
import android.content.Intent
@@ -46,11 +46,13 @@
import com.android.internal.widget.RecyclerView
import com.android.internal.widget.RecyclerViewAccessibilityDelegate
import com.android.internal.widget.ResolverDrawerLayout
-import com.android.systemui.mediaprojection.MediaProjectionCaptureTarget
-import com.android.systemui.mediaprojection.MediaProjectionServiceHelper
+import com.android.systemui.res.R
+import com.android.systemui.mediaprojection.appselector.MediaProjectionAppSelectorComponent
+import com.android.systemui.mediaprojection.appselector.MediaProjectionAppSelectorController
+import com.android.systemui.mediaprojection.appselector.MediaProjectionAppSelectorResultHandler
+import com.android.systemui.mediaprojection.appselector.MediaProjectionAppSelectorView
import com.android.systemui.mediaprojection.appselector.data.RecentTask
import com.android.systemui.mediaprojection.appselector.view.MediaProjectionRecentsViewController
-import com.android.systemui.res.R
import com.android.systemui.statusbar.policy.ConfigurationController
import com.android.systemui.util.AsyncActivityLauncher
import javax.inject.Inject
diff --git a/packages/SystemUI/src/com/android/systemui/mediaprojection/MediaProjectionCaptureTarget.kt b/packages/SystemUI/src/com/android/systemui/media/MediaProjectionCaptureTarget.kt
similarity index 80%
rename from packages/SystemUI/src/com/android/systemui/mediaprojection/MediaProjectionCaptureTarget.kt
rename to packages/SystemUI/src/com/android/systemui/media/MediaProjectionCaptureTarget.kt
index 11d0be5..fbf9294 100644
--- a/packages/SystemUI/src/com/android/systemui/mediaprojection/MediaProjectionCaptureTarget.kt
+++ b/packages/SystemUI/src/com/android/systemui/media/MediaProjectionCaptureTarget.kt
@@ -14,17 +14,20 @@
* limitations under the License.
*/
-package com.android.systemui.mediaprojection
+package com.android.systemui.media
import android.os.IBinder
import android.os.Parcel
import android.os.Parcelable
/**
- * Class that represents an area that should be captured. Currently it has only a launch cookie that
- * represents a task but we potentially could add more identifiers e.g. for a pair of tasks.
+ * Class that represents an area that should be captured.
+ * Currently it has only a launch cookie that represents a task but
+ * we potentially could add more identifiers e.g. for a pair of tasks.
*/
-data class MediaProjectionCaptureTarget(val launchCookie: IBinder?) : Parcelable {
+data class MediaProjectionCaptureTarget(
+ val launchCookie: IBinder?
+): Parcelable {
constructor(parcel: Parcel) : this(parcel.readStrongBinder())
diff --git a/packages/SystemUI/src/com/android/systemui/mediaprojection/permission/MediaProjectionPermissionActivity.java b/packages/SystemUI/src/com/android/systemui/media/MediaProjectionPermissionActivity.java
similarity index 97%
rename from packages/SystemUI/src/com/android/systemui/mediaprojection/permission/MediaProjectionPermissionActivity.java
rename to packages/SystemUI/src/com/android/systemui/media/MediaProjectionPermissionActivity.java
index 2b56d0c..4de6278 100644
--- a/packages/SystemUI/src/com/android/systemui/mediaprojection/permission/MediaProjectionPermissionActivity.java
+++ b/packages/SystemUI/src/com/android/systemui/media/MediaProjectionPermissionActivity.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.systemui.mediaprojection.permission;
+package com.android.systemui.media;
import static android.media.projection.IMediaProjectionManager.EXTRA_PACKAGE_REUSING_GRANTED_CONSENT;
import static android.media.projection.IMediaProjectionManager.EXTRA_USER_REVIEW_GRANTED_CONSENT;
@@ -22,8 +22,8 @@
import static android.media.projection.ReviewGrantedConsentResult.RECORD_CONTENT_DISPLAY;
import static android.view.WindowManager.LayoutParams.SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS;
-import static com.android.systemui.mediaprojection.permission.ScreenShareOptionKt.ENTIRE_SCREEN;
-import static com.android.systemui.mediaprojection.permission.ScreenShareOptionKt.SINGLE_APP;
+import static com.android.systemui.screenrecord.ScreenShareOptionKt.ENTIRE_SCREEN;
+import static com.android.systemui.screenrecord.ScreenShareOptionKt.SINGLE_APP;
import android.annotation.Nullable;
import android.app.Activity;
@@ -51,13 +51,13 @@
import android.util.Log;
import android.view.Window;
+import com.android.systemui.res.R;
import com.android.systemui.flags.FeatureFlags;
import com.android.systemui.flags.Flags;
-import com.android.systemui.mediaprojection.MediaProjectionServiceHelper;
-import com.android.systemui.mediaprojection.appselector.MediaProjectionAppSelectorActivity;
import com.android.systemui.mediaprojection.devicepolicy.ScreenCaptureDevicePolicyResolver;
import com.android.systemui.mediaprojection.devicepolicy.ScreenCaptureDisabledDialog;
-import com.android.systemui.res.R;
+import com.android.systemui.screenrecord.MediaProjectionPermissionDialog;
+import com.android.systemui.screenrecord.ScreenShareOption;
import com.android.systemui.statusbar.phone.SystemUIDialog;
import com.android.systemui.util.Utils;
diff --git a/packages/SystemUI/src/com/android/systemui/mediaprojection/MediaProjectionServiceHelper.kt b/packages/SystemUI/src/com/android/systemui/media/MediaProjectionServiceHelper.kt
similarity index 98%
rename from packages/SystemUI/src/com/android/systemui/mediaprojection/MediaProjectionServiceHelper.kt
rename to packages/SystemUI/src/com/android/systemui/media/MediaProjectionServiceHelper.kt
index f1cade7..9e616e2 100644
--- a/packages/SystemUI/src/com/android/systemui/mediaprojection/MediaProjectionServiceHelper.kt
+++ b/packages/SystemUI/src/com/android/systemui/media/MediaProjectionServiceHelper.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.systemui.mediaprojection
+package com.android.systemui.media
import android.content.Context
import android.media.projection.IMediaProjection
diff --git a/packages/SystemUI/src/com/android/systemui/mediaprojection/appselector/MediaProjectionAppSelectorComponent.kt b/packages/SystemUI/src/com/android/systemui/mediaprojection/appselector/MediaProjectionAppSelectorComponent.kt
index 72aea04..33d9cc3 100644
--- a/packages/SystemUI/src/com/android/systemui/mediaprojection/appselector/MediaProjectionAppSelectorComponent.kt
+++ b/packages/SystemUI/src/com/android/systemui/mediaprojection/appselector/MediaProjectionAppSelectorComponent.kt
@@ -23,6 +23,8 @@
import androidx.lifecycle.DefaultLifecycleObserver
import com.android.launcher3.icons.IconFactory
import com.android.systemui.dagger.qualifiers.Application
+import com.android.systemui.media.MediaProjectionAppSelectorActivity
+import com.android.systemui.media.MediaProjectionPermissionActivity
import com.android.systemui.mediaprojection.appselector.data.ActivityTaskManagerLabelLoader
import com.android.systemui.mediaprojection.appselector.data.ActivityTaskManagerThumbnailLoader
import com.android.systemui.mediaprojection.appselector.data.AppIconLoader
@@ -35,7 +37,6 @@
import com.android.systemui.mediaprojection.appselector.view.TaskPreviewSizeProvider
import com.android.systemui.mediaprojection.devicepolicy.MediaProjectionDevicePolicyModule
import com.android.systemui.mediaprojection.devicepolicy.PersonalProfile
-import com.android.systemui.mediaprojection.permission.MediaProjectionPermissionActivity
import com.android.systemui.statusbar.phone.ConfigurationControllerImpl
import com.android.systemui.statusbar.policy.ConfigurationController
import dagger.Binds
diff --git a/packages/SystemUI/src/com/android/systemui/mediaprojection/permission/BaseScreenSharePermissionDialog.kt b/packages/SystemUI/src/com/android/systemui/screenrecord/BaseScreenSharePermissionDialog.kt
similarity index 98%
rename from packages/SystemUI/src/com/android/systemui/mediaprojection/permission/BaseScreenSharePermissionDialog.kt
rename to packages/SystemUI/src/com/android/systemui/screenrecord/BaseScreenSharePermissionDialog.kt
index 8b437c3..64006fe 100644
--- a/packages/SystemUI/src/com/android/systemui/mediaprojection/permission/BaseScreenSharePermissionDialog.kt
+++ b/packages/SystemUI/src/com/android/systemui/screenrecord/BaseScreenSharePermissionDialog.kt
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.android.systemui.mediaprojection.permission
+package com.android.systemui.screenrecord
import android.content.Context
import android.os.Bundle
diff --git a/packages/SystemUI/src/com/android/systemui/mediaprojection/permission/MediaProjectionPermissionDialog.kt b/packages/SystemUI/src/com/android/systemui/screenrecord/MediaProjectionPermissionDialog.kt
similarity index 98%
rename from packages/SystemUI/src/com/android/systemui/mediaprojection/permission/MediaProjectionPermissionDialog.kt
rename to packages/SystemUI/src/com/android/systemui/screenrecord/MediaProjectionPermissionDialog.kt
index 2f10ad3..47e28d8 100644
--- a/packages/SystemUI/src/com/android/systemui/mediaprojection/permission/MediaProjectionPermissionDialog.kt
+++ b/packages/SystemUI/src/com/android/systemui/screenrecord/MediaProjectionPermissionDialog.kt
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.android.systemui.mediaprojection.permission
+package com.android.systemui.screenrecord
import android.content.Context
import android.media.projection.MediaProjectionConfig
diff --git a/packages/SystemUI/src/com/android/systemui/screenrecord/RecordingService.java b/packages/SystemUI/src/com/android/systemui/screenrecord/RecordingService.java
index 3501b6b..7cdb655 100644
--- a/packages/SystemUI/src/com/android/systemui/screenrecord/RecordingService.java
+++ b/packages/SystemUI/src/com/android/systemui/screenrecord/RecordingService.java
@@ -41,10 +41,10 @@
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.logging.UiEventLogger;
+import com.android.systemui.res.R;
import com.android.systemui.dagger.qualifiers.LongRunning;
import com.android.systemui.dagger.qualifiers.Main;
-import com.android.systemui.mediaprojection.MediaProjectionCaptureTarget;
-import com.android.systemui.res.R;
+import com.android.systemui.media.MediaProjectionCaptureTarget;
import com.android.systemui.screenrecord.ScreenMediaRecorder.ScreenMediaRecorderListener;
import com.android.systemui.settings.UserContextProvider;
import com.android.systemui.statusbar.phone.KeyguardDismissUtil;
diff --git a/packages/SystemUI/src/com/android/systemui/screenrecord/ScreenMediaRecorder.java b/packages/SystemUI/src/com/android/systemui/screenrecord/ScreenMediaRecorder.java
index 3aab3bf..b80a01212 100644
--- a/packages/SystemUI/src/com/android/systemui/screenrecord/ScreenMediaRecorder.java
+++ b/packages/SystemUI/src/com/android/systemui/screenrecord/ScreenMediaRecorder.java
@@ -51,7 +51,7 @@
import android.view.Surface;
import android.view.WindowManager;
-import com.android.systemui.mediaprojection.MediaProjectionCaptureTarget;
+import com.android.systemui.media.MediaProjectionCaptureTarget;
import java.io.Closeable;
import java.io.File;
diff --git a/packages/SystemUI/src/com/android/systemui/screenrecord/ScreenRecordDialog.java b/packages/SystemUI/src/com/android/systemui/screenrecord/ScreenRecordDialog.java
index f2e94e9..f0ce8a4 100644
--- a/packages/SystemUI/src/com/android/systemui/screenrecord/ScreenRecordDialog.java
+++ b/packages/SystemUI/src/com/android/systemui/screenrecord/ScreenRecordDialog.java
@@ -18,7 +18,7 @@
import static android.app.Activity.RESULT_OK;
-import static com.android.systemui.mediaprojection.appselector.MediaProjectionAppSelectorActivity.KEY_CAPTURE_TARGET;
+import static com.android.systemui.media.MediaProjectionAppSelectorActivity.KEY_CAPTURE_TARGET;
import static com.android.systemui.screenrecord.ScreenRecordingAudioSource.INTERNAL;
import static com.android.systemui.screenrecord.ScreenRecordingAudioSource.MIC;
import static com.android.systemui.screenrecord.ScreenRecordingAudioSource.MIC_AND_INTERNAL;
@@ -41,8 +41,8 @@
import androidx.annotation.Nullable;
-import com.android.systemui.mediaprojection.MediaProjectionCaptureTarget;
import com.android.systemui.res.R;
+import com.android.systemui.media.MediaProjectionCaptureTarget;
import com.android.systemui.settings.UserContextProvider;
import com.android.systemui.statusbar.phone.SystemUIDialog;
diff --git a/packages/SystemUI/src/com/android/systemui/screenrecord/ScreenRecordPermissionDialog.kt b/packages/SystemUI/src/com/android/systemui/screenrecord/ScreenRecordPermissionDialog.kt
index a1d5d98..b5b7043 100644
--- a/packages/SystemUI/src/com/android/systemui/screenrecord/ScreenRecordPermissionDialog.kt
+++ b/packages/SystemUI/src/com/android/systemui/screenrecord/ScreenRecordPermissionDialog.kt
@@ -32,14 +32,10 @@
import android.widget.Spinner
import android.widget.Switch
import androidx.annotation.LayoutRes
-import com.android.systemui.mediaprojection.MediaProjectionCaptureTarget
-import com.android.systemui.mediaprojection.appselector.MediaProjectionAppSelectorActivity
-import com.android.systemui.mediaprojection.permission.BaseScreenSharePermissionDialog
-import com.android.systemui.mediaprojection.permission.ENTIRE_SCREEN
-import com.android.systemui.mediaprojection.permission.SINGLE_APP
-import com.android.systemui.mediaprojection.permission.ScreenShareOption
-import com.android.systemui.plugins.ActivityStarter
import com.android.systemui.res.R
+import com.android.systemui.media.MediaProjectionAppSelectorActivity
+import com.android.systemui.media.MediaProjectionCaptureTarget
+import com.android.systemui.plugins.ActivityStarter
import com.android.systemui.settings.UserContextProvider
/** Dialog to select screen recording options */
@@ -62,7 +58,6 @@
private lateinit var tapsView: View
private lateinit var audioSwitch: Switch
private lateinit var options: Spinner
-
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setDialogTitle(R.string.screenrecord_permission_dialog_title)
@@ -182,7 +177,6 @@
)
private const val DELAY_MS: Long = 3000
private const val INTERVAL_MS: Long = 1000
-
private fun createOptionList(): List<ScreenShareOption> {
return listOf(
ScreenShareOption(
diff --git a/packages/SystemUI/src/com/android/systemui/mediaprojection/permission/ScreenShareOption.kt b/packages/SystemUI/src/com/android/systemui/screenrecord/ScreenShareOption.kt
similarity index 94%
rename from packages/SystemUI/src/com/android/systemui/mediaprojection/permission/ScreenShareOption.kt
rename to packages/SystemUI/src/com/android/systemui/screenrecord/ScreenShareOption.kt
index 37e8d9f..ebf0dd2 100644
--- a/packages/SystemUI/src/com/android/systemui/mediaprojection/permission/ScreenShareOption.kt
+++ b/packages/SystemUI/src/com/android/systemui/screenrecord/ScreenShareOption.kt
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.android.systemui.mediaprojection.permission
+package com.android.systemui.screenrecord
import androidx.annotation.IntDef
import androidx.annotation.StringRes
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarStateControllerImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarStateControllerImpl.java
index e632214..37a4ef1 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarStateControllerImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarStateControllerImpl.java
@@ -104,8 +104,9 @@
// Record the HISTORY_SIZE most recent states
private int mHistoryIndex = 0;
private HistoricalState[] mHistoricalRecords = new HistoricalState[HISTORY_SIZE];
- // This is used by InteractionJankMonitor to get callback from HWUI.
+ // These views are used by InteractionJankMonitor to get callback from HWUI.
private View mView;
+ private KeyguardClockSwitch mClockSwitchView;
/**
* If any of the system bars is hidden.
@@ -334,6 +335,7 @@
if ((mView == null || !mView.isAttachedToWindow())
&& (view != null && view.isAttachedToWindow())) {
mView = view;
+ mClockSwitchView = view.findViewById(R.id.keyguard_clock_container);
}
mDozeAmountTarget = dozeAmount;
if (animated) {
@@ -416,21 +418,12 @@
/** Returns the id of the currently rendering clock */
public String getClockId() {
- if (mView == null) {
- return KeyguardClockSwitch.MISSING_CLOCK_ID;
- }
-
- View clockSwitch = mView.findViewById(R.id.keyguard_clock_container);
- if (clockSwitch == null) {
+ if (mClockSwitchView == null) {
Log.e(TAG, "Clock container was missing");
return KeyguardClockSwitch.MISSING_CLOCK_ID;
}
- if (!(clockSwitch instanceof KeyguardClockSwitch)) {
- Log.e(TAG, "Clock container was incorrect type: " + clockSwitch);
- return KeyguardClockSwitch.MISSING_CLOCK_ID;
- }
- return ((KeyguardClockSwitch) clockSwitch).getClockId();
+ return mClockSwitchView.getClockId();
}
private void beginInteractionJankMonitor() {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/interruption/NotificationInterruptStateProvider.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/interruption/NotificationInterruptStateProvider.java
index 88994b9..6ec9dbe 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/interruption/NotificationInterruptStateProvider.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/interruption/NotificationInterruptStateProvider.java
@@ -100,7 +100,11 @@
/**
* The notification is coming from a suspended packages, so FSI is suppressed.
*/
- NO_FSI_SUSPENDED(false);
+ NO_FSI_SUSPENDED(false),
+ /**
+ * The device is not provisioned, launch FSI.
+ */
+ FSI_NOT_PROVISIONED(true);
public final boolean shouldLaunch;
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/interruption/NotificationInterruptStateProviderImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/interruption/NotificationInterruptStateProviderImpl.java
index 0c43da0..3819843 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/interruption/NotificationInterruptStateProviderImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/interruption/NotificationInterruptStateProviderImpl.java
@@ -45,6 +45,7 @@
import com.android.systemui.statusbar.notification.NotifPipelineFlags;
import com.android.systemui.statusbar.notification.collection.NotificationEntry;
import com.android.systemui.statusbar.policy.BatteryController;
+import com.android.systemui.statusbar.policy.DeviceProvisionedController;
import com.android.systemui.statusbar.policy.HeadsUpManager;
import com.android.systemui.statusbar.policy.KeyguardStateController;
@@ -75,6 +76,7 @@
private final KeyguardNotificationVisibilityProvider mKeyguardNotificationVisibilityProvider;
private final UiEventLogger mUiEventLogger;
private final UserTracker mUserTracker;
+ private final DeviceProvisionedController mDeviceProvisionedController;
@VisibleForTesting
protected boolean mUseHeadsUp = false;
@@ -121,7 +123,8 @@
NotifPipelineFlags flags,
KeyguardNotificationVisibilityProvider keyguardNotificationVisibilityProvider,
UiEventLogger uiEventLogger,
- UserTracker userTracker) {
+ UserTracker userTracker,
+ DeviceProvisionedController deviceProvisionedController) {
mContentResolver = contentResolver;
mPowerManager = powerManager;
mBatteryController = batteryController;
@@ -163,6 +166,7 @@
headsUpObserver);
}
headsUpObserver.onChange(true); // set up
+ mDeviceProvisionedController = deviceProvisionedController;
}
@Override
@@ -334,6 +338,12 @@
}
}
+ // The device is not provisioned, launch FSI.
+ if (!mDeviceProvisionedController.isDeviceProvisioned()) {
+ return getDecisionGivenSuppression(FullScreenIntentDecision.FSI_NOT_PROVISIONED,
+ suppressedByDND);
+ }
+
// Detect the case determined by b/231322873 to launch FSI while device is in use,
// as blocked by the correct implementation, and report the event.
return getDecisionGivenSuppression(FullScreenIntentDecision.NO_FSI_NO_HUN_OR_KEYGUARD,
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ChannelEditorDialogController.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ChannelEditorDialogController.kt
index 4114eb2..a8d59d8 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ChannelEditorDialogController.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ChannelEditorDialogController.kt
@@ -71,15 +71,15 @@
private var appUid: Int? = null
private var packageName: String? = null
private var appName: String? = null
+ private var channel: NotificationChannel? = null
private var onSettingsClickListener: NotificationInfo.OnSettingsClickListener? = null
// Caller should set this if they care about when we dismiss
var onFinishListener: OnChannelEditorDialogFinishedListener? = null
- @VisibleForTesting
- internal val paddedChannels = mutableListOf<NotificationChannel>()
// Channels handed to us from NotificationInfo
- private val providedChannels = mutableListOf<NotificationChannel>()
+ @VisibleForTesting
+ internal val channelList = mutableListOf<NotificationChannel>()
// Map from NotificationChannel to importance
private val edits = mutableMapOf<NotificationChannel, Int>()
@@ -93,14 +93,14 @@
private val channelGroupList = mutableListOf<NotificationChannelGroup>()
/**
- * Give the controller all of the information it needs to present the dialog
+ * Give the controller all the information it needs to present the dialog
* for a given app. Does a bunch of querying of NoMan, but won't present anything yet
*/
fun prepareDialogForApp(
appName: String,
packageName: String,
uid: Int,
- channels: Set<NotificationChannel>,
+ channel: NotificationChannel,
appIcon: Drawable,
onSettingsClickListener: NotificationInfo.OnSettingsClickListener?
) {
@@ -110,6 +110,7 @@
this.appIcon = appIcon
this.appNotificationsEnabled = checkAreAppNotificationsOn()
this.onSettingsClickListener = onSettingsClickListener
+ this.channel = channel
// These will always start out the same
appNotificationsCurrentlyEnabled = appNotificationsEnabled
@@ -117,9 +118,7 @@
channelGroupList.clear()
channelGroupList.addAll(fetchNotificationChannelGroups())
buildGroupNameLookup()
- providedChannels.clear()
- providedChannels.addAll(channels)
- padToFourChannels(channels)
+ populateChannelList()
initDialog()
prepared = true
@@ -133,36 +132,26 @@
}
}
- private fun padToFourChannels(channels: Set<NotificationChannel>) {
- paddedChannels.clear()
- // First, add all of the given channels
- paddedChannels.addAll(channels.asSequence().take(4))
-
- // Then pad to 4 if we haven't been given that many
- paddedChannels.addAll(getDisplayableChannels(channelGroupList.asSequence())
- .filterNot { paddedChannels.contains(it) }
- .distinct()
- .take(4 - paddedChannels.size))
-
- // If we only got one channel and it has the default miscellaneous tag, then we actually
- // are looking at an app with a targetSdk <= O, and it doesn't make much sense to show the
- // channel
- if (paddedChannels.size == 1 && DEFAULT_CHANNEL_ID == paddedChannels[0].id) {
- paddedChannels.clear()
+ private fun populateChannelList() {
+ channelList.clear()
+ if (DEFAULT_CHANNEL_ID != channel!!.id) {
+ channelList.add(0, channel!!)
+ channelList.addAll(getDisplayableChannels(channelGroupList.asSequence())
+ .filterNot { it.id == channel!!.id }
+ .distinct())
}
}
private fun getDisplayableChannels(
groupList: Sequence<NotificationChannelGroup>
): Sequence<NotificationChannel> {
-
- // TODO (b/194833441): remove channel level settings when we move to a permission
val channels = groupList
.flatMap { group ->
- group.channels.asSequence().filterNot { channel ->
- channel.importance == IMPORTANCE_NONE ||
+ group.channels.asSequence()
+ .sortedWith(compareBy {group.name?.toString() ?: group.id})
+ .filterNot { channel ->
channel.isImportanceLockedByCriticalDeviceFunction
- }
+ }
}
// TODO: sort these by avgSentWeekly, but for now let's just do alphabetical (why not)
@@ -196,8 +185,7 @@
appNotificationsCurrentlyEnabled = null
edits.clear()
- paddedChannels.clear()
- providedChannels.clear()
+ channelList.clear()
groupNameLookup.clear()
}
@@ -231,7 +219,7 @@
@Suppress("unchecked_cast")
private fun fetchNotificationChannelGroups(): List<NotificationChannelGroup> {
return try {
- noMan.getNotificationChannelGroupsForPackage(packageName!!, appUid!!, false)
+ noMan.getRecentBlockedNotificationChannelGroupsForPackage(packageName!!, appUid!!)
.list as? List<NotificationChannelGroup> ?: listOf()
} catch (e: Exception) {
Log.e(TAG, "Error fetching channel groups", e)
@@ -280,7 +268,6 @@
@VisibleForTesting
fun launchSettings(sender: View) {
- val channel = if (providedChannels.size == 1) providedChannels[0] else null
onSettingsClickListener?.onClick(sender, channel, appUid!!)
}
@@ -301,14 +288,12 @@
controller = this@ChannelEditorDialogController
appIcon = this@ChannelEditorDialogController.appIcon
appName = this@ChannelEditorDialogController.appName
- channels = paddedChannels
+ channels = channelList
}
setOnShowListener {
- // play a highlight animation for the given channels
- for (channel in providedChannels) {
- listView?.highlightChannel(channel)
- }
+ // play a highlight animation for the given channel
+ listView?.highlightChannel(channel!!)
}
findViewById<TextView>(R.id.done_button)?.setOnClickListener {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ChannelEditorListView.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ChannelEditorListView.kt
index 2cfd075..10e67a4 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ChannelEditorListView.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ChannelEditorListView.kt
@@ -20,6 +20,7 @@
import android.animation.ValueAnimator
import android.app.NotificationChannel
import android.app.NotificationManager.IMPORTANCE_DEFAULT
+import android.app.NotificationManager.IMPORTANCE_LOW
import android.app.NotificationManager.IMPORTANCE_NONE
import android.app.NotificationManager.IMPORTANCE_UNSPECIFIED
import android.content.Context
@@ -55,12 +56,14 @@
// The first row is for the entire app
private lateinit var appControlRow: AppControlView
+ private lateinit var channelListView: LinearLayout
private val channelRows = mutableListOf<ChannelRow>()
override fun onFinishInflate() {
super.onFinishInflate()
appControlRow = requireViewById(R.id.app_control)
+ channelListView = requireViewById(R.id.scrollView)
}
/**
@@ -102,7 +105,7 @@
// Remove any rows
for (row in channelRows) {
- removeView(row)
+ channelListView.removeView(row)
}
channelRows.clear()
@@ -122,7 +125,7 @@
row.channel = channel
channelRows.add(row)
- addView(row)
+ channelListView.addView(row)
}
private fun updateAppControlRow(enabled: Boolean) {
@@ -179,7 +182,9 @@
switch = requireViewById(R.id.toggle)
switch.setOnCheckedChangeListener { _, b ->
channel?.let {
- controller.proposeEditForChannel(it, if (b) it.importance else IMPORTANCE_NONE)
+ controller.proposeEditForChannel(it,
+ if (b) it.originalImportance.coerceAtLeast(IMPORTANCE_LOW)
+ else IMPORTANCE_NONE)
}
}
setOnClickListener { switch.toggle() }
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java
index fb8024c..d18f991 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java
@@ -2658,42 +2658,6 @@
}
/**
- * Returns the number of channels covered by the notification row (including its children if
- * it's a summary notification).
- */
- public int getNumUniqueChannels() {
- return getUniqueChannels().size();
- }
-
- /**
- * Returns the channels covered by the notification row (including its children if
- * it's a summary notification).
- */
- public ArraySet<NotificationChannel> getUniqueChannels() {
- ArraySet<NotificationChannel> channels = new ArraySet<>();
-
- channels.add(mEntry.getChannel());
-
- // If this is a summary, then add in the children notification channels for the
- // same user and pkg.
- if (mIsSummaryWithChildren) {
- final List<ExpandableNotificationRow> childrenRows = getAttachedChildren();
- final int numChildren = childrenRows.size();
- for (int i = 0; i < numChildren; i++) {
- final ExpandableNotificationRow childRow = childrenRows.get(i);
- final NotificationChannel childChannel = childRow.getEntry().getChannel();
- final StatusBarNotification childSbn = childRow.getEntry().getSbn();
- if (childSbn.getUser().equals(mEntry.getSbn().getUser())
- && childSbn.getPackageName().equals(mEntry.getSbn().getPackageName())) {
- channels.add(childChannel);
- }
- }
- }
-
- return channels;
- }
-
- /**
* If this is a group, update the appearance of the children.
*/
public void updateChildrenAppearance() {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationGutsManager.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationGutsManager.java
index 1dd3739..6d656605 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationGutsManager.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationGutsManager.java
@@ -403,7 +403,6 @@
mChannelEditorDialogController,
packageName,
row.getEntry().getChannel(),
- row.getUniqueChannels(),
row.getEntry(),
onSettingsClick,
onAppSettingsClick,
@@ -449,7 +448,6 @@
mChannelEditorDialogController,
packageName,
row.getEntry().getChannel(),
- row.getUniqueChannels(),
row.getEntry(),
onSettingsClick,
mDeviceProvisionedController.isDeviceProvisioned(),
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationInfo.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationInfo.java
index d8f31d4..d8ebd42 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationInfo.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationInfo.java
@@ -104,8 +104,6 @@
private String mAppName;
private int mAppUid;
private String mDelegatePkg;
- private int mNumUniqueChannelsInRow;
- private Set<NotificationChannel> mUniqueChannelsInRow;
private NotificationChannel mSingleNotificationChannel;
private int mStartingChannelImportance;
private boolean mWasShownHighPriority;
@@ -196,7 +194,6 @@
ChannelEditorDialogController channelEditorDialogController,
String pkg,
NotificationChannel notificationChannel,
- Set<NotificationChannel> uniqueChannelsInRow,
NotificationEntry entry,
OnSettingsClickListener onSettingsClick,
OnAppSettingsClickListener onAppSettingsClick,
@@ -213,8 +210,6 @@
mChannelEditorDialogController = channelEditorDialogController;
mAssistantFeedbackController = assistantFeedbackController;
mPackageName = pkg;
- mUniqueChannelsInRow = uniqueChannelsInRow;
- mNumUniqueChannelsInRow = uniqueChannelsInRow.size();
mEntry = entry;
mSbn = entry.getSbn();
mPm = pm;
@@ -236,15 +231,8 @@
int numTotalChannels = mINotificationManager.getNumNotificationChannelsForPackage(
pkg, mAppUid, false /* includeDeleted */);
- if (mNumUniqueChannelsInRow == 0) {
- throw new IllegalArgumentException("bindNotification requires at least one channel");
- } else {
- // Special behavior for the Default channel if no other channels have been defined.
- mIsSingleDefaultChannel = mNumUniqueChannelsInRow == 1
- && mSingleNotificationChannel.getId().equals(
- NotificationChannel.DEFAULT_CHANNEL_ID)
- && numTotalChannels == 1;
- }
+ mIsSingleDefaultChannel = mSingleNotificationChannel.getId().equals(
+ NotificationChannel.DEFAULT_CHANNEL_ID) && numTotalChannels == 1;
mIsAutomaticChosen = getAlertingBehavior() == BEHAVIOR_AUTOMATIC;
bindHeader();
@@ -271,11 +259,6 @@
findViewById(R.id.interruptiveness_settings).setVisibility(GONE);
((TextView) findViewById(R.id.done)).setText(R.string.inline_done_button);
findViewById(R.id.turn_off_notifications).setVisibility(GONE);
- } else if (mNumUniqueChannelsInRow > 1) {
- findViewById(R.id.non_configurable_call_text).setVisibility(GONE);
- findViewById(R.id.non_configurable_text).setVisibility(GONE);
- findViewById(R.id.interruptiveness_settings).setVisibility(GONE);
- findViewById(R.id.non_configurable_multichannel_text).setVisibility(VISIBLE);
} else {
findViewById(R.id.non_configurable_call_text).setVisibility(GONE);
findViewById(R.id.non_configurable_text).setVisibility(GONE);
@@ -361,9 +344,7 @@
if (mAppUid >= 0 && mOnSettingsClickListener != null && mIsDeviceProvisioned) {
final int appUidF = mAppUid;
return ((View view) -> {
- mOnSettingsClickListener.onClick(view,
- mNumUniqueChannelsInRow > 1 ? null : mSingleNotificationChannel,
- appUidF);
+ mOnSettingsClickListener.onClick(view, mSingleNotificationChannel, appUidF);
});
}
return null;
@@ -375,7 +356,7 @@
mPresentingChannelEditorDialog = true;
mChannelEditorDialogController.prepareDialogForApp(mAppName, mPackageName, mAppUid,
- mUniqueChannelsInRow, mPkgIcon, mOnSettingsClickListener);
+ mSingleNotificationChannel, mPkgIcon, mOnSettingsClickListener);
mChannelEditorDialogController.setOnFinishListener(() -> {
mPresentingChannelEditorDialog = false;
mGutsContainer.closeControls(this, false);
@@ -392,7 +373,7 @@
private void bindName() {
final TextView channelName = findViewById(R.id.channel_name);
- if (mIsSingleDefaultChannel || mNumUniqueChannelsInRow > 1) {
+ if (mIsSingleDefaultChannel) {
channelName.setVisibility(View.GONE);
} else {
channelName.setText(mSingleNotificationChannel.getName());
@@ -459,7 +440,7 @@
Handler bgHandler = new Handler(Dependency.get(Dependency.BG_LOOPER));
bgHandler.post(
new UpdateImportanceRunnable(mINotificationManager, mPackageName, mAppUid,
- mNumUniqueChannelsInRow == 1 ? mSingleNotificationChannel : null,
+ mSingleNotificationChannel,
mStartingChannelImportance, newImportance, mIsAutomaticChosen));
mOnUserInteractionCallback.onImportanceChanged(mEntry);
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/PartialConversationInfo.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/PartialConversationInfo.java
index 06c3b79..53f7d4b 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/PartialConversationInfo.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/PartialConversationInfo.java
@@ -57,7 +57,6 @@
private StatusBarNotification mSbn;
private boolean mIsDeviceProvisioned;
private boolean mIsNonBlockable;
- private Set<NotificationChannel> mUniqueChannelsInRow;
private Drawable mPkgIcon;
private boolean mPresentingChannelEditorDialog = false;
@@ -83,7 +82,6 @@
ChannelEditorDialogController channelEditorDialogController,
String pkg,
NotificationChannel notificationChannel,
- Set<NotificationChannel> uniqueChannelsInRow,
NotificationEntry entry,
NotificationInfo.OnSettingsClickListener onSettingsClick,
boolean isDeviceProvisioned,
@@ -100,7 +98,6 @@
mIsDeviceProvisioned = isDeviceProvisioned;
mIsNonBlockable = isNonBlockable;
mChannelEditorDialogController = channelEditorDialogController;
- mUniqueChannelsInRow = uniqueChannelsInRow;
bindHeader();
bindActions();
@@ -149,7 +146,7 @@
mPresentingChannelEditorDialog = true;
mChannelEditorDialogController.prepareDialogForApp(mAppName, mPackageName, mAppUid,
- mUniqueChannelsInRow, mPkgIcon, mOnSettingsClickListener);
+ mNotificationChannel, mPkgIcon, mOnSettingsClickListener);
mChannelEditorDialogController.setOnFinishListener(() -> {
mPresentingChannelEditorDialog = false;
mGutsContainer.closeControls(this, false);
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/prod/MobileConnectionRepositoryImpl.kt b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/prod/MobileConnectionRepositoryImpl.kt
index cd68621..dc50990 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/prod/MobileConnectionRepositoryImpl.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/prod/MobileConnectionRepositoryImpl.kt
@@ -71,6 +71,7 @@
import kotlinx.coroutines.flow.asStateFlow
import kotlinx.coroutines.flow.callbackFlow
import kotlinx.coroutines.flow.filter
+import kotlinx.coroutines.flow.flowOn
import kotlinx.coroutines.flow.map
import kotlinx.coroutines.flow.mapLatest
import kotlinx.coroutines.flow.mapNotNull
@@ -181,6 +182,7 @@
telephonyManager.registerTelephonyCallback(bgDispatcher.asExecutor(), callback)
awaitClose { telephonyManager.unregisterTelephonyCallback(callback) }
}
+ .flowOn(bgDispatcher)
.scan(initial = initial) { state, event -> state.applyEvent(event) }
.stateIn(scope = scope, started = SharingStarted.WhileSubscribed(), initial)
}
@@ -358,6 +360,7 @@
awaitClose { context.unregisterReceiver(receiver) }
}
+ .flowOn(bgDispatcher)
.stateIn(scope, SharingStarted.WhileSubscribed(), defaultNetworkName)
override val dataEnabled = run {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/prod/MobileConnectionsRepositoryImpl.kt b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/prod/MobileConnectionsRepositoryImpl.kt
index 74a849a..ec54f08 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/prod/MobileConnectionsRepositoryImpl.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/prod/MobileConnectionsRepositoryImpl.kt
@@ -134,22 +134,24 @@
)
.stateIn(scope, started = SharingStarted.WhileSubscribed(), null)
- private val mobileSubscriptionsChangeEvent: Flow<Unit> = conflatedCallbackFlow {
- val callback =
- object : SubscriptionManager.OnSubscriptionsChangedListener() {
- override fun onSubscriptionsChanged() {
- logger.logOnSubscriptionsChanged()
- trySend(Unit)
- }
+ private val mobileSubscriptionsChangeEvent: Flow<Unit> =
+ conflatedCallbackFlow {
+ val callback =
+ object : SubscriptionManager.OnSubscriptionsChangedListener() {
+ override fun onSubscriptionsChanged() {
+ logger.logOnSubscriptionsChanged()
+ trySend(Unit)
+ }
+ }
+
+ subscriptionManager.addOnSubscriptionsChangedListener(
+ bgDispatcher.asExecutor(),
+ callback,
+ )
+
+ awaitClose { subscriptionManager.removeOnSubscriptionsChangedListener(callback) }
}
-
- subscriptionManager.addOnSubscriptionsChangedListener(
- bgDispatcher.asExecutor(),
- callback,
- )
-
- awaitClose { subscriptionManager.removeOnSubscriptionsChangedListener(callback) }
- }
+ .flowOn(bgDispatcher)
/**
* State flow that emits the set of mobile data subscriptions, each represented by its own
@@ -184,6 +186,7 @@
telephonyManager.registerTelephonyCallback(bgDispatcher.asExecutor(), callback)
awaitClose { telephonyManager.unregisterTelephonyCallback(callback) }
}
+ .flowOn(bgDispatcher)
.distinctUntilChanged()
.logDiffsForTable(
tableLogger,
diff --git a/packages/SystemUI/tests/src/com/android/systemui/bouncer/domain/interactor/BouncerInteractorTest.kt b/packages/SystemUI/tests/src/com/android/systemui/bouncer/domain/interactor/BouncerInteractorTest.kt
index c0257df..92c8a39 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/bouncer/domain/interactor/BouncerInteractorTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/bouncer/domain/interactor/BouncerInteractorTest.kt
@@ -395,7 +395,7 @@
val bouncerSceneKey = currentScene?.key
assertThat(bouncerSceneKey).isEqualTo(SceneKey.Bouncer)
- underTest.hide("")
+ underTest.onImeHidden()
assertThat(currentScene?.key).isEqualTo(SceneKey.Lockscreen)
}
@@ -409,7 +409,7 @@
val notBouncerSceneKey = currentScene?.key
assertThat(notBouncerSceneKey).isNotEqualTo(SceneKey.Bouncer)
- underTest.hide("")
+ underTest.onImeHidden()
assertThat(currentScene?.key).isEqualTo(notBouncerSceneKey)
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/screenrecord/RecordingServiceTest.java b/packages/SystemUI/tests/src/com/android/systemui/screenrecord/RecordingServiceTest.java
index a2aed98..59b5953 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/screenrecord/RecordingServiceTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/screenrecord/RecordingServiceTest.java
@@ -41,7 +41,7 @@
import com.android.internal.logging.UiEventLogger;
import com.android.systemui.SysuiTestCase;
-import com.android.systemui.mediaprojection.MediaProjectionCaptureTarget;
+import com.android.systemui.media.MediaProjectionCaptureTarget;
import com.android.systemui.plugins.ActivityStarter;
import com.android.systemui.settings.UserContextProvider;
import com.android.systemui.statusbar.SysuiStatusBarStateController;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/screenrecord/ScreenRecordPermissionDialogTest.kt b/packages/SystemUI/tests/src/com/android/systemui/screenrecord/ScreenRecordPermissionDialogTest.kt
index 3ae1f35..d470d24 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/screenrecord/ScreenRecordPermissionDialogTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/screenrecord/ScreenRecordPermissionDialogTest.kt
@@ -22,13 +22,11 @@
import android.view.View
import android.widget.Spinner
import androidx.test.filters.SmallTest
+import com.android.systemui.res.R
import com.android.systemui.SysuiTestCase
import com.android.systemui.flags.FeatureFlags
import com.android.systemui.flags.Flags
-import com.android.systemui.mediaprojection.permission.ENTIRE_SCREEN
-import com.android.systemui.mediaprojection.permission.SINGLE_APP
import com.android.systemui.plugins.ActivityStarter
-import com.android.systemui.res.R
import com.android.systemui.settings.UserContextProvider
import com.android.systemui.util.mockito.mock
import com.google.common.truth.Truth.assertThat
@@ -37,8 +35,8 @@
import org.junit.Test
import org.junit.runner.RunWith
import org.mockito.Mock
-import org.mockito.Mockito.`when` as whenever
import org.mockito.MockitoAnnotations
+import org.mockito.Mockito.`when` as whenever
@SmallTest
@RunWith(AndroidTestingRunner::class)
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/interruption/NotificationInterruptStateProviderImplTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/interruption/NotificationInterruptStateProviderImplTest.java
index f05436f..50ce265 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/interruption/NotificationInterruptStateProviderImplTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/interruption/NotificationInterruptStateProviderImplTest.java
@@ -71,6 +71,7 @@
import com.android.systemui.statusbar.notification.interruption.NotificationInterruptStateProvider.FullScreenIntentDecision;
import com.android.systemui.statusbar.notification.interruption.NotificationInterruptStateProviderImpl.NotificationInterruptEvent;
import com.android.systemui.statusbar.policy.BatteryController;
+import com.android.systemui.statusbar.policy.DeviceProvisionedController;
import com.android.systemui.statusbar.policy.HeadsUpManager;
import com.android.systemui.statusbar.policy.KeyguardStateController;
@@ -117,6 +118,8 @@
PendingIntent mPendingIntent;
@Mock
UserTracker mUserTracker;
+ @Mock
+ DeviceProvisionedController mDeviceProvisionedController;
private NotificationInterruptStateProviderImpl mNotifInterruptionStateProvider;
@@ -141,7 +144,8 @@
mFlags,
mKeyguardNotificationVisibilityProvider,
mUiEventLoggerFake,
- mUserTracker);
+ mUserTracker,
+ mDeviceProvisionedController);
mNotifInterruptionStateProvider.mUseHeadsUp = true;
}
@@ -694,6 +698,25 @@
}
@Test
+ public void testShouldFullscreen_suppressedInterruptionsWhenNotProvisioned() {
+ NotificationEntry entry = createFsiNotification(IMPORTANCE_HIGH, /* silenced */ false);
+ when(mPowerManager.isInteractive()).thenReturn(true);
+ when(mStatusBarStateController.getState()).thenReturn(SHADE);
+ when(mStatusBarStateController.isDreaming()).thenReturn(false);
+ when(mPowerManager.isScreenOn()).thenReturn(true);
+ when(mDeviceProvisionedController.isDeviceProvisioned()).thenReturn(false);
+ mNotifInterruptionStateProvider.addSuppressor(mSuppressInterruptions);
+
+ assertThat(mNotifInterruptionStateProvider.getFullScreenIntentDecision(entry))
+ .isEqualTo(FullScreenIntentDecision.FSI_NOT_PROVISIONED);
+ assertThat(mNotifInterruptionStateProvider.shouldLaunchFullScreenIntentWhenAdded(entry))
+ .isTrue();
+ verify(mLogger, never()).logNoFullscreen(any(), any());
+ verify(mLogger, never()).logNoFullscreenWarning(any(), any());
+ verify(mLogger).logFullscreen(entry, "FSI_NOT_PROVISIONED");
+ }
+
+ @Test
public void testShouldNotFullScreen_willHun() throws RemoteException {
NotificationEntry entry = createFsiNotification(IMPORTANCE_HIGH, /* silenced */ false);
when(mPowerManager.isInteractive()).thenReturn(true);
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/ChannelEditorDialogControllerTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/ChannelEditorDialogControllerTest.kt
index 64d0256..7dcbd80 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/ChannelEditorDialogControllerTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/ChannelEditorDialogControllerTest.kt
@@ -73,14 +73,14 @@
controller = ChannelEditorDialogController(mContext, mockNoMan, dialogBuilder)
channel1 = NotificationChannel(TEST_CHANNEL, TEST_CHANNEL_NAME, IMPORTANCE_DEFAULT)
- channel2 = NotificationChannel(TEST_CHANNEL2, TEST_CHANNEL_NAME2, IMPORTANCE_DEFAULT)
+ channel2 = NotificationChannel(TEST_CHANNEL2, TEST_CHANNEL_NAME2, IMPORTANCE_NONE)
channelDefault = NotificationChannel(
NotificationChannel.DEFAULT_CHANNEL_ID, TEST_CHANNEL_NAME, IMPORTANCE_DEFAULT)
group = NotificationChannelGroup(TEST_GROUP_ID, TEST_GROUP_NAME)
- `when`(mockNoMan.getNotificationChannelGroupsForPackage(
- eq(TEST_PACKAGE_NAME), eq(TEST_UID), anyBoolean()))
+ `when`(mockNoMan.getRecentBlockedNotificationChannelGroupsForPackage(
+ eq(TEST_PACKAGE_NAME), eq(TEST_UID)))
.thenReturn(ParceledListSlice(listOf(group)))
`when`(mockNoMan.areNotificationsEnabledForPackage(eq(TEST_PACKAGE_NAME), eq(TEST_UID)))
@@ -89,11 +89,13 @@
@Test
fun testPrepareDialogForApp_noExtraChannels() {
+ channel1.group = group.id
+ channel2.group = group.id
group.channels = listOf(channel1, channel2)
controller.prepareDialogForApp(TEST_APP_NAME, TEST_PACKAGE_NAME, TEST_UID,
- setOf(channel1, channel2), appIcon, clickListener)
+ channel1, appIcon, clickListener)
- assertEquals(2, controller.paddedChannels.size)
+ assertEquals(2, controller.channelList.size)
}
@Test
@@ -101,39 +103,41 @@
group.addChannel(channelDefault)
controller.prepareDialogForApp(TEST_APP_NAME, TEST_PACKAGE_NAME, TEST_UID,
- setOf(channelDefault), appIcon, clickListener)
+ channelDefault, appIcon, clickListener)
assertEquals("No channels should be shown when there is only the miscellaneous channel",
- 0, controller.paddedChannels.size)
+ 0, controller.channelList.size)
}
@Test
- fun testPrepareDialogForApp_noProvidedChannels_noException() {
- group.channels = listOf()
-
- controller.prepareDialogForApp(TEST_APP_NAME, TEST_PACKAGE_NAME, TEST_UID,
- setOf(), appIcon, clickListener)
- }
-
- @Test
- fun testPrepareDialogForApp_retrievesUpTo4Channels() {
+ fun testPrepareDialogForApp_AddsAllChannelsAllGroups() {
+ val group2 = NotificationChannelGroup("two", "group two")
val channel3 = NotificationChannel("test_channel_3", "Test channel 3", IMPORTANCE_DEFAULT)
+ channel3.group = group2.id
val channel4 = NotificationChannel("test_channel_4", "Test channel 4", IMPORTANCE_DEFAULT)
+ channel4.group = group.id
+ val channel5 = NotificationChannel("test_channel_5", "Test channel 5", IMPORTANCE_DEFAULT)
+ channel5.group = group.id
- group.channels = listOf(channel1, channel2, channel3, channel4)
+ `when`(mockNoMan.getRecentBlockedNotificationChannelGroupsForPackage(
+ eq(TEST_PACKAGE_NAME), eq(TEST_UID)))
+ .thenReturn(ParceledListSlice(listOf(group, group2)))
+
+ group.channels = listOf(channel1, channel2, channel4, channel5)
+ group2.channels = listOf(channel3)
controller.prepareDialogForApp(TEST_APP_NAME, TEST_PACKAGE_NAME, TEST_UID,
- setOf(channel1), appIcon, clickListener)
+ channel1, appIcon, clickListener)
- assertEquals("ChannelEditorDialog should fetch enough channels to show 4",
- 4, controller.paddedChannels.size)
+ assertEquals("ChannelEditorDialog should show all channels",
+ 5, controller.channelList.size)
}
@Test
fun testApply_demoteChannel() {
group.channels = listOf(channel1, channel2)
controller.prepareDialogForApp(TEST_APP_NAME, TEST_PACKAGE_NAME, TEST_UID,
- setOf(channel1, channel2), appIcon, clickListener)
+ channel1, appIcon, clickListener)
// propose an adjustment of channel1
controller.proposeEditForChannel(channel1, IMPORTANCE_NONE)
@@ -145,14 +149,33 @@
// Channel 2 shouldn't have changed
assertEquals("Proposed edits should take effect after apply",
+ IMPORTANCE_NONE, channel2.importance)
+ }
+
+ @Test
+ fun testApply_promoteChannel() {
+ group.channels = listOf(channel1, channel2)
+ controller.prepareDialogForApp(TEST_APP_NAME, TEST_PACKAGE_NAME, TEST_UID,
+ channel1, appIcon, clickListener)
+
+ // propose an adjustment of channel1
+ controller.proposeEditForChannel(channel2, IMPORTANCE_DEFAULT)
+
+ controller.apply()
+
+ assertEquals("Proposed edits should take effect after apply",
IMPORTANCE_DEFAULT, channel2.importance)
+
+ // Channel 1 shouldn't have changed
+ assertEquals("Proposed edits should take effect after apply",
+ IMPORTANCE_DEFAULT, channel1.importance)
}
@Test
fun testApply_demoteApp() {
group.channels = listOf(channel1, channel2)
controller.prepareDialogForApp(TEST_APP_NAME, TEST_PACKAGE_NAME, TEST_UID,
- setOf(channel1, channel2), appIcon, clickListener)
+ channel1, appIcon, clickListener)
controller.proposeSetAppNotificationsEnabled(false)
controller.apply()
@@ -168,7 +191,7 @@
.thenReturn(false)
controller.prepareDialogForApp(TEST_APP_NAME, TEST_PACKAGE_NAME, TEST_UID,
- setOf(channel1, channel2), appIcon, clickListener)
+ channel1, appIcon, clickListener)
controller.proposeSetAppNotificationsEnabled(true)
controller.apply()
@@ -181,7 +204,7 @@
// GIVEN editor dialog
group.channels = listOf(channel1, channel2)
controller.prepareDialogForApp(TEST_APP_NAME, TEST_PACKAGE_NAME, TEST_UID,
- setOf(channel1, channel2), appIcon, null)
+ channel1, appIcon, null)
// WHEN user taps settings
// Pass in any old view, it should never actually be used
@@ -197,7 +220,7 @@
group.channels = listOf(channel1, channel2)
controller.prepareDialogForApp(TEST_APP_NAME, TEST_PACKAGE_NAME, TEST_UID,
- setOf(channel1, channel2), appIcon, null)
+ channel1, appIcon, null)
// WHEN the user proposes a change
controller.proposeEditForChannel(channel1, IMPORTANCE_NONE)
@@ -214,7 +237,7 @@
group.channels = listOf(channel1, channel2)
controller.prepareDialogForApp(TEST_APP_NAME, TEST_PACKAGE_NAME, TEST_UID,
- setOf(channel1, channel2), appIcon, null)
+ channel1, appIcon, null)
// WHEN the user proposes a change
controller.proposeEditForChannel(channel1, IMPORTANCE_NONE)
@@ -236,7 +259,6 @@
const val TEST_PACKAGE_NAME = "test_package"
const val TEST_SYSTEM_PACKAGE_NAME = PRINT_SPOOLER_PACKAGE_NAME
const val TEST_UID = 1
- const val MULTIPLE_CHANNEL_COUNT = 2
const val TEST_CHANNEL = "test_channel"
const val TEST_CHANNEL_NAME = "Test Channel Name"
const val TEST_CHANNEL2 = "test_channel2"
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRowTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRowTest.java
index ac8b42a..e373143 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRowTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRowTest.java
@@ -481,33 +481,6 @@
}
@Test
- public void testGetNumUniqueChildren_defaultChannel() throws Exception {
- ExpandableNotificationRow groupRow = mNotificationTestHelper.createGroup();
-
- assertEquals(1, groupRow.getNumUniqueChannels());
- }
-
- @Test
- public void testGetNumUniqueChildren_multiChannel() throws Exception {
- ExpandableNotificationRow group = mNotificationTestHelper.createGroup();
-
- List<ExpandableNotificationRow> childRows =
- group.getChildrenContainer().getAttachedChildren();
- // Give each child a unique channel id/name.
- int i = 0;
- for (ExpandableNotificationRow childRow : childRows) {
- modifyRanking(childRow.getEntry())
- .setChannel(
- new NotificationChannel(
- "id" + i, "dinnertime" + i, IMPORTANCE_DEFAULT))
- .build();
- i++;
- }
-
- assertEquals(3, group.getNumUniqueChannels());
- }
-
- @Test
public void testIconScrollXAfterTranslationAndReset() throws Exception {
ExpandableNotificationRow group = mNotificationTestHelper.createGroup();
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationGutsManagerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationGutsManagerTest.java
index 9e0f83c..0f1e63f 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationGutsManagerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationGutsManagerTest.java
@@ -462,7 +462,6 @@
eq(mChannelEditorDialogController),
eq(statusBarNotification.getPackageName()),
any(NotificationChannel.class),
- anySet(),
eq(entry),
any(NotificationInfo.OnSettingsClickListener.class),
any(NotificationInfo.OnAppSettingsClickListener.class),
@@ -496,7 +495,6 @@
eq(mChannelEditorDialogController),
eq(statusBarNotification.getPackageName()),
any(NotificationChannel.class),
- anySet(),
eq(entry),
any(NotificationInfo.OnSettingsClickListener.class),
any(NotificationInfo.OnAppSettingsClickListener.class),
@@ -528,7 +526,6 @@
eq(mChannelEditorDialogController),
eq(statusBarNotification.getPackageName()),
any(NotificationChannel.class),
- anySet(),
eq(entry),
any(NotificationInfo.OnSettingsClickListener.class),
any(NotificationInfo.OnAppSettingsClickListener.class),
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationInfoTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationInfoTest.java
index f0b4dd4..b59385c 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationInfoTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationInfoTest.java
@@ -92,7 +92,6 @@
private static final String TEST_PACKAGE_NAME = "test_package";
private static final String TEST_SYSTEM_PACKAGE_NAME = PRINT_SPOOLER_PACKAGE_NAME;
private static final int TEST_UID = 1;
- private static final int MULTIPLE_CHANNEL_COUNT = 2;
private static final String TEST_CHANNEL = "test_channel";
private static final String TEST_CHANNEL_NAME = "TEST CHANNEL NAME";
@@ -100,8 +99,6 @@
private NotificationInfo mNotificationInfo;
private NotificationChannel mNotificationChannel;
private NotificationChannel mDefaultNotificationChannel;
- private Set<NotificationChannel> mNotificationChannelSet = new HashSet<>();
- private Set<NotificationChannel> mDefaultNotificationChannelSet = new HashSet<>();
private StatusBarNotification mSbn;
private NotificationEntry mEntry;
private UiEventLoggerFake mUiEventLogger = new UiEventLoggerFake();
@@ -162,11 +159,9 @@
// Some test channels.
mNotificationChannel = new NotificationChannel(
TEST_CHANNEL, TEST_CHANNEL_NAME, IMPORTANCE_LOW);
- mNotificationChannelSet.add(mNotificationChannel);
mDefaultNotificationChannel = new NotificationChannel(
NotificationChannel.DEFAULT_CHANNEL_ID, TEST_CHANNEL_NAME,
IMPORTANCE_LOW);
- mDefaultNotificationChannelSet.add(mDefaultNotificationChannel);
mSbn = new StatusBarNotification(TEST_PACKAGE_NAME, TEST_PACKAGE_NAME, 0, null, TEST_UID, 0,
new Notification(), UserHandle.getUserHandleForUid(TEST_UID), null, 0);
mEntry = new NotificationEntryBuilder().setSbn(mSbn).build();
@@ -185,7 +180,6 @@
mChannelEditorDialogController,
TEST_PACKAGE_NAME,
mNotificationChannel,
- mNotificationChannelSet,
mEntry,
null,
null,
@@ -212,7 +206,6 @@
mChannelEditorDialogController,
TEST_PACKAGE_NAME,
mNotificationChannel,
- mNotificationChannelSet,
mEntry,
null,
null,
@@ -235,7 +228,6 @@
mChannelEditorDialogController,
TEST_PACKAGE_NAME,
mNotificationChannel,
- mNotificationChannelSet,
mEntry,
null,
null,
@@ -267,7 +259,6 @@
mChannelEditorDialogController,
TEST_PACKAGE_NAME,
mNotificationChannel,
- mNotificationChannelSet,
entry,
null,
null,
@@ -291,7 +282,6 @@
mChannelEditorDialogController,
TEST_PACKAGE_NAME,
mNotificationChannel,
- mNotificationChannelSet,
mEntry,
null,
null,
@@ -320,7 +310,6 @@
mChannelEditorDialogController,
TEST_PACKAGE_NAME,
mNotificationChannel,
- mNotificationChannelSet,
mEntry,
null,
null,
@@ -344,7 +333,6 @@
mChannelEditorDialogController,
TEST_PACKAGE_NAME,
mNotificationChannel,
- mNotificationChannelSet,
mEntry,
null,
null,
@@ -367,7 +355,6 @@
mChannelEditorDialogController,
TEST_PACKAGE_NAME,
mDefaultNotificationChannel,
- mDefaultNotificationChannelSet,
mEntry,
null,
null,
@@ -394,7 +381,6 @@
mChannelEditorDialogController,
TEST_PACKAGE_NAME,
mDefaultNotificationChannel,
- mDefaultNotificationChannelSet,
mEntry,
null,
null,
@@ -417,7 +403,6 @@
mChannelEditorDialogController,
TEST_PACKAGE_NAME,
mNotificationChannel,
- mNotificationChannelSet,
mEntry,
null,
null,
@@ -441,7 +426,6 @@
mChannelEditorDialogController,
TEST_PACKAGE_NAME,
mNotificationChannel,
- mNotificationChannelSet,
mEntry,
(View v, NotificationChannel c, int appUid) -> {
assertEquals(mNotificationChannel, c);
@@ -470,7 +454,6 @@
mChannelEditorDialogController,
TEST_PACKAGE_NAME,
mNotificationChannel,
- mNotificationChannelSet,
mEntry,
null,
null,
@@ -494,7 +477,6 @@
mChannelEditorDialogController,
TEST_PACKAGE_NAME,
mNotificationChannel,
- mNotificationChannelSet,
mEntry,
(View v, NotificationChannel c, int appUid) -> {
assertEquals(mNotificationChannel, c);
@@ -519,7 +501,6 @@
mChannelEditorDialogController,
TEST_PACKAGE_NAME,
mNotificationChannel,
- mNotificationChannelSet,
mEntry,
null,
null,
@@ -536,7 +517,6 @@
mChannelEditorDialogController,
TEST_PACKAGE_NAME,
mNotificationChannel,
- mNotificationChannelSet,
mEntry,
(View v, NotificationChannel c, int appUid) -> { },
null,
@@ -551,86 +531,6 @@
}
@Test
- public void testOnClickListenerPassesNullChannelForBundle() throws Exception {
- final CountDownLatch latch = new CountDownLatch(1);
- mNotificationInfo.bindNotification(
- mMockPackageManager,
- mMockINotificationManager,
- mOnUserInteractionCallback,
- mChannelEditorDialogController,
- TEST_PACKAGE_NAME, mNotificationChannel,
- createMultipleChannelSet(MULTIPLE_CHANNEL_COUNT),
- mEntry,
- (View v, NotificationChannel c, int appUid) -> {
- assertEquals(null, c);
- latch.countDown();
- },
- null,
- mUiEventLogger,
- true,
- true,
- true,
- mAssistantFeedbackController,
- mMetricsLogger);
-
- mNotificationInfo.findViewById(R.id.info).performClick();
- // Verify that listener was triggered.
- assertEquals(0, latch.getCount());
- }
-
- @Test
- @UiThreadTest
- public void testBindNotification_ChannelNameInvisibleWhenBundleFromDifferentChannels()
- throws Exception {
- mNotificationInfo.bindNotification(
- mMockPackageManager,
- mMockINotificationManager,
- mOnUserInteractionCallback,
- mChannelEditorDialogController,
- TEST_PACKAGE_NAME,
- mNotificationChannel,
- createMultipleChannelSet(MULTIPLE_CHANNEL_COUNT),
- mEntry,
- null,
- null,
- mUiEventLogger,
- true,
- false,
- true,
- mAssistantFeedbackController,
- mMetricsLogger);
- final TextView channelNameView =
- mNotificationInfo.findViewById(R.id.channel_name);
- assertEquals(GONE, channelNameView.getVisibility());
- }
-
- @Test
- @UiThreadTest
- public void testStopInvisibleIfBundleFromDifferentChannels() throws Exception {
- mNotificationInfo.bindNotification(
- mMockPackageManager,
- mMockINotificationManager,
- mOnUserInteractionCallback,
- mChannelEditorDialogController,
- TEST_PACKAGE_NAME,
- mNotificationChannel,
- createMultipleChannelSet(MULTIPLE_CHANNEL_COUNT),
- mEntry,
- null,
- null,
- mUiEventLogger,
- true,
- false,
- true,
- mAssistantFeedbackController,
- mMetricsLogger);
- assertEquals(GONE, mNotificationInfo.findViewById(
- R.id.interruptiveness_settings).getVisibility());
- assertEquals(VISIBLE, mNotificationInfo.findViewById(
- R.id.non_configurable_multichannel_text).getVisibility());
- }
-
- @Test
public void testBindNotification_whenAppUnblockable() throws Exception {
mNotificationInfo.bindNotification(
mMockPackageManager,
@@ -639,7 +539,6 @@
mChannelEditorDialogController,
TEST_PACKAGE_NAME,
mNotificationChannel,
- mNotificationChannelSet,
mEntry,
null,
null,
@@ -683,7 +582,6 @@
mChannelEditorDialogController,
TEST_PACKAGE_NAME,
mNotificationChannel,
- mNotificationChannelSet,
mEntry,
null,
null,
@@ -727,7 +625,6 @@
mChannelEditorDialogController,
TEST_PACKAGE_NAME,
mNotificationChannel,
- mNotificationChannelSet,
mEntry,
null,
null,
@@ -755,7 +652,6 @@
mChannelEditorDialogController,
TEST_PACKAGE_NAME,
mNotificationChannel,
- mNotificationChannelSet,
mEntry,
null,
null,
@@ -778,7 +674,6 @@
mChannelEditorDialogController,
TEST_PACKAGE_NAME,
mNotificationChannel,
- mNotificationChannelSet,
mEntry,
null,
null,
@@ -803,7 +698,6 @@
mChannelEditorDialogController,
TEST_PACKAGE_NAME,
mNotificationChannel,
- mNotificationChannelSet,
mEntry,
null,
null,
@@ -825,7 +719,6 @@
mChannelEditorDialogController,
TEST_PACKAGE_NAME,
mNotificationChannel,
- mNotificationChannelSet,
mEntry,
null,
null,
@@ -847,7 +740,6 @@
mChannelEditorDialogController,
TEST_PACKAGE_NAME,
mNotificationChannel,
- mNotificationChannelSet,
mEntry,
null,
null,
@@ -869,7 +761,6 @@
mChannelEditorDialogController,
TEST_PACKAGE_NAME,
mNotificationChannel,
- mNotificationChannelSet,
mEntry,
null,
null,
@@ -893,7 +784,6 @@
mChannelEditorDialogController,
TEST_PACKAGE_NAME,
mNotificationChannel,
- mNotificationChannelSet,
mEntry,
null,
null,
@@ -918,7 +808,6 @@
mChannelEditorDialogController,
TEST_PACKAGE_NAME,
mNotificationChannel,
- mNotificationChannelSet,
mEntry,
null,
null,
@@ -946,7 +835,6 @@
mChannelEditorDialogController,
TEST_PACKAGE_NAME,
mNotificationChannel,
- mNotificationChannelSet,
mEntry,
null,
null,
@@ -974,7 +862,6 @@
mChannelEditorDialogController,
TEST_PACKAGE_NAME,
mNotificationChannel,
- mNotificationChannelSet,
mEntry,
null,
null,
@@ -1003,7 +890,6 @@
mChannelEditorDialogController,
TEST_PACKAGE_NAME,
mNotificationChannel,
- mNotificationChannelSet,
mEntry,
null,
null,
@@ -1031,7 +917,6 @@
mChannelEditorDialogController,
TEST_PACKAGE_NAME,
mNotificationChannel,
- mNotificationChannelSet,
mEntry,
null,
null,
@@ -1067,7 +952,6 @@
mChannelEditorDialogController,
TEST_PACKAGE_NAME,
mNotificationChannel,
- mNotificationChannelSet,
mEntry,
null,
null,
@@ -1096,7 +980,6 @@
mChannelEditorDialogController,
TEST_PACKAGE_NAME,
mNotificationChannel,
- mNotificationChannelSet,
mEntry,
null,
null,
@@ -1138,7 +1021,6 @@
mChannelEditorDialogController,
TEST_PACKAGE_NAME,
mNotificationChannel,
- mNotificationChannelSet,
mEntry,
null,
null,
@@ -1176,7 +1058,6 @@
mChannelEditorDialogController,
TEST_PACKAGE_NAME,
mNotificationChannel,
- mNotificationChannelSet,
mEntry,
null,
null,
@@ -1209,7 +1090,6 @@
mChannelEditorDialogController,
TEST_PACKAGE_NAME,
mNotificationChannel,
- mNotificationChannelSet,
mEntry,
null,
null,
@@ -1246,7 +1126,6 @@
mChannelEditorDialogController,
TEST_PACKAGE_NAME,
mNotificationChannel,
- mNotificationChannelSet,
mEntry,
null,
null,
@@ -1285,7 +1164,6 @@
mChannelEditorDialogController,
TEST_PACKAGE_NAME,
mNotificationChannel,
- mNotificationChannelSet,
mEntry,
null,
null,
@@ -1317,7 +1195,6 @@
mChannelEditorDialogController,
TEST_PACKAGE_NAME,
mNotificationChannel,
- mNotificationChannelSet,
mEntry,
null,
null,
@@ -1356,7 +1233,6 @@
mChannelEditorDialogController,
TEST_PACKAGE_NAME,
mNotificationChannel,
- mNotificationChannelSet,
mEntry,
null,
null,
@@ -1386,7 +1262,6 @@
mChannelEditorDialogController,
TEST_PACKAGE_NAME,
mNotificationChannel,
- mNotificationChannelSet,
mEntry,
null,
null,
@@ -1418,7 +1293,6 @@
mChannelEditorDialogController,
TEST_PACKAGE_NAME,
mNotificationChannel,
- mNotificationChannelSet,
mEntry,
null,
null,
@@ -1454,7 +1328,6 @@
mChannelEditorDialogController,
TEST_PACKAGE_NAME,
mNotificationChannel,
- mNotificationChannelSet,
mEntry,
null,
null,
@@ -1488,7 +1361,6 @@
mChannelEditorDialogController,
TEST_PACKAGE_NAME,
mNotificationChannel,
- mNotificationChannelSet,
mEntry,
null,
null,
@@ -1522,7 +1394,6 @@
mChannelEditorDialogController,
TEST_PACKAGE_NAME,
mNotificationChannel,
- mNotificationChannelSet,
mEntry,
null,
null,
@@ -1549,7 +1420,6 @@
mChannelEditorDialogController,
TEST_PACKAGE_NAME,
mNotificationChannel,
- mNotificationChannelSet,
mEntry,
null,
null,
@@ -1562,21 +1432,4 @@
assertFalse(mNotificationInfo.willBeRemoved());
}
-
- private Set<NotificationChannel> createMultipleChannelSet(int howMany) {
- Set<NotificationChannel> multiChannelSet = new HashSet<>();
- for (int i = 0; i < howMany; i++) {
- if (i == 0) {
- multiChannelSet.add(mNotificationChannel);
- continue;
- }
-
- NotificationChannel channel = new NotificationChannel(
- TEST_CHANNEL, TEST_CHANNEL_NAME + i, IMPORTANCE_LOW);
-
- multiChannelSet.add(channel);
- }
-
- return multiChannelSet;
- }
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/PartialConversationInfoTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/PartialConversationInfoTest.java
index e42ce27..ccedd36 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/PartialConversationInfoTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/PartialConversationInfoTest.java
@@ -83,8 +83,6 @@
private PartialConversationInfo mInfo;
private NotificationChannel mNotificationChannel;
private NotificationChannel mDefaultNotificationChannel;
- private Set<NotificationChannel> mNotificationChannelSet = new HashSet<>();
- private Set<NotificationChannel> mDefaultNotificationChannelSet = new HashSet<>();
private StatusBarNotification mSbn;
private NotificationEntry mEntry;
@@ -144,11 +142,9 @@
// Some test channels.
mNotificationChannel = new NotificationChannel(
TEST_CHANNEL, TEST_CHANNEL_NAME, IMPORTANCE_LOW);
- mNotificationChannelSet.add(mNotificationChannel);
mDefaultNotificationChannel = new NotificationChannel(
NotificationChannel.DEFAULT_CHANNEL_ID, TEST_CHANNEL_NAME,
IMPORTANCE_LOW);
- mDefaultNotificationChannelSet.add(mDefaultNotificationChannel);
Notification n = new Notification.Builder(mContext, mNotificationChannel.getId())
.setContentTitle(new SpannableString("title"))
.build();
@@ -166,7 +162,6 @@
mChannelEditorDialogController,
TEST_PACKAGE_NAME,
mNotificationChannel,
- mNotificationChannelSet,
mEntry,
null,
true,
@@ -185,7 +180,6 @@
mChannelEditorDialogController,
TEST_PACKAGE_NAME,
mNotificationChannel,
- mNotificationChannelSet,
mEntry,
null,
true,
@@ -202,7 +196,6 @@
mChannelEditorDialogController,
TEST_PACKAGE_NAME,
mNotificationChannel,
- mNotificationChannelSet,
mEntry,
null,
true,
@@ -228,7 +221,6 @@
mChannelEditorDialogController,
TEST_PACKAGE_NAME,
mNotificationChannel,
- mNotificationChannelSet,
entry,
null,
true,
@@ -247,7 +239,6 @@
mChannelEditorDialogController,
TEST_PACKAGE_NAME,
mNotificationChannel,
- mNotificationChannelSet,
mEntry,
(View v, NotificationChannel c, int appUid) -> {
assertEquals(mNotificationChannel, c);
@@ -271,7 +262,6 @@
mChannelEditorDialogController,
TEST_PACKAGE_NAME,
mNotificationChannel,
- mNotificationChannelSet,
mEntry,
(View v, NotificationChannel c, int appUid) -> {
assertEquals(mNotificationChannel, c);
@@ -294,7 +284,6 @@
mChannelEditorDialogController,
TEST_PACKAGE_NAME,
mNotificationChannel,
- mNotificationChannelSet,
mEntry,
null,
true,
@@ -311,7 +300,6 @@
mChannelEditorDialogController,
TEST_PACKAGE_NAME,
mNotificationChannel,
- mNotificationChannelSet,
mEntry,
(View v, NotificationChannel c, int appUid) -> {
assertEquals(mNotificationChannel, c);
@@ -330,7 +318,6 @@
mChannelEditorDialogController,
TEST_PACKAGE_NAME,
mNotificationChannel,
- mNotificationChannelSet,
mEntry,
null,
true,
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/CentralSurfacesImplTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/CentralSurfacesImplTest.java
index 5c3dde5..0b171b2 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/CentralSurfacesImplTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/CentralSurfacesImplTest.java
@@ -364,7 +364,8 @@
mock(NotifPipelineFlags.class),
mock(KeyguardNotificationVisibilityProvider.class),
mock(UiEventLogger.class),
- mUserTracker);
+ mUserTracker,
+ mDeviceProvisionedController);
mContext.addMockSystemService(TrustManager.class, mock(TrustManager.class));
mContext.addMockSystemService(FingerprintManager.class, mock(FingerprintManager.class));
@@ -1169,7 +1170,8 @@
NotifPipelineFlags flags,
KeyguardNotificationVisibilityProvider keyguardNotificationVisibilityProvider,
UiEventLogger uiEventLogger,
- UserTracker userTracker) {
+ UserTracker userTracker,
+ DeviceProvisionedController deviceProvisionedController) {
super(
contentResolver,
powerManager,
@@ -1183,7 +1185,8 @@
flags,
keyguardNotificationVisibilityProvider,
uiEventLogger,
- userTracker
+ userTracker,
+ deviceProvisionedController
);
mUseHeadsUp = true;
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/wmshell/BubbleEducationControllerTest.kt b/packages/SystemUI/tests/src/com/android/systemui/wmshell/BubbleEducationControllerTest.kt
index 94ed608..e59e475 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/wmshell/BubbleEducationControllerTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/wmshell/BubbleEducationControllerTest.kt
@@ -15,104 +15,119 @@
*/
package com.android.systemui.wmshell
-import android.content.ContentResolver
import android.content.Context
+import android.content.Intent
import android.content.SharedPreferences
+import android.content.pm.ShortcutInfo
+import android.content.res.Resources
+import android.os.UserHandle
import android.testing.AndroidTestingRunner
import android.testing.TestableLooper
+import androidx.core.content.edit
import androidx.test.filters.SmallTest
import com.android.systemui.model.SysUiStateTest
import com.android.wm.shell.bubbles.Bubble
import com.android.wm.shell.bubbles.BubbleEducationController
import com.android.wm.shell.bubbles.PREF_MANAGED_EDUCATION
import com.android.wm.shell.bubbles.PREF_STACK_EDUCATION
+import com.google.common.truth.Truth.assertThat
+import com.google.common.util.concurrent.MoreExecutors.directExecutor
import org.junit.Assert.assertEquals
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
-import org.mockito.ArgumentMatchers.anyBoolean
-import org.mockito.ArgumentMatchers.anyInt
-import org.mockito.ArgumentMatchers.anyString
-import org.mockito.Mockito
@SmallTest
@RunWith(AndroidTestingRunner::class)
@TestableLooper.RunWithLooper(setAsMainLooper = true)
class BubbleEducationControllerTest : SysUiStateTest() {
- private val sharedPrefsEditor = Mockito.mock(SharedPreferences.Editor::class.java)
- private val sharedPrefs = Mockito.mock(SharedPreferences::class.java)
- private val context = Mockito.mock(Context::class.java)
+
+ private lateinit var sharedPrefs: SharedPreferences
private lateinit var sut: BubbleEducationController
@Before
fun setUp() {
- Mockito.`when`(context.packageName).thenReturn("packageName")
- Mockito.`when`(context.getSharedPreferences(anyString(), anyInt())).thenReturn(sharedPrefs)
- Mockito.`when`(context.contentResolver)
- .thenReturn(Mockito.mock(ContentResolver::class.java))
- Mockito.`when`(sharedPrefs.edit()).thenReturn(sharedPrefsEditor)
- sut = BubbleEducationController(context)
+ sharedPrefs = mContext.getSharedPreferences(mContext.packageName, Context.MODE_PRIVATE)
+ sharedPrefs.edit {
+ remove(PREF_STACK_EDUCATION)
+ remove(PREF_MANAGED_EDUCATION)
+ }
+ sut = BubbleEducationController(mContext)
}
@Test
fun testSeenStackEducation_read() {
- Mockito.`when`(sharedPrefs.getBoolean(anyString(), anyBoolean())).thenReturn(true)
+ sharedPrefs.edit { putBoolean(PREF_STACK_EDUCATION, true) }
assertEquals(sut.hasSeenStackEducation, true)
- Mockito.verify(sharedPrefs).getBoolean(PREF_STACK_EDUCATION, false)
}
@Test
fun testSeenStackEducation_write() {
sut.hasSeenStackEducation = true
- Mockito.verify(sharedPrefsEditor).putBoolean(PREF_STACK_EDUCATION, true)
+ assertThat(sharedPrefs.getBoolean(PREF_STACK_EDUCATION, false)).isTrue()
}
@Test
fun testSeenManageEducation_read() {
- Mockito.`when`(sharedPrefs.getBoolean(anyString(), anyBoolean())).thenReturn(true)
+ sharedPrefs.edit { putBoolean(PREF_MANAGED_EDUCATION, true) }
assertEquals(sut.hasSeenManageEducation, true)
- Mockito.verify(sharedPrefs).getBoolean(PREF_MANAGED_EDUCATION, false)
}
@Test
fun testSeenManageEducation_write() {
sut.hasSeenManageEducation = true
- Mockito.verify(sharedPrefsEditor).putBoolean(PREF_MANAGED_EDUCATION, true)
+ assertThat(sharedPrefs.getBoolean(PREF_MANAGED_EDUCATION, false)).isTrue()
}
@Test
fun testShouldShowStackEducation() {
- val bubble = Mockito.mock(Bubble::class.java)
// When bubble is null
assertEquals(sut.shouldShowStackEducation(null), false)
+ var bubble = createFakeBubble(isConversational = false)
// When bubble is not conversation
- Mockito.`when`(bubble.isConversation).thenReturn(false)
assertEquals(sut.shouldShowStackEducation(bubble), false)
// When bubble is conversation and has seen stack edu
- Mockito.`when`(bubble.isConversation).thenReturn(true)
- Mockito.`when`(sharedPrefs.getBoolean(anyString(), anyBoolean())).thenReturn(true)
+ bubble = createFakeBubble(isConversational = true)
+ sharedPrefs.edit { putBoolean(PREF_STACK_EDUCATION, true) }
assertEquals(sut.shouldShowStackEducation(bubble), false)
// When bubble is conversation and has not seen stack edu
- Mockito.`when`(bubble.isConversation).thenReturn(true)
- Mockito.`when`(sharedPrefs.getBoolean(anyString(), anyBoolean())).thenReturn(false)
+ sharedPrefs.edit { remove(PREF_STACK_EDUCATION) }
assertEquals(sut.shouldShowStackEducation(bubble), true)
}
@Test
fun testShouldShowManageEducation() {
- val bubble = Mockito.mock(Bubble::class.java)
// When bubble is null
assertEquals(sut.shouldShowManageEducation(null), false)
+ var bubble = createFakeBubble(isConversational = false)
// When bubble is not conversation
- Mockito.`when`(bubble.isConversation).thenReturn(false)
assertEquals(sut.shouldShowManageEducation(bubble), false)
// When bubble is conversation and has seen stack edu
- Mockito.`when`(bubble.isConversation).thenReturn(true)
- Mockito.`when`(sharedPrefs.getBoolean(anyString(), anyBoolean())).thenReturn(true)
+ bubble = createFakeBubble(isConversational = true)
+ sharedPrefs.edit { putBoolean(PREF_MANAGED_EDUCATION, true) }
assertEquals(sut.shouldShowManageEducation(bubble), false)
// When bubble is conversation and has not seen stack edu
- Mockito.`when`(bubble.isConversation).thenReturn(true)
- Mockito.`when`(sharedPrefs.getBoolean(anyString(), anyBoolean())).thenReturn(false)
+ sharedPrefs.edit { remove(PREF_MANAGED_EDUCATION) }
assertEquals(sut.shouldShowManageEducation(bubble), true)
}
+
+ private fun createFakeBubble(isConversational: Boolean): Bubble {
+ return if (isConversational) {
+ val shortcutInfo = ShortcutInfo.Builder(mContext, "fakeId").build()
+ Bubble(
+ "key",
+ shortcutInfo,
+ /* desiredHeight= */ 6,
+ Resources.ID_NULL,
+ "title",
+ /* taskId= */ 0,
+ "locus",
+ /* isDismissable= */ true,
+ directExecutor()
+ ) {}
+ } else {
+ val intent = Intent(Intent.ACTION_VIEW).setPackage(mContext.packageName)
+ Bubble.createAppBubble(intent, UserHandle(1), null, directExecutor())
+ }
+ }
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/wmshell/BubblesTest.java b/packages/SystemUI/tests/src/com/android/systemui/wmshell/BubblesTest.java
index d8511e8..65b8b55 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/wmshell/BubblesTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/wmshell/BubblesTest.java
@@ -126,6 +126,7 @@
import com.android.systemui.statusbar.phone.ScreenOffAnimationController;
import com.android.systemui.statusbar.policy.BatteryController;
import com.android.systemui.statusbar.policy.ConfigurationController;
+import com.android.systemui.statusbar.policy.DeviceProvisionedController;
import com.android.systemui.statusbar.policy.HeadsUpManager;
import com.android.systemui.statusbar.policy.KeyguardStateController;
import com.android.systemui.statusbar.policy.ZenModeController;
@@ -391,7 +392,8 @@
mock(NotifPipelineFlags.class),
mock(KeyguardNotificationVisibilityProvider.class),
mock(UiEventLogger.class),
- mock(UserTracker.class)
+ mock(UserTracker.class),
+ mock(DeviceProvisionedController.class)
);
mShellTaskOrganizer = new ShellTaskOrganizer(mock(ShellInit.class),
diff --git a/packages/SystemUI/tests/src/com/android/systemui/wmshell/TestableNotificationInterruptStateProviderImpl.java b/packages/SystemUI/tests/src/com/android/systemui/wmshell/TestableNotificationInterruptStateProviderImpl.java
index 4e14bbf6..0df235d 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/wmshell/TestableNotificationInterruptStateProviderImpl.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/wmshell/TestableNotificationInterruptStateProviderImpl.java
@@ -29,6 +29,7 @@
import com.android.systemui.statusbar.notification.interruption.NotificationInterruptLogger;
import com.android.systemui.statusbar.notification.interruption.NotificationInterruptStateProviderImpl;
import com.android.systemui.statusbar.policy.BatteryController;
+import com.android.systemui.statusbar.policy.DeviceProvisionedController;
import com.android.systemui.statusbar.policy.HeadsUpManager;
import com.android.systemui.statusbar.policy.KeyguardStateController;
@@ -48,7 +49,8 @@
NotifPipelineFlags flags,
KeyguardNotificationVisibilityProvider keyguardNotificationVisibilityProvider,
UiEventLogger uiEventLogger,
- UserTracker userTracker) {
+ UserTracker userTracker,
+ DeviceProvisionedController deviceProvisionedController) {
super(contentResolver,
powerManager,
ambientDisplayConfiguration,
@@ -61,7 +63,8 @@
flags,
keyguardNotificationVisibilityProvider,
uiEventLogger,
- userTracker);
+ userTracker,
+ deviceProvisionedController);
mUseHeadsUp = true;
}
}
diff --git a/services/accessibility/accessibility.aconfig b/services/accessibility/accessibility.aconfig
index 0480c22..11189cf 100644
--- a/services/accessibility/accessibility.aconfig
+++ b/services/accessibility/accessibility.aconfig
@@ -25,5 +25,12 @@
name: "send_a11y_events_based_on_state"
namespace: "accessibility"
description: "Sends accessibility events in TouchExplorer#onAccessibilityEvent based on internal state to keep it consistent. This reduces test flakiness."
-bug: "295575684"
-}
\ No newline at end of file
+ bug: "295575684"
+}
+
+flag {
+ name: "add_window_token_without_lock"
+ namespace: "accessibility"
+ description: "Calls WMS.addWindowToken without holding A11yManagerService#mLock"
+ bug: "297972548"
+}
diff --git a/services/accessibility/java/com/android/server/accessibility/AbstractAccessibilityServiceConnection.java b/services/accessibility/java/com/android/server/accessibility/AbstractAccessibilityServiceConnection.java
index 05b6eb4..fa73cff 100644
--- a/services/accessibility/java/com/android/server/accessibility/AbstractAccessibilityServiceConnection.java
+++ b/services/accessibility/java/com/android/server/accessibility/AbstractAccessibilityServiceConnection.java
@@ -1506,11 +1506,17 @@
}
}
- public void onAdded() {
+ /**
+ * Called when the connection is first created. Add a window token for all known displays.
+ * <p>
+ * <strong>Note:</strong> Should not be called while holding the AccessibilityManagerService
+ * lock because this calls out to WindowManagerService.
+ */
+ void addWindowTokensForAllDisplays() {
final Display[] displays = mDisplayManager.getDisplays();
for (int i = 0; i < displays.length; i++) {
final int displayId = displays[i].getDisplayId();
- onDisplayAdded(displayId);
+ addWindowTokenForDisplay(displayId);
}
}
@@ -1518,9 +1524,13 @@
* Called whenever a logical display has been added to the system. Add a window token for adding
* an accessibility overlay.
*
+ * <p>
+ * <strong>Note:</strong> Should not be called while holding the AccessibilityManagerService
+ * lock because this calls out to WindowManagerService.
+ *
* @param displayId The id of the logical display that was added.
*/
- public void onDisplayAdded(int displayId) {
+ void addWindowTokenForDisplay(int displayId) {
final long identity = Binder.clearCallingIdentity();
try {
final IBinder overlayWindowToken = new Binder();
diff --git a/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java b/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java
index 93ba362..60d4ee6 100644
--- a/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java
+++ b/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java
@@ -154,6 +154,7 @@
import com.android.internal.util.ArrayUtils;
import com.android.internal.util.DumpUtils;
import com.android.internal.util.IntPair;
+import com.android.internal.util.Preconditions;
import com.android.server.AccessibilityManagerInternal;
import com.android.server.LocalServices;
import com.android.server.SystemService;
@@ -4500,6 +4501,20 @@
private int mSystemUiUid = 0;
AccessibilityDisplayListener(Context context, Handler handler) {
+ if (Flags.addWindowTokenWithoutLock()) {
+ // Avoid concerns about one thread adding displays while another thread removes
+ // them by ensuring the looper is the main looper and the DisplayListener
+ // callbacks are always executed on the one main thread.
+ final boolean isMainHandler = handler.getLooper() == Looper.getMainLooper();
+ final String errorMessage =
+ "AccessibilityDisplayListener must use the main handler";
+ if (Build.IS_USERDEBUG || Build.IS_ENG) {
+ Preconditions.checkArgument(isMainHandler, errorMessage);
+ } else if (!isMainHandler) {
+ Slog.e(LOG_TAG, errorMessage);
+ }
+ }
+
mDisplayManager = (DisplayManager) context.getSystemService(Context.DISPLAY_SERVICE);
mDisplayManager.registerDisplayListener(this, handler);
initializeDisplayList();
@@ -4541,11 +4556,21 @@
@Override
public void onDisplayAdded(int displayId) {
+ if (Flags.addWindowTokenWithoutLock()) {
+ final boolean isMainThread = Looper.getMainLooper().isCurrentThread();
+ final String errorMessage = "onDisplayAdded must be called from the main thread";
+ if (Build.IS_USERDEBUG || Build.IS_ENG) {
+ Preconditions.checkArgument(isMainThread, errorMessage);
+ } else if (!isMainThread) {
+ Slog.e(LOG_TAG, errorMessage);
+ }
+ }
final Display display = mDisplayManager.getDisplay(displayId);
if (!isValidDisplay(display)) {
return;
}
+ final List<AccessibilityServiceConnection> services;
synchronized (mLock) {
mDisplaysList.add(display);
mA11yOverlayLayers.put(
@@ -4554,21 +4579,42 @@
mInputFilter.onDisplayAdded(display);
}
AccessibilityUserState userState = getCurrentUserStateLocked();
- if (displayId != Display.DEFAULT_DISPLAY) {
- final List<AccessibilityServiceConnection> services = userState.mBoundServices;
- for (int i = 0; i < services.size(); i++) {
- AccessibilityServiceConnection boundClient = services.get(i);
- boundClient.onDisplayAdded(displayId);
+ if (Flags.addWindowTokenWithoutLock()) {
+ services = new ArrayList<>(userState.mBoundServices);
+ } else {
+ services = userState.mBoundServices;
+ if (displayId != Display.DEFAULT_DISPLAY) {
+ for (int i = 0; i < services.size(); i++) {
+ AccessibilityServiceConnection boundClient = services.get(i);
+ boundClient.addWindowTokenForDisplay(displayId);
+ }
}
}
updateMagnificationLocked(userState);
updateWindowsForAccessibilityCallbackLocked(userState);
notifyClearAccessibilityCacheLocked();
}
+ if (Flags.addWindowTokenWithoutLock()) {
+ if (displayId != Display.DEFAULT_DISPLAY) {
+ for (int i = 0; i < services.size(); i++) {
+ AccessibilityServiceConnection boundClient = services.get(i);
+ boundClient.addWindowTokenForDisplay(displayId);
+ }
+ }
+ }
}
@Override
public void onDisplayRemoved(int displayId) {
+ if (Flags.addWindowTokenWithoutLock()) {
+ final boolean isMainThread = Looper.getMainLooper().isCurrentThread();
+ final String errorMessage = "onDisplayRemoved must be called from the main thread";
+ if (Build.IS_USERDEBUG || Build.IS_ENG) {
+ Preconditions.checkArgument(isMainThread, errorMessage);
+ } else if (!isMainThread) {
+ Slog.e(LOG_TAG, errorMessage);
+ }
+ }
synchronized (mLock) {
if (!removeDisplayFromList(displayId)) {
return;
diff --git a/services/accessibility/java/com/android/server/accessibility/AccessibilityServiceConnection.java b/services/accessibility/java/com/android/server/accessibility/AccessibilityServiceConnection.java
index 9e70073..7a2a602 100644
--- a/services/accessibility/java/com/android/server/accessibility/AccessibilityServiceConnection.java
+++ b/services/accessibility/java/com/android/server/accessibility/AccessibilityServiceConnection.java
@@ -44,7 +44,6 @@
import android.view.Display;
import android.view.MotionEvent;
-
import com.android.server.inputmethod.InputMethodManagerInternal;
import com.android.server.wm.ActivityTaskManagerInternal;
import com.android.server.wm.WindowManagerInternal;
@@ -169,6 +168,10 @@
@Override
public void onServiceConnected(ComponentName componentName, IBinder service) {
+ AccessibilityUserState userState = mUserStateWeakReference.get();
+ if (userState != null && Flags.addWindowTokenWithoutLock()) {
+ addWindowTokensForAllDisplays();
+ }
synchronized (mLock) {
if (mService != service) {
if (mService != null) {
@@ -184,7 +187,6 @@
}
}
mServiceInterface = IAccessibilityServiceClient.Stub.asInterface(service);
- AccessibilityUserState userState = mUserStateWeakReference.get();
if (userState == null) return;
userState.addServiceLocked(this);
mSystemSupport.onClientChangeLocked(false);
diff --git a/services/accessibility/java/com/android/server/accessibility/AccessibilityUserState.java b/services/accessibility/java/com/android/server/accessibility/AccessibilityUserState.java
index ab6cc71..693526a 100644
--- a/services/accessibility/java/com/android/server/accessibility/AccessibilityUserState.java
+++ b/services/accessibility/java/com/android/server/accessibility/AccessibilityUserState.java
@@ -224,7 +224,9 @@
void addServiceLocked(AccessibilityServiceConnection serviceConnection) {
if (!mBoundServices.contains(serviceConnection)) {
- serviceConnection.onAdded();
+ if (!Flags.addWindowTokenWithoutLock()) {
+ serviceConnection.addWindowTokensForAllDisplays();
+ }
mBoundServices.add(serviceConnection);
mComponentNameToServiceMap.put(serviceConnection.getComponentName(), serviceConnection);
mServiceInfoChangeListener.onServiceInfoChangedLocked(this);
diff --git a/services/accessibility/java/com/android/server/accessibility/UiAutomationManager.java b/services/accessibility/java/com/android/server/accessibility/UiAutomationManager.java
index 208acdf..53c629a 100644
--- a/services/accessibility/java/com/android/server/accessibility/UiAutomationManager.java
+++ b/services/accessibility/java/com/android/server/accessibility/UiAutomationManager.java
@@ -25,9 +25,11 @@
import android.content.ComponentName;
import android.content.Context;
import android.os.Binder;
+import android.os.Build;
import android.os.Handler;
import android.os.IBinder;
import android.os.IBinder.DeathRecipient;
+import android.os.Looper;
import android.os.RemoteCallback;
import android.os.RemoteException;
import android.util.Slog;
@@ -35,6 +37,7 @@
import android.view.accessibility.AccessibilityEvent;
import com.android.internal.util.DumpUtils;
+import com.android.internal.util.Preconditions;
import com.android.server.utils.Slogf;
import com.android.server.wm.WindowManagerInternal;
@@ -98,46 +101,47 @@
accessibilityServiceInfo.setComponentName(COMPONENT_NAME);
Slogf.i(LOG_TAG, "Registering UiTestAutomationService (id=%s) when called by user %d",
accessibilityServiceInfo.getId(), Binder.getCallingUserHandle().getIdentifier());
- synchronized (mLock) {
- if (mUiAutomationService != null) {
- throw new IllegalStateException(
- "UiAutomationService " + mUiAutomationService.mServiceInterface
- + "already registered!");
- }
-
- try {
- owner.linkToDeath(mUiAutomationServiceOwnerDeathRecipient, 0);
- } catch (RemoteException re) {
- Slog.e(LOG_TAG, "Couldn't register for the death of a UiTestAutomationService!",
- re);
- return;
- }
-
- mUiAutomationFlags = flags;
- mSystemSupport = systemSupport;
- // Ignore registering UiAutomation if it is not allowed to use the accessibility
- // subsystem.
- if (!useAccessibility()) {
- return;
- }
- mUiAutomationService = new UiAutomationService(context, accessibilityServiceInfo, id,
- mainHandler, mLock, securityPolicy, systemSupport, trace, windowManagerInternal,
- systemActionPerformer, awm);
- mUiAutomationServiceOwner = owner;
- mUiAutomationService.mServiceInterface = serviceClient;
- try {
- mUiAutomationService.mServiceInterface.asBinder().linkToDeath(mUiAutomationService,
- 0);
- } catch (RemoteException re) {
- Slog.e(LOG_TAG, "Failed registering death link: " + re);
- destroyUiAutomationService();
- return;
- }
-
- mUiAutomationService.onAdded();
-
- mUiAutomationService.connectServiceUnknownThread();
+ if (mUiAutomationService != null) {
+ throw new IllegalStateException(
+ "UiAutomationService " + mUiAutomationService.mServiceInterface
+ + "already registered!");
}
+
+ try {
+ owner.linkToDeath(mUiAutomationServiceOwnerDeathRecipient, 0);
+ } catch (RemoteException re) {
+ Slog.e(LOG_TAG, "Couldn't register for the death of a UiTestAutomationService!",
+ re);
+ return;
+ }
+
+ mUiAutomationFlags = flags;
+ mSystemSupport = systemSupport;
+ // Ignore registering UiAutomation if it is not allowed to use the accessibility
+ // subsystem.
+ if (!useAccessibility()) {
+ return;
+ }
+ mUiAutomationService = new UiAutomationService(context, accessibilityServiceInfo, id,
+ mainHandler, mLock, securityPolicy, systemSupport, trace, windowManagerInternal,
+ systemActionPerformer, awm);
+ mUiAutomationServiceOwner = owner;
+ mUiAutomationService.mServiceInterface = serviceClient;
+ try {
+ mUiAutomationService.mServiceInterface.asBinder().linkToDeath(mUiAutomationService,
+ 0);
+ } catch (RemoteException re) {
+ Slog.e(LOG_TAG, "Failed registering death link: " + re);
+ destroyUiAutomationService();
+ return;
+ }
+
+ if (!Flags.addWindowTokenWithoutLock()) {
+ mUiAutomationService.addWindowTokensForAllDisplays();
+ }
+ // UiAutomationService#connectServiceUnknownThread posts to a handler
+ // so this call should return immediately.
+ mUiAutomationService.connectServiceUnknownThread();
}
void unregisterUiTestAutomationServiceLocked(IAccessibilityServiceClient serviceClient) {
@@ -253,6 +257,13 @@
super(context, COMPONENT_NAME, accessibilityServiceInfo, id, mainHandler, lock,
securityPolicy, systemSupport, trace, windowManagerInternal,
systemActionPerformer, awm);
+ final boolean isMainHandler = mainHandler.getLooper() == Looper.getMainLooper();
+ final String errorMessage = "UiAutomationService must use the main handler";
+ if (Build.IS_USERDEBUG || Build.IS_ENG) {
+ Preconditions.checkArgument(isMainHandler, errorMessage);
+ } else if (!isMainHandler) {
+ Slog.e(LOG_TAG, errorMessage);
+ }
mMainHandler = mainHandler;
setDisplayTypes(DISPLAY_TYPE_DEFAULT | DISPLAY_TYPE_PROXY);
}
@@ -274,6 +285,9 @@
// If the serviceInterface is null, the UiAutomation has been shut down on
// another thread.
if (serviceInterface != null) {
+ if (Flags.addWindowTokenWithoutLock()) {
+ mUiAutomationService.addWindowTokensForAllDisplays();
+ }
if (mTrace.isA11yTracingEnabledForTypes(
AccessibilityTrace.FLAGS_ACCESSIBILITY_SERVICE_CLIENT)) {
mTrace.logTrace("UiAutomationService.connectServiceUnknownThread",
@@ -286,7 +300,7 @@
mOverlayWindowTokens.get(Display.DEFAULT_DISPLAY));
}
} catch (RemoteException re) {
- Slog.w(LOG_TAG, "Error initialized connection", re);
+ Slog.w(LOG_TAG, "Error initializing connection", re);
destroyUiAutomationService();
}
});
diff --git a/services/companion/java/com/android/server/companion/CompanionDeviceManagerService.java b/services/companion/java/com/android/server/companion/CompanionDeviceManagerService.java
index ba45339..c791498 100644
--- a/services/companion/java/com/android/server/companion/CompanionDeviceManagerService.java
+++ b/services/companion/java/com/android/server/companion/CompanionDeviceManagerService.java
@@ -155,6 +155,7 @@
"debug.cdm.cdmservice.removal_time_window";
private static final long ASSOCIATION_REMOVAL_TIME_WINDOW_DEFAULT = DAYS.toMillis(90);
+ private static final int MAX_CN_LENGTH = 500;
private final ActivityManager mActivityManager;
private final OnPackageVisibilityChangeListener mOnPackageVisibilityChangeListener;
@@ -757,6 +758,9 @@
String callingPackage = component.getPackageName();
checkCanCallNotificationApi(callingPackage);
// TODO: check userId.
+ if (component.flattenToString().length() > MAX_CN_LENGTH) {
+ throw new IllegalArgumentException("Component name is too long.");
+ }
final long identity = Binder.clearCallingIdentity();
try {
return PendingIntent.getActivityAsUser(getContext(),
diff --git a/services/core/Android.bp b/services/core/Android.bp
index d9c2694..6521fab 100644
--- a/services/core/Android.bp
+++ b/services/core/Android.bp
@@ -194,6 +194,7 @@
"notification_flags_lib",
"camera_platform_flags_core_java_lib",
"biometrics_flags_lib",
+ "am_flags_lib",
],
javac_shard_size: 50,
javacflags: [
diff --git a/services/core/java/com/android/server/am/ActivityManagerConstants.java b/services/core/java/com/android/server/am/ActivityManagerConstants.java
index c20f0aa..9716cf6 100644
--- a/services/core/java/com/android/server/am/ActivityManagerConstants.java
+++ b/services/core/java/com/android/server/am/ActivityManagerConstants.java
@@ -225,7 +225,7 @@
/**
* The default value to {@link #KEY_ENABLE_NEW_OOMADJ}.
*/
- private static final boolean DEFAULT_ENABLE_NEW_OOM_ADJ = false;
+ private static final boolean DEFAULT_ENABLE_NEW_OOM_ADJ = Flags.oomadjusterCorrectnessRewrite();
/**
* Same as {@link TEMPORARY_ALLOW_LIST_TYPE_FOREGROUND_SERVICE_NOT_ALLOWED}
diff --git a/services/core/java/com/android/server/am/Android.bp b/services/core/java/com/android/server/am/Android.bp
new file mode 100644
index 0000000..af1200e
--- /dev/null
+++ b/services/core/java/com/android/server/am/Android.bp
@@ -0,0 +1,10 @@
+aconfig_declarations {
+ name: "am_flags",
+ package: "com.android.server.am",
+ srcs: ["*.aconfig"],
+}
+
+java_aconfig_library {
+ name: "am_flags_lib",
+ aconfig_declarations: "am_flags",
+}
diff --git a/services/core/java/com/android/server/am/flags.aconfig b/services/core/java/com/android/server/am/flags.aconfig
new file mode 100644
index 0000000..b03cc62
--- /dev/null
+++ b/services/core/java/com/android/server/am/flags.aconfig
@@ -0,0 +1,9 @@
+package: "com.android.server.am"
+
+flag {
+ name: "oomadjuster_correctness_rewrite"
+ namespace: "android_platform_power_optimization"
+ description: "Utilize new OomAdjuster implementation"
+ bug: "298055811"
+ is_fixed_read_only: true
+}
\ No newline at end of file
diff --git a/services/core/java/com/android/server/display/LocalDisplayAdapter.java b/services/core/java/com/android/server/display/LocalDisplayAdapter.java
index b32a207..0f3e7c5 100644
--- a/services/core/java/com/android/server/display/LocalDisplayAdapter.java
+++ b/services/core/java/com/android/server/display/LocalDisplayAdapter.java
@@ -1345,6 +1345,7 @@
public interface DisplayEventListener {
void onHotplug(long timestampNanos, long physicalDisplayId, boolean connected);
+ void onHotplugConnectionError(long timestampNanos, int connectionError);
void onModeChanged(long timestampNanos, long physicalDisplayId, int modeId,
long renderPeriod);
void onFrameRateOverridesChanged(long timestampNanos, long physicalDisplayId,
@@ -1367,6 +1368,11 @@
}
@Override
+ public void onHotplugConnectionError(long timestampNanos, int errorCode) {
+ mListener.onHotplugConnectionError(timestampNanos, errorCode);
+ }
+
+ @Override
public void onModeChanged(long timestampNanos, long physicalDisplayId, int modeId,
long renderPeriod) {
mListener.onModeChanged(timestampNanos, physicalDisplayId, modeId, renderPeriod);
@@ -1392,6 +1398,15 @@
}
@Override
+ public void onHotplugConnectionError(long timestampNanos, int connectionError) {
+ if (DEBUG) {
+ Slog.d(TAG, "onHotplugConnectionError("
+ + "timestampNanos=" + timestampNanos
+ + ", connectionError=" + connectionError + ")");
+ }
+ }
+
+ @Override
public void onModeChanged(long timestampNanos, long physicalDisplayId, int modeId,
long renderPeriod) {
if (DEBUG) {
diff --git a/services/core/java/com/android/server/notification/ManagedServices.java b/services/core/java/com/android/server/notification/ManagedServices.java
index c6f6fe2..fe91050 100644
--- a/services/core/java/com/android/server/notification/ManagedServices.java
+++ b/services/core/java/com/android/server/notification/ManagedServices.java
@@ -1021,7 +1021,7 @@
synchronized (mSnoozing) {
mSnoozing.remove(user);
}
- rebindServices(true, user);
+ unbindUserServices(user);
}
public void onUserSwitched(int user) {
@@ -1408,12 +1408,24 @@
void unbindOtherUserServices(int currentUser) {
TimingsTraceAndSlog t = new TimingsTraceAndSlog();
t.traceBegin("ManagedServices.unbindOtherUserServices_current" + currentUser);
- final SparseArray<Set<ComponentName>> componentsToUnbind = new SparseArray<>();
+ unbindServicesImpl(currentUser, true /* allExceptUser */);
+ t.traceEnd();
+ }
+ void unbindUserServices(int user) {
+ TimingsTraceAndSlog t = new TimingsTraceAndSlog();
+ t.traceBegin("ManagedServices.unbindUserServices" + user);
+ unbindServicesImpl(user, false /* allExceptUser */);
+ t.traceEnd();
+ }
+
+ void unbindServicesImpl(int user, boolean allExceptUser) {
+ final SparseArray<Set<ComponentName>> componentsToUnbind = new SparseArray<>();
synchronized (mMutex) {
final Set<ManagedServiceInfo> removableBoundServices = getRemovableConnectedServices();
for (ManagedServiceInfo info : removableBoundServices) {
- if (info.userid != currentUser) {
+ if ((allExceptUser && (info.userid != user))
+ || (!allExceptUser && (info.userid == user))) {
Set<ComponentName> toUnbind =
componentsToUnbind.get(info.userid, new ArraySet<>());
toUnbind.add(info.component);
@@ -1422,7 +1434,6 @@
}
}
unbindFromServices(componentsToUnbind);
- t.traceEnd();
}
protected void unbindFromServices(SparseArray<Set<ComponentName>> componentsToUnbind) {
diff --git a/services/core/java/com/android/server/notification/NotificationManagerService.java b/services/core/java/com/android/server/notification/NotificationManagerService.java
index 802dfb1..a3c71c2 100755
--- a/services/core/java/com/android/server/notification/NotificationManagerService.java
+++ b/services/core/java/com/android/server/notification/NotificationManagerService.java
@@ -177,6 +177,7 @@
import android.app.role.OnRoleHoldersChangedListener;
import android.app.role.RoleManager;
import android.app.usage.UsageEvents;
+import android.app.usage.UsageStatsManager;
import android.app.usage.UsageStatsManagerInternal;
import android.companion.ICompanionDeviceManager;
import android.compat.annotation.ChangeId;
@@ -263,6 +264,7 @@
import android.telephony.PhoneStateListener;
import android.telephony.TelephonyManager;
import android.text.TextUtils;
+import android.text.format.DateUtils;
import android.util.ArrayMap;
import android.util.ArraySet;
import android.util.AtomicFile;
@@ -4159,7 +4161,7 @@
String pkg) {
checkCallerIsSystemOrSameApp(pkg);
return mPreferencesHelper.getNotificationChannelGroups(
- pkg, Binder.getCallingUid(), false, false, true);
+ pkg, Binder.getCallingUid(), false, false, true, true, null);
}
@Override
@@ -4280,7 +4282,36 @@
String pkg, int uid, boolean includeDeleted) {
enforceSystemOrSystemUI("getNotificationChannelGroupsForPackage");
return mPreferencesHelper.getNotificationChannelGroups(
- pkg, uid, includeDeleted, true, false);
+ pkg, uid, includeDeleted, true, false, true, null);
+ }
+
+ @Override
+ public ParceledListSlice<NotificationChannelGroup>
+ getRecentBlockedNotificationChannelGroupsForPackage(String pkg, int uid) {
+ enforceSystemOrSystemUI("getRecentBlockedNotificationChannelGroupsForPackage");
+ Set<String> recentlySentChannels = new HashSet<>();
+ long now = System.currentTimeMillis();
+ long startTime = now - (DateUtils.DAY_IN_MILLIS * 14);
+ UsageEvents events = mUsageStatsManagerInternal.queryEventsForUser(
+ UserHandle.getUserId(uid), startTime, now, UsageEvents.SHOW_ALL_EVENT_DATA);
+ // get all channelids that sent notifs in the past 2 weeks
+ if (events != null) {
+ UsageEvents.Event event = new UsageEvents.Event();
+ while (events.hasNextEvent()) {
+ events.getNextEvent(event);
+ if (event.getEventType() == UsageEvents.Event.NOTIFICATION_INTERRUPTION) {
+ if (pkg.equals(event.mPackage)) {
+ String channelId = event.mNotificationChannelId;
+ if (channelId != null) {
+ recentlySentChannels.add(channelId);
+ }
+ }
+ }
+ }
+ }
+
+ return mPreferencesHelper.getNotificationChannelGroups(
+ pkg, uid, false, true, false, true, recentlySentChannels);
}
@Override
diff --git a/services/core/java/com/android/server/notification/PreferencesHelper.java b/services/core/java/com/android/server/notification/PreferencesHelper.java
index b132a23..de698d9 100644
--- a/services/core/java/com/android/server/notification/PreferencesHelper.java
+++ b/services/core/java/com/android/server/notification/PreferencesHelper.java
@@ -1459,9 +1459,9 @@
}
}
- @Override
public ParceledListSlice<NotificationChannelGroup> getNotificationChannelGroups(String pkg,
- int uid, boolean includeDeleted, boolean includeNonGrouped, boolean includeEmpty) {
+ int uid, boolean includeDeleted, boolean includeNonGrouped, boolean includeEmpty,
+ boolean includeBlocked, Set<String> activeChannelFilter) {
Objects.requireNonNull(pkg);
Map<String, NotificationChannelGroup> groups = new ArrayMap<>();
synchronized (mPackagePreferences) {
@@ -1473,7 +1473,11 @@
int N = r.channels.size();
for (int i = 0; i < N; i++) {
final NotificationChannel nc = r.channels.valueAt(i);
- if (includeDeleted || !nc.isDeleted()) {
+ boolean includeChannel = (includeDeleted || !nc.isDeleted())
+ && (activeChannelFilter == null
+ || (includeBlocked && nc.getImportance() == IMPORTANCE_NONE)
+ || activeChannelFilter.contains(nc.getId()));
+ if (includeChannel) {
if (nc.getGroup() != null) {
if (r.groups.get(nc.getGroup()) != null) {
NotificationChannelGroup ncg = groups.get(nc.getGroup());
@@ -1481,7 +1485,6 @@
ncg = r.groups.get(nc.getGroup()).clone();
ncg.setChannels(new ArrayList<>());
groups.put(nc.getGroup(), ncg);
-
}
ncg.addChannel(nc);
}
diff --git a/services/core/java/com/android/server/notification/RankingConfig.java b/services/core/java/com/android/server/notification/RankingConfig.java
index fec3591..8df24c9 100644
--- a/services/core/java/com/android/server/notification/RankingConfig.java
+++ b/services/core/java/com/android/server/notification/RankingConfig.java
@@ -40,8 +40,6 @@
int uid);
void createNotificationChannelGroup(String pkg, int uid, NotificationChannelGroup group,
boolean fromTargetApp, int callingUid, boolean isSystemOrSystemUi);
- ParceledListSlice<NotificationChannelGroup> getNotificationChannelGroups(String pkg,
- int uid, boolean includeDeleted, boolean includeNonGrouped, boolean includeEmpty);
boolean createNotificationChannel(String pkg, int uid, NotificationChannel channel,
boolean fromTargetApp, boolean hasDndAccess, int callingUid,
boolean isSystemOrSystemUi);
diff --git a/services/core/java/com/android/server/om/OverlayManagerService.java b/services/core/java/com/android/server/om/OverlayManagerService.java
index 52eef47..b9464d9 100644
--- a/services/core/java/com/android/server/om/OverlayManagerService.java
+++ b/services/core/java/com/android/server/om/OverlayManagerService.java
@@ -18,9 +18,6 @@
import static android.app.AppGlobals.getPackageManager;
import static android.content.Intent.ACTION_OVERLAY_CHANGED;
-import static android.content.Intent.ACTION_PACKAGE_ADDED;
-import static android.content.Intent.ACTION_PACKAGE_CHANGED;
-import static android.content.Intent.ACTION_PACKAGE_REMOVED;
import static android.content.Intent.ACTION_USER_ADDED;
import static android.content.Intent.ACTION_USER_REMOVED;
import static android.content.Intent.EXTRA_PACKAGE_NAME;
@@ -31,10 +28,10 @@
import static android.content.om.OverlayManagerTransaction.Request.TYPE_SET_ENABLED;
import static android.content.om.OverlayManagerTransaction.Request.TYPE_UNREGISTER_FABRICATED;
import static android.content.pm.PackageManager.SIGNATURE_MATCH;
+import static android.os.Process.INVALID_UID;
import static android.os.Trace.TRACE_TAG_RRO;
import static android.os.Trace.traceBegin;
import static android.os.Trace.traceEnd;
-
import static com.android.server.om.OverlayManagerServiceImpl.OperationFailedException;
import android.annotation.NonNull;
@@ -82,6 +79,7 @@
import android.util.Slog;
import android.util.SparseArray;
+import com.android.internal.content.PackageMonitor;
import com.android.internal.content.om.OverlayConfig;
import com.android.internal.util.ArrayUtils;
import com.android.internal.util.CollectionUtils;
@@ -261,6 +259,8 @@
private final OverlayActorEnforcer mActorEnforcer;
+ private final PackageMonitor mPackageMonitor = new OverlayManagerPackageMonitor();
+
private int mPrevStartedUserId = -1;
public OverlayManagerService(@NonNull final Context context) {
@@ -277,16 +277,9 @@
OverlayConfig.getSystemInstance(), getDefaultOverlayPackages());
mActorEnforcer = new OverlayActorEnforcer(mPackageManager);
- HandlerThread packageReceiverThread = new HandlerThread(TAG);
- packageReceiverThread.start();
-
- final IntentFilter packageFilter = new IntentFilter();
- packageFilter.addAction(ACTION_PACKAGE_ADDED);
- packageFilter.addAction(ACTION_PACKAGE_CHANGED);
- packageFilter.addAction(ACTION_PACKAGE_REMOVED);
- packageFilter.addDataScheme("package");
- getContext().registerReceiverAsUser(new PackageReceiver(), UserHandle.ALL,
- packageFilter, null, packageReceiverThread.getThreadHandler());
+ HandlerThread packageMonitorThread = new HandlerThread(TAG);
+ packageMonitorThread.start();
+ mPackageMonitor.register(context, packageMonitorThread.getLooper(), true);
final IntentFilter userFilter = new IntentFilter();
userFilter.addAction(ACTION_USER_ADDED);
@@ -372,166 +365,171 @@
return defaultPackages.toArray(new String[defaultPackages.size()]);
}
- private final class PackageReceiver extends BroadcastReceiver {
+ private final class OverlayManagerPackageMonitor extends PackageMonitor {
+
@Override
- public void onReceive(@NonNull final Context context, @NonNull final Intent intent) {
- final String action = intent.getAction();
- if (action == null) {
- Slog.e(TAG, "Cannot handle package broadcast with null action");
- return;
- }
- final Uri data = intent.getData();
- if (data == null) {
- Slog.e(TAG, "Cannot handle package broadcast with null data");
- return;
- }
- final String packageName = data.getSchemeSpecificPart();
-
- final boolean replacing = intent.getBooleanExtra(Intent.EXTRA_REPLACING, false);
- final boolean systemUpdateUninstall =
- intent.getBooleanExtra(Intent.EXTRA_SYSTEM_UPDATE_UNINSTALL, false);
-
- final int[] userIds;
- final int extraUid = intent.getIntExtra(Intent.EXTRA_UID, UserHandle.USER_NULL);
- if (extraUid == UserHandle.USER_NULL) {
- userIds = mUserManager.getUserIds();
- } else {
- userIds = new int[] { UserHandle.getUserId(extraUid) };
- }
-
- switch (action) {
- case ACTION_PACKAGE_ADDED:
- if (replacing) {
- onPackageReplaced(packageName, userIds);
- } else {
- onPackageAdded(packageName, userIds);
- }
- break;
- case ACTION_PACKAGE_CHANGED:
- // ignore the intent if it was sent by the package manager as a result of the
- // overlay manager having sent ACTION_OVERLAY_CHANGED
- if (!ACTION_OVERLAY_CHANGED.equals(intent.getStringExtra(EXTRA_REASON))) {
- onPackageChanged(packageName, userIds);
- }
- break;
- case ACTION_PACKAGE_REMOVED:
- if (replacing) {
- onPackageReplacing(packageName, systemUpdateUninstall, userIds);
- } else {
- onPackageRemoved(packageName, userIds);
- }
- break;
- default:
- // do nothing
- break;
- }
+ public void onPackageAppearedWithExtras(String packageName, Bundle extras) {
+ handlePackageAdd(packageName, extras);
}
- private void onPackageAdded(@NonNull final String packageName,
- @NonNull final int[] userIds) {
- try {
- traceBegin(TRACE_TAG_RRO, "OMS#onPackageAdded " + packageName);
- for (final int userId : userIds) {
- synchronized (mLock) {
- var packageState = mPackageManager.onPackageAdded(packageName, userId);
- if (packageState != null && !mPackageManager.isInstantApp(packageName,
- userId)) {
- try {
- updateTargetPackagesLocked(
- mImpl.onPackageAdded(packageName, userId));
- } catch (OperationFailedException e) {
- Slog.e(TAG, "onPackageAdded internal error", e);
- }
+ @Override
+ public void onPackageChangedWithExtras(String packageName, Bundle extras) {
+ handlePackageChange(packageName, extras);
+ }
+
+ @Override
+ public void onPackageDisappearedWithExtras(String packageName, Bundle extras) {
+ handlePackageRemove(packageName, extras);
+ }
+ }
+
+ private int[] getUserIds(int uid) {
+ final int[] userIds;
+ if (uid == INVALID_UID) {
+ userIds = mUserManager.getUserIds();
+ } else {
+ userIds = new int[] { UserHandle.getUserId(uid) };
+ }
+ return userIds;
+ }
+
+ private void handlePackageAdd(String packageName, Bundle extras) {
+ final boolean replacing = extras.getBoolean(Intent.EXTRA_REPLACING, false);
+ final int uid = extras.getInt(Intent.EXTRA_UID, 0);
+ final int[] userIds = getUserIds(uid);
+ if (replacing) {
+ onPackageReplaced(packageName, userIds);
+ } else {
+ onPackageAdded(packageName, userIds);
+ }
+ }
+
+ private void handlePackageChange(String packageName, Bundle extras) {
+ final int uid = extras.getInt(Intent.EXTRA_UID, 0);
+ final int[] userIds = getUserIds(uid);
+ if (!ACTION_OVERLAY_CHANGED.equals(extras.getString(EXTRA_REASON))) {
+ onPackageChanged(packageName, userIds);
+ }
+ }
+
+ private void handlePackageRemove(String packageName, Bundle extras) {
+ final boolean replacing = extras.getBoolean(Intent.EXTRA_REPLACING, false);
+ final boolean systemUpdateUninstall =
+ extras.getBoolean(Intent.EXTRA_SYSTEM_UPDATE_UNINSTALL, false);
+ final int uid = extras.getInt(Intent.EXTRA_UID, 0);
+ final int[] userIds = getUserIds(uid);
+
+ if (replacing) {
+ onPackageReplacing(packageName, systemUpdateUninstall, userIds);
+ } else {
+ onPackageRemoved(packageName, userIds);
+ }
+ }
+
+ private void onPackageAdded(@NonNull final String packageName,
+ @NonNull final int[] userIds) {
+ try {
+ traceBegin(TRACE_TAG_RRO, "OMS#onPackageAdded " + packageName);
+ for (final int userId : userIds) {
+ synchronized (mLock) {
+ var packageState = mPackageManager.onPackageAdded(packageName, userId);
+ if (packageState != null && !mPackageManager.isInstantApp(packageName,
+ userId)) {
+ try {
+ updateTargetPackagesLocked(
+ mImpl.onPackageAdded(packageName, userId));
+ } catch (OperationFailedException e) {
+ Slog.e(TAG, "onPackageAdded internal error", e);
}
}
}
- } finally {
- traceEnd(TRACE_TAG_RRO);
}
+ } finally {
+ traceEnd(TRACE_TAG_RRO);
}
+ }
- private void onPackageChanged(@NonNull final String packageName,
- @NonNull final int[] userIds) {
- try {
- traceBegin(TRACE_TAG_RRO, "OMS#onPackageChanged " + packageName);
- for (int userId : userIds) {
- synchronized (mLock) {
- var packageState = mPackageManager.onPackageUpdated(packageName, userId);
- if (packageState != null && !mPackageManager.isInstantApp(packageName,
- userId)) {
- try {
- updateTargetPackagesLocked(
- mImpl.onPackageChanged(packageName, userId));
- } catch (OperationFailedException e) {
- Slog.e(TAG, "onPackageChanged internal error", e);
- }
+ private void onPackageChanged(@NonNull final String packageName,
+ @NonNull final int[] userIds) {
+ try {
+ traceBegin(TRACE_TAG_RRO, "OMS#onPackageChanged " + packageName);
+ for (int userId : userIds) {
+ synchronized (mLock) {
+ var packageState = mPackageManager.onPackageUpdated(packageName, userId);
+ if (packageState != null && !mPackageManager.isInstantApp(packageName,
+ userId)) {
+ try {
+ updateTargetPackagesLocked(
+ mImpl.onPackageChanged(packageName, userId));
+ } catch (OperationFailedException e) {
+ Slog.e(TAG, "onPackageChanged internal error", e);
}
}
}
- } finally {
- traceEnd(TRACE_TAG_RRO);
}
+ } finally {
+ traceEnd(TRACE_TAG_RRO);
}
+ }
- private void onPackageReplacing(@NonNull final String packageName,
- boolean systemUpdateUninstall, @NonNull final int[] userIds) {
- try {
- traceBegin(TRACE_TAG_RRO, "OMS#onPackageReplacing " + packageName);
- for (int userId : userIds) {
- synchronized (mLock) {
- var packageState = mPackageManager.onPackageUpdated(packageName, userId);
- if (packageState != null && !mPackageManager.isInstantApp(packageName,
- userId)) {
- try {
- updateTargetPackagesLocked(mImpl.onPackageReplacing(packageName,
- systemUpdateUninstall, userId));
- } catch (OperationFailedException e) {
- Slog.e(TAG, "onPackageReplacing internal error", e);
- }
+ private void onPackageReplacing(@NonNull final String packageName,
+ boolean systemUpdateUninstall, @NonNull final int[] userIds) {
+ try {
+ traceBegin(TRACE_TAG_RRO, "OMS#onPackageReplacing " + packageName);
+ for (int userId : userIds) {
+ synchronized (mLock) {
+ var packageState = mPackageManager.onPackageUpdated(packageName, userId);
+ if (packageState != null && !mPackageManager.isInstantApp(packageName,
+ userId)) {
+ try {
+ updateTargetPackagesLocked(mImpl.onPackageReplacing(packageName,
+ systemUpdateUninstall, userId));
+ } catch (OperationFailedException e) {
+ Slog.e(TAG, "onPackageReplacing internal error", e);
}
}
}
- } finally {
- traceEnd(TRACE_TAG_RRO);
}
+ } finally {
+ traceEnd(TRACE_TAG_RRO);
}
+ }
- private void onPackageReplaced(@NonNull final String packageName,
- @NonNull final int[] userIds) {
- try {
- traceBegin(TRACE_TAG_RRO, "OMS#onPackageReplaced " + packageName);
- for (int userId : userIds) {
- synchronized (mLock) {
- var packageState = mPackageManager.onPackageUpdated(packageName, userId);
- if (packageState != null && !mPackageManager.isInstantApp(packageName,
- userId)) {
- try {
- updateTargetPackagesLocked(
- mImpl.onPackageReplaced(packageName, userId));
- } catch (OperationFailedException e) {
- Slog.e(TAG, "onPackageReplaced internal error", e);
- }
+ private void onPackageReplaced(@NonNull final String packageName,
+ @NonNull final int[] userIds) {
+ try {
+ traceBegin(TRACE_TAG_RRO, "OMS#onPackageReplaced " + packageName);
+ for (int userId : userIds) {
+ synchronized (mLock) {
+ var packageState = mPackageManager.onPackageUpdated(packageName, userId);
+ if (packageState != null && !mPackageManager.isInstantApp(packageName,
+ userId)) {
+ try {
+ updateTargetPackagesLocked(
+ mImpl.onPackageReplaced(packageName, userId));
+ } catch (OperationFailedException e) {
+ Slog.e(TAG, "onPackageReplaced internal error", e);
}
}
}
- } finally {
- traceEnd(TRACE_TAG_RRO);
}
+ } finally {
+ traceEnd(TRACE_TAG_RRO);
}
+ }
- private void onPackageRemoved(@NonNull final String packageName,
- @NonNull final int[] userIds) {
- try {
- traceBegin(TRACE_TAG_RRO, "OMS#onPackageRemoved " + packageName);
- for (int userId : userIds) {
- synchronized (mLock) {
- mPackageManager.onPackageRemoved(packageName, userId);
- updateTargetPackagesLocked(mImpl.onPackageRemoved(packageName, userId));
- }
+ private void onPackageRemoved(@NonNull final String packageName,
+ @NonNull final int[] userIds) {
+ try {
+ traceBegin(TRACE_TAG_RRO, "OMS#onPackageRemoved " + packageName);
+ for (int userId : userIds) {
+ synchronized (mLock) {
+ mPackageManager.onPackageRemoved(packageName, userId);
+ updateTargetPackagesLocked(mImpl.onPackageRemoved(packageName, userId));
}
- } finally {
- traceEnd(TRACE_TAG_RRO);
}
+ } finally {
+ traceEnd(TRACE_TAG_RRO);
}
}
@@ -684,7 +682,7 @@
synchronized (mLock) {
try {
mImpl.setEnabledExclusive(
- overlay, false /* withinCategory */, realUserId)
+ overlay, false /* withinCategory */, realUserId)
.ifPresent(
OverlayManagerService.this::updateTargetPackagesLocked);
return true;
diff --git a/services/core/java/com/android/server/pm/InstallPackageHelper.java b/services/core/java/com/android/server/pm/InstallPackageHelper.java
index 486b1ad..e1e5e6d 100644
--- a/services/core/java/com/android/server/pm/InstallPackageHelper.java
+++ b/services/core/java/com/android/server/pm/InstallPackageHelper.java
@@ -998,8 +998,7 @@
return;
}
final boolean isApex = (request.getScanFlags() & SCAN_AS_APEX) != 0;
- final boolean isSdkLibrary = packageToScan.isSdkLibrary();
- if (!isApex && !isSdkLibrary) {
+ if (!isApex) {
createdAppId.put(packageName, optimisticallyRegisterAppId(request));
} else {
request.getScannedPackageSetting().setAppId(Process.INVALID_UID);
diff --git a/services/core/java/com/android/server/speech/RemoteSpeechRecognitionService.java b/services/core/java/com/android/server/speech/RemoteSpeechRecognitionService.java
index 96f4a01..c2666f6 100644
--- a/services/core/java/com/android/server/speech/RemoteSpeechRecognitionService.java
+++ b/services/core/java/com/android/server/speech/RemoteSpeechRecognitionService.java
@@ -297,7 +297,8 @@
return;
}
- for (ClientState clientState : mClients.values()) {
+
+ for (ClientState clientState : mClients.values().toArray(new ClientState[0])) {
tryRespondWithError(
clientState.mDelegatingListener.mRemoteListener,
SpeechRecognizer.ERROR_SERVER_DISCONNECTED);
diff --git a/services/foldables/devicestateprovider/OWNERS b/services/foldables/devicestateprovider/OWNERS
index b2dcd0c..5732844 100644
--- a/services/foldables/devicestateprovider/OWNERS
+++ b/services/foldables/devicestateprovider/OWNERS
@@ -1,6 +1,6 @@
akulian@google.com
-kennethford@google.com
jiamingliu@google.com
kchyn@google.com
+kennethford@google.com
nickchameyev@google.com
nicomazz@google.com
\ No newline at end of file
diff --git a/services/foldables/devicestateprovider/TEST_MAPPING b/services/foldables/devicestateprovider/TEST_MAPPING
index cd0d851..47de131 100644
--- a/services/foldables/devicestateprovider/TEST_MAPPING
+++ b/services/foldables/devicestateprovider/TEST_MAPPING
@@ -1,7 +1,7 @@
{
"presubmit": [
{
- "name": "foldable-services-tests",
+ "name": "foldable-device-state-provider-tests",
"options": [
{
"exclude-annotation": "androidx.test.filters.FlakyTest"
diff --git a/services/foldables/devicestateprovider/tests/AndroidTest.xml b/services/foldables/devicestateprovider/tests/AndroidTest.xml
index 55e0d9c..f5fdac7 100644
--- a/services/foldables/devicestateprovider/tests/AndroidTest.xml
+++ b/services/foldables/devicestateprovider/tests/AndroidTest.xml
@@ -22,7 +22,7 @@
</target_preparer>
<test class="com.android.tradefed.testtype.AndroidJUnitTest">
- <option name="package" value="com.android.foldableslib.tests" />
+ <option name="package" value="com.android.foldablesdevicestatelib.tests" />
<option name="runner" value="androidx.test.runner.AndroidJUnitRunner" />
<option name="hidden-api-checks" value="false" />
</test>
diff --git a/services/tests/servicestests/src/com/android/server/accessibility/AccessibilityServiceConnectionTest.java b/services/tests/servicestests/src/com/android/server/accessibility/AccessibilityServiceConnectionTest.java
index 82b7540..2f0257a 100644
--- a/services/tests/servicestests/src/com/android/server/accessibility/AccessibilityServiceConnectionTest.java
+++ b/services/tests/servicestests/src/com/android/server/accessibility/AccessibilityServiceConnectionTest.java
@@ -39,11 +39,16 @@
import android.content.pm.ParceledListSlice;
import android.content.pm.ResolveInfo;
import android.content.pm.ServiceInfo;
+import android.hardware.display.DisplayManager;
import android.os.IBinder;
import android.os.RemoteException;
import android.os.UserHandle;
+import android.platform.test.annotations.RequiresFlagsEnabled;
+import android.platform.test.flag.junit.CheckFlagsRule;
+import android.platform.test.flag.junit.DeviceFlagsValueProvider;
import android.testing.DexmakerShareClassLoaderRule;
import android.view.Display;
+import android.view.WindowManager;
import com.android.server.accessibility.magnification.MagnificationProcessor;
import com.android.server.accessibility.test.MessageCapturingHandler;
@@ -76,6 +81,9 @@
public final DexmakerShareClassLoaderRule mDexmakerShareClassLoaderRule =
new DexmakerShareClassLoaderRule();
+ @Rule
+ public final CheckFlagsRule mCheckFlagsRule = DeviceFlagsValueProvider.createCheckFlagsRule();
+
AccessibilityServiceConnection mConnection;
@Mock AccessibilityUserState mMockUserState;
@@ -113,6 +121,8 @@
when(mMockIBinder.queryLocalInterface(any())).thenReturn(mMockServiceClient);
when(mMockA11yTrace.isA11yTracingEnabled()).thenReturn(false);
+ when(mMockContext.getSystemService(Context.DISPLAY_SERVICE))
+ .thenReturn(new DisplayManager(mMockContext));
mConnection = new AccessibilityServiceConnection(mMockUserState, mMockContext,
COMPONENT_NAME, mMockServiceInfo, SERVICE_ID, mHandler, new Object(),
@@ -168,6 +178,18 @@
assertFalse(mConnection.getServiceInfo().crashed);
}
+ @Test
+ @RequiresFlagsEnabled(Flags.FLAG_ADD_WINDOW_TOKEN_WITHOUT_LOCK)
+ public void onServiceConnected_addsWindowTokens() {
+ setServiceBinding(COMPONENT_NAME);
+ mConnection.bindLocked();
+ mConnection.onServiceConnected(COMPONENT_NAME, mMockIBinder);
+
+ verify(mMockWindowManagerInternal).addWindowToken(
+ any(), eq(WindowManager.LayoutParams.TYPE_ACCESSIBILITY_OVERLAY),
+ anyInt(), eq(null));
+ }
+
private void setServiceBinding(ComponentName componentName) {
when(mMockUserState.getBindingServicesLocked())
.thenReturn(new HashSet<>(Arrays.asList(componentName)));
diff --git a/services/tests/servicestests/src/com/android/server/accessibility/AccessibilityUserStateTest.java b/services/tests/servicestests/src/com/android/server/accessibility/AccessibilityUserStateTest.java
index b4558b2..63281b7 100644
--- a/services/tests/servicestests/src/com/android/server/accessibility/AccessibilityUserStateTest.java
+++ b/services/tests/servicestests/src/com/android/server/accessibility/AccessibilityUserStateTest.java
@@ -35,6 +35,7 @@
import static junit.framework.Assert.assertNull;
import static junit.framework.Assert.assertTrue;
+import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.verify;
@@ -46,6 +47,9 @@
import android.content.pm.PackageManager;
import android.content.res.Resources;
import android.graphics.Color;
+import android.platform.test.annotations.RequiresFlagsDisabled;
+import android.platform.test.flag.junit.CheckFlagsRule;
+import android.platform.test.flag.junit.DeviceFlagsValueProvider;
import android.provider.Settings;
import android.test.mock.MockContentResolver;
import android.testing.DexmakerShareClassLoaderRule;
@@ -88,6 +92,9 @@
@Rule public final DexmakerShareClassLoaderRule mDexmakerShareClassLoaderRule =
new DexmakerShareClassLoaderRule();
+ @Rule
+ public final CheckFlagsRule mCheckFlagsRule = DeviceFlagsValueProvider.createCheckFlagsRule();
+
@Mock private AccessibilityServiceInfo mMockServiceInfo;
@Mock private AccessibilityServiceConnection mMockConnection;
@@ -188,7 +195,7 @@
mUserState.addServiceLocked(mMockConnection);
- verify(mMockConnection, never()).onAdded();
+ verify(mMockListener, never()).onServiceInfoChangedLocked(any());
}
@Test
@@ -197,13 +204,24 @@
mUserState.addServiceLocked(mMockConnection);
- verify(mMockConnection).onAdded();
assertTrue(mUserState.getBoundServicesLocked().contains(mMockConnection));
assertEquals(mMockConnection, mUserState.mComponentNameToServiceMap.get(COMPONENT_NAME));
verify(mMockListener).onServiceInfoChangedLocked(eq(mUserState));
}
@Test
+ // addServiceLocked only calls addWindowTokensForAllDisplays when
+ // FLAG_ADD_WINDOW_TOKEN_WITHOUT_LOCK is off, so skip the test if it is on.
+ @RequiresFlagsDisabled(Flags.FLAG_ADD_WINDOW_TOKEN_WITHOUT_LOCK)
+ public void addService_flagDisabled_addsWindowTokens() {
+ when(mMockConnection.getComponentName()).thenReturn(COMPONENT_NAME);
+
+ mUserState.addServiceLocked(mMockConnection);
+
+ verify(mMockConnection).addWindowTokensForAllDisplays();
+ }
+
+ @Test
public void reconcileSoftKeyboardMode_whenStateNotMatchSettings_setBothDefault() {
// When soft kb show mode is hidden in settings and is auto in state.
putSecureIntForUser(Settings.Secure.ACCESSIBILITY_SOFT_KEYBOARD_MODE,
diff --git a/services/tests/servicestests/src/com/android/server/accessibility/UiAutomationManagerTest.java b/services/tests/servicestests/src/com/android/server/accessibility/UiAutomationManagerTest.java
index 4ce9ba0..3ee5f61 100644
--- a/services/tests/servicestests/src/com/android/server/accessibility/UiAutomationManagerTest.java
+++ b/services/tests/servicestests/src/com/android/server/accessibility/UiAutomationManagerTest.java
@@ -21,8 +21,11 @@
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
+import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyInt;
+import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.never;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
@@ -36,6 +39,10 @@
import android.content.pm.ServiceInfo;
import android.hardware.display.DisplayManager;
import android.os.IBinder;
+import android.platform.test.annotations.RequiresFlagsEnabled;
+import android.platform.test.flag.junit.CheckFlagsRule;
+import android.platform.test.flag.junit.DeviceFlagsValueProvider;
+import android.view.WindowManager;
import android.view.accessibility.AccessibilityEvent;
import com.android.server.accessibility.test.MessageCapturingHandler;
@@ -43,6 +50,7 @@
import org.junit.After;
import org.junit.Before;
+import org.junit.Rule;
import org.junit.Test;
import org.mockito.ArgumentCaptor;
import org.mockito.Mock;
@@ -58,6 +66,9 @@
MessageCapturingHandler mMessageCapturingHandler;
+ @Rule
+ public final CheckFlagsRule mCheckFlagsRule = DeviceFlagsValueProvider.createCheckFlagsRule();
+
@Mock Context mMockContext;
@Mock AccessibilityServiceInfo mMockServiceInfo;
@Mock ResolveInfo mMockResolveInfo;
@@ -197,6 +208,24 @@
assertEquals(0, mUiAutomationManager.getRequestedEventMaskLocked());
}
+ @Test
+ @RequiresFlagsEnabled(Flags.FLAG_ADD_WINDOW_TOKEN_WITHOUT_LOCK)
+ public void registerUiAutomationService_callsAddWindowTokenUsingHandler() {
+ register(0);
+ // registerUiTestAutomationServiceLocked() should not directly call addWindowToken.
+ verify(mMockWindowManagerInternal, never()).addWindowToken(
+ any(), anyInt(), anyInt(), any());
+
+ // Advance UiAutomationManager#UiAutomationService's handler.
+ mMessageCapturingHandler.sendAllMessages();
+
+ // After advancing the handler we expect addWindowToken to have been called
+ // by the UiAutomationService instance.
+ verify(mMockWindowManagerInternal).addWindowToken(
+ any(), eq(WindowManager.LayoutParams.TYPE_ACCESSIBILITY_OVERLAY),
+ anyInt(), eq(null));
+ }
+
private void register(int flags) {
mUiAutomationManager.registerUiTestAutomationServiceLocked(mMockOwner,
mMockAccessibilityServiceClient, mMockContext, mMockServiceInfo, SERVICE_ID,
diff --git a/services/tests/uiservicestests/src/com/android/server/notification/PreferencesHelperTest.java b/services/tests/uiservicestests/src/com/android/server/notification/PreferencesHelperTest.java
index 020afdb..8d7b5cb 100644
--- a/services/tests/uiservicestests/src/com/android/server/notification/PreferencesHelperTest.java
+++ b/services/tests/uiservicestests/src/com/android/server/notification/PreferencesHelperTest.java
@@ -141,6 +141,7 @@
import com.android.server.notification.PermissionHelper.PackagePermission;
import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableSet;
import com.google.protobuf.InvalidProtocolBufferException;
import org.json.JSONArray;
@@ -563,7 +564,7 @@
mHelper.getNotificationChannel(PKG_N_MR1, UID_N_MR1, channel2.getId(), false));
List<NotificationChannelGroup> actualGroups = mHelper.getNotificationChannelGroups(
- PKG_N_MR1, UID_N_MR1, false, true, false).getList();
+ PKG_N_MR1, UID_N_MR1, false, true, false, true, null).getList();
boolean foundNcg = false;
for (NotificationChannelGroup actual : actualGroups) {
if (ncg.getId().equals(actual.getId())) {
@@ -647,7 +648,7 @@
mHelper.getNotificationChannel(PKG_N_MR1, UID_N_MR1, channel3.getId(), false));
List<NotificationChannelGroup> actualGroups = mHelper.getNotificationChannelGroups(
- PKG_N_MR1, UID_N_MR1, false, true, false).getList();
+ PKG_N_MR1, UID_N_MR1, false, true, false, true, null).getList();
boolean foundNcg = false;
for (NotificationChannelGroup actual : actualGroups) {
if (ncg.getId().equals(actual.getId())) {
@@ -2620,6 +2621,16 @@
}
@Test
+ public void testOnlyHasDefaultChannel() throws Exception {
+ assertTrue(mHelper.onlyHasDefaultChannel(PKG_N_MR1, UID_N_MR1));
+ assertFalse(mHelper.onlyHasDefaultChannel(PKG_O, UID_O));
+
+ mHelper.createNotificationChannel(PKG_N_MR1, UID_N_MR1, getChannel(), true, false,
+ UID_N_MR1, false);
+ assertFalse(mHelper.onlyHasDefaultChannel(PKG_N_MR1, UID_N_MR1));
+ }
+
+ @Test
public void testCreateDeletedChannel() throws Exception {
long[] vibration = new long[]{100, 67, 145, 156};
NotificationChannel channel =
@@ -2644,16 +2655,6 @@
}
@Test
- public void testOnlyHasDefaultChannel() throws Exception {
- assertTrue(mHelper.onlyHasDefaultChannel(PKG_N_MR1, UID_N_MR1));
- assertFalse(mHelper.onlyHasDefaultChannel(PKG_O, UID_O));
-
- mHelper.createNotificationChannel(PKG_N_MR1, UID_N_MR1, getChannel(), true, false,
- UID_N_MR1, false);
- assertFalse(mHelper.onlyHasDefaultChannel(PKG_N_MR1, UID_N_MR1));
- }
-
- @Test
public void testCreateChannel_defaultChannelId() throws Exception {
try {
mHelper.createNotificationChannel(PKG_N_MR1, UID_N_MR1, new NotificationChannel(
@@ -2884,7 +2885,7 @@
UID_N_MR1});
assertEquals(0, mHelper.getNotificationChannelGroups(
- PKG_N_MR1, UID_N_MR1, true, true, false).getList().size());
+ PKG_N_MR1, UID_N_MR1, true, true, false, true, null).getList().size());
}
@Test
@@ -3022,7 +3023,7 @@
UID_N_MR1, false);
List<NotificationChannelGroup> actual = mHelper.getNotificationChannelGroups(
- PKG_N_MR1, UID_N_MR1, true, true, false).getList();
+ PKG_N_MR1, UID_N_MR1, true, true, false, true, null).getList();
assertEquals(3, actual.size());
for (NotificationChannelGroup group : actual) {
if (group.getId() == null) {
@@ -3056,14 +3057,15 @@
channel1.setGroup(ncg.getId());
mHelper.createNotificationChannel(PKG_N_MR1, UID_N_MR1, channel1, true, false,
UID_N_MR1, false);
- mHelper.getNotificationChannelGroups(PKG_N_MR1, UID_N_MR1, true, true, false).getList();
+ mHelper.getNotificationChannelGroups(PKG_N_MR1, UID_N_MR1, true, true, false, true, null)
+ .getList();
channel1.setImportance(IMPORTANCE_LOW);
mHelper.updateNotificationChannel(PKG_N_MR1, UID_N_MR1, channel1, true,
UID_N_MR1, false);
List<NotificationChannelGroup> actual = mHelper.getNotificationChannelGroups(
- PKG_N_MR1, UID_N_MR1, true, true, false).getList();
+ PKG_N_MR1, UID_N_MR1, true, true, false, true, null).getList();
assertEquals(2, actual.size());
for (NotificationChannelGroup group : actual) {
@@ -3089,7 +3091,7 @@
UID_N_MR1, false);
List<NotificationChannelGroup> actual = mHelper.getNotificationChannelGroups(
- PKG_N_MR1, UID_N_MR1, false, false, true).getList();
+ PKG_N_MR1, UID_N_MR1, false, false, true, true, null).getList();
assertEquals(2, actual.size());
for (NotificationChannelGroup group : actual) {
@@ -5786,6 +5788,62 @@
assertFalse(isUserSet);
}
+ @Test
+ public void testGetNotificationChannelGroups_withChannelFilter_includeBlocked() {
+ NotificationChannel channel =
+ new NotificationChannel("id2", "name1", NotificationManager.IMPORTANCE_HIGH);
+ mHelper.createNotificationChannel(PKG_N_MR1, UID_N_MR1, channel, true, false,
+ UID_N_MR1, false);
+ // modifying same object, don't need to call updateNotificationChannel
+ channel.setImportance(IMPORTANCE_NONE);
+
+ NotificationChannel channel2 =
+ new NotificationChannel("id2", "name2", NotificationManager.IMPORTANCE_HIGH);
+ mHelper.createNotificationChannel(PKG_N_MR1, UID_N_MR1, channel2, true, false,
+ UID_N_MR1, false);
+
+ NotificationChannel channel3 =
+ new NotificationChannel("id3", "name3", NotificationManager.IMPORTANCE_HIGH);
+ mHelper.createNotificationChannel(PKG_N_MR1, UID_N_MR1, channel3, true, false,
+ UID_N_MR1, false);
+
+ Set<String> filter = ImmutableSet.of("id3");
+
+ NotificationChannelGroup actual = mHelper.getNotificationChannelGroups(
+ PKG_N_MR1, UID_N_MR1, false, true, false, true, filter).getList().get(0);
+ assertEquals(2, actual.getChannels().size());
+ assertEquals(1, actual.getChannels().stream().filter(c -> c.getId().equals("id3")).count());
+ assertEquals(1, actual.getChannels().stream().filter(c -> c.getId().equals("id2")).count());
+ }
+
+ @Test
+ public void testGetNotificationChannelGroups_withChannelFilter_doNotIncludeBlocked() {
+ NotificationChannel channel =
+ new NotificationChannel("id2", "name1", NotificationManager.IMPORTANCE_HIGH);
+ mHelper.createNotificationChannel(PKG_N_MR1, UID_N_MR1, channel, true, false,
+ UID_N_MR1, false);
+ // modifying same object, don't need to call updateNotificationChannel
+ channel.setImportance(IMPORTANCE_NONE);
+
+ NotificationChannel channel2 =
+ new NotificationChannel("id2", "name2", NotificationManager.IMPORTANCE_HIGH);
+ mHelper.createNotificationChannel(PKG_N_MR1, UID_N_MR1, channel2, true, false,
+ UID_N_MR1, false);
+
+ NotificationChannel channel3 =
+ new NotificationChannel("id3", "name3", NotificationManager.IMPORTANCE_HIGH);
+ mHelper.createNotificationChannel(PKG_N_MR1, UID_N_MR1, channel3, true, false,
+ UID_N_MR1, false);
+
+ Set<String> filter = ImmutableSet.of("id3");
+
+ NotificationChannelGroup actual = mHelper.getNotificationChannelGroups(
+ PKG_N_MR1, UID_N_MR1, false, true, false, false, filter).getList().get(0);
+ assertEquals(1, actual.getChannels().size());
+ assertEquals(1, actual.getChannels().stream().filter(c -> c.getId().equals("id3")).count());
+ assertEquals(0, actual.getChannels().stream().filter(c -> c.getId().equals("id2")).count());
+ }
+
private static NotificationChannel cloneChannel(NotificationChannel original) {
Parcel parcel = Parcel.obtain();
try {
diff --git a/tests/BinderLeakTest/Android.bp b/tests/BinderLeakTest/Android.bp
new file mode 100644
index 0000000..78b0ede
--- /dev/null
+++ b/tests/BinderLeakTest/Android.bp
@@ -0,0 +1,40 @@
+package {
+ // See: http://go/android-license-faq
+ // A large-scale-change added 'default_applicable_licenses' to import
+ // all of the 'license_kinds' from "frameworks_base_license"
+ // to get the below license kinds:
+ // SPDX-license-identifier-Apache-2.0
+ default_applicable_licenses: ["frameworks_base_license"],
+}
+
+filegroup {
+ name: "binder_leak_test_aidl",
+ srcs: ["**/*.aidl"],
+ path: "aidl",
+}
+
+java_defaults {
+ name: "BinderTest.defaults",
+ srcs: [
+ "**/*.java",
+ ":binder_leak_test_aidl",
+ ],
+ static_libs: [
+ "androidx.test.ext.junit",
+ "androidx.test.rules",
+ "androidx.test.runner",
+ ],
+}
+
+// Built with target_sdk_version: current
+android_test {
+ name: "BinderLeakTest",
+ defaults: ["BinderTest.defaults"],
+}
+
+// Built with target_sdk_version: 33
+android_test {
+ name: "BinderLeakTest_legacy",
+ defaults: ["BinderTest.defaults"],
+ manifest: "AndroidManifest_legacy.xml",
+}
diff --git a/tests/BinderLeakTest/AndroidManifest.xml b/tests/BinderLeakTest/AndroidManifest.xml
new file mode 100644
index 0000000..756def7
--- /dev/null
+++ b/tests/BinderLeakTest/AndroidManifest.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.android.test.binder">
+ <application>
+ <service
+ android:name=".MyService"
+ android:enabled="true"
+ android:exported="true"
+ android:process=":service">
+ </service>
+ </application>
+
+ <instrumentation android:name="androidx.test.runner.AndroidJUnitRunner"
+ android:targetPackage="com.android.test.binder"
+ android:label="Binder leak test">
+ </instrumentation>
+</manifest>
diff --git a/tests/BinderLeakTest/AndroidManifest_legacy.xml b/tests/BinderLeakTest/AndroidManifest_legacy.xml
new file mode 100644
index 0000000..03d1dfd
--- /dev/null
+++ b/tests/BinderLeakTest/AndroidManifest_legacy.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.android.test.binder">
+ <uses-sdk android:minSdkVersion="33"
+ android:targetSdkVersion="33"
+ android:maxSdkVersion="33" />
+ <application>
+ <service
+ android:name=".MyService"
+ android:enabled="true"
+ android:exported="true"
+ android:process=":service">
+ </service>
+ </application>
+
+ <instrumentation android:name="androidx.test.runner.AndroidJUnitRunner"
+ android:targetPackage="com.android.test.binder"
+ android:label="Binder leak test">
+ </instrumentation>
+</manifest>
diff --git a/tests/BinderLeakTest/aidl/com/android/test/binder/IFoo.aidl b/tests/BinderLeakTest/aidl/com/android/test/binder/IFoo.aidl
new file mode 100644
index 0000000..a721959
--- /dev/null
+++ b/tests/BinderLeakTest/aidl/com/android/test/binder/IFoo.aidl
@@ -0,0 +1,5 @@
+package com.android.test.binder;
+
+interface IFoo {
+
+}
diff --git a/tests/BinderLeakTest/aidl/com/android/test/binder/IFooProvider.aidl b/tests/BinderLeakTest/aidl/com/android/test/binder/IFooProvider.aidl
new file mode 100644
index 0000000..b487f51
--- /dev/null
+++ b/tests/BinderLeakTest/aidl/com/android/test/binder/IFooProvider.aidl
@@ -0,0 +1,10 @@
+package com.android.test.binder;
+import com.android.test.binder.IFoo;
+
+interface IFooProvider {
+ IFoo createFoo();
+
+ boolean isFooGarbageCollected();
+
+ oneway void killProcess();
+}
diff --git a/tests/BinderLeakTest/java/com/android/test/binder/BinderTest.java b/tests/BinderLeakTest/java/com/android/test/binder/BinderTest.java
new file mode 100644
index 0000000..f07317f
--- /dev/null
+++ b/tests/BinderLeakTest/java/com/android/test/binder/BinderTest.java
@@ -0,0 +1,153 @@
+/*
+ * Copyright (C) 2023 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.test.binder;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotEquals;
+import static org.junit.Assert.assertTrue;
+
+import android.content.Intent;
+import android.os.Build;
+import android.os.IBinder;
+import android.os.RemoteException;
+
+import androidx.test.core.app.ApplicationProvider;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+import androidx.test.rule.ServiceTestRule;
+
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import java.lang.ref.PhantomReference;
+import java.lang.ref.ReferenceQueue;
+import java.util.concurrent.TimeoutException;
+
+@RunWith(AndroidJUnit4.class)
+public class BinderTest {
+ @Rule
+ public final ServiceTestRule serviceRule = new ServiceTestRule();
+
+ @Test
+ public void testDeathRecipientLeaksOrNot()
+ throws RemoteException, TimeoutException, InterruptedException {
+ Intent intent = new Intent(ApplicationProvider.getApplicationContext(), MyService.class);
+ IFooProvider provider = IFooProvider.Stub.asInterface(serviceRule.bindService(intent));
+ FooHolder holder = new FooHolder(provider.createFoo());
+
+ // ref will get enqueued right after holder is finalized for gc.
+ ReferenceQueue<FooHolder> refQueue = new ReferenceQueue<>();
+ PhantomReference<FooHolder> ref = new PhantomReference<>(holder, refQueue);
+
+ DeathRecorder deathRecorder = new DeathRecorder();
+ holder.registerDeathRecorder(deathRecorder);
+
+ if (getSdkVersion() >= Build.VERSION_CODES.VANILLA_ICE_CREAM) {
+ /////////////////////////////////////////////
+ // New behavior
+ //
+ // Reference chain at this moment:
+ // holder --(java strong ref)--> FooHolder
+ // FooHolder.mProxy --(java strong ref)--> IFoo.Proxy
+ // IFoo.Proxy.mRemote --(java strong ref)--> BinderProxy
+ // BinderProxy --(binder ref)--> Foo.Stub
+ // In other words, the variable "holder" is the root of the reference chain.
+
+ // By setting the variable to null, we make FooHolder, IFoo.Proxy, BinderProxy, and even
+ // Foo.Stub unreachable.
+ holder = null;
+
+ // Ensure that the objects are garbage collected
+ forceGc();
+ assertEquals(ref, refQueue.poll());
+ assertTrue(provider.isFooGarbageCollected());
+
+ // The binder has died, but we don't get notified since the death recipient is GC'ed.
+ provider.killProcess();
+ Thread.sleep(1000); // give some time for the service process to die and reaped
+ assertFalse(deathRecorder.deathRecorded);
+ } else {
+ /////////////////////////////////////////////
+ // Legacy behavior
+ //
+ // Reference chain at this moment:
+ // JavaDeathRecipient --(JNI strong ref)--> FooHolder
+ // holder --(java strong ref)--> FooHolder
+ // FooHolder.mProxy --(java strong ref)--> IFoo.Proxy
+ // IFoo.Proxy.mRemote --(java strong ref)--> BinderProxy
+ // BinderProxy --(binder ref)--> Foo.Stub
+ // So, BOTH JavaDeathRecipient and holder are roots of the reference chain.
+
+ // Even if we set holder to null, it doesn't make other objects unreachable; they are
+ // still reachable via the JNI strong ref.
+ holder = null;
+
+ // Check that objects are not garbage collected
+ forceGc();
+ assertNotEquals(ref, refQueue.poll());
+ assertFalse(provider.isFooGarbageCollected());
+
+ // The legacy behavior is getting notified even when there's no reference
+ provider.killProcess();
+ Thread.sleep(1000); // give some time for the service process to die and reaped
+ assertTrue(deathRecorder.deathRecorded);
+ }
+ }
+
+ static class FooHolder implements IBinder.DeathRecipient {
+ private IFoo mProxy;
+ private DeathRecorder mDeathRecorder;
+
+ FooHolder(IFoo proxy) throws RemoteException {
+ proxy.asBinder().linkToDeath(this, 0);
+
+ // A strong reference from DeathRecipient(this) to the binder proxy is created here
+ mProxy = proxy;
+ }
+
+ public void registerDeathRecorder(DeathRecorder dr) {
+ mDeathRecorder = dr;
+ }
+
+ @Override
+ public void binderDied() {
+ if (mDeathRecorder != null) {
+ mDeathRecorder.deathRecorded = true;
+ }
+ }
+ }
+
+ static class DeathRecorder {
+ public boolean deathRecorded = false;
+ }
+
+ // Try calling System.gc() until an orphaned object is confirmed to be finalized
+ private static void forceGc() {
+ Object obj = new Object();
+ ReferenceQueue<Object> refQueue = new ReferenceQueue<>();
+ PhantomReference<Object> ref = new PhantomReference<>(obj, refQueue);
+ obj = null; // make it an orphan
+ while (refQueue.poll() != ref) {
+ System.gc();
+ }
+ }
+
+ private static int getSdkVersion() {
+ return ApplicationProvider.getApplicationContext().getApplicationInfo().targetSdkVersion;
+ }
+}
diff --git a/tests/BinderLeakTest/java/com/android/test/binder/MyService.java b/tests/BinderLeakTest/java/com/android/test/binder/MyService.java
new file mode 100644
index 0000000..c701253
--- /dev/null
+++ b/tests/BinderLeakTest/java/com/android/test/binder/MyService.java
@@ -0,0 +1,63 @@
+/*
+ * Copyright (C) 2023 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.test.binder;
+
+import android.app.Service;
+import android.content.Intent;
+import android.os.IBinder;
+import android.os.RemoteException;
+
+import java.lang.ref.PhantomReference;
+import java.lang.ref.ReferenceQueue;
+
+public class MyService extends Service {
+ @Override
+ public IBinder onBind(Intent intent) {
+ return new IFooProvider.Stub() {
+ ReferenceQueue<IFoo> mRefQueue = new ReferenceQueue<>();
+ PhantomReference<IFoo> mRef;
+
+ @Override
+ public IFoo createFoo() throws RemoteException {
+ IFoo binder = new IFoo.Stub() {};
+ mRef = new PhantomReference<>(binder, mRefQueue);
+ return binder;
+ }
+
+ @Override
+ public boolean isFooGarbageCollected() throws RemoteException {
+ forceGc();
+ return mRefQueue.poll() == mRef;
+ }
+
+ @Override
+ public void killProcess() throws RemoteException {
+ android.os.Process.killProcess(android.os.Process.myPid());
+ }
+ };
+ }
+
+ private static void forceGc() {
+ Object obj = new Object();
+ ReferenceQueue<Object> refQueue = new ReferenceQueue<>();
+ PhantomReference<Object> ref = new PhantomReference<>(obj, refQueue);
+ obj = null; // make it an orphan
+ while (refQueue.poll() != ref) {
+ System.gc();
+ }
+ }
+}
diff --git a/tools/hoststubgen/hoststubgen/test-tiny-framework/golden-output/01-hoststubgen-test-tiny-framework-orig-dump.txt b/tools/hoststubgen/hoststubgen/test-tiny-framework/golden-output/01-hoststubgen-test-tiny-framework-orig-dump.txt
index 1aa4859..0c1d88a 100644
--- a/tools/hoststubgen/hoststubgen/test-tiny-framework/golden-output/01-hoststubgen-test-tiny-framework-orig-dump.txt
+++ b/tools/hoststubgen/hoststubgen/test-tiny-framework/golden-output/01-hoststubgen-test-tiny-framework-orig-dump.txt
@@ -13,11 +13,11 @@
}
SourceFile: "HostSideTestClassLoadHook.java"
RuntimeVisibleAnnotations:
- 0: #x(#x=[e#x.#x])
+ x: #x(#x=[e#x.#x])
java.lang.annotation.Target(
value=[Ljava/lang/annotation/ElementType;.TYPE]
)
- 1: #x(#x=e#x.#x)
+ x: #x(#x=e#x.#x)
java.lang.annotation.Retention(
value=Ljava/lang/annotation/RetentionPolicy;.CLASS
)
@@ -33,11 +33,11 @@
}
SourceFile: "HostSideTestKeep.java"
RuntimeVisibleAnnotations:
- 0: #x(#x=[e#x.#x,e#x.#x,e#x.#x,e#x.#x])
+ x: #x(#x=[e#x.#x,e#x.#x,e#x.#x,e#x.#x])
java.lang.annotation.Target(
value=[Ljava/lang/annotation/ElementType;.TYPE,Ljava/lang/annotation/ElementType;.FIELD,Ljava/lang/annotation/ElementType;.METHOD,Ljava/lang/annotation/ElementType;.CONSTRUCTOR]
)
- 1: #x(#x=e#x.#x)
+ x: #x(#x=e#x.#x)
java.lang.annotation.Retention(
value=Ljava/lang/annotation/RetentionPolicy;.CLASS
)
@@ -56,11 +56,11 @@
}
SourceFile: "HostSideTestNativeSubstitutionClass.java"
RuntimeVisibleAnnotations:
- 0: #x(#x=[e#x.#x])
+ x: #x(#x=[e#x.#x])
java.lang.annotation.Target(
value=[Ljava/lang/annotation/ElementType;.TYPE]
)
- 1: #x(#x=e#x.#x)
+ x: #x(#x=e#x.#x)
java.lang.annotation.Retention(
value=Ljava/lang/annotation/RetentionPolicy;.CLASS
)
@@ -76,11 +76,11 @@
}
SourceFile: "HostSideTestRemove.java"
RuntimeVisibleAnnotations:
- 0: #x(#x=[e#x.#x,e#x.#x,e#x.#x,e#x.#x])
+ x: #x(#x=[e#x.#x,e#x.#x,e#x.#x,e#x.#x])
java.lang.annotation.Target(
value=[Ljava/lang/annotation/ElementType;.TYPE,Ljava/lang/annotation/ElementType;.FIELD,Ljava/lang/annotation/ElementType;.METHOD,Ljava/lang/annotation/ElementType;.CONSTRUCTOR]
)
- 1: #x(#x=e#x.#x)
+ x: #x(#x=e#x.#x)
java.lang.annotation.Retention(
value=Ljava/lang/annotation/RetentionPolicy;.CLASS
)
@@ -96,11 +96,11 @@
}
SourceFile: "HostSideTestStub.java"
RuntimeVisibleAnnotations:
- 0: #x(#x=[e#x.#x,e#x.#x,e#x.#x,e#x.#x])
+ x: #x(#x=[e#x.#x,e#x.#x,e#x.#x,e#x.#x])
java.lang.annotation.Target(
value=[Ljava/lang/annotation/ElementType;.TYPE,Ljava/lang/annotation/ElementType;.FIELD,Ljava/lang/annotation/ElementType;.METHOD,Ljava/lang/annotation/ElementType;.CONSTRUCTOR]
)
- 1: #x(#x=e#x.#x)
+ x: #x(#x=e#x.#x)
java.lang.annotation.Retention(
value=Ljava/lang/annotation/RetentionPolicy;.CLASS
)
@@ -119,11 +119,11 @@
}
SourceFile: "HostSideTestSubstitute.java"
RuntimeVisibleAnnotations:
- 0: #x(#x=[e#x.#x])
+ x: #x(#x=[e#x.#x])
java.lang.annotation.Target(
value=[Ljava/lang/annotation/ElementType;.METHOD]
)
- 1: #x(#x=e#x.#x)
+ x: #x(#x=e#x.#x)
java.lang.annotation.Retention(
value=Ljava/lang/annotation/RetentionPolicy;.CLASS
)
@@ -139,11 +139,11 @@
}
SourceFile: "HostSideTestThrow.java"
RuntimeVisibleAnnotations:
- 0: #x(#x=[e#x.#x,e#x.#x])
+ x: #x(#x=[e#x.#x,e#x.#x])
java.lang.annotation.Target(
value=[Ljava/lang/annotation/ElementType;.METHOD,Ljava/lang/annotation/ElementType;.CONSTRUCTOR]
)
- 1: #x(#x=e#x.#x)
+ x: #x(#x=e#x.#x)
java.lang.annotation.Retention(
value=Ljava/lang/annotation/RetentionPolicy;.CLASS
)
@@ -159,11 +159,11 @@
}
SourceFile: "HostSideTestWholeClassKeep.java"
RuntimeVisibleAnnotations:
- 0: #x(#x=[e#x.#x])
+ x: #x(#x=[e#x.#x])
java.lang.annotation.Target(
value=[Ljava/lang/annotation/ElementType;.TYPE]
)
- 1: #x(#x=e#x.#x)
+ x: #x(#x=e#x.#x)
java.lang.annotation.Retention(
value=Ljava/lang/annotation/RetentionPolicy;.CLASS
)
@@ -179,11 +179,11 @@
}
SourceFile: "HostSideTestWholeClassStub.java"
RuntimeVisibleAnnotations:
- 0: #x(#x=[e#x.#x])
+ x: #x(#x=[e#x.#x])
java.lang.annotation.Target(
value=[Ljava/lang/annotation/ElementType;.TYPE]
)
- 1: #x(#x=e#x.#x)
+ x: #x(#x=e#x.#x)
java.lang.annotation.Retention(
value=Ljava/lang/annotation/RetentionPolicy;.CLASS
)
@@ -199,7 +199,7 @@
}
SourceFile: "HostSideTestSuppress.java"
RuntimeVisibleAnnotations:
- 0: #x(#x=[e#x.#x,e#x.#x,e#x.#x])
+ x: #x(#x=[e#x.#x,e#x.#x,e#x.#x])
java.lang.annotation.Target(
value=[Ljava/lang/annotation/ElementType;.TYPE,Ljava/lang/annotation/ElementType;.FIELD,Ljava/lang/annotation/ElementType;.METHOD]
)
@@ -217,9 +217,9 @@
flags: (0x0002) ACC_PRIVATE
Code:
stack=1, locals=1, args_size=1
- 0: aload_0
- 1: invokespecial #x // Method java/lang/Object."<init>":()V
- 4: return
+ x: aload_0
+ x: invokespecial #x // Method java/lang/Object."<init>":()V
+ x: return
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
@@ -230,11 +230,11 @@
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=1, locals=0, args_size=0
- 0: iconst_1
- 1: ireturn
+ x: iconst_1
+ x: ireturn
LineNumberTable:
RuntimeInvisibleAnnotations:
- 0: #x()
+ x: #x()
android.hosttest.annotation.HostSideTestKeep
public static int getOneStub();
@@ -242,11 +242,11 @@
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=1, locals=0, args_size=0
- 0: iconst_1
- 1: ireturn
+ x: iconst_1
+ x: ireturn
LineNumberTable:
RuntimeInvisibleAnnotations:
- 0: #x()
+ x: #x()
android.hosttest.annotation.HostSideTestStub
}
SourceFile: "TinyFrameworkCallerCheck.java"
@@ -267,9 +267,9 @@
flags: (0x0001) ACC_PUBLIC
Code:
stack=1, locals=1, args_size=1
- 0: aload_0
- 1: invokespecial #x // Method java/lang/Object."<init>":()V
- 4: return
+ x: aload_0
+ x: invokespecial #x // Method java/lang/Object."<init>":()V
+ x: return
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
@@ -280,8 +280,8 @@
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=1, locals=0, args_size=0
- 0: invokestatic #x // Method com/android/hoststubgen/test/tinyframework/TinyFrameworkCallerCheck$Impl.getOneKeep:()I
- 3: ireturn
+ x: invokestatic #x // Method com/android/hoststubgen/test/tinyframework/TinyFrameworkCallerCheck$Impl.getOneKeep:()I
+ x: ireturn
LineNumberTable:
public static int getOne_noCheck();
@@ -289,13 +289,13 @@
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=1, locals=0, args_size=0
- 0: invokestatic #x // Method com/android/hoststubgen/test/tinyframework/TinyFrameworkCallerCheck$Impl.getOneStub:()I
- 3: ireturn
+ x: invokestatic #x // Method com/android/hoststubgen/test/tinyframework/TinyFrameworkCallerCheck$Impl.getOneStub:()I
+ x: ireturn
LineNumberTable:
}
SourceFile: "TinyFrameworkCallerCheck.java"
RuntimeInvisibleAnnotations:
- 0: #x()
+ x: #x()
android.hosttest.annotation.HostSideTestWholeClassStub
NestMembers:
com/android/hoststubgen/test/tinyframework/TinyFrameworkCallerCheck$Impl
@@ -314,14 +314,14 @@
descriptor: I
flags: (0x0001) ACC_PUBLIC
RuntimeInvisibleAnnotations:
- 0: #x()
+ x: #x()
android.hosttest.annotation.HostSideTestStub
public int keep;
descriptor: I
flags: (0x0001) ACC_PUBLIC
RuntimeInvisibleAnnotations:
- 0: #x()
+ x: #x()
android.hosttest.annotation.HostSideTestKeep
public int remove;
@@ -333,21 +333,21 @@
flags: (0x0001) ACC_PUBLIC
Code:
stack=2, locals=1, args_size=1
- 0: aload_0
- 1: invokespecial #x // Method java/lang/Object."<init>":()V
- 4: aload_0
- 5: iconst_1
- 6: putfield #x // Field stub:I
- 9: aload_0
- 10: iconst_2
- 11: putfield #x // Field keep:I
- 14: return
+ x: aload_0
+ x: invokespecial #x // Method java/lang/Object."<init>":()V
+ x: aload_0
+ x: iconst_1
+ x: putfield #x // Field stub:I
+ x: aload_0
+ x: iconst_2
+ x: putfield #x // Field keep:I
+ x: return
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
0 15 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkClassAnnotations;
RuntimeInvisibleAnnotations:
- 0: #x()
+ x: #x()
android.hosttest.annotation.HostSideTestStub
public int addOne(int);
@@ -355,17 +355,17 @@
flags: (0x0001) ACC_PUBLIC
Code:
stack=2, locals=2, args_size=2
- 0: aload_0
- 1: iload_1
- 2: invokevirtual #x // Method addOneInner:(I)I
- 5: ireturn
+ x: aload_0
+ x: iload_1
+ x: invokevirtual #x // Method addOneInner:(I)I
+ x: ireturn
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
0 6 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkClassAnnotations;
0 6 1 value I
RuntimeInvisibleAnnotations:
- 0: #x()
+ x: #x()
android.hosttest.annotation.HostSideTestStub
public int addOneInner(int);
@@ -373,17 +373,17 @@
flags: (0x0001) ACC_PUBLIC
Code:
stack=2, locals=2, args_size=2
- 0: iload_1
- 1: iconst_1
- 2: iadd
- 3: ireturn
+ x: iload_1
+ x: iconst_1
+ x: iadd
+ x: ireturn
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
0 4 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkClassAnnotations;
0 4 1 value I
RuntimeInvisibleAnnotations:
- 0: #x()
+ x: #x()
android.hosttest.annotation.HostSideTestKeep
public void toBeRemoved(java.lang.String);
@@ -391,17 +391,17 @@
flags: (0x0001) ACC_PUBLIC
Code:
stack=2, locals=2, args_size=2
- 0: new #x // class java/lang/RuntimeException
- 3: dup
- 4: invokespecial #x // Method java/lang/RuntimeException."<init>":()V
- 7: athrow
+ x: new #x // class java/lang/RuntimeException
+ x: dup
+ x: invokespecial #x // Method java/lang/RuntimeException."<init>":()V
+ x: athrow
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
0 8 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkClassAnnotations;
0 8 1 foo Ljava/lang/String;
RuntimeInvisibleAnnotations:
- 0: #x()
+ x: #x()
android.hosttest.annotation.HostSideTestRemove
public int addTwo(int);
@@ -409,20 +409,20 @@
flags: (0x0001) ACC_PUBLIC
Code:
stack=3, locals=2, args_size=2
- 0: new #x // class java/lang/RuntimeException
- 3: dup
- 4: ldc #x // String not supported on host side
- 6: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
- 9: athrow
+ x: new #x // class java/lang/RuntimeException
+ x: dup
+ x: ldc #x // String not supported on host side
+ x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
+ x: athrow
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
0 10 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkClassAnnotations;
0 10 1 value I
RuntimeInvisibleAnnotations:
- 0: #x()
+ x: #x()
android.hosttest.annotation.HostSideTestStub
- 1: #x(#x=s#x)
+ x: #x(#x=s#x)
android.hosttest.annotation.HostSideTestSubstitute(
suffix="_host"
)
@@ -432,10 +432,10 @@
flags: (0x0001) ACC_PUBLIC
Code:
stack=2, locals=2, args_size=2
- 0: iload_1
- 1: iconst_2
- 2: iadd
- 3: ireturn
+ x: iload_1
+ x: iconst_2
+ x: iadd
+ x: ireturn
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
@@ -446,9 +446,9 @@
descriptor: (I)I
flags: (0x0109) ACC_PUBLIC, ACC_STATIC, ACC_NATIVE
RuntimeInvisibleAnnotations:
- 0: #x()
+ x: #x()
android.hosttest.annotation.HostSideTestStub
- 1: #x(#x=s#x)
+ x: #x(#x=s#x)
android.hosttest.annotation.HostSideTestSubstitute(
suffix="_host"
)
@@ -458,10 +458,10 @@
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=2, locals=1, args_size=1
- 0: iload_0
- 1: iconst_3
- 2: iadd
- 3: ireturn
+ x: iload_0
+ x: iconst_3
+ x: iadd
+ x: ireturn
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
@@ -472,14 +472,14 @@
flags: (0x0001) ACC_PUBLIC
Code:
stack=1, locals=1, args_size=1
- 0: ldc #x // String This value shouldn\'t be seen on the host side.
- 2: areturn
+ x: ldc #x // String This value shouldn\'t be seen on the host side.
+ x: areturn
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
0 3 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkClassAnnotations;
RuntimeInvisibleAnnotations:
- 0: #x()
+ x: #x()
android.hosttest.annotation.HostSideTestThrow
public java.lang.String visibleButUsesUnsupportedMethod();
@@ -487,22 +487,22 @@
flags: (0x0001) ACC_PUBLIC
Code:
stack=1, locals=1, args_size=1
- 0: aload_0
- 1: invokevirtual #x // Method unsupportedMethod:()Ljava/lang/String;
- 4: areturn
+ x: aload_0
+ x: invokevirtual #x // Method unsupportedMethod:()Ljava/lang/String;
+ x: areturn
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
0 5 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkClassAnnotations;
RuntimeInvisibleAnnotations:
- 0: #x()
+ x: #x()
android.hosttest.annotation.HostSideTestStub
}
SourceFile: "TinyFrameworkClassAnnotations.java"
RuntimeInvisibleAnnotations:
- 0: #x()
+ x: #x()
android.hosttest.annotation.HostSideTestStub
- 1: #x(#x=s#x)
+ x: #x(#x=s#x)
android.hosttest.annotation.HostSideTestClassLoadHook(
value="com.android.hoststubgen.test.tinyframework.TinyFrameworkClassLoadHook.onClassLoaded"
)
@@ -532,15 +532,15 @@
flags: (0x0001) ACC_PUBLIC
Code:
stack=2, locals=1, args_size=1
- 0: aload_0
- 1: invokespecial #x // Method java/lang/Object."<init>":()V
- 4: aload_0
- 5: iconst_1
- 6: putfield #x // Field stub:I
- 9: aload_0
- 10: iconst_2
- 11: putfield #x // Field keep:I
- 14: return
+ x: aload_0
+ x: invokespecial #x // Method java/lang/Object."<init>":()V
+ x: aload_0
+ x: iconst_1
+ x: putfield #x // Field stub:I
+ x: aload_0
+ x: iconst_2
+ x: putfield #x // Field keep:I
+ x: return
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
@@ -551,10 +551,10 @@
flags: (0x0001) ACC_PUBLIC
Code:
stack=2, locals=2, args_size=2
- 0: aload_0
- 1: iload_1
- 2: invokevirtual #x // Method addOneInner:(I)I
- 5: ireturn
+ x: aload_0
+ x: iload_1
+ x: invokevirtual #x // Method addOneInner:(I)I
+ x: ireturn
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
@@ -566,10 +566,10 @@
flags: (0x0001) ACC_PUBLIC
Code:
stack=2, locals=2, args_size=2
- 0: iload_1
- 1: iconst_1
- 2: iadd
- 3: ireturn
+ x: iload_1
+ x: iconst_1
+ x: iadd
+ x: ireturn
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
@@ -581,10 +581,10 @@
flags: (0x0001) ACC_PUBLIC
Code:
stack=2, locals=2, args_size=2
- 0: new #x // class java/lang/RuntimeException
- 3: dup
- 4: invokespecial #x // Method java/lang/RuntimeException."<init>":()V
- 7: athrow
+ x: new #x // class java/lang/RuntimeException
+ x: dup
+ x: invokespecial #x // Method java/lang/RuntimeException."<init>":()V
+ x: athrow
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
@@ -596,20 +596,20 @@
flags: (0x0001) ACC_PUBLIC
Code:
stack=3, locals=2, args_size=2
- 0: new #x // class java/lang/RuntimeException
- 3: dup
- 4: ldc #x // String not supported on host side
- 6: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
- 9: athrow
+ x: new #x // class java/lang/RuntimeException
+ x: dup
+ x: ldc #x // String not supported on host side
+ x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
+ x: athrow
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
0 10 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkClassClassWideAnnotations;
0 10 1 value I
RuntimeInvisibleAnnotations:
- 0: #x()
+ x: #x()
android.hosttest.annotation.HostSideTestStub
- 1: #x(#x=s#x)
+ x: #x(#x=s#x)
android.hosttest.annotation.HostSideTestSubstitute(
suffix="_host"
)
@@ -619,10 +619,10 @@
flags: (0x0001) ACC_PUBLIC
Code:
stack=2, locals=2, args_size=2
- 0: iload_1
- 1: iconst_2
- 2: iadd
- 3: ireturn
+ x: iload_1
+ x: iconst_2
+ x: iadd
+ x: ireturn
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
@@ -633,9 +633,9 @@
descriptor: (I)I
flags: (0x0109) ACC_PUBLIC, ACC_STATIC, ACC_NATIVE
RuntimeInvisibleAnnotations:
- 0: #x()
+ x: #x()
android.hosttest.annotation.HostSideTestStub
- 1: #x(#x=s#x)
+ x: #x(#x=s#x)
android.hosttest.annotation.HostSideTestSubstitute(
suffix="_host"
)
@@ -645,10 +645,10 @@
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=2, locals=1, args_size=1
- 0: iload_0
- 1: iconst_3
- 2: iadd
- 3: ireturn
+ x: iload_0
+ x: iconst_3
+ x: iadd
+ x: ireturn
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
@@ -659,8 +659,8 @@
flags: (0x0001) ACC_PUBLIC
Code:
stack=1, locals=1, args_size=1
- 0: ldc #x // String This value shouldn\'t be seen on the host side.
- 2: areturn
+ x: ldc #x // String This value shouldn\'t be seen on the host side.
+ x: areturn
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
@@ -671,9 +671,9 @@
flags: (0x0001) ACC_PUBLIC
Code:
stack=1, locals=1, args_size=1
- 0: aload_0
- 1: invokevirtual #x // Method unsupportedMethod:()Ljava/lang/String;
- 4: areturn
+ x: aload_0
+ x: invokevirtual #x // Method unsupportedMethod:()Ljava/lang/String;
+ x: areturn
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
@@ -681,7 +681,7 @@
}
SourceFile: "TinyFrameworkClassClassWideAnnotations.java"
RuntimeInvisibleAnnotations:
- 0: #x()
+ x: #x()
android.hosttest.annotation.HostSideTestWholeClassStub
## Class: com/android/hoststubgen/test/tinyframework/TinyFrameworkClassLoadHook.class
Compiled from "TinyFrameworkClassLoadHook.java"
@@ -702,9 +702,9 @@
flags: (0x0002) ACC_PRIVATE
Code:
stack=1, locals=1, args_size=1
- 0: aload_0
- 1: invokespecial #x // Method java/lang/Object."<init>":()V
- 4: return
+ x: aload_0
+ x: invokespecial #x // Method java/lang/Object."<init>":()V
+ x: return
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
@@ -715,11 +715,11 @@
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=2, locals=1, args_size=1
- 0: getstatic #x // Field sLoadedClasses:Ljava/util/Set;
- 3: aload_0
- 4: invokeinterface #x, 2 // InterfaceMethod java/util/Set.add:(Ljava/lang/Object;)Z
- 9: pop
- 10: return
+ x: getstatic #x // Field sLoadedClasses:Ljava/util/Set;
+ x: aload_0
+ x: invokeinterface #x, 2 // InterfaceMethod java/util/Set.add:(Ljava/lang/Object;)Z
+ x: pop
+ x: return
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
@@ -734,16 +734,16 @@
flags: (0x0008) ACC_STATIC
Code:
stack=2, locals=0, args_size=0
- 0: new #x // class java/util/HashSet
- 3: dup
- 4: invokespecial #x // Method java/util/HashSet."<init>":()V
- 7: putstatic #x // Field sLoadedClasses:Ljava/util/Set;
- 10: return
+ x: new #x // class java/util/HashSet
+ x: dup
+ x: invokespecial #x // Method java/util/HashSet."<init>":()V
+ x: putstatic #x // Field sLoadedClasses:Ljava/util/Set;
+ x: return
LineNumberTable:
}
SourceFile: "TinyFrameworkClassLoadHook.java"
RuntimeInvisibleAnnotations:
- 0: #x()
+ x: #x()
android.hosttest.annotation.HostSideTestWholeClassStub
## Class: com/android/hoststubgen/test/tinyframework/TinyFrameworkClassWithInitializer.class
Compiled from "TinyFrameworkClassWithInitializer.java"
@@ -763,9 +763,9 @@
flags: (0x0001) ACC_PUBLIC
Code:
stack=1, locals=1, args_size=1
- 0: aload_0
- 1: invokespecial #x // Method java/lang/Object."<init>":()V
- 4: return
+ x: aload_0
+ x: invokespecial #x // Method java/lang/Object."<init>":()V
+ x: return
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
@@ -776,18 +776,18 @@
flags: (0x0008) ACC_STATIC
Code:
stack=1, locals=0, args_size=0
- 0: iconst_1
- 1: putstatic #x // Field sInitialized:Z
- 4: return
+ x: iconst_1
+ x: putstatic #x // Field sInitialized:Z
+ x: return
LineNumberTable:
}
SourceFile: "TinyFrameworkClassWithInitializer.java"
RuntimeInvisibleAnnotations:
- 0: #x(#x=s#x)
+ x: #x(#x=s#x)
android.hosttest.annotation.HostSideTestClassLoadHook(
value="com.android.hoststubgen.test.tinyframework.TinyFrameworkClassLoadHook.onClassLoaded"
)
- 1: #x()
+ x: #x()
android.hosttest.annotation.HostSideTestWholeClassStub
## Class: com/android/hoststubgen/test/tinyframework/TinyFrameworkExceptionTester.class
Compiled from "TinyFrameworkExceptionTester.java"
@@ -803,9 +803,9 @@
flags: (0x0001) ACC_PUBLIC
Code:
stack=1, locals=1, args_size=1
- 0: aload_0
- 1: invokespecial #x // Method java/lang/Object."<init>":()V
- 4: return
+ x: aload_0
+ x: invokespecial #x // Method java/lang/Object."<init>":()V
+ x: return
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
@@ -816,18 +816,18 @@
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=4, locals=1, args_size=0
- 0: new #x // class java/lang/IllegalStateException
- 3: dup
- 4: ldc #x // String Inner exception
- 6: invokespecial #x // Method java/lang/IllegalStateException."<init>":(Ljava/lang/String;)V
- 9: athrow
- 10: astore_0
- 11: new #x // class java/lang/RuntimeException
- 14: dup
- 15: ldc #x // String Outer exception
- 17: aload_0
- 18: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;Ljava/lang/Throwable;)V
- 21: athrow
+ x: new #x // class java/lang/IllegalStateException
+ x: dup
+ x: ldc #x // String Inner exception
+ x: invokespecial #x // Method java/lang/IllegalStateException."<init>":(Ljava/lang/String;)V
+ x: athrow
+ x: astore_0
+ x: new #x // class java/lang/RuntimeException
+ x: dup
+ x: ldc #x // String Outer exception
+ x: aload_0
+ x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;Ljava/lang/Throwable;)V
+ x: athrow
Exception table:
from to target type
0 10 10 Class java/lang/Exception
@@ -841,7 +841,7 @@
}
SourceFile: "TinyFrameworkExceptionTester.java"
RuntimeInvisibleAnnotations:
- 0: #x()
+ x: #x()
android.hosttest.annotation.HostSideTestWholeClassStub
## Class: com/android/hoststubgen/test/tinyframework/TinyFrameworkForTextPolicy.class
Compiled from "TinyFrameworkForTextPolicy.java"
@@ -869,15 +869,15 @@
flags: (0x0001) ACC_PUBLIC
Code:
stack=2, locals=1, args_size=1
- 0: aload_0
- 1: invokespecial #x // Method java/lang/Object."<init>":()V
- 4: aload_0
- 5: iconst_1
- 6: putfield #x // Field stub:I
- 9: aload_0
- 10: iconst_2
- 11: putfield #x // Field keep:I
- 14: return
+ x: aload_0
+ x: invokespecial #x // Method java/lang/Object."<init>":()V
+ x: aload_0
+ x: iconst_1
+ x: putfield #x // Field stub:I
+ x: aload_0
+ x: iconst_2
+ x: putfield #x // Field keep:I
+ x: return
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
@@ -888,10 +888,10 @@
flags: (0x0001) ACC_PUBLIC
Code:
stack=2, locals=2, args_size=2
- 0: aload_0
- 1: iload_1
- 2: invokevirtual #x // Method addOneInner:(I)I
- 5: ireturn
+ x: aload_0
+ x: iload_1
+ x: invokevirtual #x // Method addOneInner:(I)I
+ x: ireturn
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
@@ -903,10 +903,10 @@
flags: (0x0001) ACC_PUBLIC
Code:
stack=2, locals=2, args_size=2
- 0: iload_1
- 1: iconst_1
- 2: iadd
- 3: ireturn
+ x: iload_1
+ x: iconst_1
+ x: iadd
+ x: ireturn
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
@@ -918,10 +918,10 @@
flags: (0x0001) ACC_PUBLIC
Code:
stack=2, locals=2, args_size=2
- 0: new #x // class java/lang/RuntimeException
- 3: dup
- 4: invokespecial #x // Method java/lang/RuntimeException."<init>":()V
- 7: athrow
+ x: new #x // class java/lang/RuntimeException
+ x: dup
+ x: invokespecial #x // Method java/lang/RuntimeException."<init>":()V
+ x: athrow
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
@@ -933,11 +933,11 @@
flags: (0x0001) ACC_PUBLIC
Code:
stack=3, locals=2, args_size=2
- 0: new #x // class java/lang/RuntimeException
- 3: dup
- 4: ldc #x // String not supported on host side
- 6: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
- 9: athrow
+ x: new #x // class java/lang/RuntimeException
+ x: dup
+ x: ldc #x // String not supported on host side
+ x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
+ x: athrow
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
@@ -949,10 +949,10 @@
flags: (0x0001) ACC_PUBLIC
Code:
stack=2, locals=2, args_size=2
- 0: iload_1
- 1: iconst_2
- 2: iadd
- 3: ireturn
+ x: iload_1
+ x: iconst_2
+ x: iadd
+ x: ireturn
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
@@ -968,10 +968,10 @@
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=2, locals=1, args_size=1
- 0: iload_0
- 1: iconst_3
- 2: iadd
- 3: ireturn
+ x: iload_0
+ x: iconst_3
+ x: iadd
+ x: ireturn
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
@@ -982,8 +982,8 @@
flags: (0x0001) ACC_PUBLIC
Code:
stack=1, locals=1, args_size=1
- 0: ldc #x // String This value shouldn\'t be seen on the host side.
- 2: areturn
+ x: ldc #x // String This value shouldn\'t be seen on the host side.
+ x: areturn
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
@@ -994,9 +994,9 @@
flags: (0x0001) ACC_PUBLIC
Code:
stack=1, locals=1, args_size=1
- 0: aload_0
- 1: invokevirtual #x // Method unsupportedMethod:()Ljava/lang/String;
- 4: areturn
+ x: aload_0
+ x: invokevirtual #x // Method unsupportedMethod:()Ljava/lang/String;
+ x: areturn
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
@@ -1017,9 +1017,9 @@
flags: (0x0001) ACC_PUBLIC
Code:
stack=1, locals=1, args_size=1
- 0: aload_0
- 1: invokespecial #x // Method java/lang/Object."<init>":()V
- 4: return
+ x: aload_0
+ x: invokespecial #x // Method java/lang/Object."<init>":()V
+ x: return
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
@@ -1034,9 +1034,9 @@
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=1, locals=1, args_size=1
- 0: iload_0
- 1: invokestatic #x // Method com/android/hoststubgen/test/tinyframework/TinyFrameworkNative_host.nativeAddTwo:(I)I
- 4: ireturn
+ x: iload_0
+ x: invokestatic #x // Method com/android/hoststubgen/test/tinyframework/TinyFrameworkNative_host.nativeAddTwo:(I)I
+ x: ireturn
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
@@ -1051,10 +1051,10 @@
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=4, locals=4, args_size=2
- 0: lload_0
- 1: lload_2
- 2: invokestatic #x // Method com/android/hoststubgen/test/tinyframework/TinyFrameworkNative_host.nativeLongPlus:(JJ)J
- 5: lreturn
+ x: lload_0
+ x: lload_2
+ x: invokestatic #x // Method com/android/hoststubgen/test/tinyframework/TinyFrameworkNative_host.nativeLongPlus:(JJ)J
+ x: lreturn
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
@@ -1063,9 +1063,9 @@
}
SourceFile: "TinyFrameworkNative.java"
RuntimeInvisibleAnnotations:
- 0: #x()
+ x: #x()
android.hosttest.annotation.HostSideTestWholeClassStub
- 1: #x(#x=s#x)
+ x: #x(#x=s#x)
android.hosttest.annotation.HostSideTestNativeSubstitutionClass(
value="TinyFrameworkNative_host"
)
@@ -1083,9 +1083,9 @@
flags: (0x0001) ACC_PUBLIC
Code:
stack=1, locals=1, args_size=1
- 0: aload_0
- 1: invokespecial #x // Method java/lang/Object."<init>":()V
- 4: return
+ x: aload_0
+ x: invokespecial #x // Method java/lang/Object."<init>":()V
+ x: return
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
@@ -1096,10 +1096,10 @@
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=2, locals=1, args_size=1
- 0: iload_0
- 1: iconst_2
- 2: iadd
- 3: ireturn
+ x: iload_0
+ x: iconst_2
+ x: iadd
+ x: ireturn
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
@@ -1110,10 +1110,10 @@
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=4, locals=4, args_size=2
- 0: lload_0
- 1: lload_2
- 2: ladd
- 3: lreturn
+ x: lload_0
+ x: lload_2
+ x: ladd
+ x: lreturn
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
@@ -1122,7 +1122,7 @@
}
SourceFile: "TinyFrameworkNative_host.java"
RuntimeInvisibleAnnotations:
- 0: #x()
+ x: #x()
android.hosttest.annotation.HostSideTestWholeClassKeep
## Class: com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$1.class
Compiled from "TinyFrameworkNestedClasses.java"
@@ -1142,12 +1142,12 @@
flags: (0x0000)
Code:
stack=2, locals=2, args_size=2
- 0: aload_0
- 1: aload_1
- 2: putfield #x // Field this$0:Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses;
- 5: aload_0
- 6: invokespecial #x // Method java/lang/Object."<init>":()V
- 9: return
+ x: aload_0
+ x: aload_1
+ x: putfield #x // Field this$0:Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses;
+ x: aload_0
+ x: invokespecial #x // Method java/lang/Object."<init>":()V
+ x: return
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
@@ -1159,9 +1159,9 @@
flags: (0x0001) ACC_PUBLIC
Code:
stack=1, locals=1, args_size=1
- 0: iconst_1
- 1: invokestatic #x // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
- 4: areturn
+ x: iconst_1
+ x: invokestatic #x // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
+ x: areturn
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
@@ -1172,9 +1172,9 @@
flags: (0x1041) ACC_PUBLIC, ACC_BRIDGE, ACC_SYNTHETIC
Code:
stack=1, locals=1, args_size=1
- 0: aload_0
- 1: invokevirtual #x // Method get:()Ljava/lang/Integer;
- 4: areturn
+ x: aload_0
+ x: invokevirtual #x // Method get:()Ljava/lang/Integer;
+ x: areturn
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
@@ -1200,9 +1200,9 @@
flags: (0x0000)
Code:
stack=1, locals=1, args_size=1
- 0: aload_0
- 1: invokespecial #x // Method java/lang/Object."<init>":()V
- 4: return
+ x: aload_0
+ x: invokespecial #x // Method java/lang/Object."<init>":()V
+ x: return
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
@@ -1213,9 +1213,9 @@
flags: (0x0001) ACC_PUBLIC
Code:
stack=1, locals=1, args_size=1
- 0: iconst_2
- 1: invokestatic #x // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
- 4: areturn
+ x: iconst_2
+ x: invokestatic #x // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
+ x: areturn
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
@@ -1226,9 +1226,9 @@
flags: (0x1041) ACC_PUBLIC, ACC_BRIDGE, ACC_SYNTHETIC
Code:
stack=1, locals=1, args_size=1
- 0: aload_0
- 1: invokevirtual #x // Method get:()Ljava/lang/Integer;
- 4: areturn
+ x: aload_0
+ x: invokevirtual #x // Method get:()Ljava/lang/Integer;
+ x: areturn
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
@@ -1258,12 +1258,12 @@
flags: (0x0000)
Code:
stack=2, locals=2, args_size=2
- 0: aload_0
- 1: aload_1
- 2: putfield #x // Field this$0:Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses;
- 5: aload_0
- 6: invokespecial #x // Method java/lang/Object."<init>":()V
- 9: return
+ x: aload_0
+ x: aload_1
+ x: putfield #x // Field this$0:Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses;
+ x: aload_0
+ x: invokespecial #x // Method java/lang/Object."<init>":()V
+ x: return
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
@@ -1275,9 +1275,9 @@
flags: (0x0001) ACC_PUBLIC
Code:
stack=1, locals=1, args_size=1
- 0: iconst_3
- 1: invokestatic #x // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
- 4: areturn
+ x: iconst_3
+ x: invokestatic #x // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
+ x: areturn
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
@@ -1288,9 +1288,9 @@
flags: (0x1041) ACC_PUBLIC, ACC_BRIDGE, ACC_SYNTHETIC
Code:
stack=1, locals=1, args_size=1
- 0: aload_0
- 1: invokevirtual #x // Method get:()Ljava/lang/Integer;
- 4: areturn
+ x: aload_0
+ x: invokevirtual #x // Method get:()Ljava/lang/Integer;
+ x: areturn
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
@@ -1316,9 +1316,9 @@
flags: (0x0000)
Code:
stack=1, locals=1, args_size=1
- 0: aload_0
- 1: invokespecial #x // Method java/lang/Object."<init>":()V
- 4: return
+ x: aload_0
+ x: invokespecial #x // Method java/lang/Object."<init>":()V
+ x: return
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
@@ -1329,9 +1329,9 @@
flags: (0x0001) ACC_PUBLIC
Code:
stack=1, locals=1, args_size=1
- 0: iconst_4
- 1: invokestatic #x // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
- 4: areturn
+ x: iconst_4
+ x: invokestatic #x // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
+ x: areturn
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
@@ -1342,9 +1342,9 @@
flags: (0x1041) ACC_PUBLIC, ACC_BRIDGE, ACC_SYNTHETIC
Code:
stack=1, locals=1, args_size=1
- 0: aload_0
- 1: invokevirtual #x // Method get:()Ljava/lang/Integer;
- 4: areturn
+ x: aload_0
+ x: invokevirtual #x // Method get:()Ljava/lang/Integer;
+ x: areturn
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
@@ -1374,12 +1374,12 @@
flags: (0x0001) ACC_PUBLIC
Code:
stack=2, locals=2, args_size=2
- 0: aload_0
- 1: invokespecial #x // Method java/lang/Object."<init>":()V
- 4: aload_0
- 5: iload_1
- 6: putfield #x // Field value:I
- 9: return
+ x: aload_0
+ x: invokespecial #x // Method java/lang/Object."<init>":()V
+ x: aload_0
+ x: iload_1
+ x: putfield #x // Field value:I
+ x: return
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
@@ -1412,15 +1412,15 @@
flags: (0x0001) ACC_PUBLIC
Code:
stack=2, locals=2, args_size=2
- 0: aload_0
- 1: aload_1
- 2: putfield #x // Field this$0:Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses;
- 5: aload_0
- 6: invokespecial #x // Method java/lang/Object."<init>":()V
- 9: aload_0
- 10: iconst_5
- 11: putfield #x // Field value:I
- 14: return
+ x: aload_0
+ x: aload_1
+ x: putfield #x // Field this$0:Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses;
+ x: aload_0
+ x: invokespecial #x // Method java/lang/Object."<init>":()V
+ x: aload_0
+ x: iconst_5
+ x: putfield #x // Field value:I
+ x: return
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
@@ -1429,7 +1429,7 @@
}
SourceFile: "TinyFrameworkNestedClasses.java"
RuntimeInvisibleAnnotations:
- 0: #x()
+ x: #x()
android.hosttest.annotation.HostSideTestWholeClassStub
NestHost: class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses
InnerClasses:
@@ -1448,9 +1448,9 @@
flags: (0x0000)
Code:
stack=1, locals=1, args_size=1
- 0: aload_0
- 1: invokespecial #x // Method java/lang/Object."<init>":()V
- 4: return
+ x: aload_0
+ x: invokespecial #x // Method java/lang/Object."<init>":()V
+ x: return
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
@@ -1461,9 +1461,9 @@
flags: (0x0001) ACC_PUBLIC
Code:
stack=1, locals=1, args_size=1
- 0: bipush 7
- 2: invokestatic #x // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
- 5: areturn
+ x: bipush 7
+ x: invokestatic #x // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
+ x: areturn
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
@@ -1474,9 +1474,9 @@
flags: (0x1041) ACC_PUBLIC, ACC_BRIDGE, ACC_SYNTHETIC
Code:
stack=1, locals=1, args_size=1
- 0: aload_0
- 1: invokevirtual #x // Method get:()Ljava/lang/Integer;
- 4: areturn
+ x: aload_0
+ x: invokevirtual #x // Method get:()Ljava/lang/Integer;
+ x: areturn
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
@@ -1507,12 +1507,12 @@
flags: (0x0001) ACC_PUBLIC
Code:
stack=2, locals=1, args_size=1
- 0: aload_0
- 1: invokespecial #x // Method java/lang/Object."<init>":()V
- 4: aload_0
- 5: bipush 6
- 7: putfield #x // Field value:I
- 10: return
+ x: aload_0
+ x: invokespecial #x // Method java/lang/Object."<init>":()V
+ x: aload_0
+ x: bipush 6
+ x: putfield #x // Field value:I
+ x: return
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
@@ -1523,16 +1523,16 @@
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=2, locals=0, args_size=0
- 0: new #x // class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$StaticNestedClass$1
- 3: dup
- 4: invokespecial #x // Method com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$StaticNestedClass$1."<init>":()V
- 7: areturn
+ x: new #x // class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$StaticNestedClass$1
+ x: dup
+ x: invokespecial #x // Method com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$StaticNestedClass$1."<init>":()V
+ x: areturn
LineNumberTable:
Signature: #x // ()Ljava/util/function/Supplier<Ljava/lang/Integer;>;
}
SourceFile: "TinyFrameworkNestedClasses.java"
RuntimeInvisibleAnnotations:
- 0: #x()
+ x: #x()
android.hosttest.annotation.HostSideTestWholeClassStub
NestHost: class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses
InnerClasses:
@@ -1552,10 +1552,10 @@
flags: (0x0001) ACC_PUBLIC
Code:
stack=2, locals=2, args_size=2
- 0: aload_0
- 1: iload_1
- 2: invokespecial #x // Method com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$BaseClass."<init>":(I)V
- 5: return
+ x: aload_0
+ x: iload_1
+ x: invokespecial #x // Method com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$BaseClass."<init>":(I)V
+ x: return
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
@@ -1591,15 +1591,15 @@
flags: (0x0001) ACC_PUBLIC
Code:
stack=4, locals=1, args_size=1
- 0: aload_0
- 1: invokespecial #x // Method java/lang/Object."<init>":()V
- 4: aload_0
- 5: new #x // class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$1
- 8: dup
- 9: aload_0
- 10: invokespecial #x // Method com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$1."<init>":(Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses;)V
- 13: putfield #x // Field mSupplier:Ljava/util/function/Supplier;
- 16: return
+ x: aload_0
+ x: invokespecial #x // Method java/lang/Object."<init>":()V
+ x: aload_0
+ x: new #x // class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$1
+ x: dup
+ x: aload_0
+ x: invokespecial #x // Method com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$1."<init>":(Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses;)V
+ x: putfield #x // Field mSupplier:Ljava/util/function/Supplier;
+ x: return
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
@@ -1610,11 +1610,11 @@
flags: (0x0001) ACC_PUBLIC
Code:
stack=3, locals=1, args_size=1
- 0: new #x // class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$3
- 3: dup
- 4: aload_0
- 5: invokespecial #x // Method com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$3."<init>":(Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses;)V
- 8: areturn
+ x: new #x // class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$3
+ x: dup
+ x: aload_0
+ x: invokespecial #x // Method com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$3."<init>":(Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses;)V
+ x: areturn
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
@@ -1626,10 +1626,10 @@
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=2, locals=0, args_size=0
- 0: new #x // class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$4
- 3: dup
- 4: invokespecial #x // Method com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$4."<init>":()V
- 7: areturn
+ x: new #x // class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$4
+ x: dup
+ x: invokespecial #x // Method com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$4."<init>":()V
+ x: areturn
LineNumberTable:
Signature: #x // ()Ljava/util/function/Supplier<Ljava/lang/Integer;>;
@@ -1638,16 +1638,16 @@
flags: (0x0008) ACC_STATIC
Code:
stack=2, locals=0, args_size=0
- 0: new #x // class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$2
- 3: dup
- 4: invokespecial #x // Method com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$2."<init>":()V
- 7: putstatic #x // Field sSupplier:Ljava/util/function/Supplier;
- 10: return
+ x: new #x // class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$2
+ x: dup
+ x: invokespecial #x // Method com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$2."<init>":()V
+ x: putstatic #x // Field sSupplier:Ljava/util/function/Supplier;
+ x: return
LineNumberTable:
}
SourceFile: "TinyFrameworkNestedClasses.java"
RuntimeInvisibleAnnotations:
- 0: #x()
+ x: #x()
android.hosttest.annotation.HostSideTestWholeClassStub
NestMembers:
com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$SubClass
diff --git a/tools/hoststubgen/hoststubgen/test-tiny-framework/golden-output/02-hoststubgen-test-tiny-framework-host-stub-dump.txt b/tools/hoststubgen/hoststubgen/test-tiny-framework/golden-output/02-hoststubgen-test-tiny-framework-host-stub-dump.txt
index 6e1528a..43ceec4 100644
--- a/tools/hoststubgen/hoststubgen/test-tiny-framework/golden-output/02-hoststubgen-test-tiny-framework-host-stub-dump.txt
+++ b/tools/hoststubgen/hoststubgen/test-tiny-framework/golden-output/02-hoststubgen-test-tiny-framework-host-stub-dump.txt
@@ -12,33 +12,33 @@
flags: (0x0002) ACC_PRIVATE
Code:
stack=3, locals=1, args_size=1
- 0: new #x // class java/lang/RuntimeException
- 3: dup
- 4: ldc #x // String Stub!
- 6: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
- 9: athrow
+ x: new #x // class java/lang/RuntimeException
+ x: dup
+ x: ldc #x // String Stub!
+ x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
+ x: athrow
public static int getOneStub();
descriptor: ()I
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=3, locals=0, args_size=0
- 0: new #x // class java/lang/RuntimeException
- 3: dup
- 4: ldc #x // String Stub!
- 6: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
- 9: athrow
+ x: new #x // class java/lang/RuntimeException
+ x: dup
+ x: ldc #x // String Stub!
+ x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
+ x: athrow
RuntimeInvisibleAnnotations:
- 0: #x()
+ x: #x()
android.hosttest.annotation.HostSideTestStub
}
InnerClasses:
private static #x= #x of #x; // Impl=class com/android/hoststubgen/test/tinyframework/TinyFrameworkCallerCheck$Impl of class com/android/hoststubgen/test/tinyframework/TinyFrameworkCallerCheck
SourceFile: "TinyFrameworkCallerCheck.java"
RuntimeVisibleAnnotations:
- 0: #x()
+ x: #x()
com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
- 1: #x()
+ x: #x()
com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
NestHost: class com/android/hoststubgen/test/tinyframework/TinyFrameworkCallerCheck
## Class: com/android/hoststubgen/test/tinyframework/TinyFrameworkCallerCheck.class
@@ -55,44 +55,44 @@
flags: (0x0001) ACC_PUBLIC
Code:
stack=3, locals=1, args_size=1
- 0: new #x // class java/lang/RuntimeException
- 3: dup
- 4: ldc #x // String Stub!
- 6: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
- 9: athrow
+ x: new #x // class java/lang/RuntimeException
+ x: dup
+ x: ldc #x // String Stub!
+ x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
+ x: athrow
public static int getOne_withCheck();
descriptor: ()I
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=3, locals=0, args_size=0
- 0: new #x // class java/lang/RuntimeException
- 3: dup
- 4: ldc #x // String Stub!
- 6: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
- 9: athrow
+ x: new #x // class java/lang/RuntimeException
+ x: dup
+ x: ldc #x // String Stub!
+ x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
+ x: athrow
public static int getOne_noCheck();
descriptor: ()I
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=3, locals=0, args_size=0
- 0: new #x // class java/lang/RuntimeException
- 3: dup
- 4: ldc #x // String Stub!
- 6: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
- 9: athrow
+ x: new #x // class java/lang/RuntimeException
+ x: dup
+ x: ldc #x // String Stub!
+ x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
+ x: athrow
}
InnerClasses:
private static #x= #x of #x; // Impl=class com/android/hoststubgen/test/tinyframework/TinyFrameworkCallerCheck$Impl of class com/android/hoststubgen/test/tinyframework/TinyFrameworkCallerCheck
SourceFile: "TinyFrameworkCallerCheck.java"
RuntimeVisibleAnnotations:
- 0: #x()
+ x: #x()
com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
- 1: #x()
+ x: #x()
com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
RuntimeInvisibleAnnotations:
- 0: #x()
+ x: #x()
android.hosttest.annotation.HostSideTestWholeClassStub
NestMembers:
com/android/hoststubgen/test/tinyframework/TinyFrameworkCallerCheck$Impl
@@ -109,7 +109,7 @@
descriptor: I
flags: (0x0001) ACC_PUBLIC
RuntimeInvisibleAnnotations:
- 0: #x()
+ x: #x()
android.hosttest.annotation.HostSideTestStub
public com.android.hoststubgen.test.tinyframework.TinyFrameworkClassAnnotations();
@@ -117,13 +117,13 @@
flags: (0x0001) ACC_PUBLIC
Code:
stack=3, locals=1, args_size=1
- 0: new #x // class java/lang/RuntimeException
- 3: dup
- 4: ldc #x // String Stub!
- 6: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
- 9: athrow
+ x: new #x // class java/lang/RuntimeException
+ x: dup
+ x: ldc #x // String Stub!
+ x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
+ x: athrow
RuntimeInvisibleAnnotations:
- 0: #x()
+ x: #x()
android.hosttest.annotation.HostSideTestStub
public int addOne(int);
@@ -131,13 +131,13 @@
flags: (0x0001) ACC_PUBLIC
Code:
stack=3, locals=2, args_size=2
- 0: new #x // class java/lang/RuntimeException
- 3: dup
- 4: ldc #x // String Stub!
- 6: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
- 9: athrow
+ x: new #x // class java/lang/RuntimeException
+ x: dup
+ x: ldc #x // String Stub!
+ x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
+ x: athrow
RuntimeInvisibleAnnotations:
- 0: #x()
+ x: #x()
android.hosttest.annotation.HostSideTestStub
public int addTwo(int);
@@ -145,47 +145,47 @@
flags: (0x0001) ACC_PUBLIC
Code:
stack=3, locals=2, args_size=2
- 0: new #x // class java/lang/RuntimeException
- 3: dup
- 4: ldc #x // String Stub!
- 6: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
- 9: athrow
+ x: new #x // class java/lang/RuntimeException
+ x: dup
+ x: ldc #x // String Stub!
+ x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
+ x: athrow
public static int nativeAddThree(int);
descriptor: (I)I
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=3, locals=1, args_size=1
- 0: new #x // class java/lang/RuntimeException
- 3: dup
- 4: ldc #x // String Stub!
- 6: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
- 9: athrow
+ x: new #x // class java/lang/RuntimeException
+ x: dup
+ x: ldc #x // String Stub!
+ x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
+ x: athrow
public java.lang.String visibleButUsesUnsupportedMethod();
descriptor: ()Ljava/lang/String;
flags: (0x0001) ACC_PUBLIC
Code:
stack=3, locals=1, args_size=1
- 0: new #x // class java/lang/RuntimeException
- 3: dup
- 4: ldc #x // String Stub!
- 6: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
- 9: athrow
+ x: new #x // class java/lang/RuntimeException
+ x: dup
+ x: ldc #x // String Stub!
+ x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
+ x: athrow
RuntimeInvisibleAnnotations:
- 0: #x()
+ x: #x()
android.hosttest.annotation.HostSideTestStub
}
SourceFile: "TinyFrameworkClassAnnotations.java"
RuntimeVisibleAnnotations:
- 0: #x()
+ x: #x()
com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
- 1: #x()
+ x: #x()
com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
RuntimeInvisibleAnnotations:
- 0: #x()
+ x: #x()
android.hosttest.annotation.HostSideTestStub
- 1: #x(#x=s#x)
+ x: #x(#x=s#x)
android.hosttest.annotation.HostSideTestClassLoadHook(
value="com.android.hoststubgen.test.tinyframework.TinyFrameworkClassLoadHook.onClassLoaded"
)
@@ -215,97 +215,97 @@
flags: (0x0001) ACC_PUBLIC
Code:
stack=3, locals=1, args_size=1
- 0: new #x // class java/lang/RuntimeException
- 3: dup
- 4: ldc #x // String Stub!
- 6: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
- 9: athrow
+ x: new #x // class java/lang/RuntimeException
+ x: dup
+ x: ldc #x // String Stub!
+ x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
+ x: athrow
public int addOne(int);
descriptor: (I)I
flags: (0x0001) ACC_PUBLIC
Code:
stack=3, locals=2, args_size=2
- 0: new #x // class java/lang/RuntimeException
- 3: dup
- 4: ldc #x // String Stub!
- 6: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
- 9: athrow
+ x: new #x // class java/lang/RuntimeException
+ x: dup
+ x: ldc #x // String Stub!
+ x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
+ x: athrow
public int addOneInner(int);
descriptor: (I)I
flags: (0x0001) ACC_PUBLIC
Code:
stack=3, locals=2, args_size=2
- 0: new #x // class java/lang/RuntimeException
- 3: dup
- 4: ldc #x // String Stub!
- 6: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
- 9: athrow
+ x: new #x // class java/lang/RuntimeException
+ x: dup
+ x: ldc #x // String Stub!
+ x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
+ x: athrow
public void toBeRemoved(java.lang.String);
descriptor: (Ljava/lang/String;)V
flags: (0x0001) ACC_PUBLIC
Code:
stack=3, locals=2, args_size=2
- 0: new #x // class java/lang/RuntimeException
- 3: dup
- 4: ldc #x // String Stub!
- 6: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
- 9: athrow
+ x: new #x // class java/lang/RuntimeException
+ x: dup
+ x: ldc #x // String Stub!
+ x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
+ x: athrow
public int addTwo(int);
descriptor: (I)I
flags: (0x0001) ACC_PUBLIC
Code:
stack=3, locals=2, args_size=2
- 0: new #x // class java/lang/RuntimeException
- 3: dup
- 4: ldc #x // String Stub!
- 6: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
- 9: athrow
+ x: new #x // class java/lang/RuntimeException
+ x: dup
+ x: ldc #x // String Stub!
+ x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
+ x: athrow
public static int nativeAddThree(int);
descriptor: (I)I
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=3, locals=1, args_size=1
- 0: new #x // class java/lang/RuntimeException
- 3: dup
- 4: ldc #x // String Stub!
- 6: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
- 9: athrow
+ x: new #x // class java/lang/RuntimeException
+ x: dup
+ x: ldc #x // String Stub!
+ x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
+ x: athrow
public java.lang.String unsupportedMethod();
descriptor: ()Ljava/lang/String;
flags: (0x0001) ACC_PUBLIC
Code:
stack=3, locals=1, args_size=1
- 0: new #x // class java/lang/RuntimeException
- 3: dup
- 4: ldc #x // String Stub!
- 6: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
- 9: athrow
+ x: new #x // class java/lang/RuntimeException
+ x: dup
+ x: ldc #x // String Stub!
+ x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
+ x: athrow
public java.lang.String visibleButUsesUnsupportedMethod();
descriptor: ()Ljava/lang/String;
flags: (0x0001) ACC_PUBLIC
Code:
stack=3, locals=1, args_size=1
- 0: new #x // class java/lang/RuntimeException
- 3: dup
- 4: ldc #x // String Stub!
- 6: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
- 9: athrow
+ x: new #x // class java/lang/RuntimeException
+ x: dup
+ x: ldc #x // String Stub!
+ x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
+ x: athrow
}
SourceFile: "TinyFrameworkClassClassWideAnnotations.java"
RuntimeVisibleAnnotations:
- 0: #x()
+ x: #x()
com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
- 1: #x()
+ x: #x()
com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
RuntimeInvisibleAnnotations:
- 0: #x()
+ x: #x()
android.hosttest.annotation.HostSideTestWholeClassStub
## Class: com/android/hoststubgen/test/tinyframework/TinyFrameworkClassLoadHook.class
Compiled from "TinyFrameworkClassLoadHook.java"
@@ -326,22 +326,22 @@
flags: (0x0002) ACC_PRIVATE
Code:
stack=3, locals=1, args_size=1
- 0: new #x // class java/lang/RuntimeException
- 3: dup
- 4: ldc #x // String Stub!
- 6: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
- 9: athrow
+ x: new #x // class java/lang/RuntimeException
+ x: dup
+ x: ldc #x // String Stub!
+ x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
+ x: athrow
public static void onClassLoaded(java.lang.Class<?>);
descriptor: (Ljava/lang/Class;)V
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=3, locals=1, args_size=1
- 0: new #x // class java/lang/RuntimeException
- 3: dup
- 4: ldc #x // String Stub!
- 6: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
- 9: athrow
+ x: new #x // class java/lang/RuntimeException
+ x: dup
+ x: ldc #x // String Stub!
+ x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
+ x: athrow
Signature: #x // (Ljava/lang/Class<*>;)V
static {};
@@ -349,20 +349,20 @@
flags: (0x0008) ACC_STATIC
Code:
stack=3, locals=0, args_size=0
- 0: new #x // class java/lang/RuntimeException
- 3: dup
- 4: ldc #x // String Stub!
- 6: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
- 9: athrow
+ x: new #x // class java/lang/RuntimeException
+ x: dup
+ x: ldc #x // String Stub!
+ x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
+ x: athrow
}
SourceFile: "TinyFrameworkClassLoadHook.java"
RuntimeVisibleAnnotations:
- 0: #x()
+ x: #x()
com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
- 1: #x()
+ x: #x()
com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
RuntimeInvisibleAnnotations:
- 0: #x()
+ x: #x()
android.hosttest.annotation.HostSideTestWholeClassStub
## Class: com/android/hoststubgen/test/tinyframework/TinyFrameworkClassWithInitializer.class
Compiled from "TinyFrameworkClassWithInitializer.java"
@@ -382,35 +382,35 @@
flags: (0x0001) ACC_PUBLIC
Code:
stack=3, locals=1, args_size=1
- 0: new #x // class java/lang/RuntimeException
- 3: dup
- 4: ldc #x // String Stub!
- 6: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
- 9: athrow
+ x: new #x // class java/lang/RuntimeException
+ x: dup
+ x: ldc #x // String Stub!
+ x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
+ x: athrow
static {};
descriptor: ()V
flags: (0x0008) ACC_STATIC
Code:
stack=3, locals=0, args_size=0
- 0: new #x // class java/lang/RuntimeException
- 3: dup
- 4: ldc #x // String Stub!
- 6: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
- 9: athrow
+ x: new #x // class java/lang/RuntimeException
+ x: dup
+ x: ldc #x // String Stub!
+ x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
+ x: athrow
}
SourceFile: "TinyFrameworkClassWithInitializer.java"
RuntimeVisibleAnnotations:
- 0: #x()
+ x: #x()
com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
- 1: #x()
+ x: #x()
com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
RuntimeInvisibleAnnotations:
- 0: #x(#x=s#x)
+ x: #x(#x=s#x)
android.hosttest.annotation.HostSideTestClassLoadHook(
value="com.android.hoststubgen.test.tinyframework.TinyFrameworkClassLoadHook.onClassLoaded"
)
- 1: #x()
+ x: #x()
android.hosttest.annotation.HostSideTestWholeClassStub
## Class: com/android/hoststubgen/test/tinyframework/TinyFrameworkExceptionTester.class
Compiled from "TinyFrameworkExceptionTester.java"
@@ -426,31 +426,31 @@
flags: (0x0001) ACC_PUBLIC
Code:
stack=3, locals=1, args_size=1
- 0: new #x // class java/lang/RuntimeException
- 3: dup
- 4: ldc #x // String Stub!
- 6: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
- 9: athrow
+ x: new #x // class java/lang/RuntimeException
+ x: dup
+ x: ldc #x // String Stub!
+ x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
+ x: athrow
public static int testException();
descriptor: ()I
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=3, locals=0, args_size=0
- 0: new #x // class java/lang/RuntimeException
- 3: dup
- 4: ldc #x // String Stub!
- 6: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
- 9: athrow
+ x: new #x // class java/lang/RuntimeException
+ x: dup
+ x: ldc #x // String Stub!
+ x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
+ x: athrow
}
SourceFile: "TinyFrameworkExceptionTester.java"
RuntimeVisibleAnnotations:
- 0: #x()
+ x: #x()
com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
- 1: #x()
+ x: #x()
com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
RuntimeInvisibleAnnotations:
- 0: #x()
+ x: #x()
android.hosttest.annotation.HostSideTestWholeClassStub
## Class: com/android/hoststubgen/test/tinyframework/TinyFrameworkForTextPolicy.class
Compiled from "TinyFrameworkForTextPolicy.java"
@@ -470,61 +470,61 @@
flags: (0x0001) ACC_PUBLIC
Code:
stack=3, locals=1, args_size=1
- 0: new #x // class java/lang/RuntimeException
- 3: dup
- 4: ldc #x // String Stub!
- 6: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
- 9: athrow
+ x: new #x // class java/lang/RuntimeException
+ x: dup
+ x: ldc #x // String Stub!
+ x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
+ x: athrow
public int addOne(int);
descriptor: (I)I
flags: (0x0001) ACC_PUBLIC
Code:
stack=3, locals=2, args_size=2
- 0: new #x // class java/lang/RuntimeException
- 3: dup
- 4: ldc #x // String Stub!
- 6: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
- 9: athrow
+ x: new #x // class java/lang/RuntimeException
+ x: dup
+ x: ldc #x // String Stub!
+ x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
+ x: athrow
public int addTwo(int);
descriptor: (I)I
flags: (0x0001) ACC_PUBLIC
Code:
stack=3, locals=2, args_size=2
- 0: new #x // class java/lang/RuntimeException
- 3: dup
- 4: ldc #x // String Stub!
- 6: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
- 9: athrow
+ x: new #x // class java/lang/RuntimeException
+ x: dup
+ x: ldc #x // String Stub!
+ x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
+ x: athrow
public static int nativeAddThree(int);
descriptor: (I)I
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=3, locals=1, args_size=1
- 0: new #x // class java/lang/RuntimeException
- 3: dup
- 4: ldc #x // String Stub!
- 6: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
- 9: athrow
+ x: new #x // class java/lang/RuntimeException
+ x: dup
+ x: ldc #x // String Stub!
+ x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
+ x: athrow
public java.lang.String visibleButUsesUnsupportedMethod();
descriptor: ()Ljava/lang/String;
flags: (0x0001) ACC_PUBLIC
Code:
stack=3, locals=1, args_size=1
- 0: new #x // class java/lang/RuntimeException
- 3: dup
- 4: ldc #x // String Stub!
- 6: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
- 9: athrow
+ x: new #x // class java/lang/RuntimeException
+ x: dup
+ x: ldc #x // String Stub!
+ x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
+ x: athrow
}
SourceFile: "TinyFrameworkForTextPolicy.java"
RuntimeVisibleAnnotations:
- 0: #x()
+ x: #x()
com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
- 1: #x()
+ x: #x()
com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
## Class: com/android/hoststubgen/test/tinyframework/TinyFrameworkNative.class
Compiled from "TinyFrameworkNative.java"
@@ -540,11 +540,11 @@
flags: (0x0001) ACC_PUBLIC
Code:
stack=3, locals=1, args_size=1
- 0: new #x // class java/lang/RuntimeException
- 3: dup
- 4: ldc #x // String Stub!
- 6: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
- 9: athrow
+ x: new #x // class java/lang/RuntimeException
+ x: dup
+ x: ldc #x // String Stub!
+ x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
+ x: athrow
public static native int nativeAddTwo(int);
descriptor: (I)I
@@ -555,11 +555,11 @@
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=3, locals=1, args_size=1
- 0: new #x // class java/lang/RuntimeException
- 3: dup
- 4: ldc #x // String Stub!
- 6: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
- 9: athrow
+ x: new #x // class java/lang/RuntimeException
+ x: dup
+ x: ldc #x // String Stub!
+ x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
+ x: athrow
public static native long nativeLongPlus(long, long);
descriptor: (JJ)J
@@ -570,22 +570,22 @@
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=3, locals=4, args_size=2
- 0: new #x // class java/lang/RuntimeException
- 3: dup
- 4: ldc #x // String Stub!
- 6: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
- 9: athrow
+ x: new #x // class java/lang/RuntimeException
+ x: dup
+ x: ldc #x // String Stub!
+ x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
+ x: athrow
}
SourceFile: "TinyFrameworkNative.java"
RuntimeVisibleAnnotations:
- 0: #x()
+ x: #x()
com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
- 1: #x()
+ x: #x()
com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
RuntimeInvisibleAnnotations:
- 0: #x()
+ x: #x()
android.hosttest.annotation.HostSideTestWholeClassStub
- 1: #x(#x=s#x)
+ x: #x(#x=s#x)
android.hosttest.annotation.HostSideTestNativeSubstitutionClass(
value="TinyFrameworkNative_host"
)
@@ -607,19 +607,19 @@
flags: (0x0001) ACC_PUBLIC
Code:
stack=3, locals=2, args_size=2
- 0: new #x // class java/lang/RuntimeException
- 3: dup
- 4: ldc #x // String Stub!
- 6: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
- 9: athrow
+ x: new #x // class java/lang/RuntimeException
+ x: dup
+ x: ldc #x // String Stub!
+ x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
+ x: athrow
}
InnerClasses:
public static #x= #x of #x; // BaseClass=class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$BaseClass of class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses
SourceFile: "TinyFrameworkNestedClasses.java"
RuntimeVisibleAnnotations:
- 0: #x()
+ x: #x()
com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
- 1: #x()
+ x: #x()
com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
NestHost: class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses
## Class: com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$InnerClass.class
@@ -644,22 +644,22 @@
flags: (0x0001) ACC_PUBLIC
Code:
stack=3, locals=2, args_size=2
- 0: new #x // class java/lang/RuntimeException
- 3: dup
- 4: ldc #x // String Stub!
- 6: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
- 9: athrow
+ x: new #x // class java/lang/RuntimeException
+ x: dup
+ x: ldc #x // String Stub!
+ x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
+ x: athrow
}
InnerClasses:
public #x= #x of #x; // InnerClass=class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$InnerClass of class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses
SourceFile: "TinyFrameworkNestedClasses.java"
RuntimeVisibleAnnotations:
- 0: #x()
+ x: #x()
com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
- 1: #x()
+ x: #x()
com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
RuntimeInvisibleAnnotations:
- 0: #x()
+ x: #x()
android.hosttest.annotation.HostSideTestWholeClassStub
NestHost: class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses
## Class: com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$StaticNestedClass.class
@@ -680,22 +680,22 @@
flags: (0x0001) ACC_PUBLIC
Code:
stack=3, locals=1, args_size=1
- 0: new #x // class java/lang/RuntimeException
- 3: dup
- 4: ldc #x // String Stub!
- 6: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
- 9: athrow
+ x: new #x // class java/lang/RuntimeException
+ x: dup
+ x: ldc #x // String Stub!
+ x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
+ x: athrow
public static java.util.function.Supplier<java.lang.Integer> getSupplier_static();
descriptor: ()Ljava/util/function/Supplier;
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=3, locals=0, args_size=0
- 0: new #x // class java/lang/RuntimeException
- 3: dup
- 4: ldc #x // String Stub!
- 6: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
- 9: athrow
+ x: new #x // class java/lang/RuntimeException
+ x: dup
+ x: ldc #x // String Stub!
+ x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
+ x: athrow
Signature: #x // ()Ljava/util/function/Supplier<Ljava/lang/Integer;>;
}
InnerClasses:
@@ -703,12 +703,12 @@
#x; // class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$StaticNestedClass$1
SourceFile: "TinyFrameworkNestedClasses.java"
RuntimeVisibleAnnotations:
- 0: #x()
+ x: #x()
com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
- 1: #x()
+ x: #x()
com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
RuntimeInvisibleAnnotations:
- 0: #x()
+ x: #x()
android.hosttest.annotation.HostSideTestWholeClassStub
NestHost: class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses
## Class: com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$SubClass.class
@@ -725,20 +725,20 @@
flags: (0x0001) ACC_PUBLIC
Code:
stack=3, locals=2, args_size=2
- 0: new #x // class java/lang/RuntimeException
- 3: dup
- 4: ldc #x // String Stub!
- 6: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
- 9: athrow
+ x: new #x // class java/lang/RuntimeException
+ x: dup
+ x: ldc #x // String Stub!
+ x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
+ x: athrow
}
InnerClasses:
public static #x= #x of #x; // BaseClass=class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$BaseClass of class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses
public static #x= #x of #x; // SubClass=class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$SubClass of class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses
SourceFile: "TinyFrameworkNestedClasses.java"
RuntimeVisibleAnnotations:
- 0: #x()
+ x: #x()
com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
- 1: #x()
+ x: #x()
com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
NestHost: class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses
## Class: com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses.class
@@ -765,22 +765,22 @@
flags: (0x0001) ACC_PUBLIC
Code:
stack=3, locals=1, args_size=1
- 0: new #x // class java/lang/RuntimeException
- 3: dup
- 4: ldc #x // String Stub!
- 6: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
- 9: athrow
+ x: new #x // class java/lang/RuntimeException
+ x: dup
+ x: ldc #x // String Stub!
+ x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
+ x: athrow
public java.util.function.Supplier<java.lang.Integer> getSupplier();
descriptor: ()Ljava/util/function/Supplier;
flags: (0x0001) ACC_PUBLIC
Code:
stack=3, locals=1, args_size=1
- 0: new #x // class java/lang/RuntimeException
- 3: dup
- 4: ldc #x // String Stub!
- 6: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
- 9: athrow
+ x: new #x // class java/lang/RuntimeException
+ x: dup
+ x: ldc #x // String Stub!
+ x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
+ x: athrow
Signature: #x // ()Ljava/util/function/Supplier<Ljava/lang/Integer;>;
public static java.util.function.Supplier<java.lang.Integer> getSupplier_static();
@@ -788,11 +788,11 @@
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=3, locals=0, args_size=0
- 0: new #x // class java/lang/RuntimeException
- 3: dup
- 4: ldc #x // String Stub!
- 6: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
- 9: athrow
+ x: new #x // class java/lang/RuntimeException
+ x: dup
+ x: ldc #x // String Stub!
+ x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
+ x: athrow
Signature: #x // ()Ljava/util/function/Supplier<Ljava/lang/Integer;>;
static {};
@@ -800,11 +800,11 @@
flags: (0x0008) ACC_STATIC
Code:
stack=3, locals=0, args_size=0
- 0: new #x // class java/lang/RuntimeException
- 3: dup
- 4: ldc #x // String Stub!
- 6: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
- 9: athrow
+ x: new #x // class java/lang/RuntimeException
+ x: dup
+ x: ldc #x // String Stub!
+ x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
+ x: athrow
}
InnerClasses:
#x; // class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$1
@@ -818,12 +818,12 @@
#x; // class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$StaticNestedClass$1
SourceFile: "TinyFrameworkNestedClasses.java"
RuntimeVisibleAnnotations:
- 0: #x()
+ x: #x()
com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
- 1: #x()
+ x: #x()
com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
RuntimeInvisibleAnnotations:
- 0: #x()
+ x: #x()
android.hosttest.annotation.HostSideTestWholeClassStub
NestMembers:
com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$SubClass
diff --git a/tools/hoststubgen/hoststubgen/test-tiny-framework/golden-output/03-hoststubgen-test-tiny-framework-host-impl-dump.txt b/tools/hoststubgen/hoststubgen/test-tiny-framework/golden-output/03-hoststubgen-test-tiny-framework-host-impl-dump.txt
index 5672e9c..faf0a46 100644
--- a/tools/hoststubgen/hoststubgen/test-tiny-framework/golden-output/03-hoststubgen-test-tiny-framework-host-impl-dump.txt
+++ b/tools/hoststubgen/hoststubgen/test-tiny-framework/golden-output/03-hoststubgen-test-tiny-framework-host-impl-dump.txt
@@ -13,13 +13,13 @@
}
SourceFile: "HostSideTestClassLoadHook.java"
RuntimeVisibleAnnotations:
- 0: #x()
+ x: #x()
com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
- 1: #x(#x=[e#x.#x])
+ x: #x(#x=[e#x.#x])
java.lang.annotation.Target(
value=[Ljava/lang/annotation/ElementType;.TYPE]
)
- 2: #x(#x=e#x.#x)
+ x: #x(#x=e#x.#x)
java.lang.annotation.Retention(
value=Ljava/lang/annotation/RetentionPolicy;.CLASS
)
@@ -35,13 +35,13 @@
}
SourceFile: "HostSideTestKeep.java"
RuntimeVisibleAnnotations:
- 0: #x()
+ x: #x()
com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
- 1: #x(#x=[e#x.#x,e#x.#x,e#x.#x,e#x.#x])
+ x: #x(#x=[e#x.#x,e#x.#x,e#x.#x,e#x.#x])
java.lang.annotation.Target(
value=[Ljava/lang/annotation/ElementType;.TYPE,Ljava/lang/annotation/ElementType;.FIELD,Ljava/lang/annotation/ElementType;.METHOD,Ljava/lang/annotation/ElementType;.CONSTRUCTOR]
)
- 2: #x(#x=e#x.#x)
+ x: #x(#x=e#x.#x)
java.lang.annotation.Retention(
value=Ljava/lang/annotation/RetentionPolicy;.CLASS
)
@@ -60,13 +60,13 @@
}
SourceFile: "HostSideTestNativeSubstitutionClass.java"
RuntimeVisibleAnnotations:
- 0: #x()
+ x: #x()
com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
- 1: #x(#x=[e#x.#x])
+ x: #x(#x=[e#x.#x])
java.lang.annotation.Target(
value=[Ljava/lang/annotation/ElementType;.TYPE]
)
- 2: #x(#x=e#x.#x)
+ x: #x(#x=e#x.#x)
java.lang.annotation.Retention(
value=Ljava/lang/annotation/RetentionPolicy;.CLASS
)
@@ -82,13 +82,13 @@
}
SourceFile: "HostSideTestRemove.java"
RuntimeVisibleAnnotations:
- 0: #x()
+ x: #x()
com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
- 1: #x(#x=[e#x.#x,e#x.#x,e#x.#x,e#x.#x])
+ x: #x(#x=[e#x.#x,e#x.#x,e#x.#x,e#x.#x])
java.lang.annotation.Target(
value=[Ljava/lang/annotation/ElementType;.TYPE,Ljava/lang/annotation/ElementType;.FIELD,Ljava/lang/annotation/ElementType;.METHOD,Ljava/lang/annotation/ElementType;.CONSTRUCTOR]
)
- 2: #x(#x=e#x.#x)
+ x: #x(#x=e#x.#x)
java.lang.annotation.Retention(
value=Ljava/lang/annotation/RetentionPolicy;.CLASS
)
@@ -104,13 +104,13 @@
}
SourceFile: "HostSideTestStub.java"
RuntimeVisibleAnnotations:
- 0: #x()
+ x: #x()
com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
- 1: #x(#x=[e#x.#x,e#x.#x,e#x.#x,e#x.#x])
+ x: #x(#x=[e#x.#x,e#x.#x,e#x.#x,e#x.#x])
java.lang.annotation.Target(
value=[Ljava/lang/annotation/ElementType;.TYPE,Ljava/lang/annotation/ElementType;.FIELD,Ljava/lang/annotation/ElementType;.METHOD,Ljava/lang/annotation/ElementType;.CONSTRUCTOR]
)
- 2: #x(#x=e#x.#x)
+ x: #x(#x=e#x.#x)
java.lang.annotation.Retention(
value=Ljava/lang/annotation/RetentionPolicy;.CLASS
)
@@ -129,13 +129,13 @@
}
SourceFile: "HostSideTestSubstitute.java"
RuntimeVisibleAnnotations:
- 0: #x()
+ x: #x()
com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
- 1: #x(#x=[e#x.#x])
+ x: #x(#x=[e#x.#x])
java.lang.annotation.Target(
value=[Ljava/lang/annotation/ElementType;.METHOD]
)
- 2: #x(#x=e#x.#x)
+ x: #x(#x=e#x.#x)
java.lang.annotation.Retention(
value=Ljava/lang/annotation/RetentionPolicy;.CLASS
)
@@ -151,13 +151,13 @@
}
SourceFile: "HostSideTestThrow.java"
RuntimeVisibleAnnotations:
- 0: #x()
+ x: #x()
com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
- 1: #x(#x=[e#x.#x,e#x.#x])
+ x: #x(#x=[e#x.#x,e#x.#x])
java.lang.annotation.Target(
value=[Ljava/lang/annotation/ElementType;.METHOD,Ljava/lang/annotation/ElementType;.CONSTRUCTOR]
)
- 2: #x(#x=e#x.#x)
+ x: #x(#x=e#x.#x)
java.lang.annotation.Retention(
value=Ljava/lang/annotation/RetentionPolicy;.CLASS
)
@@ -173,13 +173,13 @@
}
SourceFile: "HostSideTestWholeClassKeep.java"
RuntimeVisibleAnnotations:
- 0: #x()
+ x: #x()
com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
- 1: #x(#x=[e#x.#x])
+ x: #x(#x=[e#x.#x])
java.lang.annotation.Target(
value=[Ljava/lang/annotation/ElementType;.TYPE]
)
- 2: #x(#x=e#x.#x)
+ x: #x(#x=e#x.#x)
java.lang.annotation.Retention(
value=Ljava/lang/annotation/RetentionPolicy;.CLASS
)
@@ -195,13 +195,13 @@
}
SourceFile: "HostSideTestWholeClassStub.java"
RuntimeVisibleAnnotations:
- 0: #x()
+ x: #x()
com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
- 1: #x(#x=[e#x.#x])
+ x: #x(#x=[e#x.#x])
java.lang.annotation.Target(
value=[Ljava/lang/annotation/ElementType;.TYPE]
)
- 2: #x(#x=e#x.#x)
+ x: #x(#x=e#x.#x)
java.lang.annotation.Retention(
value=Ljava/lang/annotation/RetentionPolicy;.CLASS
)
@@ -219,9 +219,9 @@
flags: (0x0002) ACC_PRIVATE
Code:
stack=1, locals=1, args_size=1
- 0: aload_0
- 1: invokespecial #x // Method java/lang/Object."<init>":()V
- 4: return
+ x: aload_0
+ x: invokespecial #x // Method java/lang/Object."<init>":()V
+ x: return
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
@@ -232,17 +232,17 @@
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=4, locals=0, args_size=0
- 0: ldc #x // String com/android/hoststubgen/test/tinyframework/TinyFrameworkCallerCheck$Impl
- 2: ldc #x // String getOneKeep
- 4: ldc #x // String ()I
- 6: invokestatic #x // Method com/android/hoststubgen/hosthelper/HostTestUtils.getStackWalker:()Ljava/lang/StackWalker;
- 9: invokevirtual #x // Method java/lang/StackWalker.getCallerClass:()Ljava/lang/Class;
- 12: invokestatic #x // Method com/android/hoststubgen/hosthelper/HostTestUtils.onNonStubMethodCalled:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Class;)V
- 15: iconst_1
- 16: ireturn
+ x: ldc #x // String com/android/hoststubgen/test/tinyframework/TinyFrameworkCallerCheck$Impl
+ x: ldc #x // String getOneKeep
+ x: ldc #x // String ()I
+ x: invokestatic #x // Method com/android/hoststubgen/hosthelper/HostTestUtils.getStackWalker:()Ljava/lang/StackWalker;
+ x: invokevirtual #x // Method java/lang/StackWalker.getCallerClass:()Ljava/lang/Class;
+ x: invokestatic #x // Method com/android/hoststubgen/hosthelper/HostTestUtils.onNonStubMethodCalled:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Class;)V
+ x: iconst_1
+ x: ireturn
LineNumberTable:
RuntimeInvisibleAnnotations:
- 0: #x()
+ x: #x()
android.hosttest.annotation.HostSideTestKeep
public static int getOneStub();
@@ -250,20 +250,20 @@
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=1, locals=0, args_size=0
- 0: iconst_1
- 1: ireturn
+ x: iconst_1
+ x: ireturn
LineNumberTable:
RuntimeInvisibleAnnotations:
- 0: #x()
+ x: #x()
android.hosttest.annotation.HostSideTestStub
}
InnerClasses:
private static #x= #x of #x; // Impl=class com/android/hoststubgen/test/tinyframework/TinyFrameworkCallerCheck$Impl of class com/android/hoststubgen/test/tinyframework/TinyFrameworkCallerCheck
SourceFile: "TinyFrameworkCallerCheck.java"
RuntimeVisibleAnnotations:
- 0: #x()
+ x: #x()
com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
- 1: #x()
+ x: #x()
com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
NestHost: class com/android/hoststubgen/test/tinyframework/TinyFrameworkCallerCheck
## Class: com/android/hoststubgen/test/tinyframework/TinyFrameworkCallerCheck.class
@@ -280,9 +280,9 @@
flags: (0x0001) ACC_PUBLIC
Code:
stack=1, locals=1, args_size=1
- 0: aload_0
- 1: invokespecial #x // Method java/lang/Object."<init>":()V
- 4: return
+ x: aload_0
+ x: invokespecial #x // Method java/lang/Object."<init>":()V
+ x: return
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
@@ -293,8 +293,8 @@
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=1, locals=0, args_size=0
- 0: invokestatic #x // Method com/android/hoststubgen/test/tinyframework/TinyFrameworkCallerCheck$Impl.getOneKeep:()I
- 3: ireturn
+ x: invokestatic #x // Method com/android/hoststubgen/test/tinyframework/TinyFrameworkCallerCheck$Impl.getOneKeep:()I
+ x: ireturn
LineNumberTable:
public static int getOne_noCheck();
@@ -302,20 +302,20 @@
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=1, locals=0, args_size=0
- 0: invokestatic #x // Method com/android/hoststubgen/test/tinyframework/TinyFrameworkCallerCheck$Impl.getOneStub:()I
- 3: ireturn
+ x: invokestatic #x // Method com/android/hoststubgen/test/tinyframework/TinyFrameworkCallerCheck$Impl.getOneStub:()I
+ x: ireturn
LineNumberTable:
}
InnerClasses:
private static #x= #x of #x; // Impl=class com/android/hoststubgen/test/tinyframework/TinyFrameworkCallerCheck$Impl of class com/android/hoststubgen/test/tinyframework/TinyFrameworkCallerCheck
SourceFile: "TinyFrameworkCallerCheck.java"
RuntimeVisibleAnnotations:
- 0: #x()
+ x: #x()
com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
- 1: #x()
+ x: #x()
com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
RuntimeInvisibleAnnotations:
- 0: #x()
+ x: #x()
android.hosttest.annotation.HostSideTestWholeClassStub
NestMembers:
com/android/hoststubgen/test/tinyframework/TinyFrameworkCallerCheck$Impl
@@ -332,14 +332,14 @@
descriptor: I
flags: (0x0001) ACC_PUBLIC
RuntimeInvisibleAnnotations:
- 0: #x()
+ x: #x()
android.hosttest.annotation.HostSideTestStub
public int keep;
descriptor: I
flags: (0x0001) ACC_PUBLIC
RuntimeInvisibleAnnotations:
- 0: #x()
+ x: #x()
android.hosttest.annotation.HostSideTestKeep
private static {};
@@ -347,31 +347,31 @@
flags: (0x000a) ACC_PRIVATE, ACC_STATIC
Code:
stack=2, locals=0, args_size=0
- 0: ldc #x // class com/android/hoststubgen/test/tinyframework/TinyFrameworkClassAnnotations
- 2: ldc #x // String com.android.hoststubgen.test.tinyframework.TinyFrameworkClassLoadHook.onClassLoaded
- 4: invokestatic #x // Method com/android/hoststubgen/hosthelper/HostTestUtils.onClassLoaded:(Ljava/lang/Class;Ljava/lang/String;)V
- 7: return
+ x: ldc #x // class com/android/hoststubgen/test/tinyframework/TinyFrameworkClassAnnotations
+ x: ldc #x // String com.android.hoststubgen.test.tinyframework.TinyFrameworkClassLoadHook.onClassLoaded
+ x: invokestatic #x // Method com/android/hoststubgen/hosthelper/HostTestUtils.onClassLoaded:(Ljava/lang/Class;Ljava/lang/String;)V
+ x: return
public com.android.hoststubgen.test.tinyframework.TinyFrameworkClassAnnotations();
descriptor: ()V
flags: (0x0001) ACC_PUBLIC
Code:
stack=2, locals=1, args_size=1
- 0: aload_0
- 1: invokespecial #x // Method java/lang/Object."<init>":()V
- 4: aload_0
- 5: iconst_1
- 6: putfield #x // Field stub:I
- 9: aload_0
- 10: iconst_2
- 11: putfield #x // Field keep:I
- 14: return
+ x: aload_0
+ x: invokespecial #x // Method java/lang/Object."<init>":()V
+ x: aload_0
+ x: iconst_1
+ x: putfield #x // Field stub:I
+ x: aload_0
+ x: iconst_2
+ x: putfield #x // Field keep:I
+ x: return
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
0 15 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkClassAnnotations;
RuntimeInvisibleAnnotations:
- 0: #x()
+ x: #x()
android.hosttest.annotation.HostSideTestStub
public int addOne(int);
@@ -379,17 +379,17 @@
flags: (0x0001) ACC_PUBLIC
Code:
stack=2, locals=2, args_size=2
- 0: aload_0
- 1: iload_1
- 2: invokevirtual #x // Method addOneInner:(I)I
- 5: ireturn
+ x: aload_0
+ x: iload_1
+ x: invokevirtual #x // Method addOneInner:(I)I
+ x: ireturn
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
0 6 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkClassAnnotations;
0 6 1 value I
RuntimeInvisibleAnnotations:
- 0: #x()
+ x: #x()
android.hosttest.annotation.HostSideTestStub
public int addOneInner(int);
@@ -397,23 +397,23 @@
flags: (0x0001) ACC_PUBLIC
Code:
stack=4, locals=2, args_size=2
- 0: ldc #x // String com/android/hoststubgen/test/tinyframework/TinyFrameworkClassAnnotations
- 2: ldc #x // String addOneInner
- 4: ldc #x // String (I)I
- 6: invokestatic #x // Method com/android/hoststubgen/hosthelper/HostTestUtils.getStackWalker:()Ljava/lang/StackWalker;
- 9: invokevirtual #x // Method java/lang/StackWalker.getCallerClass:()Ljava/lang/Class;
- 12: invokestatic #x // Method com/android/hoststubgen/hosthelper/HostTestUtils.onNonStubMethodCalled:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Class;)V
- 15: iload_1
- 16: iconst_1
- 17: iadd
- 18: ireturn
+ x: ldc #x // String com/android/hoststubgen/test/tinyframework/TinyFrameworkClassAnnotations
+ x: ldc #x // String addOneInner
+ x: ldc #x // String (I)I
+ x: invokestatic #x // Method com/android/hoststubgen/hosthelper/HostTestUtils.getStackWalker:()Ljava/lang/StackWalker;
+ x: invokevirtual #x // Method java/lang/StackWalker.getCallerClass:()Ljava/lang/Class;
+ x: invokestatic #x // Method com/android/hoststubgen/hosthelper/HostTestUtils.onNonStubMethodCalled:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Class;)V
+ x: iload_1
+ x: iconst_1
+ x: iadd
+ x: ireturn
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
15 4 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkClassAnnotations;
15 4 1 value I
RuntimeInvisibleAnnotations:
- 0: #x()
+ x: #x()
android.hosttest.annotation.HostSideTestKeep
public int addTwo(int);
@@ -421,10 +421,10 @@
flags: (0x0001) ACC_PUBLIC
Code:
stack=2, locals=2, args_size=2
- 0: iload_1
- 1: iconst_2
- 2: iadd
- 3: ireturn
+ x: iload_1
+ x: iconst_2
+ x: iadd
+ x: ireturn
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
@@ -436,10 +436,10 @@
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=2, locals=1, args_size=1
- 0: iload_0
- 1: iconst_3
- 2: iadd
- 3: ireturn
+ x: iload_0
+ x: iconst_3
+ x: iadd
+ x: ireturn
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
@@ -450,20 +450,20 @@
flags: (0x0001) ACC_PUBLIC
Code:
stack=4, locals=1, args_size=1
- 0: ldc #x // String com/android/hoststubgen/test/tinyframework/TinyFrameworkClassAnnotations
- 2: ldc #x // String unsupportedMethod
- 4: ldc #x // String ()Ljava/lang/String;
- 6: invokestatic #x // Method com/android/hoststubgen/hosthelper/HostTestUtils.getStackWalker:()Ljava/lang/StackWalker;
- 9: invokevirtual #x // Method java/lang/StackWalker.getCallerClass:()Ljava/lang/Class;
- 12: invokestatic #x // Method com/android/hoststubgen/hosthelper/HostTestUtils.onNonStubMethodCalled:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Class;)V
- 15: invokestatic #x // Method com/android/hoststubgen/hosthelper/HostTestUtils.onThrowMethodCalled:()V
- 18: new #x // class java/lang/RuntimeException
- 21: dup
- 22: ldc #x // String Unreachable
- 24: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
- 27: athrow
+ x: ldc #x // String com/android/hoststubgen/test/tinyframework/TinyFrameworkClassAnnotations
+ x: ldc #x // String unsupportedMethod
+ x: ldc #x // String ()Ljava/lang/String;
+ x: invokestatic #x // Method com/android/hoststubgen/hosthelper/HostTestUtils.getStackWalker:()Ljava/lang/StackWalker;
+ x: invokevirtual #x // Method java/lang/StackWalker.getCallerClass:()Ljava/lang/Class;
+ x: invokestatic #x // Method com/android/hoststubgen/hosthelper/HostTestUtils.onNonStubMethodCalled:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Class;)V
+ x: invokestatic #x // Method com/android/hoststubgen/hosthelper/HostTestUtils.onThrowMethodCalled:()V
+ x: new #x // class java/lang/RuntimeException
+ x: dup
+ x: ldc #x // String Unreachable
+ x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
+ x: athrow
RuntimeInvisibleAnnotations:
- 0: #x()
+ x: #x()
android.hosttest.annotation.HostSideTestThrow
public java.lang.String visibleButUsesUnsupportedMethod();
@@ -471,27 +471,27 @@
flags: (0x0001) ACC_PUBLIC
Code:
stack=1, locals=1, args_size=1
- 0: aload_0
- 1: invokevirtual #x // Method unsupportedMethod:()Ljava/lang/String;
- 4: areturn
+ x: aload_0
+ x: invokevirtual #x // Method unsupportedMethod:()Ljava/lang/String;
+ x: areturn
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
0 5 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkClassAnnotations;
RuntimeInvisibleAnnotations:
- 0: #x()
+ x: #x()
android.hosttest.annotation.HostSideTestStub
}
SourceFile: "TinyFrameworkClassAnnotations.java"
RuntimeVisibleAnnotations:
- 0: #x()
+ x: #x()
com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
- 1: #x()
+ x: #x()
com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
RuntimeInvisibleAnnotations:
- 0: #x()
+ x: #x()
android.hosttest.annotation.HostSideTestStub
- 1: #x(#x=s#x)
+ x: #x(#x=s#x)
android.hosttest.annotation.HostSideTestClassLoadHook(
value="com.android.hoststubgen.test.tinyframework.TinyFrameworkClassLoadHook.onClassLoaded"
)
@@ -521,15 +521,15 @@
flags: (0x0001) ACC_PUBLIC
Code:
stack=2, locals=1, args_size=1
- 0: aload_0
- 1: invokespecial #x // Method java/lang/Object."<init>":()V
- 4: aload_0
- 5: iconst_1
- 6: putfield #x // Field stub:I
- 9: aload_0
- 10: iconst_2
- 11: putfield #x // Field keep:I
- 14: return
+ x: aload_0
+ x: invokespecial #x // Method java/lang/Object."<init>":()V
+ x: aload_0
+ x: iconst_1
+ x: putfield #x // Field stub:I
+ x: aload_0
+ x: iconst_2
+ x: putfield #x // Field keep:I
+ x: return
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
@@ -540,10 +540,10 @@
flags: (0x0001) ACC_PUBLIC
Code:
stack=2, locals=2, args_size=2
- 0: aload_0
- 1: iload_1
- 2: invokevirtual #x // Method addOneInner:(I)I
- 5: ireturn
+ x: aload_0
+ x: iload_1
+ x: invokevirtual #x // Method addOneInner:(I)I
+ x: ireturn
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
@@ -555,10 +555,10 @@
flags: (0x0001) ACC_PUBLIC
Code:
stack=2, locals=2, args_size=2
- 0: iload_1
- 1: iconst_1
- 2: iadd
- 3: ireturn
+ x: iload_1
+ x: iconst_1
+ x: iadd
+ x: ireturn
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
@@ -570,10 +570,10 @@
flags: (0x0001) ACC_PUBLIC
Code:
stack=2, locals=2, args_size=2
- 0: new #x // class java/lang/RuntimeException
- 3: dup
- 4: invokespecial #x // Method java/lang/RuntimeException."<init>":()V
- 7: athrow
+ x: new #x // class java/lang/RuntimeException
+ x: dup
+ x: invokespecial #x // Method java/lang/RuntimeException."<init>":()V
+ x: athrow
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
@@ -585,10 +585,10 @@
flags: (0x0001) ACC_PUBLIC
Code:
stack=2, locals=2, args_size=2
- 0: iload_1
- 1: iconst_2
- 2: iadd
- 3: ireturn
+ x: iload_1
+ x: iconst_2
+ x: iadd
+ x: ireturn
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
@@ -600,10 +600,10 @@
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=2, locals=1, args_size=1
- 0: iload_0
- 1: iconst_3
- 2: iadd
- 3: ireturn
+ x: iload_0
+ x: iconst_3
+ x: iadd
+ x: ireturn
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
@@ -614,8 +614,8 @@
flags: (0x0001) ACC_PUBLIC
Code:
stack=1, locals=1, args_size=1
- 0: ldc #x // String This value shouldn\'t be seen on the host side.
- 2: areturn
+ x: ldc #x // String This value shouldn\'t be seen on the host side.
+ x: areturn
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
@@ -626,9 +626,9 @@
flags: (0x0001) ACC_PUBLIC
Code:
stack=1, locals=1, args_size=1
- 0: aload_0
- 1: invokevirtual #x // Method unsupportedMethod:()Ljava/lang/String;
- 4: areturn
+ x: aload_0
+ x: invokevirtual #x // Method unsupportedMethod:()Ljava/lang/String;
+ x: areturn
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
@@ -636,12 +636,12 @@
}
SourceFile: "TinyFrameworkClassClassWideAnnotations.java"
RuntimeVisibleAnnotations:
- 0: #x()
+ x: #x()
com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
- 1: #x()
+ x: #x()
com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
RuntimeInvisibleAnnotations:
- 0: #x()
+ x: #x()
android.hosttest.annotation.HostSideTestWholeClassStub
## Class: com/android/hoststubgen/test/tinyframework/TinyFrameworkClassLoadHook.class
Compiled from "TinyFrameworkClassLoadHook.java"
@@ -662,9 +662,9 @@
flags: (0x0002) ACC_PRIVATE
Code:
stack=1, locals=1, args_size=1
- 0: aload_0
- 1: invokespecial #x // Method java/lang/Object."<init>":()V
- 4: return
+ x: aload_0
+ x: invokespecial #x // Method java/lang/Object."<init>":()V
+ x: return
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
@@ -675,11 +675,11 @@
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=2, locals=1, args_size=1
- 0: getstatic #x // Field sLoadedClasses:Ljava/util/Set;
- 3: aload_0
- 4: invokeinterface #x, 2 // InterfaceMethod java/util/Set.add:(Ljava/lang/Object;)Z
- 9: pop
- 10: return
+ x: getstatic #x // Field sLoadedClasses:Ljava/util/Set;
+ x: aload_0
+ x: invokeinterface #x, 2 // InterfaceMethod java/util/Set.add:(Ljava/lang/Object;)Z
+ x: pop
+ x: return
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
@@ -694,21 +694,21 @@
flags: (0x0008) ACC_STATIC
Code:
stack=2, locals=0, args_size=0
- 0: new #x // class java/util/HashSet
- 3: dup
- 4: invokespecial #x // Method java/util/HashSet."<init>":()V
- 7: putstatic #x // Field sLoadedClasses:Ljava/util/Set;
- 10: return
+ x: new #x // class java/util/HashSet
+ x: dup
+ x: invokespecial #x // Method java/util/HashSet."<init>":()V
+ x: putstatic #x // Field sLoadedClasses:Ljava/util/Set;
+ x: return
LineNumberTable:
}
SourceFile: "TinyFrameworkClassLoadHook.java"
RuntimeVisibleAnnotations:
- 0: #x()
+ x: #x()
com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
- 1: #x()
+ x: #x()
com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
RuntimeInvisibleAnnotations:
- 0: #x()
+ x: #x()
android.hosttest.annotation.HostSideTestWholeClassStub
## Class: com/android/hoststubgen/test/tinyframework/TinyFrameworkClassWithInitializer.class
Compiled from "TinyFrameworkClassWithInitializer.java"
@@ -728,9 +728,9 @@
flags: (0x0001) ACC_PUBLIC
Code:
stack=1, locals=1, args_size=1
- 0: aload_0
- 1: invokespecial #x // Method java/lang/Object."<init>":()V
- 4: return
+ x: aload_0
+ x: invokespecial #x // Method java/lang/Object."<init>":()V
+ x: return
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
@@ -741,26 +741,26 @@
flags: (0x0008) ACC_STATIC
Code:
stack=2, locals=0, args_size=0
- 0: ldc #x // class com/android/hoststubgen/test/tinyframework/TinyFrameworkClassWithInitializer
- 2: ldc #x // String com.android.hoststubgen.test.tinyframework.TinyFrameworkClassLoadHook.onClassLoaded
- 4: invokestatic #x // Method com/android/hoststubgen/hosthelper/HostTestUtils.onClassLoaded:(Ljava/lang/Class;Ljava/lang/String;)V
- 7: iconst_1
- 8: putstatic #x // Field sInitialized:Z
- 11: return
+ x: ldc #x // class com/android/hoststubgen/test/tinyframework/TinyFrameworkClassWithInitializer
+ x: ldc #x // String com.android.hoststubgen.test.tinyframework.TinyFrameworkClassLoadHook.onClassLoaded
+ x: invokestatic #x // Method com/android/hoststubgen/hosthelper/HostTestUtils.onClassLoaded:(Ljava/lang/Class;Ljava/lang/String;)V
+ x: iconst_1
+ x: putstatic #x // Field sInitialized:Z
+ x: return
LineNumberTable:
}
SourceFile: "TinyFrameworkClassWithInitializer.java"
RuntimeVisibleAnnotations:
- 0: #x()
+ x: #x()
com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
- 1: #x()
+ x: #x()
com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
RuntimeInvisibleAnnotations:
- 0: #x(#x=s#x)
+ x: #x(#x=s#x)
android.hosttest.annotation.HostSideTestClassLoadHook(
value="com.android.hoststubgen.test.tinyframework.TinyFrameworkClassLoadHook.onClassLoaded"
)
- 1: #x()
+ x: #x()
android.hosttest.annotation.HostSideTestWholeClassStub
## Class: com/android/hoststubgen/test/tinyframework/TinyFrameworkExceptionTester.class
Compiled from "TinyFrameworkExceptionTester.java"
@@ -776,9 +776,9 @@
flags: (0x0001) ACC_PUBLIC
Code:
stack=1, locals=1, args_size=1
- 0: aload_0
- 1: invokespecial #x // Method java/lang/Object."<init>":()V
- 4: return
+ x: aload_0
+ x: invokespecial #x // Method java/lang/Object."<init>":()V
+ x: return
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
@@ -789,18 +789,18 @@
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=4, locals=1, args_size=0
- 0: new #x // class java/lang/IllegalStateException
- 3: dup
- 4: ldc #x // String Inner exception
- 6: invokespecial #x // Method java/lang/IllegalStateException."<init>":(Ljava/lang/String;)V
- 9: athrow
- 10: astore_0
- 11: new #x // class java/lang/RuntimeException
- 14: dup
- 15: ldc #x // String Outer exception
- 17: aload_0
- 18: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;Ljava/lang/Throwable;)V
- 21: athrow
+ x: new #x // class java/lang/IllegalStateException
+ x: dup
+ x: ldc #x // String Inner exception
+ x: invokespecial #x // Method java/lang/IllegalStateException."<init>":(Ljava/lang/String;)V
+ x: athrow
+ x: astore_0
+ x: new #x // class java/lang/RuntimeException
+ x: dup
+ x: ldc #x // String Outer exception
+ x: aload_0
+ x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;Ljava/lang/Throwable;)V
+ x: athrow
Exception table:
from to target type
0 10 10 Class java/lang/Exception
@@ -814,12 +814,12 @@
}
SourceFile: "TinyFrameworkExceptionTester.java"
RuntimeVisibleAnnotations:
- 0: #x()
+ x: #x()
com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
- 1: #x()
+ x: #x()
com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
RuntimeInvisibleAnnotations:
- 0: #x()
+ x: #x()
android.hosttest.annotation.HostSideTestWholeClassStub
## Class: com/android/hoststubgen/test/tinyframework/TinyFrameworkForTextPolicy.class
Compiled from "TinyFrameworkForTextPolicy.java"
@@ -843,25 +843,25 @@
flags: (0x000a) ACC_PRIVATE, ACC_STATIC
Code:
stack=2, locals=0, args_size=0
- 0: ldc #x // class com/android/hoststubgen/test/tinyframework/TinyFrameworkForTextPolicy
- 2: ldc #x // String com.android.hoststubgen.test.tinyframework.TinyFrameworkClassLoadHook.onClassLoaded
- 4: invokestatic #x // Method com/android/hoststubgen/hosthelper/HostTestUtils.onClassLoaded:(Ljava/lang/Class;Ljava/lang/String;)V
- 7: return
+ x: ldc #x // class com/android/hoststubgen/test/tinyframework/TinyFrameworkForTextPolicy
+ x: ldc #x // String com.android.hoststubgen.test.tinyframework.TinyFrameworkClassLoadHook.onClassLoaded
+ x: invokestatic #x // Method com/android/hoststubgen/hosthelper/HostTestUtils.onClassLoaded:(Ljava/lang/Class;Ljava/lang/String;)V
+ x: return
public com.android.hoststubgen.test.tinyframework.TinyFrameworkForTextPolicy();
descriptor: ()V
flags: (0x0001) ACC_PUBLIC
Code:
stack=2, locals=1, args_size=1
- 0: aload_0
- 1: invokespecial #x // Method java/lang/Object."<init>":()V
- 4: aload_0
- 5: iconst_1
- 6: putfield #x // Field stub:I
- 9: aload_0
- 10: iconst_2
- 11: putfield #x // Field keep:I
- 14: return
+ x: aload_0
+ x: invokespecial #x // Method java/lang/Object."<init>":()V
+ x: aload_0
+ x: iconst_1
+ x: putfield #x // Field stub:I
+ x: aload_0
+ x: iconst_2
+ x: putfield #x // Field keep:I
+ x: return
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
@@ -872,10 +872,10 @@
flags: (0x0001) ACC_PUBLIC
Code:
stack=2, locals=2, args_size=2
- 0: aload_0
- 1: iload_1
- 2: invokevirtual #x // Method addOneInner:(I)I
- 5: ireturn
+ x: aload_0
+ x: iload_1
+ x: invokevirtual #x // Method addOneInner:(I)I
+ x: ireturn
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
@@ -887,16 +887,16 @@
flags: (0x0001) ACC_PUBLIC
Code:
stack=4, locals=2, args_size=2
- 0: ldc #x // String com/android/hoststubgen/test/tinyframework/TinyFrameworkForTextPolicy
- 2: ldc #x // String addOneInner
- 4: ldc #x // String (I)I
- 6: invokestatic #x // Method com/android/hoststubgen/hosthelper/HostTestUtils.getStackWalker:()Ljava/lang/StackWalker;
- 9: invokevirtual #x // Method java/lang/StackWalker.getCallerClass:()Ljava/lang/Class;
- 12: invokestatic #x // Method com/android/hoststubgen/hosthelper/HostTestUtils.onNonStubMethodCalled:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Class;)V
- 15: iload_1
- 16: iconst_1
- 17: iadd
- 18: ireturn
+ x: ldc #x // String com/android/hoststubgen/test/tinyframework/TinyFrameworkForTextPolicy
+ x: ldc #x // String addOneInner
+ x: ldc #x // String (I)I
+ x: invokestatic #x // Method com/android/hoststubgen/hosthelper/HostTestUtils.getStackWalker:()Ljava/lang/StackWalker;
+ x: invokevirtual #x // Method java/lang/StackWalker.getCallerClass:()Ljava/lang/Class;
+ x: invokestatic #x // Method com/android/hoststubgen/hosthelper/HostTestUtils.onNonStubMethodCalled:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Class;)V
+ x: iload_1
+ x: iconst_1
+ x: iadd
+ x: ireturn
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
@@ -908,10 +908,10 @@
flags: (0x0001) ACC_PUBLIC
Code:
stack=2, locals=2, args_size=2
- 0: iload_1
- 1: iconst_2
- 2: iadd
- 3: ireturn
+ x: iload_1
+ x: iconst_2
+ x: iadd
+ x: ireturn
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
@@ -923,10 +923,10 @@
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=2, locals=1, args_size=1
- 0: iload_0
- 1: iconst_3
- 2: iadd
- 3: ireturn
+ x: iload_0
+ x: iconst_3
+ x: iadd
+ x: ireturn
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
@@ -937,27 +937,27 @@
flags: (0x0001) ACC_PUBLIC
Code:
stack=4, locals=1, args_size=1
- 0: ldc #x // String com/android/hoststubgen/test/tinyframework/TinyFrameworkForTextPolicy
- 2: ldc #x // String unsupportedMethod
- 4: ldc #x // String ()Ljava/lang/String;
- 6: invokestatic #x // Method com/android/hoststubgen/hosthelper/HostTestUtils.getStackWalker:()Ljava/lang/StackWalker;
- 9: invokevirtual #x // Method java/lang/StackWalker.getCallerClass:()Ljava/lang/Class;
- 12: invokestatic #x // Method com/android/hoststubgen/hosthelper/HostTestUtils.onNonStubMethodCalled:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Class;)V
- 15: invokestatic #x // Method com/android/hoststubgen/hosthelper/HostTestUtils.onThrowMethodCalled:()V
- 18: new #x // class java/lang/RuntimeException
- 21: dup
- 22: ldc #x // String Unreachable
- 24: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
- 27: athrow
+ x: ldc #x // String com/android/hoststubgen/test/tinyframework/TinyFrameworkForTextPolicy
+ x: ldc #x // String unsupportedMethod
+ x: ldc #x // String ()Ljava/lang/String;
+ x: invokestatic #x // Method com/android/hoststubgen/hosthelper/HostTestUtils.getStackWalker:()Ljava/lang/StackWalker;
+ x: invokevirtual #x // Method java/lang/StackWalker.getCallerClass:()Ljava/lang/Class;
+ x: invokestatic #x // Method com/android/hoststubgen/hosthelper/HostTestUtils.onNonStubMethodCalled:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Class;)V
+ x: invokestatic #x // Method com/android/hoststubgen/hosthelper/HostTestUtils.onThrowMethodCalled:()V
+ x: new #x // class java/lang/RuntimeException
+ x: dup
+ x: ldc #x // String Unreachable
+ x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
+ x: athrow
public java.lang.String visibleButUsesUnsupportedMethod();
descriptor: ()Ljava/lang/String;
flags: (0x0001) ACC_PUBLIC
Code:
stack=1, locals=1, args_size=1
- 0: aload_0
- 1: invokevirtual #x // Method unsupportedMethod:()Ljava/lang/String;
- 4: areturn
+ x: aload_0
+ x: invokevirtual #x // Method unsupportedMethod:()Ljava/lang/String;
+ x: areturn
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
@@ -965,9 +965,9 @@
}
SourceFile: "TinyFrameworkForTextPolicy.java"
RuntimeVisibleAnnotations:
- 0: #x()
+ x: #x()
com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
- 1: #x()
+ x: #x()
com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
## Class: com/android/hoststubgen/test/tinyframework/TinyFrameworkNative.class
Compiled from "TinyFrameworkNative.java"
@@ -983,9 +983,9 @@
flags: (0x0001) ACC_PUBLIC
Code:
stack=1, locals=1, args_size=1
- 0: aload_0
- 1: invokespecial #x // Method java/lang/Object."<init>":()V
- 4: return
+ x: aload_0
+ x: invokespecial #x // Method java/lang/Object."<init>":()V
+ x: return
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
@@ -996,18 +996,18 @@
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=1, locals=1, args_size=1
- 0: iload_0
- 1: invokestatic #x // Method com/android/hoststubgen/test/tinyframework/TinyFrameworkNative_host.nativeAddTwo:(I)I
- 4: ireturn
+ x: iload_0
+ x: invokestatic #x // Method com/android/hoststubgen/test/tinyframework/TinyFrameworkNative_host.nativeAddTwo:(I)I
+ x: ireturn
public static int nativeAddTwo_should_be_like_this(int);
descriptor: (I)I
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=1, locals=1, args_size=1
- 0: iload_0
- 1: invokestatic #x // Method com/android/hoststubgen/test/tinyframework/TinyFrameworkNative_host.nativeAddTwo:(I)I
- 4: ireturn
+ x: iload_0
+ x: invokestatic #x // Method com/android/hoststubgen/test/tinyframework/TinyFrameworkNative_host.nativeAddTwo:(I)I
+ x: ireturn
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
@@ -1018,20 +1018,20 @@
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=4, locals=4, args_size=2
- 0: lload_0
- 1: lload_2
- 2: invokestatic #x // Method com/android/hoststubgen/test/tinyframework/TinyFrameworkNative_host.nativeLongPlus:(JJ)J
- 5: lreturn
+ x: lload_0
+ x: lload_2
+ x: invokestatic #x // Method com/android/hoststubgen/test/tinyframework/TinyFrameworkNative_host.nativeLongPlus:(JJ)J
+ x: lreturn
public static long nativeLongPlus_should_be_like_this(long, long);
descriptor: (JJ)J
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=4, locals=4, args_size=2
- 0: lload_0
- 1: lload_2
- 2: invokestatic #x // Method com/android/hoststubgen/test/tinyframework/TinyFrameworkNative_host.nativeLongPlus:(JJ)J
- 5: lreturn
+ x: lload_0
+ x: lload_2
+ x: invokestatic #x // Method com/android/hoststubgen/test/tinyframework/TinyFrameworkNative_host.nativeLongPlus:(JJ)J
+ x: lreturn
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
@@ -1040,14 +1040,14 @@
}
SourceFile: "TinyFrameworkNative.java"
RuntimeVisibleAnnotations:
- 0: #x()
+ x: #x()
com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
- 1: #x()
+ x: #x()
com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
RuntimeInvisibleAnnotations:
- 0: #x()
+ x: #x()
android.hosttest.annotation.HostSideTestWholeClassStub
- 1: #x(#x=s#x)
+ x: #x(#x=s#x)
android.hosttest.annotation.HostSideTestNativeSubstitutionClass(
value="TinyFrameworkNative_host"
)
@@ -1065,15 +1065,15 @@
flags: (0x0001) ACC_PUBLIC
Code:
stack=4, locals=1, args_size=1
- 0: ldc #x // String com/android/hoststubgen/test/tinyframework/TinyFrameworkNative_host
- 2: ldc #x // String <init>
- 4: ldc #x // String ()V
- 6: invokestatic #x // Method com/android/hoststubgen/hosthelper/HostTestUtils.getStackWalker:()Ljava/lang/StackWalker;
- 9: invokevirtual #x // Method java/lang/StackWalker.getCallerClass:()Ljava/lang/Class;
- 12: invokestatic #x // Method com/android/hoststubgen/hosthelper/HostTestUtils.onNonStubMethodCalled:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Class;)V
- 15: aload_0
- 16: invokespecial #x // Method java/lang/Object."<init>":()V
- 19: return
+ x: ldc #x // String com/android/hoststubgen/test/tinyframework/TinyFrameworkNative_host
+ x: ldc #x // String <init>
+ x: ldc #x // String ()V
+ x: invokestatic #x // Method com/android/hoststubgen/hosthelper/HostTestUtils.getStackWalker:()Ljava/lang/StackWalker;
+ x: invokevirtual #x // Method java/lang/StackWalker.getCallerClass:()Ljava/lang/Class;
+ x: invokestatic #x // Method com/android/hoststubgen/hosthelper/HostTestUtils.onNonStubMethodCalled:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Class;)V
+ x: aload_0
+ x: invokespecial #x // Method java/lang/Object."<init>":()V
+ x: return
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
@@ -1084,16 +1084,16 @@
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=4, locals=1, args_size=1
- 0: ldc #x // String com/android/hoststubgen/test/tinyframework/TinyFrameworkNative_host
- 2: ldc #x // String nativeAddTwo
- 4: ldc #x // String (I)I
- 6: invokestatic #x // Method com/android/hoststubgen/hosthelper/HostTestUtils.getStackWalker:()Ljava/lang/StackWalker;
- 9: invokevirtual #x // Method java/lang/StackWalker.getCallerClass:()Ljava/lang/Class;
- 12: invokestatic #x // Method com/android/hoststubgen/hosthelper/HostTestUtils.onNonStubMethodCalled:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Class;)V
- 15: iload_0
- 16: iconst_2
- 17: iadd
- 18: ireturn
+ x: ldc #x // String com/android/hoststubgen/test/tinyframework/TinyFrameworkNative_host
+ x: ldc #x // String nativeAddTwo
+ x: ldc #x // String (I)I
+ x: invokestatic #x // Method com/android/hoststubgen/hosthelper/HostTestUtils.getStackWalker:()Ljava/lang/StackWalker;
+ x: invokevirtual #x // Method java/lang/StackWalker.getCallerClass:()Ljava/lang/Class;
+ x: invokestatic #x // Method com/android/hoststubgen/hosthelper/HostTestUtils.onNonStubMethodCalled:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Class;)V
+ x: iload_0
+ x: iconst_2
+ x: iadd
+ x: ireturn
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
@@ -1104,16 +1104,16 @@
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=4, locals=4, args_size=2
- 0: ldc #x // String com/android/hoststubgen/test/tinyframework/TinyFrameworkNative_host
- 2: ldc #x // String nativeLongPlus
- 4: ldc #x // String (JJ)J
- 6: invokestatic #x // Method com/android/hoststubgen/hosthelper/HostTestUtils.getStackWalker:()Ljava/lang/StackWalker;
- 9: invokevirtual #x // Method java/lang/StackWalker.getCallerClass:()Ljava/lang/Class;
- 12: invokestatic #x // Method com/android/hoststubgen/hosthelper/HostTestUtils.onNonStubMethodCalled:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Class;)V
- 15: lload_0
- 16: lload_2
- 17: ladd
- 18: lreturn
+ x: ldc #x // String com/android/hoststubgen/test/tinyframework/TinyFrameworkNative_host
+ x: ldc #x // String nativeLongPlus
+ x: ldc #x // String (JJ)J
+ x: invokestatic #x // Method com/android/hoststubgen/hosthelper/HostTestUtils.getStackWalker:()Ljava/lang/StackWalker;
+ x: invokevirtual #x // Method java/lang/StackWalker.getCallerClass:()Ljava/lang/Class;
+ x: invokestatic #x // Method com/android/hoststubgen/hosthelper/HostTestUtils.onNonStubMethodCalled:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Class;)V
+ x: lload_0
+ x: lload_2
+ x: ladd
+ x: lreturn
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
@@ -1122,10 +1122,10 @@
}
SourceFile: "TinyFrameworkNative_host.java"
RuntimeVisibleAnnotations:
- 0: #x()
+ x: #x()
com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
RuntimeInvisibleAnnotations:
- 0: #x()
+ x: #x()
android.hosttest.annotation.HostSideTestWholeClassKeep
## Class: com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$1.class
Compiled from "TinyFrameworkNestedClasses.java"
@@ -1145,12 +1145,12 @@
flags: (0x0000)
Code:
stack=2, locals=2, args_size=2
- 0: aload_0
- 1: aload_1
- 2: putfield #x // Field this$0:Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses;
- 5: aload_0
- 6: invokespecial #x // Method java/lang/Object."<init>":()V
- 9: return
+ x: aload_0
+ x: aload_1
+ x: putfield #x // Field this$0:Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses;
+ x: aload_0
+ x: invokespecial #x // Method java/lang/Object."<init>":()V
+ x: return
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
@@ -1162,15 +1162,15 @@
flags: (0x0001) ACC_PUBLIC
Code:
stack=4, locals=1, args_size=1
- 0: ldc #x // String com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$1
- 2: ldc #x // String get
- 4: ldc #x // String ()Ljava/lang/Integer;
- 6: invokestatic #x // Method com/android/hoststubgen/hosthelper/HostTestUtils.getStackWalker:()Ljava/lang/StackWalker;
- 9: invokevirtual #x // Method java/lang/StackWalker.getCallerClass:()Ljava/lang/Class;
- 12: invokestatic #x // Method com/android/hoststubgen/hosthelper/HostTestUtils.onNonStubMethodCalled:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Class;)V
- 15: iconst_1
- 16: invokestatic #x // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
- 19: areturn
+ x: ldc #x // String com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$1
+ x: ldc #x // String get
+ x: ldc #x // String ()Ljava/lang/Integer;
+ x: invokestatic #x // Method com/android/hoststubgen/hosthelper/HostTestUtils.getStackWalker:()Ljava/lang/StackWalker;
+ x: invokevirtual #x // Method java/lang/StackWalker.getCallerClass:()Ljava/lang/Class;
+ x: invokestatic #x // Method com/android/hoststubgen/hosthelper/HostTestUtils.onNonStubMethodCalled:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Class;)V
+ x: iconst_1
+ x: invokestatic #x // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
+ x: areturn
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
@@ -1181,15 +1181,15 @@
flags: (0x1041) ACC_PUBLIC, ACC_BRIDGE, ACC_SYNTHETIC
Code:
stack=4, locals=1, args_size=1
- 0: ldc #x // String com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$1
- 2: ldc #x // String get
- 4: ldc #x // String ()Ljava/lang/Object;
- 6: invokestatic #x // Method com/android/hoststubgen/hosthelper/HostTestUtils.getStackWalker:()Ljava/lang/StackWalker;
- 9: invokevirtual #x // Method java/lang/StackWalker.getCallerClass:()Ljava/lang/Class;
- 12: invokestatic #x // Method com/android/hoststubgen/hosthelper/HostTestUtils.onNonStubMethodCalled:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Class;)V
- 15: aload_0
- 16: invokevirtual #x // Method get:()Ljava/lang/Integer;
- 19: areturn
+ x: ldc #x // String com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$1
+ x: ldc #x // String get
+ x: ldc #x // String ()Ljava/lang/Object;
+ x: invokestatic #x // Method com/android/hoststubgen/hosthelper/HostTestUtils.getStackWalker:()Ljava/lang/StackWalker;
+ x: invokevirtual #x // Method java/lang/StackWalker.getCallerClass:()Ljava/lang/Class;
+ x: invokestatic #x // Method com/android/hoststubgen/hosthelper/HostTestUtils.onNonStubMethodCalled:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Class;)V
+ x: aload_0
+ x: invokevirtual #x // Method get:()Ljava/lang/Integer;
+ x: areturn
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
@@ -1201,7 +1201,7 @@
Signature: #x // Ljava/lang/Object;Ljava/util/function/Supplier<Ljava/lang/Integer;>;
SourceFile: "TinyFrameworkNestedClasses.java"
RuntimeVisibleAnnotations:
- 0: #x()
+ x: #x()
com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
NestHost: class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses
## Class: com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$2.class
@@ -1218,9 +1218,9 @@
flags: (0x0000)
Code:
stack=1, locals=1, args_size=1
- 0: aload_0
- 1: invokespecial #x // Method java/lang/Object."<init>":()V
- 4: return
+ x: aload_0
+ x: invokespecial #x // Method java/lang/Object."<init>":()V
+ x: return
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
@@ -1231,15 +1231,15 @@
flags: (0x0001) ACC_PUBLIC
Code:
stack=4, locals=1, args_size=1
- 0: ldc #x // String com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$2
- 2: ldc #x // String get
- 4: ldc #x // String ()Ljava/lang/Integer;
- 6: invokestatic #x // Method com/android/hoststubgen/hosthelper/HostTestUtils.getStackWalker:()Ljava/lang/StackWalker;
- 9: invokevirtual #x // Method java/lang/StackWalker.getCallerClass:()Ljava/lang/Class;
- 12: invokestatic #x // Method com/android/hoststubgen/hosthelper/HostTestUtils.onNonStubMethodCalled:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Class;)V
- 15: iconst_2
- 16: invokestatic #x // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
- 19: areturn
+ x: ldc #x // String com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$2
+ x: ldc #x // String get
+ x: ldc #x // String ()Ljava/lang/Integer;
+ x: invokestatic #x // Method com/android/hoststubgen/hosthelper/HostTestUtils.getStackWalker:()Ljava/lang/StackWalker;
+ x: invokevirtual #x // Method java/lang/StackWalker.getCallerClass:()Ljava/lang/Class;
+ x: invokestatic #x // Method com/android/hoststubgen/hosthelper/HostTestUtils.onNonStubMethodCalled:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Class;)V
+ x: iconst_2
+ x: invokestatic #x // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
+ x: areturn
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
@@ -1250,15 +1250,15 @@
flags: (0x1041) ACC_PUBLIC, ACC_BRIDGE, ACC_SYNTHETIC
Code:
stack=4, locals=1, args_size=1
- 0: ldc #x // String com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$2
- 2: ldc #x // String get
- 4: ldc #x // String ()Ljava/lang/Object;
- 6: invokestatic #x // Method com/android/hoststubgen/hosthelper/HostTestUtils.getStackWalker:()Ljava/lang/StackWalker;
- 9: invokevirtual #x // Method java/lang/StackWalker.getCallerClass:()Ljava/lang/Class;
- 12: invokestatic #x // Method com/android/hoststubgen/hosthelper/HostTestUtils.onNonStubMethodCalled:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Class;)V
- 15: aload_0
- 16: invokevirtual #x // Method get:()Ljava/lang/Integer;
- 19: areturn
+ x: ldc #x // String com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$2
+ x: ldc #x // String get
+ x: ldc #x // String ()Ljava/lang/Object;
+ x: invokestatic #x // Method com/android/hoststubgen/hosthelper/HostTestUtils.getStackWalker:()Ljava/lang/StackWalker;
+ x: invokevirtual #x // Method java/lang/StackWalker.getCallerClass:()Ljava/lang/Class;
+ x: invokestatic #x // Method com/android/hoststubgen/hosthelper/HostTestUtils.onNonStubMethodCalled:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Class;)V
+ x: aload_0
+ x: invokevirtual #x // Method get:()Ljava/lang/Integer;
+ x: areturn
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
@@ -1270,7 +1270,7 @@
Signature: #x // Ljava/lang/Object;Ljava/util/function/Supplier<Ljava/lang/Integer;>;
SourceFile: "TinyFrameworkNestedClasses.java"
RuntimeVisibleAnnotations:
- 0: #x()
+ x: #x()
com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
NestHost: class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses
## Class: com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$3.class
@@ -1291,12 +1291,12 @@
flags: (0x0000)
Code:
stack=2, locals=2, args_size=2
- 0: aload_0
- 1: aload_1
- 2: putfield #x // Field this$0:Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses;
- 5: aload_0
- 6: invokespecial #x // Method java/lang/Object."<init>":()V
- 9: return
+ x: aload_0
+ x: aload_1
+ x: putfield #x // Field this$0:Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses;
+ x: aload_0
+ x: invokespecial #x // Method java/lang/Object."<init>":()V
+ x: return
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
@@ -1308,15 +1308,15 @@
flags: (0x0001) ACC_PUBLIC
Code:
stack=4, locals=1, args_size=1
- 0: ldc #x // String com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$3
- 2: ldc #x // String get
- 4: ldc #x // String ()Ljava/lang/Integer;
- 6: invokestatic #x // Method com/android/hoststubgen/hosthelper/HostTestUtils.getStackWalker:()Ljava/lang/StackWalker;
- 9: invokevirtual #x // Method java/lang/StackWalker.getCallerClass:()Ljava/lang/Class;
- 12: invokestatic #x // Method com/android/hoststubgen/hosthelper/HostTestUtils.onNonStubMethodCalled:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Class;)V
- 15: iconst_3
- 16: invokestatic #x // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
- 19: areturn
+ x: ldc #x // String com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$3
+ x: ldc #x // String get
+ x: ldc #x // String ()Ljava/lang/Integer;
+ x: invokestatic #x // Method com/android/hoststubgen/hosthelper/HostTestUtils.getStackWalker:()Ljava/lang/StackWalker;
+ x: invokevirtual #x // Method java/lang/StackWalker.getCallerClass:()Ljava/lang/Class;
+ x: invokestatic #x // Method com/android/hoststubgen/hosthelper/HostTestUtils.onNonStubMethodCalled:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Class;)V
+ x: iconst_3
+ x: invokestatic #x // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
+ x: areturn
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
@@ -1327,15 +1327,15 @@
flags: (0x1041) ACC_PUBLIC, ACC_BRIDGE, ACC_SYNTHETIC
Code:
stack=4, locals=1, args_size=1
- 0: ldc #x // String com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$3
- 2: ldc #x // String get
- 4: ldc #x // String ()Ljava/lang/Object;
- 6: invokestatic #x // Method com/android/hoststubgen/hosthelper/HostTestUtils.getStackWalker:()Ljava/lang/StackWalker;
- 9: invokevirtual #x // Method java/lang/StackWalker.getCallerClass:()Ljava/lang/Class;
- 12: invokestatic #x // Method com/android/hoststubgen/hosthelper/HostTestUtils.onNonStubMethodCalled:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Class;)V
- 15: aload_0
- 16: invokevirtual #x // Method get:()Ljava/lang/Integer;
- 19: areturn
+ x: ldc #x // String com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$3
+ x: ldc #x // String get
+ x: ldc #x // String ()Ljava/lang/Object;
+ x: invokestatic #x // Method com/android/hoststubgen/hosthelper/HostTestUtils.getStackWalker:()Ljava/lang/StackWalker;
+ x: invokevirtual #x // Method java/lang/StackWalker.getCallerClass:()Ljava/lang/Class;
+ x: invokestatic #x // Method com/android/hoststubgen/hosthelper/HostTestUtils.onNonStubMethodCalled:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Class;)V
+ x: aload_0
+ x: invokevirtual #x // Method get:()Ljava/lang/Integer;
+ x: areturn
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
@@ -1347,7 +1347,7 @@
Signature: #x // Ljava/lang/Object;Ljava/util/function/Supplier<Ljava/lang/Integer;>;
SourceFile: "TinyFrameworkNestedClasses.java"
RuntimeVisibleAnnotations:
- 0: #x()
+ x: #x()
com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
NestHost: class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses
## Class: com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$4.class
@@ -1364,9 +1364,9 @@
flags: (0x0000)
Code:
stack=1, locals=1, args_size=1
- 0: aload_0
- 1: invokespecial #x // Method java/lang/Object."<init>":()V
- 4: return
+ x: aload_0
+ x: invokespecial #x // Method java/lang/Object."<init>":()V
+ x: return
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
@@ -1377,15 +1377,15 @@
flags: (0x0001) ACC_PUBLIC
Code:
stack=4, locals=1, args_size=1
- 0: ldc #x // String com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$4
- 2: ldc #x // String get
- 4: ldc #x // String ()Ljava/lang/Integer;
- 6: invokestatic #x // Method com/android/hoststubgen/hosthelper/HostTestUtils.getStackWalker:()Ljava/lang/StackWalker;
- 9: invokevirtual #x // Method java/lang/StackWalker.getCallerClass:()Ljava/lang/Class;
- 12: invokestatic #x // Method com/android/hoststubgen/hosthelper/HostTestUtils.onNonStubMethodCalled:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Class;)V
- 15: iconst_4
- 16: invokestatic #x // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
- 19: areturn
+ x: ldc #x // String com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$4
+ x: ldc #x // String get
+ x: ldc #x // String ()Ljava/lang/Integer;
+ x: invokestatic #x // Method com/android/hoststubgen/hosthelper/HostTestUtils.getStackWalker:()Ljava/lang/StackWalker;
+ x: invokevirtual #x // Method java/lang/StackWalker.getCallerClass:()Ljava/lang/Class;
+ x: invokestatic #x // Method com/android/hoststubgen/hosthelper/HostTestUtils.onNonStubMethodCalled:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Class;)V
+ x: iconst_4
+ x: invokestatic #x // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
+ x: areturn
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
@@ -1396,15 +1396,15 @@
flags: (0x1041) ACC_PUBLIC, ACC_BRIDGE, ACC_SYNTHETIC
Code:
stack=4, locals=1, args_size=1
- 0: ldc #x // String com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$4
- 2: ldc #x // String get
- 4: ldc #x // String ()Ljava/lang/Object;
- 6: invokestatic #x // Method com/android/hoststubgen/hosthelper/HostTestUtils.getStackWalker:()Ljava/lang/StackWalker;
- 9: invokevirtual #x // Method java/lang/StackWalker.getCallerClass:()Ljava/lang/Class;
- 12: invokestatic #x // Method com/android/hoststubgen/hosthelper/HostTestUtils.onNonStubMethodCalled:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Class;)V
- 15: aload_0
- 16: invokevirtual #x // Method get:()Ljava/lang/Integer;
- 19: areturn
+ x: ldc #x // String com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$4
+ x: ldc #x // String get
+ x: ldc #x // String ()Ljava/lang/Object;
+ x: invokestatic #x // Method com/android/hoststubgen/hosthelper/HostTestUtils.getStackWalker:()Ljava/lang/StackWalker;
+ x: invokevirtual #x // Method java/lang/StackWalker.getCallerClass:()Ljava/lang/Class;
+ x: invokestatic #x // Method com/android/hoststubgen/hosthelper/HostTestUtils.onNonStubMethodCalled:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Class;)V
+ x: aload_0
+ x: invokevirtual #x // Method get:()Ljava/lang/Integer;
+ x: areturn
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
@@ -1416,7 +1416,7 @@
Signature: #x // Ljava/lang/Object;Ljava/util/function/Supplier<Ljava/lang/Integer;>;
SourceFile: "TinyFrameworkNestedClasses.java"
RuntimeVisibleAnnotations:
- 0: #x()
+ x: #x()
com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
NestHost: class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses
## Class: com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$BaseClass.class
@@ -1437,12 +1437,12 @@
flags: (0x0001) ACC_PUBLIC
Code:
stack=2, locals=2, args_size=2
- 0: aload_0
- 1: invokespecial #x // Method java/lang/Object."<init>":()V
- 4: aload_0
- 5: iload_1
- 6: putfield #x // Field value:I
- 9: return
+ x: aload_0
+ x: invokespecial #x // Method java/lang/Object."<init>":()V
+ x: aload_0
+ x: iload_1
+ x: putfield #x // Field value:I
+ x: return
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
@@ -1453,9 +1453,9 @@
public static #x= #x of #x; // BaseClass=class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$BaseClass of class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses
SourceFile: "TinyFrameworkNestedClasses.java"
RuntimeVisibleAnnotations:
- 0: #x()
+ x: #x()
com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
- 1: #x()
+ x: #x()
com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
NestHost: class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses
## Class: com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$InnerClass.class
@@ -1480,15 +1480,15 @@
flags: (0x0001) ACC_PUBLIC
Code:
stack=2, locals=2, args_size=2
- 0: aload_0
- 1: aload_1
- 2: putfield #x // Field this$0:Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses;
- 5: aload_0
- 6: invokespecial #x // Method java/lang/Object."<init>":()V
- 9: aload_0
- 10: iconst_5
- 11: putfield #x // Field value:I
- 14: return
+ x: aload_0
+ x: aload_1
+ x: putfield #x // Field this$0:Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses;
+ x: aload_0
+ x: invokespecial #x // Method java/lang/Object."<init>":()V
+ x: aload_0
+ x: iconst_5
+ x: putfield #x // Field value:I
+ x: return
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
@@ -1499,12 +1499,12 @@
public #x= #x of #x; // InnerClass=class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$InnerClass of class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses
SourceFile: "TinyFrameworkNestedClasses.java"
RuntimeVisibleAnnotations:
- 0: #x()
+ x: #x()
com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
- 1: #x()
+ x: #x()
com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
RuntimeInvisibleAnnotations:
- 0: #x()
+ x: #x()
android.hosttest.annotation.HostSideTestWholeClassStub
NestHost: class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses
## Class: com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$StaticNestedClass$1.class
@@ -1521,9 +1521,9 @@
flags: (0x0000)
Code:
stack=1, locals=1, args_size=1
- 0: aload_0
- 1: invokespecial #x // Method java/lang/Object."<init>":()V
- 4: return
+ x: aload_0
+ x: invokespecial #x // Method java/lang/Object."<init>":()V
+ x: return
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
@@ -1534,15 +1534,15 @@
flags: (0x0001) ACC_PUBLIC
Code:
stack=4, locals=1, args_size=1
- 0: ldc #x // String com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$StaticNestedClass$1
- 2: ldc #x // String get
- 4: ldc #x // String ()Ljava/lang/Integer;
- 6: invokestatic #x // Method com/android/hoststubgen/hosthelper/HostTestUtils.getStackWalker:()Ljava/lang/StackWalker;
- 9: invokevirtual #x // Method java/lang/StackWalker.getCallerClass:()Ljava/lang/Class;
- 12: invokestatic #x // Method com/android/hoststubgen/hosthelper/HostTestUtils.onNonStubMethodCalled:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Class;)V
- 15: bipush 7
- 17: invokestatic #x // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
- 20: areturn
+ x: ldc #x // String com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$StaticNestedClass$1
+ x: ldc #x // String get
+ x: ldc #x // String ()Ljava/lang/Integer;
+ x: invokestatic #x // Method com/android/hoststubgen/hosthelper/HostTestUtils.getStackWalker:()Ljava/lang/StackWalker;
+ x: invokevirtual #x // Method java/lang/StackWalker.getCallerClass:()Ljava/lang/Class;
+ x: invokestatic #x // Method com/android/hoststubgen/hosthelper/HostTestUtils.onNonStubMethodCalled:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Class;)V
+ x: bipush 7
+ x: invokestatic #x // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
+ x: areturn
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
@@ -1553,15 +1553,15 @@
flags: (0x1041) ACC_PUBLIC, ACC_BRIDGE, ACC_SYNTHETIC
Code:
stack=4, locals=1, args_size=1
- 0: ldc #x // String com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$StaticNestedClass$1
- 2: ldc #x // String get
- 4: ldc #x // String ()Ljava/lang/Object;
- 6: invokestatic #x // Method com/android/hoststubgen/hosthelper/HostTestUtils.getStackWalker:()Ljava/lang/StackWalker;
- 9: invokevirtual #x // Method java/lang/StackWalker.getCallerClass:()Ljava/lang/Class;
- 12: invokestatic #x // Method com/android/hoststubgen/hosthelper/HostTestUtils.onNonStubMethodCalled:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Class;)V
- 15: aload_0
- 16: invokevirtual #x // Method get:()Ljava/lang/Integer;
- 19: areturn
+ x: ldc #x // String com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$StaticNestedClass$1
+ x: ldc #x // String get
+ x: ldc #x // String ()Ljava/lang/Object;
+ x: invokestatic #x // Method com/android/hoststubgen/hosthelper/HostTestUtils.getStackWalker:()Ljava/lang/StackWalker;
+ x: invokevirtual #x // Method java/lang/StackWalker.getCallerClass:()Ljava/lang/Class;
+ x: invokestatic #x // Method com/android/hoststubgen/hosthelper/HostTestUtils.onNonStubMethodCalled:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Class;)V
+ x: aload_0
+ x: invokevirtual #x // Method get:()Ljava/lang/Integer;
+ x: areturn
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
@@ -1574,7 +1574,7 @@
Signature: #x // Ljava/lang/Object;Ljava/util/function/Supplier<Ljava/lang/Integer;>;
SourceFile: "TinyFrameworkNestedClasses.java"
RuntimeVisibleAnnotations:
- 0: #x()
+ x: #x()
com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
NestHost: class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses
## Class: com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$StaticNestedClass.class
@@ -1595,12 +1595,12 @@
flags: (0x0001) ACC_PUBLIC
Code:
stack=2, locals=1, args_size=1
- 0: aload_0
- 1: invokespecial #x // Method java/lang/Object."<init>":()V
- 4: aload_0
- 5: bipush 6
- 7: putfield #x // Field value:I
- 10: return
+ x: aload_0
+ x: invokespecial #x // Method java/lang/Object."<init>":()V
+ x: aload_0
+ x: bipush 6
+ x: putfield #x // Field value:I
+ x: return
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
@@ -1611,10 +1611,10 @@
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=2, locals=0, args_size=0
- 0: new #x // class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$StaticNestedClass$1
- 3: dup
- 4: invokespecial #x // Method com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$StaticNestedClass$1."<init>":()V
- 7: areturn
+ x: new #x // class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$StaticNestedClass$1
+ x: dup
+ x: invokespecial #x // Method com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$StaticNestedClass$1."<init>":()V
+ x: areturn
LineNumberTable:
Signature: #x // ()Ljava/util/function/Supplier<Ljava/lang/Integer;>;
}
@@ -1623,12 +1623,12 @@
#x; // class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$StaticNestedClass$1
SourceFile: "TinyFrameworkNestedClasses.java"
RuntimeVisibleAnnotations:
- 0: #x()
+ x: #x()
com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
- 1: #x()
+ x: #x()
com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
RuntimeInvisibleAnnotations:
- 0: #x()
+ x: #x()
android.hosttest.annotation.HostSideTestWholeClassStub
NestHost: class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses
## Class: com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$SubClass.class
@@ -1645,10 +1645,10 @@
flags: (0x0001) ACC_PUBLIC
Code:
stack=2, locals=2, args_size=2
- 0: aload_0
- 1: iload_1
- 2: invokespecial #x // Method com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$BaseClass."<init>":(I)V
- 5: return
+ x: aload_0
+ x: iload_1
+ x: invokespecial #x // Method com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$BaseClass."<init>":(I)V
+ x: return
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
@@ -1660,9 +1660,9 @@
public static #x= #x of #x; // SubClass=class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$SubClass of class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses
SourceFile: "TinyFrameworkNestedClasses.java"
RuntimeVisibleAnnotations:
- 0: #x()
+ x: #x()
com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
- 1: #x()
+ x: #x()
com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
NestHost: class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses
## Class: com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses.class
@@ -1689,15 +1689,15 @@
flags: (0x0001) ACC_PUBLIC
Code:
stack=4, locals=1, args_size=1
- 0: aload_0
- 1: invokespecial #x // Method java/lang/Object."<init>":()V
- 4: aload_0
- 5: new #x // class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$1
- 8: dup
- 9: aload_0
- 10: invokespecial #x // Method com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$1."<init>":(Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses;)V
- 13: putfield #x // Field mSupplier:Ljava/util/function/Supplier;
- 16: return
+ x: aload_0
+ x: invokespecial #x // Method java/lang/Object."<init>":()V
+ x: aload_0
+ x: new #x // class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$1
+ x: dup
+ x: aload_0
+ x: invokespecial #x // Method com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$1."<init>":(Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses;)V
+ x: putfield #x // Field mSupplier:Ljava/util/function/Supplier;
+ x: return
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
@@ -1708,11 +1708,11 @@
flags: (0x0001) ACC_PUBLIC
Code:
stack=3, locals=1, args_size=1
- 0: new #x // class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$3
- 3: dup
- 4: aload_0
- 5: invokespecial #x // Method com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$3."<init>":(Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses;)V
- 8: areturn
+ x: new #x // class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$3
+ x: dup
+ x: aload_0
+ x: invokespecial #x // Method com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$3."<init>":(Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses;)V
+ x: areturn
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
@@ -1724,10 +1724,10 @@
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=2, locals=0, args_size=0
- 0: new #x // class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$4
- 3: dup
- 4: invokespecial #x // Method com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$4."<init>":()V
- 7: areturn
+ x: new #x // class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$4
+ x: dup
+ x: invokespecial #x // Method com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$4."<init>":()V
+ x: areturn
LineNumberTable:
Signature: #x // ()Ljava/util/function/Supplier<Ljava/lang/Integer;>;
@@ -1736,11 +1736,11 @@
flags: (0x0008) ACC_STATIC
Code:
stack=2, locals=0, args_size=0
- 0: new #x // class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$2
- 3: dup
- 4: invokespecial #x // Method com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$2."<init>":()V
- 7: putstatic #x // Field sSupplier:Ljava/util/function/Supplier;
- 10: return
+ x: new #x // class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$2
+ x: dup
+ x: invokespecial #x // Method com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$2."<init>":()V
+ x: putstatic #x // Field sSupplier:Ljava/util/function/Supplier;
+ x: return
LineNumberTable:
}
InnerClasses:
@@ -1755,12 +1755,12 @@
#x; // class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$StaticNestedClass$1
SourceFile: "TinyFrameworkNestedClasses.java"
RuntimeVisibleAnnotations:
- 0: #x()
+ x: #x()
com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
- 1: #x()
+ x: #x()
com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
RuntimeInvisibleAnnotations:
- 0: #x()
+ x: #x()
android.hosttest.annotation.HostSideTestWholeClassStub
NestMembers:
com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$SubClass
diff --git a/tools/hoststubgen/scripts/dump-jar b/tools/hoststubgen/scripts/dump-jar
index 93729fb..992665e 100755
--- a/tools/hoststubgen/scripts/dump-jar
+++ b/tools/hoststubgen/scripts/dump-jar
@@ -93,6 +93,7 @@
if (( $simple )) ; then
# For "simple output" mode,
# - Normalize the constant numbers (replace with "#x")
+ # - Normalize byte code offsets and other similar numbers. (e.g. "0:" -> "x:")
# - Remove the constant pool
# - Remove the line number table
# - Some other transient lines
@@ -100,6 +101,7 @@
# `/PATTERN-1/,/PATTERN-1/{//!d}` is a trick to delete lines between two patterns, without
# the start and the end lines.
sed -e 's/#[0-9][0-9]*/#x/g' \
+ -e 's/^\( *\)[0-9][0-9]*:/\1x:/' \
-e '/^Constant pool:/,/^[^ ]/{//!d}' \
-e '/^ *line *[0-9][0-9]*: *[0-9][0-9]*$/d' \
-e '/SHA-256 checksum/d' \