Loading Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -375,6 +375,7 @@ java_defaults { "core/java/android/view/IDisplayFoldListener.aidl", "core/java/android/view/IGraphicsStats.aidl", "core/java/android/view/IGraphicsStatsCallback.aidl", "core/java/android/view/IInputMonitorHost.aidl", "core/java/android/view/IInputFilter.aidl", "core/java/android/view/IInputFilterHost.aidl", "core/java/android/view/IOnKeyguardExitResult.aidl", Loading apct-tests/perftests/multiuser/src/android/multiuser/UserLifecycleTests.java +109 −0 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ import android.content.pm.UserInfo; import android.os.RemoteException; import android.os.UserHandle; import android.os.UserManager; import android.util.Log; import androidx.test.InstrumentationRegistry; import androidx.test.filters.LargeTest; Loading Loading @@ -130,6 +131,47 @@ public class UserLifecycleTests { } } /** Tests switching to an already-created, but no-longer-running, user. */ @Test public void switchUser_stopped() throws Exception { while (mRunner.keepRunning()) { mRunner.pauseTiming(); final int startUser = mAm.getCurrentUser(); final int testUser = initializeNewUserAndSwitchBack(/* stopNewUser */ true); final CountDownLatch latch = new CountDownLatch(1); registerBroadcastReceiver(Intent.ACTION_USER_UNLOCKED, latch, testUser); mRunner.resumeTiming(); mAm.switchUser(testUser); boolean success = latch.await(TIMEOUT_IN_SECOND, TimeUnit.SECONDS); mRunner.pauseTiming(); attestTrue("Failed to achieve 2nd ACTION_USER_UNLOCKED for user " + testUser, success); switchUser(startUser); removeUser(testUser); mRunner.resumeTiming(); } } /** Tests switching to an already-created already-running non-owner user. */ @Test public void switchUser_running() throws Exception { while (mRunner.keepRunning()) { mRunner.pauseTiming(); final int startUser = mAm.getCurrentUser(); final int testUser = initializeNewUserAndSwitchBack(/* stopNewUser */ false); mRunner.resumeTiming(); switchUser(testUser); mRunner.pauseTiming(); attestTrue("Failed to switch to user " + testUser, mAm.isUserRunning(testUser)); switchUser(startUser); removeUser(testUser); mRunner.resumeTiming(); } } @Test public void stopUser() throws Exception { while (mRunner.keepRunning()) { Loading Loading @@ -188,6 +230,34 @@ public class UserLifecycleTests { } } /** Tests starting an already-created, but no-longer-running, profile. */ @Test public void managedProfileUnlock_stopped() throws Exception { while (mRunner.keepRunning()) { mRunner.pauseTiming(); final UserInfo userInfo = mUm.createProfileForUser("TestUser", UserInfo.FLAG_MANAGED_PROFILE, mAm.getCurrentUser()); // Start the profile initially, then stop it. Similar to setQuietModeEnabled. final CountDownLatch latch1 = new CountDownLatch(1); registerBroadcastReceiver(Intent.ACTION_USER_UNLOCKED, latch1, userInfo.id); mIam.startUserInBackground(userInfo.id); latch1.await(TIMEOUT_IN_SECOND, TimeUnit.SECONDS); stopUser(userInfo.id, true); // Now we restart the profile. final CountDownLatch latch2 = new CountDownLatch(1); registerBroadcastReceiver(Intent.ACTION_USER_UNLOCKED, latch2, userInfo.id); mRunner.resumeTiming(); mIam.startUserInBackground(userInfo.id); latch2.await(TIMEOUT_IN_SECOND, TimeUnit.SECONDS); mRunner.pauseTiming(); removeUser(userInfo.id); mRunner.resumeTiming(); } } @Test public void ephemeralUserStopped() throws Exception { while (mRunner.keepRunning()) { Loading Loading @@ -262,6 +332,35 @@ public class UserLifecycleTests { latch.await(TIMEOUT_IN_SECOND, TimeUnit.SECONDS); } /** * Creates a user and waits for its ACTION_USER_UNLOCKED. * Then switches to back to the original user and waits for its switchUser() to finish. * * @param stopNewUser whether to stop the new user after switching to otherUser. * @return userId of the newly created user. */ private int initializeNewUserAndSwitchBack(boolean stopNewUser) throws Exception { final int origUser = mAm.getCurrentUser(); // First, create and switch to testUser, waiting for its ACTION_USER_UNLOCKED final int testUser = mUm.createUser("TestUser", 0).id; final CountDownLatch latch1 = new CountDownLatch(1); registerBroadcastReceiver(Intent.ACTION_USER_UNLOCKED, latch1, testUser); mAm.switchUser(testUser); attestTrue("Failed to achieve initial ACTION_USER_UNLOCKED for user " + testUser, latch1.await(TIMEOUT_IN_SECOND, TimeUnit.SECONDS)); // Second, switch back to origUser, waiting merely for switchUser() to finish switchUser(origUser); attestTrue("Didn't switch back to user, " + origUser, origUser == mAm.getCurrentUser()); if (stopNewUser) { stopUser(testUser, true); attestFalse("Failed to stop user " + testUser, mAm.isUserRunning(testUser)); } return testUser; } private void registerUserSwitchObserver(final CountDownLatch switchLatch, final CountDownLatch bootCompleteLatch, final int userId) throws Exception { ActivityManager.getService().registerUserSwitchObserver( Loading Loading @@ -313,4 +412,14 @@ public class UserLifecycleTests { mUsersToRemove.add(userId); } } private void attestTrue(String message, boolean attestion) { if (!attestion) { Log.w(TAG, message); } } private void attestFalse(String message, boolean attestion) { attestTrue(message, !attestion); } } api/current.txt +6 −46 Original line number Diff line number Diff line Loading @@ -11452,6 +11452,7 @@ package android.content.pm { method public long getSize(); method public int getStagedSessionErrorCode(); method @NonNull public String getStagedSessionErrorMessage(); method public long getUpdatedMillis(); method @NonNull public android.os.UserHandle getUser(); method public boolean isActive(); method public boolean isCommitted(); Loading Loading @@ -34275,6 +34276,7 @@ package android.os { ctor public Binder(@Nullable String); method public void attachInterface(@Nullable android.os.IInterface, @Nullable String); method public static final long clearCallingIdentity(); method public static final long clearCallingWorkSource(); method public void dump(@NonNull java.io.FileDescriptor, @Nullable String[]); method protected void dump(@NonNull java.io.FileDescriptor, @NonNull java.io.PrintWriter, @Nullable String[]); method public void dumpAsync(@NonNull java.io.FileDescriptor, @Nullable String[]); Loading @@ -34283,6 +34285,7 @@ package android.os { method public static final int getCallingUid(); method public static final int getCallingUidOrThrow(); method @NonNull public static final android.os.UserHandle getCallingUserHandle(); method public static final int getCallingWorkSourceUid(); method @Nullable public String getInterfaceDescriptor(); method public boolean isBinderAlive(); method public static final void joinThreadPool(); Loading @@ -34291,6 +34294,8 @@ package android.os { method public boolean pingBinder(); method @Nullable public android.os.IInterface queryLocalInterface(@NonNull String); method public static final void restoreCallingIdentity(long); method public static final void restoreCallingWorkSource(long); method public static final long setCallingWorkSourceUid(int); method public final boolean transact(int, @NonNull android.os.Parcel, @Nullable android.os.Parcel, int) throws android.os.RemoteException; method public boolean unlinkToDeath(@NonNull android.os.IBinder.DeathRecipient, int); } Loading Loading @@ -37069,12 +37074,6 @@ package android.provider { field public static final String CACHED_NUMBER_TYPE = "numbertype"; field public static final String CACHED_PHOTO_ID = "photo_id"; field public static final String CACHED_PHOTO_URI = "photo_uri"; field public static final String CALL_ID_APP_NAME = "call_id_app_name"; field public static final String CALL_ID_DESCRIPTION = "call_id_description"; field public static final String CALL_ID_DETAILS = "call_id_details"; field public static final String CALL_ID_NAME = "call_id_name"; field public static final String CALL_ID_NUISANCE_CONFIDENCE = "call_id_nuisance_confidence"; field public static final String CALL_ID_PACKAGE_NAME = "call_id_package_name"; field public static final String CALL_SCREENING_APP_NAME = "call_screening_app_name"; field public static final String CALL_SCREENING_COMPONENT_NAME = "call_screening_component_name"; field public static final android.net.Uri CONTENT_FILTER_URI; Loading Loading @@ -43257,7 +43256,6 @@ package android.telecom { method public android.telecom.PhoneAccountHandle getAccountHandle(); method public int getCallCapabilities(); method public int getCallDirection(); method @Nullable public android.telecom.CallIdentification getCallIdentification(); method public int getCallProperties(); method public String getCallerDisplayName(); method public int getCallerDisplayNamePresentation(); Loading Loading @@ -43339,34 +43337,6 @@ package android.telecom { field public static final int ROUTE_WIRED_OR_EARPIECE = 5; // 0x5 } public final class CallIdentification implements android.os.Parcelable { method public int describeContents(); method @NonNull public CharSequence getCallScreeningAppName(); method @NonNull public String getCallScreeningPackageName(); method @Nullable public CharSequence getDescription(); method @Nullable public CharSequence getDetails(); method @Nullable public CharSequence getName(); method public int getNuisanceConfidence(); method @Nullable public android.graphics.drawable.Icon getPhoto(); method public void writeToParcel(android.os.Parcel, int); field public static final int CONFIDENCE_LIKELY_NOT_NUISANCE = -1; // 0xffffffff field public static final int CONFIDENCE_LIKELY_NUISANCE = 1; // 0x1 field public static final int CONFIDENCE_NOT_NUISANCE = -2; // 0xfffffffe field public static final int CONFIDENCE_NUISANCE = 2; // 0x2 field public static final int CONFIDENCE_UNKNOWN = 0; // 0x0 field @NonNull public static final android.os.Parcelable.Creator<android.telecom.CallIdentification> CREATOR; } public static final class CallIdentification.Builder { ctor public CallIdentification.Builder(); method @NonNull public android.telecom.CallIdentification build(); method @NonNull public android.telecom.CallIdentification.Builder setDescription(@Nullable CharSequence); method @NonNull public android.telecom.CallIdentification.Builder setDetails(@Nullable CharSequence); method @NonNull public android.telecom.CallIdentification.Builder setName(@Nullable CharSequence); method @NonNull public android.telecom.CallIdentification.Builder setNuisanceConfidence(int); method @NonNull public android.telecom.CallIdentification.Builder setPhoto(@Nullable android.graphics.drawable.Icon); } public abstract class CallRedirectionService extends android.app.Service { ctor public CallRedirectionService(); method public final void cancelCall(); Loading @@ -43382,17 +43352,7 @@ package android.telecom { ctor public CallScreeningService(); method public android.os.IBinder onBind(android.content.Intent); method public abstract void onScreenCall(@NonNull android.telecom.Call.Details); method public final void provideCallIdentification(@NonNull android.telecom.Call.Details, @NonNull android.telecom.CallIdentification); method public final void respondToCall(@NonNull android.telecom.Call.Details, @NonNull android.telecom.CallScreeningService.CallResponse); field public static final String ACTION_NUISANCE_CALL_STATUS_CHANGED = "android.telecom.action.NUISANCE_CALL_STATUS_CHANGED"; field public static final int CALL_DURATION_LONG = 4; // 0x4 field public static final int CALL_DURATION_MEDIUM = 3; // 0x3 field public static final int CALL_DURATION_SHORT = 2; // 0x2 field public static final int CALL_DURATION_VERY_SHORT = 1; // 0x1 field public static final String EXTRA_CALL_DURATION = "android.telecom.extra.CALL_DURATION"; field public static final String EXTRA_CALL_HANDLE = "android.telecom.extra.CALL_HANDLE"; field public static final String EXTRA_CALL_TYPE = "android.telecom.extra.CALL_TYPE"; field public static final String EXTRA_IS_NUISANCE = "android.telecom.extra.IS_NUISANCE"; field public static final String SERVICE_INTERFACE = "android.telecom.CallScreeningService"; } Loading Loading @@ -44001,7 +43961,6 @@ package android.telecom { method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public boolean isVoiceMailNumber(android.telecom.PhoneAccountHandle, String); method @RequiresPermission(anyOf={android.Manifest.permission.CALL_PHONE, android.Manifest.permission.MANAGE_OWN_CALLS}) public void placeCall(android.net.Uri, android.os.Bundle); method public void registerPhoneAccount(android.telecom.PhoneAccount); method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public void reportNuisanceCallStatus(@NonNull android.net.Uri, boolean); method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public void showInCallScreen(boolean); method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void silenceRinger(); method public void unregisterPhoneAccount(android.telecom.PhoneAccountHandle); Loading Loading @@ -45150,6 +45109,7 @@ package android.telephony { method public boolean canChangeDtmfToneLength(); method @Nullable public android.telephony.TelephonyManager createForPhoneAccountHandle(android.telecom.PhoneAccountHandle); method public android.telephony.TelephonyManager createForSubscriptionId(int); method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public boolean doesSwitchMultiSimConfigTriggerReboot(); method @RequiresPermission(android.Manifest.permission.ACCESS_FINE_LOCATION) public java.util.List<android.telephony.CellInfo> getAllCellInfo(); method public int getCallState(); method public int getCardIdForDefaultEuicc(); api/system-current.txt +10 −40 Original line number Diff line number Diff line Loading @@ -1462,7 +1462,7 @@ package android.content.om { method @Nullable public String getCategory(); method @NonNull public String getPackageName(); method @Nullable public String getTargetOverlayableName(); method @Nullable public String getTargetPackageName(); method @NonNull public String getTargetPackageName(); method public int getUserId(); method public boolean isEnabled(); method public void writeToParcel(android.os.Parcel, int); Loading Loading @@ -4232,13 +4232,19 @@ package android.net { method @Nullable public java.net.InetAddress getGateway(); method @Nullable public android.net.LinkAddress getIpAddress(); method @NonNull public java.util.List<android.net.RouteInfo> getRoutes(@Nullable String); method public void setDomains(@Nullable String); method public void setGateway(@Nullable java.net.InetAddress); method public void setIpAddress(@Nullable android.net.LinkAddress); method public void writeToParcel(android.os.Parcel, int); field @NonNull public static final android.os.Parcelable.Creator<android.net.StaticIpConfiguration> CREATOR; } public static final class StaticIpConfiguration.Builder { ctor public StaticIpConfiguration.Builder(); method @NonNull public android.net.StaticIpConfiguration build(); method @NonNull public android.net.StaticIpConfiguration.Builder setDnsServers(@NonNull Iterable<java.net.InetAddress>); method @NonNull public android.net.StaticIpConfiguration.Builder setDomains(@Nullable String); method @NonNull public android.net.StaticIpConfiguration.Builder setGateway(@Nullable java.net.InetAddress); method @NonNull public android.net.StaticIpConfiguration.Builder setIpAddress(@Nullable android.net.LinkAddress); } public class TrafficStats { method public static void setThreadStatsTagApp(); method public static void setThreadStatsTagBackup(); Loading Loading @@ -4288,37 +4294,6 @@ package android.net.apf { } package android.net.captiveportal { public final class CaptivePortalProbeResult { ctor public CaptivePortalProbeResult(int); ctor public CaptivePortalProbeResult(int, @Nullable String, @Nullable String); ctor public CaptivePortalProbeResult(int, @Nullable String, @Nullable String, @Nullable android.net.captiveportal.CaptivePortalProbeSpec); method public boolean isFailed(); method public boolean isPartialConnectivity(); method public boolean isPortal(); method public boolean isSuccessful(); field @NonNull public static final android.net.captiveportal.CaptivePortalProbeResult FAILED; field public static final int FAILED_CODE = 599; // 0x257 field public static final android.net.captiveportal.CaptivePortalProbeResult PARTIAL; field public static final int PORTAL_CODE = 302; // 0x12e field @NonNull public static final android.net.captiveportal.CaptivePortalProbeResult SUCCESS; field public static final int SUCCESS_CODE = 204; // 0xcc field @Nullable public final String detectUrl; field @Nullable public final android.net.captiveportal.CaptivePortalProbeSpec probeSpec; field @Nullable public final String redirectUrl; } public abstract class CaptivePortalProbeSpec { method @NonNull public String getEncodedSpec(); method @NonNull public abstract android.net.captiveportal.CaptivePortalProbeResult getResult(int, @Nullable String); method @NonNull public java.net.URL getUrl(); method @NonNull public static java.util.Collection<android.net.captiveportal.CaptivePortalProbeSpec> parseCaptivePortalProbeSpecs(@NonNull String); method @Nullable public static android.net.captiveportal.CaptivePortalProbeSpec parseSpecOrNull(@Nullable String); } } package android.net.metrics { public final class ApfProgramEvent implements android.net.metrics.IpConnectivityLog.Event { Loading Loading @@ -5168,10 +5143,6 @@ package android.os { } public class Binder implements android.os.IBinder { method public static final long clearCallingWorkSource(); method public static final int getCallingWorkSourceUid(); method public static final void restoreCallingWorkSource(long); method public static final long setCallingWorkSourceUid(int); method public static void setProxyTransactListener(@Nullable android.os.Binder.ProxyTransactListener); } Loading Loading @@ -8092,7 +8063,6 @@ package android.telephony { method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE, android.Manifest.permission.READ_PHONE_STATE}) public boolean isOffhook(); method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isPotentialEmergencyNumber(@NonNull String); method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE, android.Manifest.permission.READ_PHONE_STATE}) public boolean isRadioOn(); method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isRebootRequiredForModemConfigChange(); method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE, android.Manifest.permission.READ_PHONE_STATE}) public boolean isRinging(); method @RequiresPermission(anyOf={android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE, android.Manifest.permission.READ_PHONE_STATE}) public boolean isVideoCallingEnabled(); method @Deprecated @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public boolean isVisualVoicemailEnabled(android.telecom.PhoneAccountHandle); api/test-current.txt +14 −34 Original line number Diff line number Diff line Loading @@ -716,6 +716,11 @@ package android.content.pm { package android.content.res { public final class AssetManager implements java.lang.AutoCloseable { method @NonNull public String[] getApkPaths(); method @Nullable public java.util.Map<java.lang.String,java.lang.String> getOverlayableMap(String); } public final class Configuration implements java.lang.Comparable<android.content.res.Configuration> android.os.Parcelable { field public int assetsSeq; field public final android.app.WindowConfiguration windowConfiguration; Loading Loading @@ -1320,13 +1325,19 @@ package android.net { method @Nullable public java.net.InetAddress getGateway(); method @Nullable public android.net.LinkAddress getIpAddress(); method @NonNull public java.util.List<android.net.RouteInfo> getRoutes(@Nullable String); method public void setDomains(@Nullable String); method public void setGateway(@Nullable java.net.InetAddress); method public void setIpAddress(@Nullable android.net.LinkAddress); method public void writeToParcel(android.os.Parcel, int); field @NonNull public static final android.os.Parcelable.Creator<android.net.StaticIpConfiguration> CREATOR; } public static final class StaticIpConfiguration.Builder { ctor public StaticIpConfiguration.Builder(); method @NonNull public android.net.StaticIpConfiguration build(); method @NonNull public android.net.StaticIpConfiguration.Builder setDnsServers(@NonNull Iterable<java.net.InetAddress>); method @NonNull public android.net.StaticIpConfiguration.Builder setDomains(@Nullable String); method @NonNull public android.net.StaticIpConfiguration.Builder setGateway(@Nullable java.net.InetAddress); method @NonNull public android.net.StaticIpConfiguration.Builder setIpAddress(@Nullable android.net.LinkAddress); } public final class TestNetworkInterface implements android.os.Parcelable { ctor public TestNetworkInterface(android.os.ParcelFileDescriptor, String); method public int describeContents(); Loading Loading @@ -1371,37 +1382,6 @@ package android.net.apf { } package android.net.captiveportal { public final class CaptivePortalProbeResult { ctor public CaptivePortalProbeResult(int); ctor public CaptivePortalProbeResult(int, @Nullable String, @Nullable String); ctor public CaptivePortalProbeResult(int, @Nullable String, @Nullable String, @Nullable android.net.captiveportal.CaptivePortalProbeSpec); method public boolean isFailed(); method public boolean isPartialConnectivity(); method public boolean isPortal(); method public boolean isSuccessful(); field @NonNull public static final android.net.captiveportal.CaptivePortalProbeResult FAILED; field public static final int FAILED_CODE = 599; // 0x257 field public static final android.net.captiveportal.CaptivePortalProbeResult PARTIAL; field public static final int PORTAL_CODE = 302; // 0x12e field @NonNull public static final android.net.captiveportal.CaptivePortalProbeResult SUCCESS; field public static final int SUCCESS_CODE = 204; // 0xcc field @Nullable public final String detectUrl; field @Nullable public final android.net.captiveportal.CaptivePortalProbeSpec probeSpec; field @Nullable public final String redirectUrl; } public abstract class CaptivePortalProbeSpec { method @NonNull public String getEncodedSpec(); method @NonNull public abstract android.net.captiveportal.CaptivePortalProbeResult getResult(int, @Nullable String); method @NonNull public java.net.URL getUrl(); method @NonNull public static java.util.Collection<android.net.captiveportal.CaptivePortalProbeSpec> parseCaptivePortalProbeSpecs(@NonNull String); method @Nullable public static android.net.captiveportal.CaptivePortalProbeSpec parseSpecOrNull(@Nullable String); } } package android.net.metrics { public final class ApfProgramEvent implements android.net.metrics.IpConnectivityLog.Event { Loading Loading
Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -375,6 +375,7 @@ java_defaults { "core/java/android/view/IDisplayFoldListener.aidl", "core/java/android/view/IGraphicsStats.aidl", "core/java/android/view/IGraphicsStatsCallback.aidl", "core/java/android/view/IInputMonitorHost.aidl", "core/java/android/view/IInputFilter.aidl", "core/java/android/view/IInputFilterHost.aidl", "core/java/android/view/IOnKeyguardExitResult.aidl", Loading
apct-tests/perftests/multiuser/src/android/multiuser/UserLifecycleTests.java +109 −0 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ import android.content.pm.UserInfo; import android.os.RemoteException; import android.os.UserHandle; import android.os.UserManager; import android.util.Log; import androidx.test.InstrumentationRegistry; import androidx.test.filters.LargeTest; Loading Loading @@ -130,6 +131,47 @@ public class UserLifecycleTests { } } /** Tests switching to an already-created, but no-longer-running, user. */ @Test public void switchUser_stopped() throws Exception { while (mRunner.keepRunning()) { mRunner.pauseTiming(); final int startUser = mAm.getCurrentUser(); final int testUser = initializeNewUserAndSwitchBack(/* stopNewUser */ true); final CountDownLatch latch = new CountDownLatch(1); registerBroadcastReceiver(Intent.ACTION_USER_UNLOCKED, latch, testUser); mRunner.resumeTiming(); mAm.switchUser(testUser); boolean success = latch.await(TIMEOUT_IN_SECOND, TimeUnit.SECONDS); mRunner.pauseTiming(); attestTrue("Failed to achieve 2nd ACTION_USER_UNLOCKED for user " + testUser, success); switchUser(startUser); removeUser(testUser); mRunner.resumeTiming(); } } /** Tests switching to an already-created already-running non-owner user. */ @Test public void switchUser_running() throws Exception { while (mRunner.keepRunning()) { mRunner.pauseTiming(); final int startUser = mAm.getCurrentUser(); final int testUser = initializeNewUserAndSwitchBack(/* stopNewUser */ false); mRunner.resumeTiming(); switchUser(testUser); mRunner.pauseTiming(); attestTrue("Failed to switch to user " + testUser, mAm.isUserRunning(testUser)); switchUser(startUser); removeUser(testUser); mRunner.resumeTiming(); } } @Test public void stopUser() throws Exception { while (mRunner.keepRunning()) { Loading Loading @@ -188,6 +230,34 @@ public class UserLifecycleTests { } } /** Tests starting an already-created, but no-longer-running, profile. */ @Test public void managedProfileUnlock_stopped() throws Exception { while (mRunner.keepRunning()) { mRunner.pauseTiming(); final UserInfo userInfo = mUm.createProfileForUser("TestUser", UserInfo.FLAG_MANAGED_PROFILE, mAm.getCurrentUser()); // Start the profile initially, then stop it. Similar to setQuietModeEnabled. final CountDownLatch latch1 = new CountDownLatch(1); registerBroadcastReceiver(Intent.ACTION_USER_UNLOCKED, latch1, userInfo.id); mIam.startUserInBackground(userInfo.id); latch1.await(TIMEOUT_IN_SECOND, TimeUnit.SECONDS); stopUser(userInfo.id, true); // Now we restart the profile. final CountDownLatch latch2 = new CountDownLatch(1); registerBroadcastReceiver(Intent.ACTION_USER_UNLOCKED, latch2, userInfo.id); mRunner.resumeTiming(); mIam.startUserInBackground(userInfo.id); latch2.await(TIMEOUT_IN_SECOND, TimeUnit.SECONDS); mRunner.pauseTiming(); removeUser(userInfo.id); mRunner.resumeTiming(); } } @Test public void ephemeralUserStopped() throws Exception { while (mRunner.keepRunning()) { Loading Loading @@ -262,6 +332,35 @@ public class UserLifecycleTests { latch.await(TIMEOUT_IN_SECOND, TimeUnit.SECONDS); } /** * Creates a user and waits for its ACTION_USER_UNLOCKED. * Then switches to back to the original user and waits for its switchUser() to finish. * * @param stopNewUser whether to stop the new user after switching to otherUser. * @return userId of the newly created user. */ private int initializeNewUserAndSwitchBack(boolean stopNewUser) throws Exception { final int origUser = mAm.getCurrentUser(); // First, create and switch to testUser, waiting for its ACTION_USER_UNLOCKED final int testUser = mUm.createUser("TestUser", 0).id; final CountDownLatch latch1 = new CountDownLatch(1); registerBroadcastReceiver(Intent.ACTION_USER_UNLOCKED, latch1, testUser); mAm.switchUser(testUser); attestTrue("Failed to achieve initial ACTION_USER_UNLOCKED for user " + testUser, latch1.await(TIMEOUT_IN_SECOND, TimeUnit.SECONDS)); // Second, switch back to origUser, waiting merely for switchUser() to finish switchUser(origUser); attestTrue("Didn't switch back to user, " + origUser, origUser == mAm.getCurrentUser()); if (stopNewUser) { stopUser(testUser, true); attestFalse("Failed to stop user " + testUser, mAm.isUserRunning(testUser)); } return testUser; } private void registerUserSwitchObserver(final CountDownLatch switchLatch, final CountDownLatch bootCompleteLatch, final int userId) throws Exception { ActivityManager.getService().registerUserSwitchObserver( Loading Loading @@ -313,4 +412,14 @@ public class UserLifecycleTests { mUsersToRemove.add(userId); } } private void attestTrue(String message, boolean attestion) { if (!attestion) { Log.w(TAG, message); } } private void attestFalse(String message, boolean attestion) { attestTrue(message, !attestion); } }
api/current.txt +6 −46 Original line number Diff line number Diff line Loading @@ -11452,6 +11452,7 @@ package android.content.pm { method public long getSize(); method public int getStagedSessionErrorCode(); method @NonNull public String getStagedSessionErrorMessage(); method public long getUpdatedMillis(); method @NonNull public android.os.UserHandle getUser(); method public boolean isActive(); method public boolean isCommitted(); Loading Loading @@ -34275,6 +34276,7 @@ package android.os { ctor public Binder(@Nullable String); method public void attachInterface(@Nullable android.os.IInterface, @Nullable String); method public static final long clearCallingIdentity(); method public static final long clearCallingWorkSource(); method public void dump(@NonNull java.io.FileDescriptor, @Nullable String[]); method protected void dump(@NonNull java.io.FileDescriptor, @NonNull java.io.PrintWriter, @Nullable String[]); method public void dumpAsync(@NonNull java.io.FileDescriptor, @Nullable String[]); Loading @@ -34283,6 +34285,7 @@ package android.os { method public static final int getCallingUid(); method public static final int getCallingUidOrThrow(); method @NonNull public static final android.os.UserHandle getCallingUserHandle(); method public static final int getCallingWorkSourceUid(); method @Nullable public String getInterfaceDescriptor(); method public boolean isBinderAlive(); method public static final void joinThreadPool(); Loading @@ -34291,6 +34294,8 @@ package android.os { method public boolean pingBinder(); method @Nullable public android.os.IInterface queryLocalInterface(@NonNull String); method public static final void restoreCallingIdentity(long); method public static final void restoreCallingWorkSource(long); method public static final long setCallingWorkSourceUid(int); method public final boolean transact(int, @NonNull android.os.Parcel, @Nullable android.os.Parcel, int) throws android.os.RemoteException; method public boolean unlinkToDeath(@NonNull android.os.IBinder.DeathRecipient, int); } Loading Loading @@ -37069,12 +37074,6 @@ package android.provider { field public static final String CACHED_NUMBER_TYPE = "numbertype"; field public static final String CACHED_PHOTO_ID = "photo_id"; field public static final String CACHED_PHOTO_URI = "photo_uri"; field public static final String CALL_ID_APP_NAME = "call_id_app_name"; field public static final String CALL_ID_DESCRIPTION = "call_id_description"; field public static final String CALL_ID_DETAILS = "call_id_details"; field public static final String CALL_ID_NAME = "call_id_name"; field public static final String CALL_ID_NUISANCE_CONFIDENCE = "call_id_nuisance_confidence"; field public static final String CALL_ID_PACKAGE_NAME = "call_id_package_name"; field public static final String CALL_SCREENING_APP_NAME = "call_screening_app_name"; field public static final String CALL_SCREENING_COMPONENT_NAME = "call_screening_component_name"; field public static final android.net.Uri CONTENT_FILTER_URI; Loading Loading @@ -43257,7 +43256,6 @@ package android.telecom { method public android.telecom.PhoneAccountHandle getAccountHandle(); method public int getCallCapabilities(); method public int getCallDirection(); method @Nullable public android.telecom.CallIdentification getCallIdentification(); method public int getCallProperties(); method public String getCallerDisplayName(); method public int getCallerDisplayNamePresentation(); Loading Loading @@ -43339,34 +43337,6 @@ package android.telecom { field public static final int ROUTE_WIRED_OR_EARPIECE = 5; // 0x5 } public final class CallIdentification implements android.os.Parcelable { method public int describeContents(); method @NonNull public CharSequence getCallScreeningAppName(); method @NonNull public String getCallScreeningPackageName(); method @Nullable public CharSequence getDescription(); method @Nullable public CharSequence getDetails(); method @Nullable public CharSequence getName(); method public int getNuisanceConfidence(); method @Nullable public android.graphics.drawable.Icon getPhoto(); method public void writeToParcel(android.os.Parcel, int); field public static final int CONFIDENCE_LIKELY_NOT_NUISANCE = -1; // 0xffffffff field public static final int CONFIDENCE_LIKELY_NUISANCE = 1; // 0x1 field public static final int CONFIDENCE_NOT_NUISANCE = -2; // 0xfffffffe field public static final int CONFIDENCE_NUISANCE = 2; // 0x2 field public static final int CONFIDENCE_UNKNOWN = 0; // 0x0 field @NonNull public static final android.os.Parcelable.Creator<android.telecom.CallIdentification> CREATOR; } public static final class CallIdentification.Builder { ctor public CallIdentification.Builder(); method @NonNull public android.telecom.CallIdentification build(); method @NonNull public android.telecom.CallIdentification.Builder setDescription(@Nullable CharSequence); method @NonNull public android.telecom.CallIdentification.Builder setDetails(@Nullable CharSequence); method @NonNull public android.telecom.CallIdentification.Builder setName(@Nullable CharSequence); method @NonNull public android.telecom.CallIdentification.Builder setNuisanceConfidence(int); method @NonNull public android.telecom.CallIdentification.Builder setPhoto(@Nullable android.graphics.drawable.Icon); } public abstract class CallRedirectionService extends android.app.Service { ctor public CallRedirectionService(); method public final void cancelCall(); Loading @@ -43382,17 +43352,7 @@ package android.telecom { ctor public CallScreeningService(); method public android.os.IBinder onBind(android.content.Intent); method public abstract void onScreenCall(@NonNull android.telecom.Call.Details); method public final void provideCallIdentification(@NonNull android.telecom.Call.Details, @NonNull android.telecom.CallIdentification); method public final void respondToCall(@NonNull android.telecom.Call.Details, @NonNull android.telecom.CallScreeningService.CallResponse); field public static final String ACTION_NUISANCE_CALL_STATUS_CHANGED = "android.telecom.action.NUISANCE_CALL_STATUS_CHANGED"; field public static final int CALL_DURATION_LONG = 4; // 0x4 field public static final int CALL_DURATION_MEDIUM = 3; // 0x3 field public static final int CALL_DURATION_SHORT = 2; // 0x2 field public static final int CALL_DURATION_VERY_SHORT = 1; // 0x1 field public static final String EXTRA_CALL_DURATION = "android.telecom.extra.CALL_DURATION"; field public static final String EXTRA_CALL_HANDLE = "android.telecom.extra.CALL_HANDLE"; field public static final String EXTRA_CALL_TYPE = "android.telecom.extra.CALL_TYPE"; field public static final String EXTRA_IS_NUISANCE = "android.telecom.extra.IS_NUISANCE"; field public static final String SERVICE_INTERFACE = "android.telecom.CallScreeningService"; } Loading Loading @@ -44001,7 +43961,6 @@ package android.telecom { method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public boolean isVoiceMailNumber(android.telecom.PhoneAccountHandle, String); method @RequiresPermission(anyOf={android.Manifest.permission.CALL_PHONE, android.Manifest.permission.MANAGE_OWN_CALLS}) public void placeCall(android.net.Uri, android.os.Bundle); method public void registerPhoneAccount(android.telecom.PhoneAccount); method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public void reportNuisanceCallStatus(@NonNull android.net.Uri, boolean); method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public void showInCallScreen(boolean); method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void silenceRinger(); method public void unregisterPhoneAccount(android.telecom.PhoneAccountHandle); Loading Loading @@ -45150,6 +45109,7 @@ package android.telephony { method public boolean canChangeDtmfToneLength(); method @Nullable public android.telephony.TelephonyManager createForPhoneAccountHandle(android.telecom.PhoneAccountHandle); method public android.telephony.TelephonyManager createForSubscriptionId(int); method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public boolean doesSwitchMultiSimConfigTriggerReboot(); method @RequiresPermission(android.Manifest.permission.ACCESS_FINE_LOCATION) public java.util.List<android.telephony.CellInfo> getAllCellInfo(); method public int getCallState(); method public int getCardIdForDefaultEuicc();
api/system-current.txt +10 −40 Original line number Diff line number Diff line Loading @@ -1462,7 +1462,7 @@ package android.content.om { method @Nullable public String getCategory(); method @NonNull public String getPackageName(); method @Nullable public String getTargetOverlayableName(); method @Nullable public String getTargetPackageName(); method @NonNull public String getTargetPackageName(); method public int getUserId(); method public boolean isEnabled(); method public void writeToParcel(android.os.Parcel, int); Loading Loading @@ -4232,13 +4232,19 @@ package android.net { method @Nullable public java.net.InetAddress getGateway(); method @Nullable public android.net.LinkAddress getIpAddress(); method @NonNull public java.util.List<android.net.RouteInfo> getRoutes(@Nullable String); method public void setDomains(@Nullable String); method public void setGateway(@Nullable java.net.InetAddress); method public void setIpAddress(@Nullable android.net.LinkAddress); method public void writeToParcel(android.os.Parcel, int); field @NonNull public static final android.os.Parcelable.Creator<android.net.StaticIpConfiguration> CREATOR; } public static final class StaticIpConfiguration.Builder { ctor public StaticIpConfiguration.Builder(); method @NonNull public android.net.StaticIpConfiguration build(); method @NonNull public android.net.StaticIpConfiguration.Builder setDnsServers(@NonNull Iterable<java.net.InetAddress>); method @NonNull public android.net.StaticIpConfiguration.Builder setDomains(@Nullable String); method @NonNull public android.net.StaticIpConfiguration.Builder setGateway(@Nullable java.net.InetAddress); method @NonNull public android.net.StaticIpConfiguration.Builder setIpAddress(@Nullable android.net.LinkAddress); } public class TrafficStats { method public static void setThreadStatsTagApp(); method public static void setThreadStatsTagBackup(); Loading Loading @@ -4288,37 +4294,6 @@ package android.net.apf { } package android.net.captiveportal { public final class CaptivePortalProbeResult { ctor public CaptivePortalProbeResult(int); ctor public CaptivePortalProbeResult(int, @Nullable String, @Nullable String); ctor public CaptivePortalProbeResult(int, @Nullable String, @Nullable String, @Nullable android.net.captiveportal.CaptivePortalProbeSpec); method public boolean isFailed(); method public boolean isPartialConnectivity(); method public boolean isPortal(); method public boolean isSuccessful(); field @NonNull public static final android.net.captiveportal.CaptivePortalProbeResult FAILED; field public static final int FAILED_CODE = 599; // 0x257 field public static final android.net.captiveportal.CaptivePortalProbeResult PARTIAL; field public static final int PORTAL_CODE = 302; // 0x12e field @NonNull public static final android.net.captiveportal.CaptivePortalProbeResult SUCCESS; field public static final int SUCCESS_CODE = 204; // 0xcc field @Nullable public final String detectUrl; field @Nullable public final android.net.captiveportal.CaptivePortalProbeSpec probeSpec; field @Nullable public final String redirectUrl; } public abstract class CaptivePortalProbeSpec { method @NonNull public String getEncodedSpec(); method @NonNull public abstract android.net.captiveportal.CaptivePortalProbeResult getResult(int, @Nullable String); method @NonNull public java.net.URL getUrl(); method @NonNull public static java.util.Collection<android.net.captiveportal.CaptivePortalProbeSpec> parseCaptivePortalProbeSpecs(@NonNull String); method @Nullable public static android.net.captiveportal.CaptivePortalProbeSpec parseSpecOrNull(@Nullable String); } } package android.net.metrics { public final class ApfProgramEvent implements android.net.metrics.IpConnectivityLog.Event { Loading Loading @@ -5168,10 +5143,6 @@ package android.os { } public class Binder implements android.os.IBinder { method public static final long clearCallingWorkSource(); method public static final int getCallingWorkSourceUid(); method public static final void restoreCallingWorkSource(long); method public static final long setCallingWorkSourceUid(int); method public static void setProxyTransactListener(@Nullable android.os.Binder.ProxyTransactListener); } Loading Loading @@ -8092,7 +8063,6 @@ package android.telephony { method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE, android.Manifest.permission.READ_PHONE_STATE}) public boolean isOffhook(); method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isPotentialEmergencyNumber(@NonNull String); method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE, android.Manifest.permission.READ_PHONE_STATE}) public boolean isRadioOn(); method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isRebootRequiredForModemConfigChange(); method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE, android.Manifest.permission.READ_PHONE_STATE}) public boolean isRinging(); method @RequiresPermission(anyOf={android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE, android.Manifest.permission.READ_PHONE_STATE}) public boolean isVideoCallingEnabled(); method @Deprecated @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public boolean isVisualVoicemailEnabled(android.telecom.PhoneAccountHandle);
api/test-current.txt +14 −34 Original line number Diff line number Diff line Loading @@ -716,6 +716,11 @@ package android.content.pm { package android.content.res { public final class AssetManager implements java.lang.AutoCloseable { method @NonNull public String[] getApkPaths(); method @Nullable public java.util.Map<java.lang.String,java.lang.String> getOverlayableMap(String); } public final class Configuration implements java.lang.Comparable<android.content.res.Configuration> android.os.Parcelable { field public int assetsSeq; field public final android.app.WindowConfiguration windowConfiguration; Loading Loading @@ -1320,13 +1325,19 @@ package android.net { method @Nullable public java.net.InetAddress getGateway(); method @Nullable public android.net.LinkAddress getIpAddress(); method @NonNull public java.util.List<android.net.RouteInfo> getRoutes(@Nullable String); method public void setDomains(@Nullable String); method public void setGateway(@Nullable java.net.InetAddress); method public void setIpAddress(@Nullable android.net.LinkAddress); method public void writeToParcel(android.os.Parcel, int); field @NonNull public static final android.os.Parcelable.Creator<android.net.StaticIpConfiguration> CREATOR; } public static final class StaticIpConfiguration.Builder { ctor public StaticIpConfiguration.Builder(); method @NonNull public android.net.StaticIpConfiguration build(); method @NonNull public android.net.StaticIpConfiguration.Builder setDnsServers(@NonNull Iterable<java.net.InetAddress>); method @NonNull public android.net.StaticIpConfiguration.Builder setDomains(@Nullable String); method @NonNull public android.net.StaticIpConfiguration.Builder setGateway(@Nullable java.net.InetAddress); method @NonNull public android.net.StaticIpConfiguration.Builder setIpAddress(@Nullable android.net.LinkAddress); } public final class TestNetworkInterface implements android.os.Parcelable { ctor public TestNetworkInterface(android.os.ParcelFileDescriptor, String); method public int describeContents(); Loading Loading @@ -1371,37 +1382,6 @@ package android.net.apf { } package android.net.captiveportal { public final class CaptivePortalProbeResult { ctor public CaptivePortalProbeResult(int); ctor public CaptivePortalProbeResult(int, @Nullable String, @Nullable String); ctor public CaptivePortalProbeResult(int, @Nullable String, @Nullable String, @Nullable android.net.captiveportal.CaptivePortalProbeSpec); method public boolean isFailed(); method public boolean isPartialConnectivity(); method public boolean isPortal(); method public boolean isSuccessful(); field @NonNull public static final android.net.captiveportal.CaptivePortalProbeResult FAILED; field public static final int FAILED_CODE = 599; // 0x257 field public static final android.net.captiveportal.CaptivePortalProbeResult PARTIAL; field public static final int PORTAL_CODE = 302; // 0x12e field @NonNull public static final android.net.captiveportal.CaptivePortalProbeResult SUCCESS; field public static final int SUCCESS_CODE = 204; // 0xcc field @Nullable public final String detectUrl; field @Nullable public final android.net.captiveportal.CaptivePortalProbeSpec probeSpec; field @Nullable public final String redirectUrl; } public abstract class CaptivePortalProbeSpec { method @NonNull public String getEncodedSpec(); method @NonNull public abstract android.net.captiveportal.CaptivePortalProbeResult getResult(int, @Nullable String); method @NonNull public java.net.URL getUrl(); method @NonNull public static java.util.Collection<android.net.captiveportal.CaptivePortalProbeSpec> parseCaptivePortalProbeSpecs(@NonNull String); method @Nullable public static android.net.captiveportal.CaptivePortalProbeSpec parseSpecOrNull(@Nullable String); } } package android.net.metrics { public final class ApfProgramEvent implements android.net.metrics.IpConnectivityLog.Event { Loading