summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--api/current.txt93
-rw-r--r--api/system-current.txt25
-rw-r--r--api/test-current.txt18
-rwxr-xr-xcmds/hid/hid6
-rw-r--r--cmds/statsd/Android.bp2
-rw-r--r--cmds/statsd/src/StatsService.cpp49
-rw-r--r--cmds/statsd/src/atoms.proto59
-rw-r--r--cmds/statsd/src/external/GpuStatsPuller.cpp91
-rw-r--r--cmds/statsd/src/external/GpuStatsPuller.h36
-rw-r--r--cmds/statsd/src/external/StatsPullerManager.cpp4
-rw-r--r--cmds/statsd/src/logd/LogEvent.cpp132
-rw-r--r--cmds/statsd/src/logd/LogEvent.h27
-rw-r--r--core/java/android/app/AppOpsManager.java6
-rw-r--r--core/java/android/companion/BluetoothDeviceFilterUtils.java4
-rw-r--r--core/java/android/content/res/Resources.java8
-rw-r--r--core/java/android/content/res/ResourcesImpl.java1
-rw-r--r--core/java/android/database/sqlite/SQLiteDatabase.java26
-rw-r--r--core/java/android/database/sqlite/SQLiteOpenHelper.java9
-rw-r--r--core/java/android/hardware/camera2/CaptureResult.java8
-rw-r--r--core/java/android/hardware/hdmi/HdmiControlManager.java7
-rw-r--r--core/java/android/net/ConnectivityManager.java2
-rw-r--r--core/java/android/net/InetAddresses.java6
-rw-r--r--core/java/android/net/VpnService.java44
-rw-r--r--core/java/android/os/PowerManager.java27
-rw-r--r--core/java/android/os/Process.java6
-rw-r--r--core/java/android/os/ZygoteProcess.java162
-rw-r--r--core/java/android/permission/PermissionControllerService.java2
-rw-r--r--core/java/android/provider/DeviceConfig.java14
-rw-r--r--core/java/android/provider/Settings.java1
-rw-r--r--core/java/android/service/autofill/CustomDescription.java4
-rw-r--r--core/java/android/service/autofill/FillResponse.java15
-rw-r--r--core/java/android/service/autofill/UserData.java4
-rw-r--r--core/java/android/service/autofill/augmented/AugmentedAutofillService.java1
-rw-r--r--core/java/android/view/Display.java14
-rw-r--r--core/java/android/view/ViewRootImpl.java4
-rw-r--r--core/java/android/view/WindowManager.java16
-rw-r--r--core/java/android/view/WindowManagerImpl.java9
-rw-r--r--core/java/android/view/accessibility/AccessibilityNodeIdManager.java13
-rw-r--r--core/java/android/widget/RemoteViews.java11
-rw-r--r--core/java/com/android/internal/app/ChooserActivity.java2
-rw-r--r--core/java/com/android/internal/os/Zygote.java145
-rw-r--r--core/java/com/android/internal/os/ZygoteArguments.java10
-rw-r--r--core/java/com/android/internal/os/ZygoteConnection.java35
-rw-r--r--core/java/com/android/internal/os/ZygoteInit.java2
-rw-r--r--core/java/com/android/internal/os/ZygoteServer.java240
-rw-r--r--core/java/com/android/internal/policy/DecorView.java3
-rw-r--r--core/java/com/android/internal/widget/DecorCaptionView.java18
-rw-r--r--core/java/com/android/server/SystemConfig.java15
-rw-r--r--core/jni/com_android_internal_os_Zygote.cpp264
-rw-r--r--core/jni/fd_utils.cpp6
-rwxr-xr-xcore/jni/runtime_native_boot-flags-test.sh47
-rw-r--r--core/res/res/color-car/car_borderless_button_text_color.xml20
-rw-r--r--core/res/res/color-car/car_button_text_color.xml20
-rw-r--r--core/res/res/color-car/car_switch.xml24
-rw-r--r--core/res/res/drawable-car/car_button_background.xml36
-rw-r--r--core/res/res/drawable-car/car_checkbox.xml23
-rw-r--r--core/res/res/drawable-car/car_dialog_button_background.xml22
-rw-r--r--core/res/res/drawable-car/car_seekbar_thumb.xml24
-rw-r--r--core/res/res/drawable-car/car_seekbar_thumb_dark.xml24
-rw-r--r--core/res/res/drawable-car/car_seekbar_thumb_light.xml24
-rw-r--r--core/res/res/drawable-car/car_seekbar_track.xml43
-rw-r--r--core/res/res/drawable-car/car_seekbar_track_dark.xml44
-rw-r--r--core/res/res/drawable-car/car_seekbar_track_light.xml44
-rw-r--r--core/res/res/drawable-car/car_switch_thumb.xml25
-rw-r--r--core/res/res/drawable-nodpi/stat_sys_adb.xml24
-rw-r--r--core/res/res/layout-car/car_preference.xml72
-rw-r--r--core/res/res/layout-car/car_preference_category.xml65
-rw-r--r--core/res/res/layout-car/car_resolver_different_item_header.xml33
-rw-r--r--core/res/res/layout-car/car_resolver_list.xml112
-rw-r--r--core/res/res/layout-car/car_resolver_list_with_default.xml161
-rw-r--r--location/java/android/location/ILocationManager.aidl1
-rw-r--r--location/java/android/location/Location.java46
-rw-r--r--location/java/android/location/LocationManager.java17
-rw-r--r--location/java/android/location/LocationRequest.java10
-rw-r--r--location/java/com/android/internal/location/ProviderRequest.java2
-rw-r--r--packages/BackupRestoreConfirmation/res/values-de/strings.xml2
-rw-r--r--packages/SettingsLib/res/values-de/strings.xml2
-rw-r--r--packages/SettingsLib/res/values-es/strings.xml4
-rw-r--r--packages/SettingsLib/res/values-hy/strings.xml2
-rw-r--r--packages/SystemUI/Android.bp1
-rw-r--r--packages/SystemUI/res-keyguard/layout/bubble_clock.xml4
-rw-r--r--packages/SystemUI/res-keyguard/layout/stretchanalog_clock.xml4
-rw-r--r--packages/SystemUI/shared/src/com/android/systemui/shared/recents/ISystemUiProxy.aidl10
-rw-r--r--packages/SystemUI/src/com/android/keyguard/KeyguardStatusView.java13
-rw-r--r--packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java30
-rw-r--r--packages/SystemUI/src/com/android/systemui/analytics/DataCollector.java14
-rw-r--r--packages/SystemUI/src/com/android/systemui/classifier/Classifier.java1
-rw-r--r--packages/SystemUI/src/com/android/systemui/classifier/DirectionEvaluator.java1
-rw-r--r--packages/SystemUI/src/com/android/systemui/classifier/FalsingManager.java12
-rw-r--r--packages/SystemUI/src/com/android/systemui/classifier/HumanInteractionClassifier.java3
-rw-r--r--packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java2
-rw-r--r--packages/SystemUI/src/com/android/systemui/recents/OverviewProxyService.java39
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/AlertingNotificationManager.java3
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/AmbientPulseManager.java2
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/NavigationBarController.java4
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java37
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/PulseExpansionHandler.kt272
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationWakeUpCoordinator.kt215
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/NotificationData.java4
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/NotificationEntry.java6
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java18
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableView.java4
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationContentView.java25
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/AmbientState.java66
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/AnimationFilter.java4
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationSection.java63
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java295
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationSwipeHelper.java8
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithm.java22
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackStateAnimator.java26
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarFragment.java5
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java48
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java8
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java18
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowView.java3
-rw-r--r--packages/SystemUI/src/com/android/systemui/util/InjectionInflationController.java6
-rw-r--r--packages/SystemUI/tests/src/com/android/keyguard/KeyguardUpdateMonitorTest.java11
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutTest.java4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationSwipeHelperTest.java2
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationPanelViewTest.java16
-rw-r--r--proto/src/wifi.proto24
-rw-r--r--services/core/java/com/android/server/ConnectivityService.java2
-rw-r--r--services/core/java/com/android/server/LocationManagerService.java116
-rw-r--r--services/core/java/com/android/server/am/ActiveServices.java2
-rw-r--r--services/core/java/com/android/server/am/ProcessList.java2
-rw-r--r--services/core/java/com/android/server/inputmethod/InputMethodManagerService.java11
-rw-r--r--services/core/java/com/android/server/location/GnssLocationProvider.java11
-rw-r--r--services/core/java/com/android/server/os/BugreportManagerServiceImpl.java9
-rw-r--r--services/core/java/com/android/server/pm/permission/DefaultPermissionGrantPolicy.java7
-rw-r--r--services/core/java/com/android/server/power/batterysaver/BatterySaverController.java2
-rw-r--r--services/core/java/com/android/server/wallpaper/WallpaperManagerInternal.java30
-rw-r--r--services/core/java/com/android/server/wallpaper/WallpaperManagerService.java68
-rw-r--r--services/core/java/com/android/server/wm/DisplayContent.java7
-rw-r--r--services/core/java/com/android/server/wm/DisplayPolicy.java13
-rw-r--r--services/core/java/com/android/server/wm/TaskPositioner.java11
-rw-r--r--services/core/java/com/android/server/wm/WindowManagerInternal.java5
-rw-r--r--services/core/java/com/android/server/wm/WindowManagerService.java9
-rw-r--r--services/core/java/com/android/server/wm/WindowState.java35
-rw-r--r--services/core/jni/com_android_server_location_GnssLocationProvider.cpp16
-rw-r--r--services/tests/servicestests/src/com/android/server/usage/AppStandbyControllerTests.java26
-rw-r--r--services/tests/wmtests/src/com/android/server/wm/WindowFrameTests.java71
-rw-r--r--services/usage/java/com/android/server/usage/UsageStatsDatabase.java33
-rw-r--r--services/usage/java/com/android/server/usage/UserUsageStatsService.java5
-rw-r--r--telecomm/java/android/telecom/PhoneAccountSuggestion.java5
-rw-r--r--telephony/java/android/telephony/PhoneNumberRange.java2
-rw-r--r--telephony/java/android/telephony/SubscriptionManager.java35
-rw-r--r--telephony/java/android/telephony/TelephonyManager.java22
-rw-r--r--telephony/java/android/telephony/mbms/vendor/MbmsGroupCallServiceBase.java13
148 files changed, 3334 insertions, 1266 deletions
diff --git a/api/current.txt b/api/current.txt
index 8debaa5c2f0d..0703a18ca5a6 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -4268,6 +4268,7 @@ package android.app {
method public int noteOpNoThrow(String, int, String);
method public int noteProxyOp(String, String);
method public int noteProxyOpNoThrow(String, String);
+ method public int noteProxyOpNoThrow(@NonNull String, @Nullable String, int);
method public static String permissionToOp(String);
method public int startOp(String, int, String);
method public int startOpNoThrow(String, int, String);
@@ -12335,7 +12336,7 @@ package android.content.res {
public final class Resources.Theme {
method public void applyStyle(int, boolean);
method public void dump(int, String, String);
- method public int[] getAttributeResolutionStack(@AttrRes int, @StyleRes int, @StyleRes int);
+ method @NonNull public int[] getAttributeResolutionStack(@AttrRes int, @StyleRes int, @StyleRes int);
method public int getChangingConfigurations();
method public android.graphics.drawable.Drawable getDrawable(@DrawableRes int) throws android.content.res.Resources.NotFoundException;
method @StyleRes public int getExplicitStyle(@Nullable android.util.AttributeSet);
@@ -22855,6 +22856,7 @@ package android.location {
method public float getBearing();
method public float getBearingAccuracyDegrees();
method public long getElapsedRealtimeNanos();
+ method public long getElapsedRealtimeUncertaintyNanos();
method public android.os.Bundle getExtras();
method public double getLatitude();
method public double getLongitude();
@@ -22867,6 +22869,7 @@ package android.location {
method public boolean hasAltitude();
method public boolean hasBearing();
method public boolean hasBearingAccuracy();
+ method public boolean hasElapsedRealtimeUncertaintyNanos();
method public boolean hasSpeed();
method public boolean hasSpeedAccuracy();
method public boolean hasVerticalAccuracy();
@@ -22882,6 +22885,7 @@ package android.location {
method public void setBearing(float);
method public void setBearingAccuracyDegrees(float);
method public void setElapsedRealtimeNanos(long);
+ method public void setElapsedRealtimeUncertaintyNanos(long);
method public void setExtras(android.os.Bundle);
method public void setLatitude(double);
method public void setLongitude(double);
@@ -28753,8 +28757,8 @@ package android.net {
}
public class InetAddresses {
- method public static boolean isNumericAddress(String);
- method public static java.net.InetAddress parseNumericAddress(String);
+ method public static boolean isNumericAddress(@NonNull String);
+ method @NonNull public static java.net.InetAddress parseNumericAddress(@NonNull String);
}
public final class IpPrefix implements android.os.Parcelable {
@@ -29345,25 +29349,25 @@ package android.net {
public class VpnService.Builder {
ctor public VpnService.Builder();
- method public android.net.VpnService.Builder addAddress(java.net.InetAddress, int);
- method public android.net.VpnService.Builder addAddress(String, int);
- method public android.net.VpnService.Builder addAllowedApplication(String) throws android.content.pm.PackageManager.NameNotFoundException;
- method public android.net.VpnService.Builder addDisallowedApplication(String) throws android.content.pm.PackageManager.NameNotFoundException;
- method public android.net.VpnService.Builder addDnsServer(java.net.InetAddress);
- method public android.net.VpnService.Builder addDnsServer(String);
- method public android.net.VpnService.Builder addRoute(java.net.InetAddress, int);
- method public android.net.VpnService.Builder addRoute(String, int);
- method public android.net.VpnService.Builder addSearchDomain(String);
- method public android.net.VpnService.Builder allowBypass();
- method public android.net.VpnService.Builder allowFamily(int);
- method public android.os.ParcelFileDescriptor establish();
- method public android.net.VpnService.Builder setBlocking(boolean);
- method public android.net.VpnService.Builder setConfigureIntent(android.app.PendingIntent);
- method public android.net.VpnService.Builder setHttpProxy(@NonNull android.net.ProxyInfo);
- method public android.net.VpnService.Builder setMetered(boolean);
- method public android.net.VpnService.Builder setMtu(int);
- method public android.net.VpnService.Builder setSession(String);
- method public android.net.VpnService.Builder setUnderlyingNetworks(android.net.Network[]);
+ method @NonNull public android.net.VpnService.Builder addAddress(@NonNull java.net.InetAddress, int);
+ method @NonNull public android.net.VpnService.Builder addAddress(@NonNull String, int);
+ method @NonNull public android.net.VpnService.Builder addAllowedApplication(@NonNull String) throws android.content.pm.PackageManager.NameNotFoundException;
+ method @NonNull public android.net.VpnService.Builder addDisallowedApplication(@NonNull String) throws android.content.pm.PackageManager.NameNotFoundException;
+ method @NonNull public android.net.VpnService.Builder addDnsServer(@NonNull java.net.InetAddress);
+ method @NonNull public android.net.VpnService.Builder addDnsServer(@NonNull String);
+ method @NonNull public android.net.VpnService.Builder addRoute(@NonNull java.net.InetAddress, int);
+ method @NonNull public android.net.VpnService.Builder addRoute(@NonNull String, int);
+ method @NonNull public android.net.VpnService.Builder addSearchDomain(@NonNull String);
+ method @NonNull public android.net.VpnService.Builder allowBypass();
+ method @NonNull public android.net.VpnService.Builder allowFamily(int);
+ method @Nullable public android.os.ParcelFileDescriptor establish();
+ method @NonNull public android.net.VpnService.Builder setBlocking(boolean);
+ method @NonNull public android.net.VpnService.Builder setConfigureIntent(@NonNull android.app.PendingIntent);
+ method @NonNull public android.net.VpnService.Builder setHttpProxy(@NonNull android.net.ProxyInfo);
+ method @NonNull public android.net.VpnService.Builder setMetered(boolean);
+ method @NonNull public android.net.VpnService.Builder setMtu(int);
+ method @NonNull public android.net.VpnService.Builder setSession(@NonNull String);
+ method @NonNull public android.net.VpnService.Builder setUnderlyingNetworks(@Nullable android.net.Network[]);
}
}
@@ -35128,6 +35132,7 @@ package android.os {
field public static final int LOCATION_MODE_FOREGROUND_ONLY = 3; // 0x3
field public static final int LOCATION_MODE_GPS_DISABLED_WHEN_SCREEN_OFF = 1; // 0x1
field public static final int LOCATION_MODE_NO_CHANGE = 0; // 0x0
+ field public static final int LOCATION_MODE_THROTTLE_REQUESTS_WHEN_SCREEN_OFF = 4; // 0x4
field public static final int ON_AFTER_RELEASE = 536870912; // 0x20000000
field public static final int PARTIAL_WAKE_LOCK = 1; // 0x1
field public static final int PROXIMITY_SCREEN_OFF_WAKE_LOCK = 32; // 0x20
@@ -41121,10 +41126,10 @@ package android.service.autofill {
public static class CustomDescription.Builder {
ctor public CustomDescription.Builder(@NonNull android.widget.RemoteViews);
- method public android.service.autofill.CustomDescription.Builder addChild(int, @NonNull android.service.autofill.Transformation);
- method public android.service.autofill.CustomDescription.Builder addOnClickAction(int, @NonNull android.service.autofill.OnClickAction);
- method public android.service.autofill.CustomDescription.Builder batchUpdate(@NonNull android.service.autofill.Validator, @NonNull android.service.autofill.BatchUpdates);
- method public android.service.autofill.CustomDescription build();
+ method @NonNull public android.service.autofill.CustomDescription.Builder addChild(int, @NonNull android.service.autofill.Transformation);
+ method @NonNull public android.service.autofill.CustomDescription.Builder addOnClickAction(int, @NonNull android.service.autofill.OnClickAction);
+ method @NonNull public android.service.autofill.CustomDescription.Builder batchUpdate(@NonNull android.service.autofill.Validator, @NonNull android.service.autofill.BatchUpdates);
+ method @NonNull public android.service.autofill.CustomDescription build();
}
public final class Dataset implements android.os.Parcelable {
@@ -41229,17 +41234,17 @@ package android.service.autofill {
public static final class FillResponse.Builder {
ctor public FillResponse.Builder();
method @NonNull public android.service.autofill.FillResponse.Builder addDataset(@Nullable android.service.autofill.Dataset);
- method public android.service.autofill.FillResponse build();
- method public android.service.autofill.FillResponse.Builder disableAutofill(long);
+ method @NonNull public android.service.autofill.FillResponse build();
+ method @NonNull public android.service.autofill.FillResponse.Builder disableAutofill(long);
method @NonNull public android.service.autofill.FillResponse.Builder setAuthentication(@NonNull android.view.autofill.AutofillId[], @Nullable android.content.IntentSender, @Nullable android.widget.RemoteViews);
- method public android.service.autofill.FillResponse.Builder setClientState(@Nullable android.os.Bundle);
- method public android.service.autofill.FillResponse.Builder setFieldClassificationIds(@NonNull android.view.autofill.AutofillId...);
- method public android.service.autofill.FillResponse.Builder setFlags(int);
- method public android.service.autofill.FillResponse.Builder setFooter(@NonNull android.widget.RemoteViews);
- method public android.service.autofill.FillResponse.Builder setHeader(@NonNull android.widget.RemoteViews);
- method public android.service.autofill.FillResponse.Builder setIgnoredIds(android.view.autofill.AutofillId...);
+ method @NonNull public android.service.autofill.FillResponse.Builder setClientState(@Nullable android.os.Bundle);
+ method @NonNull public android.service.autofill.FillResponse.Builder setFieldClassificationIds(@NonNull android.view.autofill.AutofillId...);
+ method @NonNull public android.service.autofill.FillResponse.Builder setFlags(int);
+ method @NonNull public android.service.autofill.FillResponse.Builder setFooter(@NonNull android.widget.RemoteViews);
+ method @NonNull public android.service.autofill.FillResponse.Builder setHeader(@NonNull android.widget.RemoteViews);
+ method @NonNull public android.service.autofill.FillResponse.Builder setIgnoredIds(android.view.autofill.AutofillId...);
method @NonNull public android.service.autofill.FillResponse.Builder setSaveInfo(@NonNull android.service.autofill.SaveInfo);
- method public android.service.autofill.FillResponse.Builder setUserData(@NonNull android.service.autofill.UserData);
+ method @NonNull public android.service.autofill.FillResponse.Builder setUserData(@NonNull android.service.autofill.UserData);
}
public final class ImageTransformation implements android.os.Parcelable android.service.autofill.Transformation {
@@ -41348,10 +41353,10 @@ package android.service.autofill {
public static final class UserData.Builder {
ctor public UserData.Builder(@NonNull String, @NonNull String, @NonNull String);
- method public android.service.autofill.UserData.Builder add(@NonNull String, @NonNull String);
- method public android.service.autofill.UserData build();
- method public android.service.autofill.UserData.Builder setFieldClassificationAlgorithm(@Nullable String, @Nullable android.os.Bundle);
- method public android.service.autofill.UserData.Builder setFieldClassificationAlgorithmForCategory(@NonNull String, @Nullable String, @Nullable android.os.Bundle);
+ method @NonNull public android.service.autofill.UserData.Builder add(@NonNull String, @NonNull String);
+ method @NonNull public android.service.autofill.UserData build();
+ method @NonNull public android.service.autofill.UserData.Builder setFieldClassificationAlgorithm(@Nullable String, @Nullable android.os.Bundle);
+ method @NonNull public android.service.autofill.UserData.Builder setFieldClassificationAlgorithmForCategory(@NonNull String, @Nullable String, @Nullable android.os.Bundle);
}
public interface Validator {
@@ -43822,7 +43827,7 @@ package android.telecom {
public final class PhoneAccountSuggestion implements android.os.Parcelable {
method public int describeContents();
- method public android.telecom.PhoneAccountHandle getPhoneAccountHandle();
+ method @NonNull public android.telecom.PhoneAccountHandle getPhoneAccountHandle();
method public int getReason();
method public boolean shouldAutoSelect();
method public void writeToParcel(android.os.Parcel, int);
@@ -56688,7 +56693,7 @@ package android.widget {
method public void setLong(int, String, long);
method public void setOnClickFillInIntent(int, android.content.Intent);
method public void setOnClickPendingIntent(int, android.app.PendingIntent);
- method public void setOnClickResponse(int, android.widget.RemoteViews.RemoteResponse);
+ method public void setOnClickResponse(int, @NonNull android.widget.RemoteViews.RemoteResponse);
method public void setPendingIntentTemplate(int, android.app.PendingIntent);
method public void setProgressBar(int, int, int, boolean);
method public void setRelativeScrollPosition(int, int);
@@ -56719,9 +56724,9 @@ package android.widget {
public static class RemoteViews.RemoteResponse {
ctor public RemoteViews.RemoteResponse();
- method public android.widget.RemoteViews.RemoteResponse addSharedElement(int, String);
- method public static android.widget.RemoteViews.RemoteResponse fromFillInIntent(android.content.Intent);
- method public static android.widget.RemoteViews.RemoteResponse fromPendingIntent(android.app.PendingIntent);
+ method @NonNull public android.widget.RemoteViews.RemoteResponse addSharedElement(int, @NonNull String);
+ method @NonNull public static android.widget.RemoteViews.RemoteResponse fromFillInIntent(@NonNull android.content.Intent);
+ method @NonNull public static android.widget.RemoteViews.RemoteResponse fromPendingIntent(@NonNull android.app.PendingIntent);
}
@java.lang.annotation.Target({java.lang.annotation.ElementType.TYPE}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.RUNTIME) public static @interface RemoteViews.RemoteView {
diff --git a/api/system-current.txt b/api/system-current.txt
index 94bc1dd7e54f..2a8f5b44f191 100644
--- a/api/system-current.txt
+++ b/api/system-current.txt
@@ -313,7 +313,6 @@ package android.app {
method @Deprecated @RequiresPermission(android.Manifest.permission.GET_APP_OPS_STATS) public java.util.List<android.app.AppOpsManager.PackageOps> getOpsForPackage(int, String, int[]);
method @NonNull @RequiresPermission(android.Manifest.permission.GET_APP_OPS_STATS) public java.util.List<android.app.AppOpsManager.PackageOps> getOpsForPackage(int, @NonNull String, @Nullable java.lang.String...);
method @NonNull @RequiresPermission(android.Manifest.permission.GET_APP_OPS_STATS) public java.util.List<android.app.AppOpsManager.PackageOps> getPackagesForOps(@Nullable String[]);
- method public int noteProxyOpNoThrow(@NonNull String, @Nullable String, int);
method public static int opToDefaultMode(@NonNull String);
method @Nullable public static String opToPermission(@NonNull String);
method @RequiresPermission("android.permission.MANAGE_APP_OPS_MODES") public void setMode(String, int, String, int);
@@ -1969,10 +1968,10 @@ package android.hardware.hdmi {
method @Nullable public android.hardware.hdmi.HdmiPlaybackClient getPlaybackClient();
method @Nullable public android.hardware.hdmi.HdmiSwitchClient getSwitchClient();
method @Nullable public android.hardware.hdmi.HdmiTvClient getTvClient();
- method public boolean isRemoteDeviceConnected(android.hardware.hdmi.HdmiDeviceInfo);
- method public void powerOffRemoteDevice(android.hardware.hdmi.HdmiDeviceInfo);
+ method public boolean isRemoteDeviceConnected(@NonNull android.hardware.hdmi.HdmiDeviceInfo);
+ method public void powerOffRemoteDevice(@NonNull android.hardware.hdmi.HdmiDeviceInfo);
method @RequiresPermission(android.Manifest.permission.HDMI_CEC) public void removeHotplugEventListener(android.hardware.hdmi.HdmiControlManager.HotplugEventListener);
- method public void requestRemoteDeviceToBecomeActiveSource(android.hardware.hdmi.HdmiDeviceInfo);
+ method public void requestRemoteDeviceToBecomeActiveSource(@NonNull android.hardware.hdmi.HdmiDeviceInfo);
method @RequiresPermission(android.Manifest.permission.HDMI_CEC) public void setStandbyMode(boolean);
field public static final String ACTION_OSD_MESSAGE = "android.hardware.hdmi.action.OSD_MESSAGE";
field public static final int AVR_VOLUME_MUTED = 101; // 0x65
@@ -5667,7 +5666,7 @@ package android.permission {
public abstract class PermissionControllerService extends android.app.Service {
ctor public PermissionControllerService();
method public final void attachBaseContext(android.content.Context);
- method public final android.os.IBinder onBind(android.content.Intent);
+ method @NonNull public final android.os.IBinder onBind(android.content.Intent);
method public abstract int onCountPermissionApps(@NonNull java.util.List<java.lang.String>, int);
method @NonNull public abstract java.util.List<android.permission.RuntimePermissionPresentationInfo> onGetAppPermissions(@NonNull String);
method @NonNull public abstract java.util.List<android.permission.RuntimePermissionUsageInfo> onGetPermissionUsages(boolean, long);
@@ -6991,7 +6990,7 @@ package android.telecom {
}
public final class PhoneAccountSuggestion implements android.os.Parcelable {
- ctor public PhoneAccountSuggestion(android.telecom.PhoneAccountHandle, int, boolean);
+ ctor public PhoneAccountSuggestion(@NonNull android.telecom.PhoneAccountHandle, int, boolean);
}
public class PhoneAccountSuggestionService extends android.app.Service {
@@ -7678,7 +7677,7 @@ package android.telephony {
public final class PhoneNumberRange implements android.os.Parcelable {
ctor public PhoneNumberRange(@NonNull String, @NonNull String, @NonNull String, @NonNull String);
method public int describeContents();
- method public boolean matches(String);
+ method public boolean matches(@NonNull String);
method public void writeToParcel(android.os.Parcel, int);
field @NonNull public static final android.os.Parcelable.Creator<android.telephony.PhoneNumberRange> CREATOR;
}
@@ -7926,7 +7925,7 @@ package android.telephony {
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean enableDataConnectivity();
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean enableModemForSlot(int, boolean);
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void enableVideoCalling(boolean);
- method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public String getAidForAppType(int);
+ method @Nullable @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public String getAidForAppType(int);
method @Deprecated @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public java.util.List<android.service.carrier.CarrierIdentifier> getAllowedCarriers(int);
method public java.util.List<java.lang.String> getCarrierPackageNamesForIntent(android.content.Intent);
method public java.util.List<java.lang.String> getCarrierPackageNamesForIntentAndPhone(android.content.Intent, int);
@@ -7942,9 +7941,10 @@ package android.telephony {
method @Deprecated public boolean getDataEnabled();
method @Deprecated public boolean getDataEnabled(int);
method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean getEmergencyCallbackMode();
- method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public String getIsimDomain();
+ method @Nullable @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public String getIsimDomain();
method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public String getIsimIst();
method @NonNull @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public java.util.List<android.util.Pair<java.lang.Integer,java.lang.Integer>> getLogicalToPhysicalSlotMapping();
+ method public static long getMaxNumberVerificationTimeoutMillis();
method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public long getPreferredNetworkTypeBitmap();
method @RequiresPermission(anyOf={android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE, android.Manifest.permission.READ_PHONE_STATE}) public int getRadioPowerState();
method public int getSimApplicationState();
@@ -8005,7 +8005,6 @@ package android.telephony {
field public static final String EXTRA_SIM_STATE = "android.telephony.extra.SIM_STATE";
field public static final String EXTRA_VISUAL_VOICEMAIL_ENABLED_BY_USER_BOOL = "android.telephony.extra.VISUAL_VOICEMAIL_ENABLED_BY_USER_BOOL";
field public static final String EXTRA_VOICEMAIL_SCRAMBLED_PIN_STRING = "android.telephony.extra.VOICEMAIL_SCRAMBLED_PIN_STRING";
- field public static final long MAX_NUMBER_VERIFICATION_TIMEOUT_MILLIS = 60000L; // 0xea60L
field public static final long NETWORK_TYPE_BITMASK_1xRTT = 64L; // 0x40L
field public static final long NETWORK_TYPE_BITMASK_CDMA = 8L; // 0x8L
field public static final long NETWORK_TYPE_BITMASK_EDGE = 2L; // 0x2L
@@ -9295,12 +9294,12 @@ package android.telephony.mbms.vendor {
public class MbmsGroupCallServiceBase extends android.app.Service {
ctor public MbmsGroupCallServiceBase();
method public void dispose(int) throws android.os.RemoteException;
- method public int initialize(android.telephony.mbms.MbmsGroupCallSessionCallback, int) throws android.os.RemoteException;
+ method public int initialize(@NonNull android.telephony.mbms.MbmsGroupCallSessionCallback, int) throws android.os.RemoteException;
method public void onAppCallbackDied(int, int);
method public android.os.IBinder onBind(android.content.Intent);
- method public int startGroupCall(int, long, java.util.List<java.lang.Integer>, java.util.List<java.lang.Integer>, android.telephony.mbms.GroupCallCallback);
+ method public int startGroupCall(int, long, @NonNull java.util.List<java.lang.Integer>, @NonNull java.util.List<java.lang.Integer>, @NonNull android.telephony.mbms.GroupCallCallback);
method public void stopGroupCall(int, long);
- method public void updateGroupCall(int, long, java.util.List<java.lang.Integer>, java.util.List<java.lang.Integer>);
+ method public void updateGroupCall(int, long, @NonNull java.util.List<java.lang.Integer>, @NonNull java.util.List<java.lang.Integer>);
}
public class MbmsStreamingServiceBase extends android.os.Binder {
diff --git a/api/test-current.txt b/api/test-current.txt
index e38ebe61ddec..1e9802a10e1d 100644
--- a/api/test-current.txt
+++ b/api/test-current.txt
@@ -905,6 +905,7 @@ package android.location {
public class LocationManager {
method public String[] getBackgroundThrottlingWhitelist();
method public String[] getIgnoreSettingsWhitelist();
+ method @NonNull public java.util.List<android.location.LocationRequest> getTestProviderCurrentRequests(String);
method @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void requestLocationUpdates(android.location.LocationRequest, android.location.LocationListener, android.os.Looper);
method @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void requestLocationUpdates(android.location.LocationRequest, android.app.PendingIntent);
method @RequiresPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) public void setLocationEnabledForUser(boolean, android.os.UserHandle);
@@ -918,11 +919,14 @@ package android.location {
method public long getInterval();
method public int getNumUpdates();
method public int getQuality();
+ method public boolean isLocationSettingsIgnored();
method public android.location.LocationRequest setExpireAt(long);
method public android.location.LocationRequest setExpireIn(long);
method public android.location.LocationRequest setFastestInterval(long);
method public android.location.LocationRequest setInterval(long);
+ method @RequiresPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) public android.location.LocationRequest setLocationSettingsIgnored(boolean);
method public android.location.LocationRequest setNumUpdates(int);
+ method public android.location.LocationRequest setProvider(String);
method public android.location.LocationRequest setQuality(int);
method public void writeToParcel(android.os.Parcel, int);
field public static final int ACCURACY_BLOCK = 102; // 0x66
@@ -2000,6 +2004,7 @@ package android.provider {
field public static final String DYNAMIC_POWER_SAVINGS_ENABLED = "dynamic_power_savings_enabled";
field public static final String HIDDEN_API_BLACKLIST_EXEMPTIONS = "hidden_api_blacklist_exemptions";
field public static final String LOCATION_GLOBAL_KILL_SWITCH = "location_global_kill_switch";
+ field public static final String LOCATION_IGNORE_SETTINGS_PACKAGE_WHITELIST = "location_ignore_settings_package_whitelist";
field public static final String LOW_POWER_MODE = "low_power";
field public static final String LOW_POWER_MODE_STICKY = "low_power_sticky";
field public static final String OVERLAY_DISPLAY_DEVICES = "overlay_display_devices";
@@ -2316,7 +2321,7 @@ package android.telecom {
}
public final class PhoneAccountSuggestion implements android.os.Parcelable {
- ctor public PhoneAccountSuggestion(android.telecom.PhoneAccountHandle, int, boolean);
+ ctor public PhoneAccountSuggestion(@NonNull android.telecom.PhoneAccountHandle, int, boolean);
}
public class PhoneAccountSuggestionService extends android.app.Service {
@@ -2435,12 +2440,12 @@ package android.telephony.mbms.vendor {
public class MbmsGroupCallServiceBase extends android.app.Service {
ctor public MbmsGroupCallServiceBase();
method public void dispose(int) throws android.os.RemoteException;
- method public int initialize(android.telephony.mbms.MbmsGroupCallSessionCallback, int) throws android.os.RemoteException;
+ method public int initialize(@NonNull android.telephony.mbms.MbmsGroupCallSessionCallback, int) throws android.os.RemoteException;
method public void onAppCallbackDied(int, int);
method public android.os.IBinder onBind(android.content.Intent);
- method public int startGroupCall(int, long, java.util.List<java.lang.Integer>, java.util.List<java.lang.Integer>, android.telephony.mbms.GroupCallCallback);
+ method public int startGroupCall(int, long, @NonNull java.util.List<java.lang.Integer>, @NonNull java.util.List<java.lang.Integer>, @NonNull android.telephony.mbms.GroupCallCallback);
method public void stopGroupCall(int, long);
- method public void updateGroupCall(int, long, java.util.List<java.lang.Integer>, java.util.List<java.lang.Integer>);
+ method public void updateGroupCall(int, long, @NonNull java.util.List<java.lang.Integer>, @NonNull java.util.List<java.lang.Integer>);
}
public class MbmsStreamingServiceBase extends android.os.Binder {
@@ -2727,10 +2732,6 @@ package android.view {
field public static final int CALLBACK_ANIMATION = 1; // 0x1
}
- public final class Display {
- method public boolean supportsSystemDecorations();
- }
-
public class FocusFinder {
method public static void sort(android.view.View[], int, int, android.view.ViewGroup, boolean);
}
@@ -2800,6 +2801,7 @@ package android.view {
method public default void setShouldShowIme(int, boolean);
method public default void setShouldShowSystemDecors(int, boolean);
method public default void setShouldShowWithInsecureKeyguard(int, boolean);
+ method public default boolean shouldShowSystemDecors(int);
}
public static class WindowManager.LayoutParams extends android.view.ViewGroup.LayoutParams implements android.os.Parcelable {
diff --git a/cmds/hid/hid b/cmds/hid/hid
index 2359fcd738dd..3931da1e2a85 100755
--- a/cmds/hid/hid
+++ b/cmds/hid/hid
@@ -5,4 +5,10 @@
#
base=/system
export CLASSPATH=$base/framework/hid.jar
+
+# Preload the native portion libhidcommand_jni.so to bypass the dependency
+# checks in the Java classloader, which prohibit dependencies that aren't
+# listed in system/core/rootdir/etc/public.libraries.android.txt.
+export LD_PRELOAD=libhidcommand_jni.so
+
exec app_process $base/bin com.android.commands.hid.Hid "$@"
diff --git a/cmds/statsd/Android.bp b/cmds/statsd/Android.bp
index ca48881ca519..da720021512d 100644
--- a/cmds/statsd/Android.bp
+++ b/cmds/statsd/Android.bp
@@ -68,6 +68,7 @@ cc_defaults {
"src/config/ConfigKey.cpp",
"src/config/ConfigListener.cpp",
"src/config/ConfigManager.cpp",
+ "src/external/GpuStatsPuller.cpp",
"src/external/Perfetto.cpp",
"src/external/Perfprofd.cpp",
"src/external/StatsPuller.cpp",
@@ -122,6 +123,7 @@ cc_defaults {
shared_libs: [
"libbase",
"libbinder",
+ "libgraphicsenv",
"libincident",
"liblog",
"libutils",
diff --git a/cmds/statsd/src/StatsService.cpp b/cmds/statsd/src/StatsService.cpp
index 69fbf1f9d881..9ac888ba2eb5 100644
--- a/cmds/statsd/src/StatsService.cpp
+++ b/cmds/statsd/src/StatsService.cpp
@@ -1229,70 +1229,81 @@ Status StatsService::sendBinaryPushStateChangedAtom(const android::String16& tra
hardware::Return<void> StatsService::reportSpeakerImpedance(
const SpeakerImpedance& speakerImpedance) {
- LogEvent event(getWallClockSec() * NS_PER_SEC, getElapsedRealtimeNs(), speakerImpedance);
- mProcessor->OnLogEvent(&event);
+ android::util::stats_write(android::util::SPEAKER_IMPEDANCE_REPORTED,
+ speakerImpedance.speakerLocation, speakerImpedance.milliOhms);
return hardware::Void();
}
hardware::Return<void> StatsService::reportHardwareFailed(const HardwareFailed& hardwareFailed) {
- LogEvent event(getWallClockSec() * NS_PER_SEC, getElapsedRealtimeNs(), hardwareFailed);
- mProcessor->OnLogEvent(&event);
+ android::util::stats_write(android::util::HARDWARE_FAILED, int32_t(hardwareFailed.hardwareType),
+ hardwareFailed.hardwareLocation, int32_t(hardwareFailed.errorCode));
return hardware::Void();
}
hardware::Return<void> StatsService::reportPhysicalDropDetected(
const PhysicalDropDetected& physicalDropDetected) {
- LogEvent event(getWallClockSec() * NS_PER_SEC, getElapsedRealtimeNs(), physicalDropDetected);
- mProcessor->OnLogEvent(&event);
+ android::util::stats_write(android::util::PHYSICAL_DROP_DETECTED,
+ int32_t(physicalDropDetected.confidencePctg), physicalDropDetected.accelPeak,
+ physicalDropDetected.freefallDuration);
return hardware::Void();
}
hardware::Return<void> StatsService::reportChargeCycles(const ChargeCycles& chargeCycles) {
- LogEvent event(getWallClockSec() * NS_PER_SEC, getElapsedRealtimeNs(), chargeCycles);
- mProcessor->OnLogEvent(&event);
+ std::vector<int32_t> buckets = chargeCycles.cycleBucket;
+ int initialSize = buckets.size();
+ for (int i = 0; i < 10 - initialSize; i++) {
+ buckets.push_back(-1); // Push -1 for buckets that do not exist.
+ }
+ android::util::stats_write(android::util::CHARGE_CYCLES_REPORTED, buckets[0], buckets[1],
+ buckets[2], buckets[3], buckets[4], buckets[5], buckets[6], buckets[7], buckets[8],
+ buckets[9]);
return hardware::Void();
}
hardware::Return<void> StatsService::reportBatteryHealthSnapshot(
const BatteryHealthSnapshotArgs& batteryHealthSnapshotArgs) {
- LogEvent event(getWallClockSec() * NS_PER_SEC, getElapsedRealtimeNs(),
- batteryHealthSnapshotArgs);
- mProcessor->OnLogEvent(&event);
+ android::util::stats_write(android::util::BATTERY_HEALTH_SNAPSHOT,
+ int32_t(batteryHealthSnapshotArgs.type), batteryHealthSnapshotArgs.temperatureDeciC,
+ batteryHealthSnapshotArgs.voltageMicroV, batteryHealthSnapshotArgs.currentMicroA,
+ batteryHealthSnapshotArgs.openCircuitVoltageMicroV,
+ batteryHealthSnapshotArgs.resistanceMicroOhm, batteryHealthSnapshotArgs.levelPercent);
return hardware::Void();
}
hardware::Return<void> StatsService::reportSlowIo(const SlowIo& slowIo) {
- LogEvent event(getWallClockSec() * NS_PER_SEC, getElapsedRealtimeNs(), slowIo);
- mProcessor->OnLogEvent(&event);
+ android::util::stats_write(android::util::SLOW_IO, int32_t(slowIo.operation), slowIo.count);
return hardware::Void();
}
hardware::Return<void> StatsService::reportBatteryCausedShutdown(
const BatteryCausedShutdown& batteryCausedShutdown) {
- LogEvent event(getWallClockSec() * NS_PER_SEC, getElapsedRealtimeNs(), batteryCausedShutdown);
- mProcessor->OnLogEvent(&event);
+ android::util::stats_write(android::util::BATTERY_CAUSED_SHUTDOWN,
+ batteryCausedShutdown.voltageMicroV);
return hardware::Void();
}
hardware::Return<void> StatsService::reportUsbPortOverheatEvent(
const UsbPortOverheatEvent& usbPortOverheatEvent) {
- LogEvent event(getWallClockSec() * NS_PER_SEC, getElapsedRealtimeNs(), usbPortOverheatEvent);
- mProcessor->OnLogEvent(&event);
+ android::util::stats_write(android::util::USB_PORT_OVERHEAT_EVENT_REPORTED,
+ usbPortOverheatEvent.plugTemperatureDeciC, usbPortOverheatEvent.maxTemperatureDeciC,
+ usbPortOverheatEvent.timeToOverheat, usbPortOverheatEvent.timeToHysteresis,
+ usbPortOverheatEvent.timeToInactive);
return hardware::Void();
}
hardware::Return<void> StatsService::reportSpeechDspStat(
const SpeechDspStat& speechDspStat) {
- LogEvent event(getWallClockSec() * NS_PER_SEC, getElapsedRealtimeNs(), speechDspStat);
- mProcessor->OnLogEvent(&event);
+ android::util::stats_write(android::util::SPEECH_DSP_STAT_REPORTED,
+ speechDspStat.totalUptimeMillis, speechDspStat.totalDowntimeMillis,
+ speechDspStat.totalCrashCount, speechDspStat.totalRecoverCount);
return hardware::Void();
}
diff --git a/cmds/statsd/src/atoms.proto b/cmds/statsd/src/atoms.proto
index b6474001deba..a983b2705d14 100644
--- a/cmds/statsd/src/atoms.proto
+++ b/cmds/statsd/src/atoms.proto
@@ -149,7 +149,7 @@ message Atom {
WTFOccurred wtf_occurred = 80;
LowMemReported low_mem_reported = 81;
GenericAtom generic_atom = 82;
- KeyValuePairsAtom key_value_pairs_atom = 83;
+ KeyValuePairsAtom key_value_pairs_atom = 83 [(allow_from_any_uid) = true];
VibratorStateChanged vibrator_state_changed = 84;
DeferredJobStatsReported deferred_job_stats_reported = 85;
ThermalThrottlingStateChanged thermal_throttling = 86;
@@ -252,7 +252,7 @@ message Atom {
}
// Pulled events will start at field 10000.
- // Next: 10048
+ // Next: 10056
oneof pulled {
WifiBytesTransfer wifi_bytes_transfer = 10000;
WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001;
@@ -308,6 +308,8 @@ message Atom {
TrainInfo train_info = 10051;
TimeZoneDataInfo time_zone_data_info = 10052;
SDCardInfo sdcard_info = 10053;
+ GpuStatsGlobalInfo gpu_stats_global_info = 10054;
+ GpuStatsAppInfo gpu_stats_app_info = 10055;
}
// DO NOT USE field numbers above 100,000 in AOSP.
@@ -1566,6 +1568,7 @@ message WatchdogRollbackOccurred {
ROLLBACK_INITIATE = 1;
ROLLBACK_SUCCESS = 2;
ROLLBACK_FAILURE = 3;
+ ROLLBACK_ROOT_TRIGGERED = 4;
}
optional RollbackType rollback_type = 1;
@@ -5688,3 +5691,55 @@ message TimeZoneDataInfo {
// A version identifier for the data set on device. e.g. "2018i"
optional string tzdb_version = 1;
}
+
+/*
+ * Logs the GPU stats global health information.
+ *
+ * Logged from:
+ * frameworks/native/services/gpuservice/gpustats/
+ */
+message GpuStatsGlobalInfo {
+ // Package name of the gpu driver.
+ optional string driver_package_name = 1;
+
+ // Version name of the gpu driver.
+ optional string driver_version_name = 2;
+
+ // Version code of the gpu driver.
+ optional int64 driver_version_code = 3;
+
+ // Build time of the gpu driver in UTC as seconds since January 1, 1970.
+ optional int64 driver_build_time = 4;
+
+ // Total count of the gl driver gets loaded.
+ optional int64 gl_loading_count = 5;
+
+ // Total count of the gl driver fails to be loaded.
+ optional int64 gl_loading_failure_count = 6;
+
+ // Total count of the Vulkan driver gets loaded.
+ optional int64 vk_loading_count = 7;
+
+ // Total count of the Vulkan driver fails to be loaded.
+ optional int64 vk_loading_failure_count = 8;
+}
+
+/*
+ * Logs the GPU stats per app health information.
+ *
+ * Logged from:
+ * frameworks/native/services/gpuservice/gpustats/
+ */
+message GpuStatsAppInfo {
+ // Package name of the application that loads the gpu driver.
+ optional string app_package_name = 1;
+
+ // Version code of the gpu driver this app loads.
+ optional int64 driver_version_code = 2;
+
+ // List of all the gl driver loading times for this app.
+ repeated int64 gl_driver_loading_time = 3;
+
+ // List of all the Vulkan driver laoding times for this app.
+ repeated int64 vk_driver_loading_time = 4;
+}
diff --git a/cmds/statsd/src/external/GpuStatsPuller.cpp b/cmds/statsd/src/external/GpuStatsPuller.cpp
new file mode 100644
index 000000000000..844580321719
--- /dev/null
+++ b/cmds/statsd/src/external/GpuStatsPuller.cpp
@@ -0,0 +1,91 @@
+/*
+ * Copyright 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "GpuStatsPuller.h"
+
+#include <binder/IServiceManager.h>
+#include <graphicsenv/GpuStatsInfo.h>
+#include <graphicsenv/IGpuService.h>
+
+#include "logd/LogEvent.h"
+
+#include "stats_log_util.h"
+#include "statslog.h"
+
+namespace android {
+namespace os {
+namespace statsd {
+
+GpuStatsPuller::GpuStatsPuller(const int tagId) : StatsPuller(tagId) {
+}
+
+static sp<IGpuService> getGpuService() {
+ const sp<IBinder> binder = defaultServiceManager()->checkService(String16("gpu"));
+ if (!binder) {
+ ALOGE("Failed to get gpu service");
+ return nullptr;
+ }
+
+ return interface_cast<IGpuService>(binder);
+}
+
+static bool pullGpuStatsGlobalInfo(const sp<IGpuService>& gpuService,
+ std::vector<std::shared_ptr<LogEvent>>* data) {
+ std::vector<GpuStatsGlobalInfo> stats;
+ status_t status = gpuService->getGpuStatsGlobalInfo(&stats);
+ if (status != OK) {
+ return false;
+ }
+
+ data->clear();
+ data->reserve(stats.size());
+ for (const auto& info : stats) {
+ std::shared_ptr<LogEvent> event = make_shared<LogEvent>(
+ android::util::GPU_STATS_GLOBAL_INFO, getWallClockNs(), getElapsedRealtimeNs());
+ if (!event->write(info.driverPackageName)) return false;
+ if (!event->write(info.driverVersionName)) return false;
+ if (!event->write((int64_t)info.driverVersionCode)) return false;
+ if (!event->write(info.driverBuildTime)) return false;
+ if (!event->write((int64_t)info.glLoadingCount)) return false;
+ if (!event->write((int64_t)info.glLoadingFailureCount)) return false;
+ if (!event->write((int64_t)info.vkLoadingCount)) return false;
+ if (!event->write((int64_t)info.vkLoadingFailureCount)) return false;
+ event->init();
+ data->emplace_back(event);
+ }
+
+ return true;
+}
+
+bool GpuStatsPuller::PullInternal(std::vector<std::shared_ptr<LogEvent>>* data) {
+ const sp<IGpuService> gpuService = getGpuService();
+ if (!gpuService) {
+ return false;
+ }
+
+ switch (mTagId) {
+ case android::util::GPU_STATS_GLOBAL_INFO:
+ return pullGpuStatsGlobalInfo(gpuService, data);
+ default:
+ break;
+ }
+
+ return false;
+}
+
+} // namespace statsd
+} // namespace os
+} // namespace android
diff --git a/cmds/statsd/src/external/GpuStatsPuller.h b/cmds/statsd/src/external/GpuStatsPuller.h
new file mode 100644
index 000000000000..4c7a4d604252
--- /dev/null
+++ b/cmds/statsd/src/external/GpuStatsPuller.h
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include "StatsPuller.h"
+
+namespace android {
+namespace os {
+namespace statsd {
+
+/**
+ * Pull GpuStats from GpuService.
+ */
+class GpuStatsPuller : public StatsPuller {
+public:
+ explicit GpuStatsPuller(const int tagId);
+ bool PullInternal(std::vector<std::shared_ptr<LogEvent>>* data) override;
+};
+
+} // namespace statsd
+} // namespace os
+} // namespace android
diff --git a/cmds/statsd/src/external/StatsPullerManager.cpp b/cmds/statsd/src/external/StatsPullerManager.cpp
index 1513834b6724..924704ba6db5 100644
--- a/cmds/statsd/src/external/StatsPullerManager.cpp
+++ b/cmds/statsd/src/external/StatsPullerManager.cpp
@@ -27,6 +27,7 @@
#include "../logd/LogEvent.h"
#include "../stats_log_util.h"
#include "../statscompanion_util.h"
+#include "GpuStatsPuller.h"
#include "PowerStatsPuller.h"
#include "ResourceHealthManagerPuller.h"
#include "StatsCallbackPuller.h"
@@ -240,6 +241,9 @@ std::map<int, PullAtomInfo> StatsPullerManager::kAllPullAtomInfo = {
// SDCardInfo
{android::util::SDCARD_INFO,
{.puller = new StatsCompanionServicePuller(android::util::SDCARD_INFO)}},
+ // GpuStatsGlobalInfo
+ {android::util::GPU_STATS_GLOBAL_INFO,
+ {.puller = new GpuStatsPuller(android::util::GPU_STATS_GLOBAL_INFO)}},
};
StatsPullerManager::StatsPullerManager() : mNextPullTimeNs(NO_ALARM_UPDATE) {
diff --git a/cmds/statsd/src/logd/LogEvent.cpp b/cmds/statsd/src/logd/LogEvent.cpp
index dec36b54a1ce..0430e4ec9a2d 100644
--- a/cmds/statsd/src/logd/LogEvent.cpp
+++ b/cmds/statsd/src/logd/LogEvent.cpp
@@ -21,6 +21,7 @@
#include "statslog.h"
#include <binder/IPCThreadState.h>
+#include <private/android_filesystem_config.h>
namespace android {
namespace os {
@@ -202,140 +203,11 @@ LogEvent::LogEvent(const string& trainName, int64_t trainVersionCode, bool requi
}
LogEvent::LogEvent(int64_t wallClockTimestampNs, int64_t elapsedTimestampNs,
- const SpeakerImpedance& speakerImpedance) {
- mLogdTimestampNs = wallClockTimestampNs;
- mElapsedTimestampNs = elapsedTimestampNs;
- mTagId = android::util::SPEAKER_IMPEDANCE_REPORTED;
-
- mValues.push_back(
- FieldValue(Field(mTagId, getSimpleField(1)), Value(speakerImpedance.speakerLocation)));
- mValues.push_back(
- FieldValue(Field(mTagId, getSimpleField(2)), Value(speakerImpedance.milliOhms)));
-}
-
-LogEvent::LogEvent(int64_t wallClockTimestampNs, int64_t elapsedTimestampNs,
- const HardwareFailed& hardwareFailed) {
- mLogdTimestampNs = wallClockTimestampNs;
- mElapsedTimestampNs = elapsedTimestampNs;
- mTagId = android::util::HARDWARE_FAILED;
-
- mValues.push_back(FieldValue(Field(mTagId, getSimpleField(1)),
- Value(int32_t(hardwareFailed.hardwareType))));
- mValues.push_back(
- FieldValue(Field(mTagId, getSimpleField(2)), Value(hardwareFailed.hardwareLocation)));
- mValues.push_back(
- FieldValue(Field(mTagId, getSimpleField(3)), Value(int32_t(hardwareFailed.errorCode))));
-}
-
-LogEvent::LogEvent(int64_t wallClockTimestampNs, int64_t elapsedTimestampNs,
- const PhysicalDropDetected& physicalDropDetected) {
- mLogdTimestampNs = wallClockTimestampNs;
- mElapsedTimestampNs = elapsedTimestampNs;
- mTagId = android::util::PHYSICAL_DROP_DETECTED;
-
- mValues.push_back(FieldValue(Field(mTagId, getSimpleField(1)),
- Value(int32_t(physicalDropDetected.confidencePctg))));
- mValues.push_back(
- FieldValue(Field(mTagId, getSimpleField(2)), Value(physicalDropDetected.accelPeak)));
- mValues.push_back(FieldValue(Field(mTagId, getSimpleField(3)),
- Value(physicalDropDetected.freefallDuration)));
-}
-
-LogEvent::LogEvent(int64_t wallClockTimestampNs, int64_t elapsedTimestampNs,
- const ChargeCycles& chargeCycles) {
- mLogdTimestampNs = wallClockTimestampNs;
- mElapsedTimestampNs = elapsedTimestampNs;
- mTagId = android::util::CHARGE_CYCLES_REPORTED;
-
- for (size_t i = 0; i < chargeCycles.cycleBucket.size(); i++) {
- mValues.push_back(FieldValue(Field(mTagId, getSimpleField(i + 1)),
- Value(chargeCycles.cycleBucket[i])));
- }
-}
-
-LogEvent::LogEvent(int64_t wallClockTimestampNs, int64_t elapsedTimestampNs,
- const BatteryHealthSnapshotArgs& batteryHealthSnapshotArgs) {
- mLogdTimestampNs = wallClockTimestampNs;
- mElapsedTimestampNs = elapsedTimestampNs;
- mTagId = android::util::BATTERY_HEALTH_SNAPSHOT;
-
- mValues.push_back(FieldValue(Field(mTagId, getSimpleField(1)),
- Value(int32_t(batteryHealthSnapshotArgs.type))));
- mValues.push_back(FieldValue(Field(mTagId, getSimpleField(2)),
- Value(batteryHealthSnapshotArgs.temperatureDeciC)));
- mValues.push_back(FieldValue(Field(mTagId, getSimpleField(3)),
- Value(batteryHealthSnapshotArgs.voltageMicroV)));
- mValues.push_back(FieldValue(Field(mTagId, getSimpleField(4)),
- Value(batteryHealthSnapshotArgs.currentMicroA)));
- mValues.push_back(FieldValue(Field(mTagId, getSimpleField(5)),
- Value(batteryHealthSnapshotArgs.openCircuitVoltageMicroV)));
- mValues.push_back(FieldValue(Field(mTagId, getSimpleField(6)),
- Value(batteryHealthSnapshotArgs.resistanceMicroOhm)));
- mValues.push_back(FieldValue(Field(mTagId, getSimpleField(7)),
- Value(batteryHealthSnapshotArgs.levelPercent)));
-}
-
-LogEvent::LogEvent(int64_t wallClockTimestampNs, int64_t elapsedTimestampNs, const SlowIo& slowIo) {
- mLogdTimestampNs = wallClockTimestampNs;
- mElapsedTimestampNs = elapsedTimestampNs;
- mTagId = android::util::SLOW_IO;
-
- int pos[] = {1};
- mValues.push_back(
- FieldValue(Field(mTagId, getSimpleField(1)), Value(int32_t(slowIo.operation))));
- pos[0]++;
- mValues.push_back(FieldValue(Field(mTagId, getSimpleField(2)), Value(slowIo.count)));
-}
-
-LogEvent::LogEvent(int64_t wallClockTimestampNs, int64_t elapsedTimestampNs,
- const SpeechDspStat& speechDspStat) {
- mLogdTimestampNs = wallClockTimestampNs;
- mElapsedTimestampNs = elapsedTimestampNs;
- mTagId = android::util::SPEECH_DSP_STAT_REPORTED;
-
- mValues.push_back(FieldValue(Field(mTagId, getSimpleField(1)),
- Value(speechDspStat.totalUptimeMillis)));
- mValues.push_back(FieldValue(Field(mTagId, getSimpleField(2)),
- Value(speechDspStat.totalDowntimeMillis)));
- mValues.push_back(FieldValue(Field(mTagId, getSimpleField(3)),
- Value(speechDspStat.totalCrashCount)));
- mValues.push_back(FieldValue(Field(mTagId, getSimpleField(4)),
- Value(speechDspStat.totalRecoverCount)));
-}
-
-LogEvent::LogEvent(int64_t wallClockTimestampNs, int64_t elapsedTimestampNs,
- const BatteryCausedShutdown& batteryCausedShutdown) {
- mLogdTimestampNs = wallClockTimestampNs;
- mElapsedTimestampNs = elapsedTimestampNs;
- mTagId = android::util::BATTERY_CAUSED_SHUTDOWN;
-
- mValues.push_back(FieldValue(Field(mTagId, getSimpleField(1)),
- Value(batteryCausedShutdown.voltageMicroV)));
-}
-
-LogEvent::LogEvent(int64_t wallClockTimestampNs, int64_t elapsedTimestampNs,
- const UsbPortOverheatEvent& usbPortOverheatEvent) {
- mLogdTimestampNs = wallClockTimestampNs;
- mElapsedTimestampNs = elapsedTimestampNs;
- mTagId = android::util::USB_PORT_OVERHEAT_EVENT_REPORTED;
-
- mValues.push_back(FieldValue(Field(mTagId, getSimpleField(1)),
- Value(usbPortOverheatEvent.plugTemperatureDeciC)));
- mValues.push_back(FieldValue(Field(mTagId, getSimpleField(2)),
- Value(usbPortOverheatEvent.maxTemperatureDeciC)));
- mValues.push_back(FieldValue(Field(mTagId, getSimpleField(3)),
- Value(usbPortOverheatEvent.timeToOverheat)));
- mValues.push_back(FieldValue(Field(mTagId, getSimpleField(4)),
- Value(usbPortOverheatEvent.timeToHysteresis)));
- mValues.push_back(FieldValue(Field(mTagId, getSimpleField(5)),
- Value(usbPortOverheatEvent.timeToInactive)));
-}
-
-LogEvent::LogEvent(int64_t wallClockTimestampNs, int64_t elapsedTimestampNs,
const VendorAtom& vendorAtom) {
mLogdTimestampNs = wallClockTimestampNs;
mElapsedTimestampNs = elapsedTimestampNs;
mTagId = vendorAtom.atomId;
+ mLogUid = AID_STATSD;
mValues.push_back(
FieldValue(Field(mTagId, getSimpleField(1)), Value(vendorAtom.reverseDomainName)));
diff --git a/cmds/statsd/src/logd/LogEvent.h b/cmds/statsd/src/logd/LogEvent.h
index 111a619760df..2fde8b4c027d 100644
--- a/cmds/statsd/src/logd/LogEvent.h
+++ b/cmds/statsd/src/logd/LogEvent.h
@@ -108,33 +108,6 @@ public:
const std::vector<uint8_t>& experimentIds, int32_t userId);
explicit LogEvent(int64_t wallClockTimestampNs, int64_t elapsedTimestampNs,
- const SpeakerImpedance& speakerImpedance);
-
- explicit LogEvent(int64_t wallClockTimestampNs, int64_t elapsedTimestampNs,
- const HardwareFailed& hardwareFailed);
-
- explicit LogEvent(int64_t wallClockTimestampNs, int64_t elapsedTimestampNs,
- const PhysicalDropDetected& physicalDropDetected);
-
- explicit LogEvent(int64_t wallClockTimestampNs, int64_t elapsedTimestampNs,
- const ChargeCycles& chargeCycles);
-
- explicit LogEvent(int64_t wallClockTimestampNs, int64_t elapsedTimestampNs,
- const BatteryHealthSnapshotArgs& batteryHealthSnapshotArgs);
-
- explicit LogEvent(int64_t wallClockTimestampNs, int64_t elapsedTimestampNs,
- const SlowIo& slowIo);
-
- explicit LogEvent(int64_t wallClockTimestampNs, int64_t elapsedTimestampNs,
- const BatteryCausedShutdown& batteryCausedShutdown);
-
- explicit LogEvent(int64_t wallClockTimestampNs, int64_t elapsedTimestampNs,
- const UsbPortOverheatEvent& usbPortOverheatEvent);
-
- explicit LogEvent(int64_t wallClockTimestampNs, int64_t elapsedTimestampNs,
- const SpeechDspStat& speechDspStat);
-
- explicit LogEvent(int64_t wallClockTimestampNs, int64_t elapsedTimestampNs,
const VendorAtom& vendorAtom);
explicit LogEvent(int64_t wallClockTimestampNs, int64_t elapsedTimestampNs,
diff --git a/core/java/android/app/AppOpsManager.java b/core/java/android/app/AppOpsManager.java
index 2e82e620fac8..5bf7ef54f8b7 100644
--- a/core/java/android/app/AppOpsManager.java
+++ b/core/java/android/app/AppOpsManager.java
@@ -4375,8 +4375,7 @@ public class AppOpsManager {
}
/**
- * Like {@link #noteProxyOp(String, String)} but instead
- * of throwing a {@link SecurityException} it returns {@link #MODE_ERRORED}.
+ * Like {@link #noteProxyOpNoThrow(String, String)} but allows to specify the proxied uid.
*
* <p>This API requires package with the {@code proxiedPackageName} to belong to
* {@code proxiedUid}.
@@ -4385,10 +4384,7 @@ public class AppOpsManager {
* @param proxiedPackageName The package to note the op for or {@code null} if the op should be
* noted for the "android" package
* @param proxiedUid The uid the package belongs to
- *
- * @hide
*/
- @SystemApi
public int noteProxyOpNoThrow(@NonNull String op, @Nullable String proxiedPackageName,
int proxiedUid) {
return noteProxyOpNoThrow(strOpToOp(op), proxiedPackageName, proxiedUid);
diff --git a/core/java/android/companion/BluetoothDeviceFilterUtils.java b/core/java/android/companion/BluetoothDeviceFilterUtils.java
index bd507a6b8bcc..75e726bfad0d 100644
--- a/core/java/android/companion/BluetoothDeviceFilterUtils.java
+++ b/core/java/android/companion/BluetoothDeviceFilterUtils.java
@@ -30,6 +30,7 @@ import android.os.Parcelable;
import android.util.Log;
import java.util.Arrays;
+import java.util.Collections;
import java.util.List;
import java.util.regex.Pattern;
@@ -78,11 +79,12 @@ public class BluetoothDeviceFilterUtils {
static boolean matchesServiceUuid(ParcelUuid serviceUuid, ParcelUuid serviceUuidMask,
BluetoothDevice device) {
+ ParcelUuid[] uuids = device.getUuids();
final boolean result = serviceUuid == null ||
ScanFilter.matchesServiceUuids(
serviceUuid,
serviceUuidMask,
- Arrays.asList(device.getUuids()));
+ uuids == null ? Collections.emptyList() : Arrays.asList(uuids));
if (DEBUG) debugLogMatchResult(result, device, serviceUuid);
return result;
}
diff --git a/core/java/android/content/res/Resources.java b/core/java/android/content/res/Resources.java
index a2ae994f7b0f..c855d45f519e 100644
--- a/core/java/android/content/res/Resources.java
+++ b/core/java/android/content/res/Resources.java
@@ -1782,10 +1782,16 @@ public class Resources {
* @param explicitStyleRes A resource identifier of an explicit style resource.
* @return ordered list of resource ID that are considered when resolving attribute values.
*/
+ @NonNull
public int[] getAttributeResolutionStack(@AttrRes int defStyleAttr,
@StyleRes int defStyleRes, @StyleRes int explicitStyleRes) {
- return mThemeImpl.getAttributeResolutionStack(
+ int[] stack = mThemeImpl.getAttributeResolutionStack(
defStyleAttr, defStyleRes, explicitStyleRes);
+ if (stack == null) {
+ return new int[0];
+ } else {
+ return stack;
+ }
}
}
diff --git a/core/java/android/content/res/ResourcesImpl.java b/core/java/android/content/res/ResourcesImpl.java
index da064c956fcc..565cd3375c32 100644
--- a/core/java/android/content/res/ResourcesImpl.java
+++ b/core/java/android/content/res/ResourcesImpl.java
@@ -1507,6 +1507,7 @@ public class ResourcesImpl {
* @param explicitStyleRes A resource identifier of an explicit style resource.
* @return ordered list of resource ID that are considered when resolving attribute values.
*/
+ @Nullable
public int[] getAttributeResolutionStack(@AttrRes int defStyleAttr,
@StyleRes int defStyleRes, @StyleRes int explicitStyleRes) {
synchronized (mKey) {
diff --git a/core/java/android/database/sqlite/SQLiteDatabase.java b/core/java/android/database/sqlite/SQLiteDatabase.java
index dffbd89c33d2..caf3e9337b92 100644
--- a/core/java/android/database/sqlite/SQLiteDatabase.java
+++ b/core/java/android/database/sqlite/SQLiteDatabase.java
@@ -2655,26 +2655,24 @@ public final class SQLiteDatabase extends SQLiteClosable {
* Sets the maximum number of milliseconds that SQLite connection is allowed to be idle
* before it is closed and removed from the pool.
*
- * <p>DO NOT USE this method unless you fully understand the implication
- * of what it does.
- * A connection timeout allows the system to internally close a connection to a SQLite
- * database after a given timeout.
- * This is good for reducing app's memory consumption, but it has
- * side effects that are hard to predict. For example, SQLite internally maintains
- * a lot of "per-connection" states that apps can typically modify with a {@code PRAGMA}
- * statement, and such states will be reset once the connection is closed.
- * The system does not provide a callback that would allow apps to
- * reconfigure a newly created connection and thus there's no way to re-configure
- * connections when they're re-made internally. Do not use it unless you're sure
- * your app uses no per-connection states.
+ * <p><b>DO NOT USE</b> this method.
+ * This feature has negative side effects that are very hard to foresee.
+ * <p>A connection timeout allows the system to internally close a connection to
+ * a SQLite database after a given timeout, which is good for reducing app's memory
+ * consumption.
+ * <b>However</b> the side effect is it <b>will reset all of SQLite's per-connection
+ * states</b>, which are typically modified with a {@code PRAGMA} statement, and
+ * these states <b>will not be restored</b> when a connection is re-established
+ * internally, and the system does not provide a callback for an app to reconfigure a
+ * connection.
+ * This feature may only be used if an app relies on none of such per-connection states.
*
* @param idleConnectionTimeoutMs timeout in milliseconds. Use {@link Long#MAX_VALUE}
* to allow unlimited idle connections.
*
* @see SQLiteOpenHelper#setIdleConnectionTimeout(long)
*
- * @deprecated DO NOT USE this method unless you fully understand the implication
- * of what it does.
+ * @deprecated DO NOT USE this method. See the javadoc for the details.
*/
@NonNull
@Deprecated
diff --git a/core/java/android/database/sqlite/SQLiteOpenHelper.java b/core/java/android/database/sqlite/SQLiteOpenHelper.java
index 8163c4d412a7..62cec0e1aa92 100644
--- a/core/java/android/database/sqlite/SQLiteOpenHelper.java
+++ b/core/java/android/database/sqlite/SQLiteOpenHelper.java
@@ -267,8 +267,8 @@ public abstract class SQLiteOpenHelper implements AutoCloseable {
* <p>This method should be called from the constructor of the subclass,
* before opening the database
*
- * <p>DO NOT USE this method unless you fully understand the implication
- * of what it does.
+ * <p><b>DO NOT USE</b> this method.
+ * This feature has negative side effects that are very hard to foresee.
* See the javadoc of
* {@link SQLiteDatabase.OpenParams.Builder#setIdleConnectionTimeout(long)}
* for the details.
@@ -278,8 +278,9 @@ public abstract class SQLiteOpenHelper implements AutoCloseable {
*
* @see SQLiteDatabase.OpenParams.Builder#setIdleConnectionTimeout(long)
*
- * @deprecated DO NOT USE this method unless you fully understand the implication
- * of what it does.
+ * @deprecated DO NOT USE this method. See the javadoc of
+ * {@link SQLiteDatabase.OpenParams.Builder#setIdleConnectionTimeout(long)}
+ * for the details.
*/
@Deprecated
public void setIdleConnectionTimeout(@IntRange(from = 0) final long idleConnectionTimeoutMs) {
diff --git a/core/java/android/hardware/camera2/CaptureResult.java b/core/java/android/hardware/camera2/CaptureResult.java
index 0900f3b11d4c..53d4dd3d36ee 100644
--- a/core/java/android/hardware/camera2/CaptureResult.java
+++ b/core/java/android/hardware/camera2/CaptureResult.java
@@ -4735,13 +4735,17 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> {
* <p>String containing the ID of the underlying active physical camera.</p>
* <p>The ID of the active physical camera that's backing the logical camera. All camera
* streams and metadata that are not physical camera specific will be originating from this
- * physical camera. This must be one of valid physical IDs advertised in the physicalIds
- * static tag.</p>
+ * physical camera.</p>
* <p>For a logical camera made up of physical cameras where each camera's lenses have
* different characteristics, the camera device may choose to switch between the physical
* cameras when application changes FOCAL_LENGTH or SCALER_CROP_REGION.
* At the time of lens switch, this result metadata reflects the new active physical camera
* ID.</p>
+ * <p>This key will be available if the camera device advertises this key via {@link android.hardware.camera2.CameraCharacteristics#getAvailableCaptureResultKeys }.
+ * When available, this must be one of valid physical IDs backing this logical multi-camera.
+ * If this key is not available for a logical multi-camera, the camera device implementation
+ * may still switch between different active physical cameras based on use case, but the
+ * current active physical camera information won't be available to the application.</p>
* <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
*/
@PublicKey
diff --git a/core/java/android/hardware/hdmi/HdmiControlManager.java b/core/java/android/hardware/hdmi/HdmiControlManager.java
index 56020b24c556..aff385dc23e1 100644
--- a/core/java/android/hardware/hdmi/HdmiControlManager.java
+++ b/core/java/android/hardware/hdmi/HdmiControlManager.java
@@ -19,6 +19,7 @@ package android.hardware.hdmi;
import static com.android.internal.os.RoSystemProperties.PROPERTY_HDMI_IS_DEVICE_HDMI_CEC_SWITCH;
import android.annotation.IntDef;
+import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.RequiresFeature;
import android.annotation.RequiresPermission;
@@ -456,7 +457,7 @@ public final class HdmiControlManager {
* @hide
*/
@SystemApi
- public void powerOffRemoteDevice(HdmiDeviceInfo deviceInfo) {
+ public void powerOffRemoteDevice(@NonNull HdmiDeviceInfo deviceInfo) {
Preconditions.checkNotNull(deviceInfo);
try {
mService.powerOffRemoteDevice(
@@ -495,7 +496,7 @@ public final class HdmiControlManager {
* @hide
*/
@SystemApi
- public void requestRemoteDeviceToBecomeActiveSource(HdmiDeviceInfo deviceInfo) {
+ public void requestRemoteDeviceToBecomeActiveSource(@NonNull HdmiDeviceInfo deviceInfo) {
Preconditions.checkNotNull(deviceInfo);
try {
mService.askRemoteDeviceToBecomeActiveSource(deviceInfo.getPhysicalAddress());
@@ -566,7 +567,7 @@ public final class HdmiControlManager {
* @hide
*/
@SystemApi
- public boolean isRemoteDeviceConnected(HdmiDeviceInfo targetDevice) {
+ public boolean isRemoteDeviceConnected(@NonNull HdmiDeviceInfo targetDevice) {
Preconditions.checkNotNull(targetDevice);
mPhysicalAddress = getPhysicalAddress();
if (mPhysicalAddress == INVALID_PHYSICAL_ADDRESS) {
diff --git a/core/java/android/net/ConnectivityManager.java b/core/java/android/net/ConnectivityManager.java
index 64ed32266217..1312f18a14ed 100644
--- a/core/java/android/net/ConnectivityManager.java
+++ b/core/java/android/net/ConnectivityManager.java
@@ -4293,6 +4293,8 @@ public class ConnectivityManager {
* @return {@code uid} if the connection is found and the app has permission to observe it
* (e.g., if it is associated with the calling VPN app's tunnel) or
* {@link android.os.Process#INVALID_UID} if the connection is not found.
+ * Throws {@link SecurityException} if the caller is not the active VPN for the current user.
+ * Throws {@link IllegalArgumentException} if an unsupported protocol is requested.
*/
public int getConnectionOwnerUid(int protocol, @NonNull InetSocketAddress local,
@NonNull InetSocketAddress remote) {
diff --git a/core/java/android/net/InetAddresses.java b/core/java/android/net/InetAddresses.java
index 8e6c69a97edb..01b795e456fa 100644
--- a/core/java/android/net/InetAddresses.java
+++ b/core/java/android/net/InetAddresses.java
@@ -16,6 +16,8 @@
package android.net;
+import android.annotation.NonNull;
+
import libcore.net.InetAddressUtils;
import java.net.InetAddress;
@@ -40,7 +42,7 @@ public class InetAddresses {
* @param address the address to parse.
* @return true if the supplied address is numeric, false otherwise.
*/
- public static boolean isNumericAddress(String address) {
+ public static boolean isNumericAddress(@NonNull String address) {
return InetAddressUtils.isNumericAddress(address);
}
@@ -57,7 +59,7 @@ public class InetAddresses {
* @return an {@link InetAddress} instance corresponding to the address.
* @throws IllegalArgumentException if {@code address} is not a numeric address.
*/
- public static InetAddress parseNumericAddress(String address) {
+ public static @NonNull InetAddress parseNumericAddress(@NonNull String address) {
return InetAddressUtils.parseNumericAddress(address);
}
}
diff --git a/core/java/android/net/VpnService.java b/core/java/android/net/VpnService.java
index ebb1ae4bb795..870d8b1b7c22 100644
--- a/core/java/android/net/VpnService.java
+++ b/core/java/android/net/VpnService.java
@@ -20,6 +20,7 @@ import static android.system.OsConstants.AF_INET;
import static android.system.OsConstants.AF_INET6;
import android.annotation.NonNull;
+import android.annotation.Nullable;
import android.annotation.RequiresPermission;
import android.annotation.SystemApi;
import android.annotation.UnsupportedAppUsage;
@@ -479,7 +480,8 @@ public class VpnService extends Service {
* system-managed dialogs and notifications. This is recommended
* not required.
*/
- public Builder setSession(String session) {
+ @NonNull
+ public Builder setSession(@NonNull String session) {
mConfig.session = session;
return this;
}
@@ -489,7 +491,8 @@ public class VpnService extends Service {
* configure the VPN connection. If it is not set, the button
* to configure will not be shown in system-managed dialogs.
*/
- public Builder setConfigureIntent(PendingIntent intent) {
+ @NonNull
+ public Builder setConfigureIntent(@NonNull PendingIntent intent) {
mConfig.configureIntent = intent;
return this;
}
@@ -501,6 +504,7 @@ public class VpnService extends Service {
*
* @throws IllegalArgumentException if the value is not positive.
*/
+ @NonNull
public Builder setMtu(int mtu) {
if (mtu <= 0) {
throw new IllegalArgumentException("Bad mtu");
@@ -513,6 +517,7 @@ public class VpnService extends Service {
* Sets an HTTP proxy for the VPN network. This proxy is only a recommendation
* and it is possible that some apps will ignore it.
*/
+ @NonNull
public Builder setHttpProxy(@NonNull ProxyInfo proxyInfo) {
mConfig.proxyInfo = proxyInfo;
return this;
@@ -528,7 +533,8 @@ public class VpnService extends Service {
*
* @throws IllegalArgumentException if the address is invalid.
*/
- public Builder addAddress(InetAddress address, int prefixLength) {
+ @NonNull
+ public Builder addAddress(@NonNull InetAddress address, int prefixLength) {
check(address, prefixLength);
if (address.isAnyLocalAddress()) {
@@ -550,7 +556,8 @@ public class VpnService extends Service {
* @throws IllegalArgumentException if the address is invalid.
* @see #addAddress(InetAddress, int)
*/
- public Builder addAddress(String address, int prefixLength) {
+ @NonNull
+ public Builder addAddress(@NonNull String address, int prefixLength) {
return addAddress(InetAddress.parseNumericAddress(address), prefixLength);
}
@@ -563,7 +570,8 @@ public class VpnService extends Service {
*
* @throws IllegalArgumentException if the route is invalid.
*/
- public Builder addRoute(InetAddress address, int prefixLength) {
+ @NonNull
+ public Builder addRoute(@NonNull InetAddress address, int prefixLength) {
check(address, prefixLength);
int offset = prefixLength / 8;
@@ -591,7 +599,8 @@ public class VpnService extends Service {
* @throws IllegalArgumentException if the route is invalid.
* @see #addRoute(InetAddress, int)
*/
- public Builder addRoute(String address, int prefixLength) {
+ @NonNull
+ public Builder addRoute(@NonNull String address, int prefixLength) {
return addRoute(InetAddress.parseNumericAddress(address), prefixLength);
}
@@ -605,7 +614,8 @@ public class VpnService extends Service {
*
* @throws IllegalArgumentException if the address is invalid.
*/
- public Builder addDnsServer(InetAddress address) {
+ @NonNull
+ public Builder addDnsServer(@NonNull InetAddress address) {
if (address.isLoopbackAddress() || address.isAnyLocalAddress()) {
throw new IllegalArgumentException("Bad address");
}
@@ -627,14 +637,16 @@ public class VpnService extends Service {
* @throws IllegalArgumentException if the address is invalid.
* @see #addDnsServer(InetAddress)
*/
- public Builder addDnsServer(String address) {
+ @NonNull
+ public Builder addDnsServer(@NonNull String address) {
return addDnsServer(InetAddress.parseNumericAddress(address));
}
/**
* Add a search domain to the DNS resolver.
*/
- public Builder addSearchDomain(String domain) {
+ @NonNull
+ public Builder addSearchDomain(@NonNull String domain) {
if (mConfig.searchDomains == null) {
mConfig.searchDomains = new ArrayList<String>();
}
@@ -660,6 +672,7 @@ public class VpnService extends Service {
*
* @return this {@link Builder} object to facilitate chaining of method calls.
*/
+ @NonNull
public Builder allowFamily(int family) {
if (family == AF_INET) {
mConfig.allowIPv4 = true;
@@ -703,7 +716,8 @@ public class VpnService extends Service {
*
* @return this {@link Builder} object to facilitate chaining method calls.
*/
- public Builder addAllowedApplication(String packageName)
+ @NonNull
+ public Builder addAllowedApplication(@NonNull String packageName)
throws PackageManager.NameNotFoundException {
if (mConfig.disallowedApplications != null) {
throw new UnsupportedOperationException("addDisallowedApplication already called");
@@ -735,7 +749,8 @@ public class VpnService extends Service {
*
* @return this {@link Builder} object to facilitate chaining method calls.
*/
- public Builder addDisallowedApplication(String packageName)
+ @NonNull
+ public Builder addDisallowedApplication(@NonNull String packageName)
throws PackageManager.NameNotFoundException {
if (mConfig.allowedApplications != null) {
throw new UnsupportedOperationException("addAllowedApplication already called");
@@ -758,6 +773,7 @@ public class VpnService extends Service {
*
* @return this {@link Builder} object to facilitate chaining of method calls.
*/
+ @NonNull
public Builder allowBypass() {
mConfig.allowBypass = true;
return this;
@@ -772,6 +788,7 @@ public class VpnService extends Service {
*
* @return this {@link Builder} object to facilitate chaining method calls.
*/
+ @NonNull
public Builder setBlocking(boolean blocking) {
mConfig.blocking = blocking;
return this;
@@ -786,7 +803,8 @@ public class VpnService extends Service {
*
* @return this {@link Builder} object to facilitate chaining method calls.
*/
- public Builder setUnderlyingNetworks(Network[] networks) {
+ @NonNull
+ public Builder setUnderlyingNetworks(@Nullable Network[] networks) {
mConfig.underlyingNetworks = networks != null ? networks.clone() : null;
return this;
}
@@ -807,6 +825,7 @@ public class VpnService extends Service {
* @see #setUnderlyingNetworks(Networks[])
* @see ConnectivityManager#isActiveNetworkMetered()
*/
+ @NonNull
public Builder setMetered(boolean isMetered) {
mConfig.isMetered = isMetered;
return this;
@@ -855,6 +874,7 @@ public class VpnService extends Service {
* in {@code AndroidManifest.xml}.
* @see VpnService
*/
+ @Nullable
public ParcelFileDescriptor establish() {
mConfig.addresses = mAddresses;
mConfig.routes = mRoutes;
diff --git a/core/java/android/os/PowerManager.java b/core/java/android/os/PowerManager.java
index 4b32df798e68..c906d33a081e 100644
--- a/core/java/android/os/PowerManager.java
+++ b/core/java/android/os/PowerManager.java
@@ -764,8 +764,14 @@ public final class PowerManager {
*/
public static final int LOCATION_MODE_FOREGROUND_ONLY = 3;
+ /**
+ * In this mode, location will not be turned off, but LocationManager will throttle all
+ * requests to providers when the device is non-interactive.
+ */
+ public static final int LOCATION_MODE_THROTTLE_REQUESTS_WHEN_SCREEN_OFF = 4;
+
static final int MIN_LOCATION_MODE = LOCATION_MODE_NO_CHANGE;
- static final int MAX_LOCATION_MODE = LOCATION_MODE_FOREGROUND_ONLY;
+ static final int MAX_LOCATION_MODE = LOCATION_MODE_THROTTLE_REQUESTS_WHEN_SCREEN_OFF;
/**
* @hide
@@ -776,9 +782,28 @@ public final class PowerManager {
LOCATION_MODE_GPS_DISABLED_WHEN_SCREEN_OFF,
LOCATION_MODE_ALL_DISABLED_WHEN_SCREEN_OFF,
LOCATION_MODE_FOREGROUND_ONLY,
+ LOCATION_MODE_THROTTLE_REQUESTS_WHEN_SCREEN_OFF,
})
public @interface LocationPowerSaveMode {}
+ /** @hide */
+ public static String locationPowerSaveModeToString(@LocationPowerSaveMode int mode) {
+ switch (mode) {
+ case LOCATION_MODE_NO_CHANGE:
+ return "NO_CHANGE";
+ case LOCATION_MODE_GPS_DISABLED_WHEN_SCREEN_OFF:
+ return "GPS_DISABLED_WHEN_SCREEN_OFF";
+ case LOCATION_MODE_ALL_DISABLED_WHEN_SCREEN_OFF:
+ return "ALL_DISABLED_WHEN_SCREEN_OFF";
+ case LOCATION_MODE_FOREGROUND_ONLY:
+ return "FOREGROUND_ONLY";
+ case LOCATION_MODE_THROTTLE_REQUESTS_WHEN_SCREEN_OFF:
+ return "THROTTLE_REQUESTS_WHEN_SCREEN_OFF";
+ default:
+ return Integer.toString(mode);
+ }
+ }
+
final Context mContext;
final IPowerManager mService;
final Handler mHandler;
diff --git a/core/java/android/os/Process.java b/core/java/android/os/Process.java
index cd43b42c8ca5..03fc2a947051 100644
--- a/core/java/android/os/Process.java
+++ b/core/java/android/os/Process.java
@@ -529,7 +529,8 @@ public class Process {
return ZYGOTE_PROCESS.start(processClass, niceName, uid, gid, gids,
runtimeFlags, mountExternal, targetSdkVersion, seInfo,
abi, instructionSet, appDataDir, invokeWith, packageName,
- packagesForUid, sandboxId, /*useBlastulaPool=*/ true, zygoteArgs);
+ packagesForUid, sandboxId, /*useUnspecializedAppProcessPool=*/ true,
+ zygoteArgs);
}
/** @hide */
@@ -550,7 +551,8 @@ public class Process {
return WebViewZygote.getProcess().start(processClass, niceName, uid, gid, gids,
runtimeFlags, mountExternal, targetSdkVersion, seInfo,
abi, instructionSet, appDataDir, invokeWith, packageName,
- packagesForUid, sandboxId, /*useBlastulaPool=*/ false, zygoteArgs);
+ packagesForUid, sandboxId, /*useUnspecializedAppProcessPool=*/ false,
+ zygoteArgs);
}
/**
diff --git a/core/java/android/os/ZygoteProcess.java b/core/java/android/os/ZygoteProcess.java
index 650232f79738..60f4f06c9617 100644
--- a/core/java/android/os/ZygoteProcess.java
+++ b/core/java/android/os/ZygoteProcess.java
@@ -82,9 +82,9 @@ public class ZygoteProcess {
private static final String LOG_TAG = "ZygoteProcess";
/**
- * The default value for enabling the blastula pool.
+ * The default value for enabling the unspecialized app process (USAP) pool.
*/
- private static final String BLASTULA_POOL_ENABLED_DEFAULT = "false";
+ private static final String USAP_POOL_ENABLED_DEFAULT = "false";
/**
* The name of the socket used to communicate with the primary zygote.
@@ -97,14 +97,14 @@ public class ZygoteProcess {
private final LocalSocketAddress mZygoteSecondarySocketAddress;
/**
- * The name of the socket used to communicate with the primary blastula pool.
+ * The name of the socket used to communicate with the primary USAP pool.
*/
- private final LocalSocketAddress mBlastulaPoolSocketAddress;
+ private final LocalSocketAddress mUsapPoolSocketAddress;
/**
- * The name of the socket used to communicate with the secondary (alternate ABI) blastula pool.
+ * The name of the socket used to communicate with the secondary (alternate ABI) USAP pool.
*/
- private final LocalSocketAddress mBlastulaPoolSecondarySocketAddress;
+ private final LocalSocketAddress mUsapPoolSecondarySocketAddress;
public ZygoteProcess() {
mZygoteSocketAddress =
@@ -114,15 +114,15 @@ public class ZygoteProcess {
new LocalSocketAddress(Zygote.SECONDARY_SOCKET_NAME,
LocalSocketAddress.Namespace.RESERVED);
- mBlastulaPoolSocketAddress =
- new LocalSocketAddress(Zygote.BLASTULA_POOL_PRIMARY_SOCKET_NAME,
+ mUsapPoolSocketAddress =
+ new LocalSocketAddress(Zygote.USAP_POOL_PRIMARY_SOCKET_NAME,
LocalSocketAddress.Namespace.RESERVED);
- mBlastulaPoolSecondarySocketAddress =
- new LocalSocketAddress(Zygote.BLASTULA_POOL_SECONDARY_SOCKET_NAME,
+ mUsapPoolSecondarySocketAddress =
+ new LocalSocketAddress(Zygote.USAP_POOL_SECONDARY_SOCKET_NAME,
LocalSocketAddress.Namespace.RESERVED);
- if (fetchBlastulaPoolEnabledProp()) {
- informZygotesOfBlastulaPoolStatus();
+ if (fetchUsapPoolEnabledProp()) {
+ informZygotesOfUsapPoolStatus();
}
}
@@ -131,8 +131,8 @@ public class ZygoteProcess {
mZygoteSocketAddress = primarySocketAddress;
mZygoteSecondarySocketAddress = secondarySocketAddress;
- mBlastulaPoolSocketAddress = null;
- mBlastulaPoolSecondarySocketAddress = null;
+ mUsapPoolSocketAddress = null;
+ mUsapPoolSecondarySocketAddress = null;
}
public LocalSocketAddress getPrimarySocketAddress() {
@@ -144,7 +144,7 @@ public class ZygoteProcess {
*/
public static class ZygoteState {
final LocalSocketAddress mZygoteSocketAddress;
- final LocalSocketAddress mBlastulaSocketAddress;
+ final LocalSocketAddress mUsapSocketAddress;
private final LocalSocket mZygoteSessionSocket;
@@ -156,13 +156,13 @@ public class ZygoteProcess {
private boolean mClosed;
private ZygoteState(LocalSocketAddress zygoteSocketAddress,
- LocalSocketAddress blastulaSocketAddress,
+ LocalSocketAddress usapSocketAddress,
LocalSocket zygoteSessionSocket,
DataInputStream zygoteInputStream,
BufferedWriter zygoteOutputWriter,
List<String> abiList) {
this.mZygoteSocketAddress = zygoteSocketAddress;
- this.mBlastulaSocketAddress = blastulaSocketAddress;
+ this.mUsapSocketAddress = usapSocketAddress;
this.mZygoteSessionSocket = zygoteSessionSocket;
this.mZygoteInputStream = zygoteInputStream;
this.mZygoteOutputWriter = zygoteOutputWriter;
@@ -171,16 +171,16 @@ public class ZygoteProcess {
/**
* Create a new ZygoteState object by connecting to the given Zygote socket and saving the
- * given blastula socket address.
+ * given USAP socket address.
*
* @param zygoteSocketAddress Zygote socket to connect to
- * @param blastulaSocketAddress Blastula socket address to save for later
+ * @param usapSocketAddress USAP socket address to save for later
* @return A new ZygoteState object containing a session socket for the given Zygote socket
* address
* @throws IOException
*/
public static ZygoteState connect(LocalSocketAddress zygoteSocketAddress,
- LocalSocketAddress blastulaSocketAddress)
+ LocalSocketAddress usapSocketAddress)
throws IOException {
DataInputStream zygoteInputStream = null;
@@ -202,16 +202,16 @@ public class ZygoteProcess {
throw ex;
}
- return new ZygoteState(zygoteSocketAddress, blastulaSocketAddress,
+ return new ZygoteState(zygoteSocketAddress, usapSocketAddress,
zygoteSessionSocket, zygoteInputStream, zygoteOutputWriter,
getAbiList(zygoteOutputWriter, zygoteInputStream));
}
- LocalSocket getBlastulaSessionSocket() throws IOException {
- final LocalSocket blastulaSessionSocket = new LocalSocket();
- blastulaSessionSocket.connect(this.mBlastulaSocketAddress);
+ LocalSocket getUsapSessionSocket() throws IOException {
+ final LocalSocket usapSessionSocket = new LocalSocket();
+ usapSessionSocket.connect(this.mUsapSocketAddress);
- return blastulaSessionSocket;
+ return usapSessionSocket;
}
boolean matches(String abi) {
@@ -268,13 +268,13 @@ public class ZygoteProcess {
private ZygoteState secondaryZygoteState;
/**
- * If the blastula pool should be created and used to start applications.
+ * If the USAP pool should be created and used to start applications.
*
- * Setting this value to false will disable the creation, maintenance, and use of the blastula
- * pool. When the blastula pool is disabled the application lifecycle will be identical to
+ * Setting this value to false will disable the creation, maintenance, and use of the USAP
+ * pool. When the USAP pool is disabled the application lifecycle will be identical to
* previous versions of Android.
*/
- private boolean mBlastulaPoolEnabled = false;
+ private boolean mUsapPoolEnabled = false;
/**
* Start a new process.
@@ -328,11 +328,11 @@ public class ZygoteProcess {
@Nullable String packageName,
@Nullable String[] packagesForUid,
@Nullable String sandboxId,
- boolean useBlastulaPool,
+ boolean useUsapPool,
@Nullable String[] zygoteArgs) {
// TODO (chriswailes): Is there a better place to check this value?
- if (fetchBlastulaPoolEnabledPropWithMinInterval()) {
- informZygotesOfBlastulaPoolStatus();
+ if (fetchUsapPoolEnabledPropWithMinInterval()) {
+ informZygotesOfUsapPoolStatus();
}
try {
@@ -340,7 +340,7 @@ public class ZygoteProcess {
runtimeFlags, mountExternal, targetSdkVersion, seInfo,
abi, instructionSet, appDataDir, invokeWith, /*startChildZygote=*/false,
packageName, packagesForUid, sandboxId,
- useBlastulaPool, zygoteArgs);
+ useUsapPool, zygoteArgs);
} catch (ZygoteStartFailedEx ex) {
Log.e(LOG_TAG,
"Starting VM process through Zygote failed");
@@ -388,7 +388,7 @@ public class ZygoteProcess {
*/
@GuardedBy("mLock")
private Process.ProcessStartResult zygoteSendArgsAndGetResult(
- ZygoteState zygoteState, boolean useBlastulaPool, ArrayList<String> args)
+ ZygoteState zygoteState, boolean useUsapPool, ArrayList<String> args)
throws ZygoteStartFailedEx {
// Throw early if any of the arguments are malformed. This means we can
// avoid writing a partial response to the zygote.
@@ -415,41 +415,41 @@ public class ZygoteProcess {
Process.ProcessStartResult result = new Process.ProcessStartResult();
// TODO (chriswailes): Move branch body into separate function.
- if (useBlastulaPool && mBlastulaPoolEnabled && isValidBlastulaCommand(args)) {
- LocalSocket blastulaSessionSocket = null;
+ if (useUsapPool && mUsapPoolEnabled && isValidUsapCommand(args)) {
+ LocalSocket usapSessionSocket = null;
try {
- blastulaSessionSocket = zygoteState.getBlastulaSessionSocket();
+ usapSessionSocket = zygoteState.getUsapSessionSocket();
- final BufferedWriter blastulaWriter =
+ final BufferedWriter usapWriter =
new BufferedWriter(
- new OutputStreamWriter(blastulaSessionSocket.getOutputStream()),
+ new OutputStreamWriter(usapSessionSocket.getOutputStream()),
Zygote.SOCKET_BUFFER_SIZE);
- final DataInputStream blastulaReader =
- new DataInputStream(blastulaSessionSocket.getInputStream());
+ final DataInputStream usapReader =
+ new DataInputStream(usapSessionSocket.getInputStream());
- blastulaWriter.write(msgStr);
- blastulaWriter.flush();
+ usapWriter.write(msgStr);
+ usapWriter.flush();
- result.pid = blastulaReader.readInt();
- // Blastulas can't be used to spawn processes that need wrappers.
+ result.pid = usapReader.readInt();
+ // USAPs can't be used to spawn processes that need wrappers.
result.usingWrapper = false;
if (result.pid < 0) {
- throw new ZygoteStartFailedEx("Blastula specialization failed");
+ throw new ZygoteStartFailedEx("USAP specialization failed");
}
return result;
} catch (IOException ex) {
- // If there was an IOException using the blastula pool we will log the error and
+ // If there was an IOException using the USAP pool we will log the error and
// attempt to start the process through the Zygote.
- Log.e(LOG_TAG, "IO Exception while communicating with blastula pool - "
+ Log.e(LOG_TAG, "IO Exception while communicating with USAP pool - "
+ ex.getMessage());
} finally {
try {
- blastulaSessionSocket.close();
+ usapSessionSocket.close();
} catch (IOException ex) {
- Log.e(LOG_TAG, "Failed to close blastula session socket: " + ex.getMessage());
+ Log.e(LOG_TAG, "Failed to close USAP session socket: " + ex.getMessage());
}
}
}
@@ -481,9 +481,9 @@ public class ZygoteProcess {
}
/**
- * Flags that may not be passed to a blastula.
+ * Flags that may not be passed to a USAP.
*/
- private static final String[] INVALID_BLASTULA_FLAGS = {
+ private static final String[] INVALID_USAP_FLAGS = {
"--query-abi-list",
"--get-pid",
"--preload-default",
@@ -497,13 +497,13 @@ public class ZygoteProcess {
};
/**
- * Tests a command list to see if it is valid to send to a blastula.
- * @param args Zygote/Blastula command arguments
- * @return True if the command can be passed to a blastula; false otherwise
+ * Tests a command list to see if it is valid to send to a USAP.
+ * @param args Zygote/USAP command arguments
+ * @return True if the command can be passed to a USAP; false otherwise
*/
- private static boolean isValidBlastulaCommand(ArrayList<String> args) {
+ private static boolean isValidUsapCommand(ArrayList<String> args) {
for (String flag : args) {
- for (String badFlag : INVALID_BLASTULA_FLAGS) {
+ for (String badFlag : INVALID_USAP_FLAGS) {
if (flag.startsWith(badFlag)) {
return false;
}
@@ -551,7 +551,7 @@ public class ZygoteProcess {
@Nullable String packageName,
@Nullable String[] packagesForUid,
@Nullable String sandboxId,
- boolean useBlastulaPool,
+ boolean useUnspecializedAppProcessPool,
@Nullable String[] extraArgs)
throws ZygoteStartFailedEx {
ArrayList<String> argsForZygote = new ArrayList<String>();
@@ -651,41 +651,41 @@ public class ZygoteProcess {
synchronized(mLock) {
return zygoteSendArgsAndGetResult(openZygoteSocketIfNeeded(abi),
- useBlastulaPool,
+ useUnspecializedAppProcessPool,
argsForZygote);
}
}
- private boolean fetchBlastulaPoolEnabledProp() {
- boolean origVal = mBlastulaPoolEnabled;
+ private boolean fetchUsapPoolEnabledProp() {
+ boolean origVal = mUsapPoolEnabled;
final String propertyString =
Zygote.getSystemProperty(
- DeviceConfig.RuntimeNative.BLASTULA_POOL_ENABLED,
- BLASTULA_POOL_ENABLED_DEFAULT);
+ DeviceConfig.RuntimeNative.USAP_POOL_ENABLED,
+ USAP_POOL_ENABLED_DEFAULT);
if (!propertyString.isEmpty()) {
- mBlastulaPoolEnabled =
+ mUsapPoolEnabled =
Zygote.getSystemPropertyBoolean(
- DeviceConfig.RuntimeNative.BLASTULA_POOL_ENABLED,
- Boolean.parseBoolean(BLASTULA_POOL_ENABLED_DEFAULT));
+ DeviceConfig.RuntimeNative.USAP_POOL_ENABLED,
+ Boolean.parseBoolean(USAP_POOL_ENABLED_DEFAULT));
}
- if (origVal != mBlastulaPoolEnabled) {
- Log.i(LOG_TAG, "blastulaPoolEnabled = " + mBlastulaPoolEnabled);
+ if (origVal != mUsapPoolEnabled) {
+ Log.i(LOG_TAG, "usapPoolEnabled = " + mUsapPoolEnabled);
}
- return origVal != mBlastulaPoolEnabled;
+ return origVal != mUsapPoolEnabled;
}
private long mLastPropCheckTimestamp = 0;
- private boolean fetchBlastulaPoolEnabledPropWithMinInterval() {
+ private boolean fetchUsapPoolEnabledPropWithMinInterval() {
final long currentTimestamp = SystemClock.elapsedRealtime();
if (currentTimestamp - mLastPropCheckTimestamp >= Zygote.PROPERTY_CHECK_INTERVAL) {
mLastPropCheckTimestamp = currentTimestamp;
- return fetchBlastulaPoolEnabledProp();
+ return fetchUsapPoolEnabledProp();
}
return false;
@@ -882,7 +882,7 @@ public class ZygoteProcess {
private void attemptConnectionToPrimaryZygote() throws IOException {
if (primaryZygoteState == null || primaryZygoteState.isClosed()) {
primaryZygoteState =
- ZygoteState.connect(mZygoteSocketAddress, mBlastulaPoolSocketAddress);
+ ZygoteState.connect(mZygoteSocketAddress, mUsapPoolSocketAddress);
maybeSetApiBlacklistExemptions(primaryZygoteState, false);
maybeSetHiddenApiAccessLogSampleRate(primaryZygoteState);
@@ -897,7 +897,7 @@ public class ZygoteProcess {
if (secondaryZygoteState == null || secondaryZygoteState.isClosed()) {
secondaryZygoteState =
ZygoteState.connect(mZygoteSecondarySocketAddress,
- mBlastulaPoolSecondarySocketAddress);
+ mUsapPoolSecondarySocketAddress);
maybeSetApiBlacklistExemptions(secondaryZygoteState, false);
maybeSetHiddenApiAccessLogSampleRate(secondaryZygoteState);
@@ -1052,11 +1052,11 @@ public class ZygoteProcess {
}
/**
- * Sends messages to the zygotes telling them to change the status of their blastula pools. If
+ * Sends messages to the zygotes telling them to change the status of their USAP pools. If
* this notification fails the ZygoteProcess will fall back to the previous behavior.
*/
- private void informZygotesOfBlastulaPoolStatus() {
- final String command = "1\n--blastula-pool-enabled=" + mBlastulaPoolEnabled + "\n";
+ private void informZygotesOfUsapPoolStatus() {
+ final String command = "1\n--usap-pool-enabled=" + mUsapPoolEnabled + "\n";
synchronized (mLock) {
try {
@@ -1065,8 +1065,8 @@ public class ZygoteProcess {
primaryZygoteState.mZygoteOutputWriter.write(command);
primaryZygoteState.mZygoteOutputWriter.flush();
} catch (IOException ioe) {
- mBlastulaPoolEnabled = !mBlastulaPoolEnabled;
- Log.w(LOG_TAG, "Failed to inform zygotes of blastula pool status: "
+ mUsapPoolEnabled = !mUsapPoolEnabled;
+ Log.w(LOG_TAG, "Failed to inform zygotes of USAP pool status: "
+ ioe.getMessage());
return;
}
@@ -1082,7 +1082,7 @@ public class ZygoteProcess {
secondaryZygoteState.mZygoteInputStream.readInt();
} catch (IOException ioe) {
throw new IllegalStateException(
- "Blastula pool state change cause an irrecoverable error",
+ "USAP pool state change cause an irrecoverable error",
ioe);
}
} catch (IOException ioe) {
@@ -1096,7 +1096,7 @@ public class ZygoteProcess {
primaryZygoteState.mZygoteInputStream.readInt();
} catch (IOException ioe) {
throw new IllegalStateException(
- "Blastula pool state change cause an irrecoverable error",
+ "USAP pool state change cause an irrecoverable error",
ioe);
}
}
@@ -1150,7 +1150,7 @@ public class ZygoteProcess {
abi, instructionSet, null /* appDataDir */, null /* invokeWith */,
true /* startChildZygote */, null /* packageName */,
null /* packagesForUid */, null /* sandboxId */,
- false /* useBlastulaPool */, extraArgs);
+ false /* useUsapPool */, extraArgs);
} catch (ZygoteStartFailedEx ex) {
throw new RuntimeException("Starting child-zygote through Zygote failed", ex);
}
diff --git a/core/java/android/permission/PermissionControllerService.java b/core/java/android/permission/PermissionControllerService.java
index e883d25ab0bd..ee03689f211d 100644
--- a/core/java/android/permission/PermissionControllerService.java
+++ b/core/java/android/permission/PermissionControllerService.java
@@ -197,7 +197,7 @@ public abstract class PermissionControllerService extends Service {
@NonNull String permission, @PermissionGrantState int grantState);
@Override
- public final IBinder onBind(Intent intent) {
+ public final @NonNull IBinder onBind(Intent intent) {
return new IPermissionController.Stub() {
@Override
public void revokeRuntimePermissions(
diff --git a/core/java/android/provider/DeviceConfig.java b/core/java/android/provider/DeviceConfig.java
index 010e3b1f23ed..2cd3c48b0eb8 100644
--- a/core/java/android/provider/DeviceConfig.java
+++ b/core/java/android/provider/DeviceConfig.java
@@ -145,32 +145,32 @@ public final class DeviceConfig {
*/
/**
- * If {@code true}, enables the blastula pool feature.
+ * If {@code true}, enables the unspecialized app process (USAP) pool feature.
*
* @hide for internal use only
*/
- String BLASTULA_POOL_ENABLED = "blastula_pool_enabled";
+ String USAP_POOL_ENABLED = "usap_pool_enabled";
/**
- * The maximum number of processes to keep in the blastula pool.
+ * The maximum number of processes to keep in the USAP pool.
*
* @hide for internal use only
*/
- String BLASTULA_POOL_SIZE_MAX = "blastula_pool_size_max";
+ String USAP_POOL_SIZE_MAX = "usap_pool_size_max";
/**
- * The minimum number of processes to keep in the blastula pool.
+ * The minimum number of processes to keep in the USAP pool.
*
* @hide for internal use only
*/
- String BLASTULA_POOL_SIZE_MIN = "blastula_pool_size_min";
+ String USAP_POOL_SIZE_MIN = "usap_pool_size_min";
/**
* The threshold used to determine if the pool should be refilled.
*
* @hide for internal use only
*/
- String BLASTULA_POOL_REFILL_THRESHOLD = "blastula_refill_threshold";
+ String USAP_POOL_REFILL_THRESHOLD = "usap_refill_threshold";
}
/**
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java
index d395a9f9b61e..f5eb63fb61f9 100644
--- a/core/java/android/provider/Settings.java
+++ b/core/java/android/provider/Settings.java
@@ -9635,6 +9635,7 @@ public final class Settings {
* when user location settings are off), for emergency purposes.
* @hide
*/
+ @TestApi
public static final String LOCATION_IGNORE_SETTINGS_PACKAGE_WHITELIST =
"location_ignore_settings_package_whitelist";
diff --git a/core/java/android/service/autofill/CustomDescription.java b/core/java/android/service/autofill/CustomDescription.java
index ea87f4fe564e..c28d2bbe30ea 100644
--- a/core/java/android/service/autofill/CustomDescription.java
+++ b/core/java/android/service/autofill/CustomDescription.java
@@ -176,6 +176,7 @@ public final class CustomDescription implements Parcelable {
* by the Android System.
* @throws IllegalStateException if {@link #build()} was already called.
*/
+ @NonNull
public Builder addChild(int id, @NonNull Transformation transformation) {
throwIfDestroyed();
Preconditions.checkArgument((transformation instanceof InternalTransformation),
@@ -270,6 +271,7 @@ public final class CustomDescription implements Parcelable {
* by the Android System.
* @throws IllegalStateException if {@link #build()} was already called.
*/
+ @NonNull
public Builder batchUpdate(@NonNull Validator condition, @NonNull BatchUpdates updates) {
throwIfDestroyed();
Preconditions.checkArgument((condition instanceof InternalValidator),
@@ -323,6 +325,7 @@ public final class CustomDescription implements Parcelable {
* by the Android System.
* @throws IllegalStateException if {@link #build()} was already called.
*/
+ @NonNull
public Builder addOnClickAction(int id, @NonNull OnClickAction action) {
throwIfDestroyed();
Preconditions.checkArgument((action instanceof InternalOnClickAction),
@@ -338,6 +341,7 @@ public final class CustomDescription implements Parcelable {
/**
* Creates a new {@link CustomDescription} instance.
*/
+ @NonNull
public CustomDescription build() {
throwIfDestroyed();
mDestroyed = true;
diff --git a/core/java/android/service/autofill/FillResponse.java b/core/java/android/service/autofill/FillResponse.java
index 257114ccc87b..6b3009f9f9ef 100644
--- a/core/java/android/service/autofill/FillResponse.java
+++ b/core/java/android/service/autofill/FillResponse.java
@@ -272,7 +272,8 @@ public final class FillResponse implements Parcelable {
*
* @see android.app.PendingIntent#getIntentSender()
*/
- public @NonNull Builder setAuthentication(@NonNull AutofillId[] ids,
+ @NonNull
+ public Builder setAuthentication(@NonNull AutofillId[] ids,
@Nullable IntentSender authentication, @Nullable RemoteViews presentation) {
throwIfDestroyed();
throwIfDisableAutofillCalled();
@@ -298,6 +299,7 @@ public final class FillResponse implements Parcelable {
* <p>This is typically used when the service cannot autofill the view; for example, a
* text field representing the result of a Captcha challenge.
*/
+ @NonNull
public Builder setIgnoredIds(AutofillId...ids) {
throwIfDestroyed();
mIgnoredIds = ids;
@@ -318,7 +320,8 @@ public final class FillResponse implements Parcelable {
*
* @return This builder.
*/
- public @NonNull Builder addDataset(@Nullable Dataset dataset) {
+ @NonNull
+ public Builder addDataset(@Nullable Dataset dataset) {
throwIfDestroyed();
throwIfDisableAutofillCalled();
if (dataset == null) {
@@ -359,6 +362,7 @@ public final class FillResponse implements Parcelable {
* @param clientState The custom client state.
* @return This builder.
*/
+ @NonNull
public Builder setClientState(@Nullable Bundle clientState) {
throwIfDestroyed();
throwIfDisableAutofillCalled();
@@ -379,6 +383,7 @@ public final class FillResponse implements Parcelable {
* already called.
* @throws NullPointerException if {@code ids} or any element on it is {@code null}.
*/
+ @NonNull
public Builder setFieldClassificationIds(@NonNull AutofillId... ids) {
throwIfDestroyed();
throwIfDisableAutofillCalled();
@@ -398,6 +403,7 @@ public final class FillResponse implements Parcelable {
*
* @return This builder.
*/
+ @NonNull
public Builder setFlags(@FillResponseFlags int flags) {
throwIfDestroyed();
mFlags = Preconditions.checkFlagsArgument(flags,
@@ -437,6 +443,7 @@ public final class FillResponse implements Parcelable {
* {@link #setSaveInfo(SaveInfo)}, {@link #setClientState(Bundle)}, or
* {@link #setFieldClassificationIds(AutofillId...)} was already called.
*/
+ @NonNull
public Builder disableAutofill(long duration) {
throwIfDestroyed();
if (duration <= 0) {
@@ -475,6 +482,7 @@ public final class FillResponse implements Parcelable {
* already set for this builder.
*/
// TODO(b/69796626): make it sticky / update javadoc
+ @NonNull
public Builder setHeader(@NonNull RemoteViews header) {
throwIfDestroyed();
throwIfAuthenticationCalled();
@@ -506,6 +514,7 @@ public final class FillResponse implements Parcelable {
* requires authentication}.
*/
// TODO(b/69796626): make it sticky / update javadoc
+ @NonNull
public Builder setFooter(@NonNull RemoteViews footer) {
throwIfDestroyed();
throwIfAuthenticationCalled();
@@ -524,6 +533,7 @@ public final class FillResponse implements Parcelable {
* {@link #setAuthentication(AutofillId[], IntentSender, RemoteViews)
* requires authentication}.
*/
+ @NonNull
public Builder setUserData(@NonNull UserData userData) {
throwIfDestroyed();
throwIfAuthenticationCalled();
@@ -548,6 +558,7 @@ public final class FillResponse implements Parcelable {
*
* @return A built response.
*/
+ @NonNull
public FillResponse build() {
throwIfDestroyed();
if (mAuthentication == null && mDatasets == null && mSaveInfo == null
diff --git a/core/java/android/service/autofill/UserData.java b/core/java/android/service/autofill/UserData.java
index cea04962b547..7814f70b612b 100644
--- a/core/java/android/service/autofill/UserData.java
+++ b/core/java/android/service/autofill/UserData.java
@@ -266,6 +266,7 @@ public final class UserData implements FieldClassificationUserData, Parcelable {
*
* @return this builder
*/
+ @NonNull
public Builder setFieldClassificationAlgorithm(@Nullable String name,
@Nullable Bundle args) {
throwIfDestroyed();
@@ -291,6 +292,7 @@ public final class UserData implements FieldClassificationUserData, Parcelable {
*
* @return this builder
*/
+ @NonNull
public Builder setFieldClassificationAlgorithmForCategory(@NonNull String categoryId,
@Nullable String name, @Nullable Bundle args) {
throwIfDestroyed();
@@ -333,6 +335,7 @@ public final class UserData implements FieldClassificationUserData, Parcelable {
* {@link UserData#getMaxValueLength()}</li>
* </ul>
*/
+ @NonNull
public Builder add(@NonNull String value, @NonNull String categoryId) {
throwIfDestroyed();
checkNotEmpty("categoryId", categoryId);
@@ -386,6 +389,7 @@ public final class UserData implements FieldClassificationUserData, Parcelable {
*
* @return The built dataset.
*/
+ @NonNull
public UserData build() {
throwIfDestroyed();
mDestroyed = true;
diff --git a/core/java/android/service/autofill/augmented/AugmentedAutofillService.java b/core/java/android/service/autofill/augmented/AugmentedAutofillService.java
index 463eae681f05..cd549301f5d1 100644
--- a/core/java/android/service/autofill/augmented/AugmentedAutofillService.java
+++ b/core/java/android/service/autofill/augmented/AugmentedAutofillService.java
@@ -253,6 +253,7 @@ public abstract class AugmentedAutofillService extends Service {
}
@Override
+ /** @hide */
protected final void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
if (mAutofillProxies != null) {
final int size = mAutofillProxies.size();
diff --git a/core/java/android/view/Display.java b/core/java/android/view/Display.java
index 91c85e79c9ec..dbb207196f15 100644
--- a/core/java/android/view/Display.java
+++ b/core/java/android/view/Display.java
@@ -21,7 +21,6 @@ import static android.Manifest.permission.CONFIGURE_DISPLAY_COLOR_MODE;
import android.annotation.IntDef;
import android.annotation.Nullable;
import android.annotation.RequiresPermission;
-import android.annotation.TestApi;
import android.annotation.UnsupportedAppUsage;
import android.app.KeyguardManager;
import android.content.res.CompatibilityInfo;
@@ -231,7 +230,6 @@ public final class Display {
* bar, navigation bar, home activity or IME.
* </p>
*
- * @see #supportsSystemDecorations
* @hide
*/
// TODO (b/114338689): Remove the flag and use IWindowManager#setShouldShowSystemDecors
@@ -907,18 +905,6 @@ public final class Display {
}
/**
- * Returns whether this display should support showing system decorations.
- *
- * @see #FLAG_SHOULD_SHOW_SYSTEM_DECORATIONS
- * @hide
- */
- @TestApi
- // TODO (b/114338689): Remove the method and use IWindowManager#shouldShowSystemDecors
- public boolean supportsSystemDecorations() {
- return (mDisplayInfo.flags & FLAG_SHOULD_SHOW_SYSTEM_DECORATIONS) != 0;
- }
-
- /**
* Returns the display's HDR capabilities.
*
* @see #isHdr()
diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java
index 65b1abd715d9..a3d0a7e195e0 100644
--- a/core/java/android/view/ViewRootImpl.java
+++ b/core/java/android/view/ViewRootImpl.java
@@ -3477,7 +3477,7 @@ public final class ViewRootImpl implements ViewParent,
usingAsyncReport = true;
final Handler handler = mAttachInfo.mHandler;
mAttachInfo.mThreadedRenderer.setFrameCompleteCallback((long frameNr) ->
- handler.post(() -> {
+ handler.postAtFrontOfQueue(() -> {
// TODO: Use the frame number
pendingDrawFinished();
if (commitCallbacks != null) {
@@ -3489,7 +3489,7 @@ public final class ViewRootImpl implements ViewParent,
} else if (commitCallbacks != null && commitCallbacks.size() > 0) {
final Handler handler = mAttachInfo.mHandler;
mAttachInfo.mThreadedRenderer.setFrameCompleteCallback((long frameNr) ->
- handler.post(() -> {
+ handler.postAtFrontOfQueue(() -> {
for (int i = 0; i < commitCallbacks.size(); i++) {
commitCallbacks.get(i).run();
}
diff --git a/core/java/android/view/WindowManager.java b/core/java/android/view/WindowManager.java
index 0275c2528265..86b735046b2b 100644
--- a/core/java/android/view/WindowManager.java
+++ b/core/java/android/view/WindowManager.java
@@ -481,6 +481,7 @@ public interface WindowManager extends ViewManager {
*
* @param displayId The id of the display.
* @param shouldShow Indicates that the display should show system decors.
+ * @see #shouldShowSystemDecors(int)
* @hide
*/
@TestApi
@@ -488,6 +489,21 @@ public interface WindowManager extends ViewManager {
}
/**
+ * Checks if the display supports showing system decors.
+ * <p>
+ * System decors include status bar, navigation bar, launcher.
+ * </p>
+ *
+ * @param displayId The id of the display.
+ * @see #setShouldShowSystemDecors(int, boolean)
+ * @hide
+ */
+ @TestApi
+ default boolean shouldShowSystemDecors(int displayId) {
+ return false;
+ }
+
+ /**
* Sets that the display should show IME.
*
* @param displayId Display ID.
diff --git a/core/java/android/view/WindowManagerImpl.java b/core/java/android/view/WindowManagerImpl.java
index a102f6c8a74d..2e4db5c4eef9 100644
--- a/core/java/android/view/WindowManagerImpl.java
+++ b/core/java/android/view/WindowManagerImpl.java
@@ -177,6 +177,15 @@ public final class WindowManagerImpl implements WindowManager {
}
@Override
+ public boolean shouldShowSystemDecors(int displayId) {
+ try {
+ return WindowManagerGlobal.getWindowManagerService().shouldShowSystemDecors(displayId);
+ } catch (RemoteException e) {
+ }
+ return false;
+ }
+
+ @Override
public void setShouldShowIme(int displayId, boolean shouldShow) {
try {
WindowManagerGlobal.getWindowManagerService().setShouldShowIme(displayId, shouldShow);
diff --git a/core/java/android/view/accessibility/AccessibilityNodeIdManager.java b/core/java/android/view/accessibility/AccessibilityNodeIdManager.java
index 1ac704774e7f..0f5e950582dd 100644
--- a/core/java/android/view/accessibility/AccessibilityNodeIdManager.java
+++ b/core/java/android/view/accessibility/AccessibilityNodeIdManager.java
@@ -45,7 +45,9 @@ public final class AccessibilityNodeIdManager {
* @param id The accessibilityViewId of the view.
*/
public void registerViewWithId(View view, int id) {
- mIdsToViews.append(id, view);
+ synchronized (mIdsToViews) {
+ mIdsToViews.append(id, view);
+ }
}
/**
@@ -53,7 +55,9 @@ public final class AccessibilityNodeIdManager {
* @param id The id returned from registerView when the view as first associated.
*/
public void unregisterViewWithId(int id) {
- mIdsToViews.remove(id);
+ synchronized (mIdsToViews) {
+ mIdsToViews.remove(id);
+ }
}
/**
@@ -62,7 +66,10 @@ public final class AccessibilityNodeIdManager {
* @return The view.
*/
public View findView(int id) {
- final View view = mIdsToViews.get(id);
+ View view = null;
+ synchronized (mIdsToViews) {
+ view = mIdsToViews.get(id);
+ }
return view != null && view.includeForAccessibility() ? view : null;
}
}
diff --git a/core/java/android/widget/RemoteViews.java b/core/java/android/widget/RemoteViews.java
index 516c48e6a6c5..564d972ac26d 100644
--- a/core/java/android/widget/RemoteViews.java
+++ b/core/java/android/widget/RemoteViews.java
@@ -2803,7 +2803,7 @@ public class RemoteViews implements Parcelable, Filter {
* @param viewId The id of the view that will trigger the {@link RemoteResponse} when clicked
* @param response The {@link RemoteResponse} to send when user clicks
*/
- public void setOnClickResponse(int viewId, RemoteResponse response) {
+ public void setOnClickResponse(int viewId, @NonNull RemoteResponse response) {
addAction(new SetOnClickResponse(viewId, response));
}
@@ -3926,7 +3926,8 @@ public class RemoteViews implements Parcelable, Filter {
*
* @param pendingIntent The {@link PendingIntent} to send as part of the response
*/
- public static RemoteResponse fromPendingIntent(PendingIntent pendingIntent) {
+ @NonNull
+ public static RemoteResponse fromPendingIntent(@NonNull PendingIntent pendingIntent) {
RemoteResponse response = new RemoteResponse();
response.mPendingIntent = pendingIntent;
return response;
@@ -3957,7 +3958,8 @@ public class RemoteViews implements Parcelable, Filter {
* @see RemoteViews#setOnClickFillInIntent(int, Intent)
* @return
*/
- public static RemoteResponse fromFillInIntent(Intent fillIntent) {
+ @NonNull
+ public static RemoteResponse fromFillInIntent(@NonNull Intent fillIntent) {
RemoteResponse response = new RemoteResponse();
response.mFillIntent = fillIntent;
return response;
@@ -3974,7 +3976,8 @@ public class RemoteViews implements Parcelable, Filter {
*
* @see ActivityOptions#makeSceneTransitionAnimation(Activity, Pair[])
*/
- public RemoteResponse addSharedElement(int viewId, String sharedElementName) {
+ @NonNull
+ public RemoteResponse addSharedElement(int viewId, @NonNull String sharedElementName) {
if (mViewIds == null) {
mViewIds = new IntArray();
mElementNames = new ArrayList<>();
diff --git a/core/java/com/android/internal/app/ChooserActivity.java b/core/java/com/android/internal/app/ChooserActivity.java
index 89e3d6b6460f..a5a1dd993e0c 100644
--- a/core/java/com/android/internal/app/ChooserActivity.java
+++ b/core/java/com/android/internal/app/ChooserActivity.java
@@ -135,7 +135,7 @@ public class ChooserActivity extends ResolverActivity {
* {@link AppPredictionManager} will be queried for direct share targets.
*/
// TODO(b/123089490): Replace with system flag
- private static final boolean USE_PREDICTION_MANAGER_FOR_DIRECT_TARGETS = false;
+ private static final boolean USE_PREDICTION_MANAGER_FOR_DIRECT_TARGETS = true;
// TODO(b/123088566) Share these in a better way.
private static final String APP_PREDICTION_SHARE_UI_SURFACE = "share";
public static final String LAUNCH_LOCATON_DIRECT_SHARE = "direct_share";
diff --git a/core/java/com/android/internal/os/Zygote.java b/core/java/com/android/internal/os/Zygote.java
index 0ccaec0be20e..2bba3c914664 100644
--- a/core/java/com/android/internal/os/Zygote.java
+++ b/core/java/com/android/internal/os/Zygote.java
@@ -126,8 +126,8 @@ public final class Zygote {
/** Read-write external storage should be mounted instead of package sandbox */
public static final int MOUNT_EXTERNAL_FULL = IVold.REMOUNT_MODE_FULL;
- /** Number of bytes sent to the Zygote over blastula pipes or the pool event FD */
- public static final int BLASTULA_MANAGEMENT_MESSAGE_BYTES = 8;
+ /** Number of bytes sent to the Zygote over USAP pipes or the pool event FD */
+ public static final int USAP_MANAGEMENT_MESSAGE_BYTES = 8;
/**
* An extraArg passed when a zygote process is forking a child-zygote, specifying a name
@@ -187,12 +187,12 @@ public final class Zygote {
/**
* @hide for internal use only
*/
- public static final String BLASTULA_POOL_PRIMARY_SOCKET_NAME = "blastula_pool";
+ public static final String USAP_POOL_PRIMARY_SOCKET_NAME = "usap_pool_primary";
/**
* @hide for internal use only
*/
- public static final String BLASTULA_POOL_SECONDARY_SOCKET_NAME = "blastula_pool_secondary";
+ public static final String USAP_POOL_SECONDARY_SOCKET_NAME = "usap_pool_secondary";
private Zygote() {}
@@ -262,7 +262,7 @@ public final class Zygote {
String sandboxId);
/**
- * Specialize a Blastula instance. The current VM must have been started
+ * Specialize an unspecialized app process. The current VM must have been started
* with the -Xzygote flag.
*
* @param uid The UNIX uid that the new process should setuid() to before spawning any threads
@@ -282,12 +282,11 @@ public final class Zygote {
* @param instructionSet null-ok The instruction set to use.
* @param appDataDir null-ok The data directory of the app.
*/
- public static void specializeBlastula(int uid, int gid, int[] gids, int runtimeFlags,
+ public static void specializeAppProcess(int uid, int gid, int[] gids, int runtimeFlags,
int[][] rlimits, int mountExternal, String seInfo, String niceName,
boolean startChildZygote, String instructionSet, String appDataDir, String packageName,
String[] packagesForUID, String sandboxId) {
-
- nativeSpecializeBlastula(uid, gid, gids, runtimeFlags, rlimits, mountExternal, seInfo,
+ nativeSpecializeAppProcess(uid, gid, gids, runtimeFlags, rlimits, mountExternal, seInfo,
niceName, startChildZygote, instructionSet, appDataDir,
packageName, packagesForUID, sandboxId);
@@ -306,7 +305,7 @@ public final class Zygote {
ZygoteHooks.postForkCommon();
}
- private static native void nativeSpecializeBlastula(int uid, int gid, int[] gids,
+ private static native void nativeSpecializeAppProcess(int uid, int gid, int[] gids,
int runtimeFlags, int[][] rlimits, int mountExternal, String seInfo, String niceName,
boolean startChildZygote, String instructionSet, String appDataDir, String packageName,
String[] packagesForUID, String sandboxId);
@@ -427,11 +426,11 @@ public final class Zygote {
defaultValue);
}
- protected static void emptyBlastulaPool() {
- nativeEmptyBlastulaPool();
+ protected static void emptyUsapPool() {
+ nativeEmptyUsapPool();
}
- private static native void nativeEmptyBlastulaPool();
+ private static native void nativeEmptyUsapPool();
/**
* Returns the value of a system property converted to a boolean using specific logic.
@@ -454,105 +453,105 @@ public final class Zygote {
}
/**
- * @return Number of blastulas currently in the pool
+ * @return Number of unspecialized app processes currently in the pool
*/
- static int getBlastulaPoolCount() {
- return nativeGetBlastulaPoolCount();
+ static int getUsapPoolCount() {
+ return nativeGetUsapPoolCount();
}
- private static native int nativeGetBlastulaPoolCount();
+ private static native int nativeGetUsapPoolCount();
/**
* @return The event FD used for communication between the signal handler and the ZygoteServer
* poll loop
*/
- static FileDescriptor getBlastulaPoolEventFD() {
+ static FileDescriptor getUsapPoolEventFD() {
FileDescriptor fd = new FileDescriptor();
- fd.setInt$(nativeGetBlastulaPoolEventFD());
+ fd.setInt$(nativeGetUsapPoolEventFD());
return fd;
}
- private static native int nativeGetBlastulaPoolEventFD();
+ private static native int nativeGetUsapPoolEventFD();
/**
- * Fork a new blastula process from the zygote
+ * Fork a new unspecialized app process from the zygote
*
* @param sessionSocketRawFDs Anonymous session sockets that are currently open
- * @return In the Zygote process this function will always return null; in blastula processes
- * this function will return a Runnable object representing the new application that is
- * passed up from blastulaMain.
+ * @return In the Zygote process this function will always return null; in unspecialized app
+ * processes this function will return a Runnable object representing the new
+ * application that is passed up from usapMain.
*/
- static Runnable forkBlastula(LocalServerSocket blastulaPoolSocket,
- int[] sessionSocketRawFDs) {
+ static Runnable forkUsap(LocalServerSocket usapPoolSocket,
+ int[] sessionSocketRawFDs) {
FileDescriptor[] pipeFDs = null;
try {
pipeFDs = Os.pipe2(O_CLOEXEC);
} catch (ErrnoException errnoEx) {
- throw new IllegalStateException("Unable to create blastula pipe.", errnoEx);
+ throw new IllegalStateException("Unable to create USAP pipe.", errnoEx);
}
int pid =
- nativeForkBlastula(pipeFDs[0].getInt$(), pipeFDs[1].getInt$(), sessionSocketRawFDs);
+ nativeForkUsap(pipeFDs[0].getInt$(), pipeFDs[1].getInt$(), sessionSocketRawFDs);
if (pid == 0) {
IoUtils.closeQuietly(pipeFDs[0]);
- return blastulaMain(blastulaPoolSocket, pipeFDs[1]);
+ return usapMain(usapPoolSocket, pipeFDs[1]);
} else {
// The read-end of the pipe will be closed by the native code.
- // See removeBlastulaTableEntry();
+ // See removeUsapTableEntry();
IoUtils.closeQuietly(pipeFDs[1]);
return null;
}
}
- private static native int nativeForkBlastula(int readPipeFD,
+ private static native int nativeForkUsap(int readPipeFD,
int writePipeFD,
int[] sessionSocketRawFDs);
/**
- * This function is used by blastulas to wait for specialization requests from the system
- * server.
+ * This function is used by unspecialized app processes to wait for specialization requests from
+ * the system server.
*
* @param writePipe The write end of the reporting pipe used to communicate with the poll loop
* of the ZygoteServer.
* @return A runnable oject representing the new application.
*/
- private static Runnable blastulaMain(LocalServerSocket blastulaPoolSocket,
- FileDescriptor writePipe) {
+ private static Runnable usapMain(LocalServerSocket usapPoolSocket,
+ FileDescriptor writePipe) {
final int pid = Process.myPid();
LocalSocket sessionSocket = null;
- DataOutputStream blastulaOutputStream = null;
+ DataOutputStream usapOutputStream = null;
Credentials peerCredentials = null;
ZygoteArguments args = null;
while (true) {
try {
- sessionSocket = blastulaPoolSocket.accept();
+ sessionSocket = usapPoolSocket.accept();
- BufferedReader blastulaReader =
+ BufferedReader usapReader =
new BufferedReader(new InputStreamReader(sessionSocket.getInputStream()));
- blastulaOutputStream =
+ usapOutputStream =
new DataOutputStream(sessionSocket.getOutputStream());
peerCredentials = sessionSocket.getPeerCredentials();
- String[] argStrings = readArgumentList(blastulaReader);
+ String[] argStrings = readArgumentList(usapReader);
if (argStrings != null) {
args = new ZygoteArguments(argStrings);
// TODO (chriswailes): Should this only be run for debug builds?
- validateBlastulaCommand(args);
+ validateUsapCommand(args);
break;
} else {
- Log.e("Blastula", "Truncated command received.");
+ Log.e("USAP", "Truncated command received.");
IoUtils.closeQuietly(sessionSocket);
}
} catch (Exception ex) {
- Log.e("Blastula", ex.getMessage());
+ Log.e("USAP", ex.getMessage());
IoUtils.closeQuietly(sessionSocket);
}
}
@@ -571,29 +570,29 @@ public final class Zygote {
try {
// Used by ZygoteProcess.zygoteSendArgsAndGetResult to fill in a
// Process.ProcessStartResult object.
- blastulaOutputStream.writeInt(pid);
+ usapOutputStream.writeInt(pid);
} catch (IOException ioEx) {
- Log.e("Blastula", "Failed to write response to session socket: " + ioEx.getMessage());
+ Log.e("USAP", "Failed to write response to session socket: " + ioEx.getMessage());
System.exit(-1);
} finally {
IoUtils.closeQuietly(sessionSocket);
- IoUtils.closeQuietly(blastulaPoolSocket);
+ IoUtils.closeQuietly(usapPoolSocket);
}
try {
ByteArrayOutputStream buffer =
- new ByteArrayOutputStream(Zygote.BLASTULA_MANAGEMENT_MESSAGE_BYTES);
+ new ByteArrayOutputStream(Zygote.USAP_MANAGEMENT_MESSAGE_BYTES);
DataOutputStream outputStream = new DataOutputStream(buffer);
- // This is written as a long so that the blastula reporting pipe and blastula pool
- // event FD handlers in ZygoteServer.runSelectLoop can be unified. These two cases
- // should both send/receive 8 bytes.
+ // This is written as a long so that the USAP reporting pipe and USAP pool event FD
+ // handlers in ZygoteServer.runSelectLoop can be unified. These two cases should both
+ // send/receive 8 bytes.
outputStream.writeLong(pid);
outputStream.flush();
Os.write(writePipe, buffer.toByteArray(), 0, buffer.size());
} catch (Exception ex) {
- Log.e("Blastula",
+ Log.e("USAP",
String.format("Failed to write PID (%d) to pipe (%d): %s",
pid, writePipe.getInt$(), ex.getMessage()));
System.exit(-1);
@@ -601,7 +600,7 @@ public final class Zygote {
IoUtils.closeQuietly(writePipe);
}
- specializeBlastula(args.mUid, args.mGid, args.mGids,
+ specializeAppProcess(args.mUid, args.mGid, args.mGids,
args.mRuntimeFlags, rlimits, args.mMountExternal,
args.mSeInfo, args.mNiceName, args.mStartChildZygote,
args.mInstructionSet, args.mAppDataDir, args.mPackageName,
@@ -619,37 +618,37 @@ public final class Zygote {
null /* classLoader */);
}
- private static final String BLASTULA_ERROR_PREFIX = "Invalid command to blastula: ";
+ private static final String USAP_ERROR_PREFIX = "Invalid command to USAP: ";
/**
- * Checks a set of zygote arguments to see if they can be handled by a blastula. Throws an
+ * Checks a set of zygote arguments to see if they can be handled by a USAP. Throws an
* exception if an invalid arugment is encountered.
* @param args The arguments to test
*/
- private static void validateBlastulaCommand(ZygoteArguments args) {
+ private static void validateUsapCommand(ZygoteArguments args) {
if (args.mAbiListQuery) {
- throw new IllegalArgumentException(BLASTULA_ERROR_PREFIX + "--query-abi-list");
+ throw new IllegalArgumentException(USAP_ERROR_PREFIX + "--query-abi-list");
} else if (args.mPidQuery) {
- throw new IllegalArgumentException(BLASTULA_ERROR_PREFIX + "--get-pid");
+ throw new IllegalArgumentException(USAP_ERROR_PREFIX + "--get-pid");
} else if (args.mPreloadDefault) {
- throw new IllegalArgumentException(BLASTULA_ERROR_PREFIX + "--preload-default");
+ throw new IllegalArgumentException(USAP_ERROR_PREFIX + "--preload-default");
} else if (args.mPreloadPackage != null) {
- throw new IllegalArgumentException(BLASTULA_ERROR_PREFIX + "--preload-package");
+ throw new IllegalArgumentException(USAP_ERROR_PREFIX + "--preload-package");
} else if (args.mPreloadApp != null) {
- throw new IllegalArgumentException(BLASTULA_ERROR_PREFIX + "--preload-app");
+ throw new IllegalArgumentException(USAP_ERROR_PREFIX + "--preload-app");
} else if (args.mStartChildZygote) {
- throw new IllegalArgumentException(BLASTULA_ERROR_PREFIX + "--start-child-zygote");
+ throw new IllegalArgumentException(USAP_ERROR_PREFIX + "--start-child-zygote");
} else if (args.mApiBlacklistExemptions != null) {
throw new IllegalArgumentException(
- BLASTULA_ERROR_PREFIX + "--set-api-blacklist-exemptions");
+ USAP_ERROR_PREFIX + "--set-api-blacklist-exemptions");
} else if (args.mHiddenApiAccessLogSampleRate != -1) {
throw new IllegalArgumentException(
- BLASTULA_ERROR_PREFIX + "--hidden-api-log-sampling-rate=");
+ USAP_ERROR_PREFIX + "--hidden-api-log-sampling-rate=");
} else if (args.mHiddenApiAccessStatslogSampleRate != -1) {
throw new IllegalArgumentException(
- BLASTULA_ERROR_PREFIX + "--hidden-api-statslog-sampling-rate=");
+ USAP_ERROR_PREFIX + "--hidden-api-statslog-sampling-rate=");
} else if (args.mInvokeWith != null) {
- throw new IllegalArgumentException(BLASTULA_ERROR_PREFIX + "--invoke-with");
+ throw new IllegalArgumentException(USAP_ERROR_PREFIX + "--invoke-with");
} else if (args.mPermittedCapabilities != 0 || args.mEffectiveCapabilities != 0) {
throw new ZygoteSecurityException("Client may not specify capabilities: "
+ "permitted=0x" + Long.toHexString(args.mPermittedCapabilities)
@@ -658,25 +657,25 @@ public final class Zygote {
}
/**
- * @return Raw file descriptors for the read-end of blastula reporting pipes.
+ * @return Raw file descriptors for the read-end of USAP reporting pipes.
*/
- protected static int[] getBlastulaPipeFDs() {
- return nativeGetBlastulaPipeFDs();
+ protected static int[] getUsapPipeFDs() {
+ return nativeGetUsapPipeFDs();
}
- private static native int[] nativeGetBlastulaPipeFDs();
+ private static native int[] nativeGetUsapPipeFDs();
/**
- * Remove the blastula table entry for the provided process ID.
+ * Remove the USAP table entry for the provided process ID.
*
- * @param blastulaPID Process ID of the entry to remove
+ * @param usapPID Process ID of the entry to remove
* @return True if the entry was removed; false if it doesn't exist
*/
- protected static boolean removeBlastulaTableEntry(int blastulaPID) {
- return nativeRemoveBlastulaTableEntry(blastulaPID);
+ protected static boolean removeUsapTableEntry(int usapPID) {
+ return nativeRemoveUsapTableEntry(usapPID);
}
- private static native boolean nativeRemoveBlastulaTableEntry(int blastulaPID);
+ private static native boolean nativeRemoveUsapTableEntry(int usapPID);
/**
* uid 1000 (Process.SYSTEM_UID) may specify any uid &gt; 1000 in normal
diff --git a/core/java/com/android/internal/os/ZygoteArguments.java b/core/java/com/android/internal/os/ZygoteArguments.java
index 3beee788a582..28642d8ba80c 100644
--- a/core/java/com/android/internal/os/ZygoteArguments.java
+++ b/core/java/com/android/internal/os/ZygoteArguments.java
@@ -103,8 +103,8 @@ class ZygoteArguments {
/**
*
*/
- boolean mBlastulaPoolEnabled;
- boolean mBlastulaPoolStatusSpecified = false;
+ boolean mUsapPoolEnabled;
+ boolean mUsapPoolStatusSpecified = false;
/**
* from all --rlimit=r,c,m
@@ -418,9 +418,9 @@ class ZygoteArguments {
throw new IllegalArgumentException("Duplicate arg specified");
}
mSandboxId = arg.substring(arg.indexOf('=') + 1);
- } else if (arg.startsWith("--blastula-pool-enabled=")) {
- mBlastulaPoolStatusSpecified = true;
- mBlastulaPoolEnabled = Boolean.parseBoolean(arg.substring(arg.indexOf('=') + 1));
+ } else if (arg.startsWith("--usap-pool-enabled=")) {
+ mUsapPoolStatusSpecified = true;
+ mUsapPoolEnabled = Boolean.parseBoolean(arg.substring(arg.indexOf('=') + 1));
expectRuntimeArgs = false;
} else {
break;
diff --git a/core/java/com/android/internal/os/ZygoteConnection.java b/core/java/com/android/internal/os/ZygoteConnection.java
index bcdce311d940..87adce7c3a62 100644
--- a/core/java/com/android/internal/os/ZygoteConnection.java
+++ b/core/java/com/android/internal/os/ZygoteConnection.java
@@ -159,8 +159,8 @@ class ZygoteConnection {
return null;
}
- if (parsedArgs.mBlastulaPoolStatusSpecified) {
- return handleBlastulaPoolStatusChange(zygoteServer, parsedArgs.mBlastulaPoolEnabled);
+ if (parsedArgs.mUsapPoolStatusSpecified) {
+ return handleUsapPoolStatusChange(zygoteServer, parsedArgs.mUsapPoolEnabled);
}
if (parsedArgs.mPreloadDefault) {
@@ -331,18 +331,18 @@ class ZygoteConnection {
}
}
- private Runnable stateChangeWithBlastulaPoolReset(ZygoteServer zygoteServer,
+ private Runnable stateChangeWithUsapPoolReset(ZygoteServer zygoteServer,
Runnable stateChangeCode) {
try {
- if (zygoteServer.isBlastulaPoolEnabled()) {
- Zygote.emptyBlastulaPool();
+ if (zygoteServer.isUsapPoolEnabled()) {
+ Zygote.emptyUsapPool();
}
stateChangeCode.run();
- if (zygoteServer.isBlastulaPoolEnabled()) {
+ if (zygoteServer.isUsapPoolEnabled()) {
Runnable fpResult =
- zygoteServer.fillBlastulaPool(
+ zygoteServer.fillUsapPool(
new int[]{mSocket.getFileDescriptor().getInt$()});
if (fpResult != null) {
@@ -363,24 +363,24 @@ class ZygoteConnection {
* Makes the necessary changes to implement a new API blacklist exemption policy, and then
* responds to the system server, letting it know that the task has been completed.
*
- * This necessitates a change to the internal state of the Zygote. As such, if the blastula
- * pool is enabled all existing blastulas have an incorrect API blacklist exemption list. To
+ * This necessitates a change to the internal state of the Zygote. As such, if the USAP
+ * pool is enabled all existing USAPs have an incorrect API blacklist exemption list. To
* properly handle this request the pool must be emptied and refilled. This process can return
* a Runnable object that must be returned to ZygoteServer.runSelectLoop to be invoked.
*
* @param zygoteServer The server object that received the request
* @param exemptions The new exemption list.
- * @return A Runnable object representing a new app in any blastulas spawned from here; the
+ * @return A Runnable object representing a new app in any USAPs spawned from here; the
* zygote process will always receive a null value from this function.
*/
private Runnable handleApiBlacklistExemptions(ZygoteServer zygoteServer, String[] exemptions) {
- return stateChangeWithBlastulaPoolReset(zygoteServer,
+ return stateChangeWithUsapPoolReset(zygoteServer,
() -> ZygoteInit.setApiBlacklistExemptions(exemptions));
}
- private Runnable handleBlastulaPoolStatusChange(ZygoteServer zygoteServer, boolean newStatus) {
+ private Runnable handleUsapPoolStatusChange(ZygoteServer zygoteServer, boolean newStatus) {
try {
- Runnable fpResult = zygoteServer.setBlastulaPoolStatus(newStatus, mSocket);
+ Runnable fpResult = zygoteServer.setUsapPoolStatus(newStatus, mSocket);
if (fpResult == null) {
mSocketOutStream.writeInt(0);
@@ -473,8 +473,8 @@ class ZygoteConnection {
/**
* Changes the API access log sample rate for the Zygote and processes spawned from it.
*
- * This necessitates a change to the internal state of the Zygote. As such, if the blastula
- * pool is enabled all existing blastulas have an incorrect API access log sample rate. To
+ * This necessitates a change to the internal state of the Zygote. As such, if the USAP
+ * pool is enabled all existing USAPs have an incorrect API access log sample rate. To
* properly handle this request the pool must be emptied and refilled. This process can return
* a Runnable object that must be returned to ZygoteServer.runSelectLoop to be invoked.
*
@@ -486,11 +486,10 @@ class ZygoteConnection {
*/
private Runnable handleHiddenApiAccessLogSampleRate(ZygoteServer zygoteServer,
int samplingRate, int statsdSamplingRate) {
- return stateChangeWithBlastulaPoolReset(zygoteServer, () -> {
+ return stateChangeWithUsapPoolReset(zygoteServer, () -> {
int maxSamplingRate = Math.max(samplingRate, statsdSamplingRate);
ZygoteInit.setHiddenApiAccessLogSampleRate(maxSamplingRate);
- HiddenApiUsageLogger.setHiddenApiAccessLogSampleRates(samplingRate,
- statsdSamplingRate);
+ HiddenApiUsageLogger.setHiddenApiAccessLogSampleRates(samplingRate, statsdSamplingRate);
ZygoteInit.setHiddenApiUsageLogger(HiddenApiUsageLogger.getInstance());
});
}
diff --git a/core/java/com/android/internal/os/ZygoteInit.java b/core/java/com/android/internal/os/ZygoteInit.java
index 7cddf7588b28..a5e7202c0e50 100644
--- a/core/java/com/android/internal/os/ZygoteInit.java
+++ b/core/java/com/android/internal/os/ZygoteInit.java
@@ -99,7 +99,7 @@ public class ZygoteInit {
private static final String ABI_LIST_ARG = "--abi-list=";
// TODO (chriswailes): Re-name this --zygote-socket-name= and then add a
- // --blastula-socket-name parameter.
+ // --usap-socket-name parameter.
private static final String SOCKET_NAME_ARG = "--socket-name=";
/**
diff --git a/core/java/com/android/internal/os/ZygoteServer.java b/core/java/com/android/internal/os/ZygoteServer.java
index c4c98baf0e4c..65953172818e 100644
--- a/core/java/com/android/internal/os/ZygoteServer.java
+++ b/core/java/com/android/internal/os/ZygoteServer.java
@@ -51,39 +51,40 @@ class ZygoteServer {
public static final String TAG = "ZygoteServer";
/**
- * The maximim value that will be accepted from the BLASTULA_POOL_SIZE_MAX device property.
- * is a mirror of BLASTULA_POOL_MAX_LIMIT found in com_android_internal_os_Zygote.cpp.
+ * The maximim value that will be accepted from the USAP_POOL_SIZE_MAX device property.
+ * is a mirror of USAP_POOL_MAX_LIMIT found in com_android_internal_os_Zygote.cpp.
*/
- private static final int BLASTULA_POOL_SIZE_MAX_LIMIT = 100;
+ private static final int USAP_POOL_SIZE_MAX_LIMIT = 100;
/**
- * The minimum value that will be accepted from the BLASTULA_POOL_SIZE_MIN device property.
+ * The minimum value that will be accepted from the USAP_POOL_SIZE_MIN device property.
*/
- private static final int BLASTULA_POOL_SIZE_MIN_LIMIT = 1;
+ private static final int USAP_POOL_SIZE_MIN_LIMIT = 1;
- /** The default value used for the BLASTULA_POOL_SIZE_MAX device property */
- private static final String BLASTULA_POOL_SIZE_MAX_DEFAULT = "10";
+ /** The default value used for the USAP_POOL_SIZE_MAX device property */
+ private static final String USAP_POOL_SIZE_MAX_DEFAULT = "10";
- /** The default value used for the BLASTULA_POOL_SIZE_MIN device property */
- private static final String BLASTULA_POOL_SIZE_MIN_DEFAULT = "1";
+ /** The default value used for the USAP_POOL_SIZE_MIN device property */
+ private static final String USAP_POOL_SIZE_MIN_DEFAULT = "1";
/**
- * Indicates if this Zygote server can support a blastula pool. Currently this should only be
- * true for the primary and secondary Zygotes, and not the App Zygotes or the WebView Zygote.
+ * Indicates if this Zygote server can support a unspecialized app process pool. Currently this
+ * should only be true for the primary and secondary Zygotes, and not the App Zygotes or the
+ * WebView Zygote.
*
* TODO (chriswailes): Make this an explicit argument to the constructor
*/
- private final boolean mBlastulaPoolSupported;
+ private final boolean mUsapPoolSupported;
/**
- * If the blastula pool should be created and used to start applications.
+ * If the unspecialized app process pool should be created and used to start applications.
*
- * Setting this value to false will disable the creation, maintenance, and use of the blastula
- * pool. When the blastula pool is disabled the application lifecycle will be identical to
+ * Setting this value to false will disable the creation, maintenance, and use of the USAP
+ * pool. When the USAP pool is disabled the application lifecycle will be identical to
* previous versions of Android.
*/
- private boolean mBlastulaPoolEnabled = false;
+ private boolean mUsapPoolEnabled = false;
/**
* Listening socket that accepts new server connections.
@@ -91,15 +92,15 @@ class ZygoteServer {
private LocalServerSocket mZygoteSocket;
/**
- * The name of the blastula socket to use if the blastula pool is enabled.
+ * The name of the unspecialized app process pool socket to use if the USAP pool is enabled.
*/
- private LocalServerSocket mBlastulaPoolSocket;
+ private LocalServerSocket mUsapPoolSocket;
/**
* File descriptor used for communication between the signal handler and the ZygoteServer poll
* loop.
* */
- private FileDescriptor mBlastulaPoolEventFD;
+ private FileDescriptor mUsapPoolEventFD;
/**
* Whether or not mZygoteSocket's underlying FD should be closed directly.
@@ -116,62 +117,61 @@ class ZygoteServer {
private boolean mIsForkChild;
/**
- * The runtime-adjustable maximum Blastula pool size.
+ * The runtime-adjustable maximum USAP pool size.
*/
- private int mBlastulaPoolSizeMax = 0;
+ private int mUsapPoolSizeMax = 0;
/**
- * The runtime-adjustable minimum Blastula pool size.
+ * The runtime-adjustable minimum USAP pool size.
*/
- private int mBlastulaPoolSizeMin = 0;
+ private int mUsapPoolSizeMin = 0;
/**
- * The runtime-adjustable value used to determine when to re-fill the
- * blastula pool. The pool will be re-filled when
- * (sBlastulaPoolMax - gBlastulaPoolCount) >= sBlastulaPoolRefillThreshold.
+ * The runtime-adjustable value used to determine when to re-fill the USAP pool. The pool will
+ * be re-filled when (mUsapPoolMax - gUsapPoolCount) >= sUsapPoolRefillThreshold.
*/
- private int mBlastulaPoolRefillThreshold = 0;
+ private int mUsapPoolRefillThreshold = 0;
ZygoteServer() {
- mBlastulaPoolEventFD = null;
+ mUsapPoolEventFD = null;
mZygoteSocket = null;
- mBlastulaPoolSocket = null;
+ mUsapPoolSocket = null;
- mBlastulaPoolSupported = false;
+ mUsapPoolSupported = false;
}
/**
- * Initialize the Zygote server with the Zygote server socket, blastula pool server socket,
- * and blastula pool event FD.
+ * Initialize the Zygote server with the Zygote server socket, USAP pool server socket, and USAP
+ * pool event FD.
*
* @param isPrimaryZygote If this is the primary Zygote or not.
*/
ZygoteServer(boolean isPrimaryZygote) {
- mBlastulaPoolEventFD = Zygote.getBlastulaPoolEventFD();
+ mUsapPoolEventFD = Zygote.getUsapPoolEventFD();
if (isPrimaryZygote) {
mZygoteSocket = Zygote.createManagedSocketFromInitSocket(Zygote.PRIMARY_SOCKET_NAME);
- mBlastulaPoolSocket =
+ mUsapPoolSocket =
Zygote.createManagedSocketFromInitSocket(
- Zygote.BLASTULA_POOL_PRIMARY_SOCKET_NAME);
+ Zygote.USAP_POOL_PRIMARY_SOCKET_NAME);
} else {
mZygoteSocket = Zygote.createManagedSocketFromInitSocket(Zygote.SECONDARY_SOCKET_NAME);
- mBlastulaPoolSocket =
+ mUsapPoolSocket =
Zygote.createManagedSocketFromInitSocket(
- Zygote.BLASTULA_POOL_SECONDARY_SOCKET_NAME);
+ Zygote.USAP_POOL_SECONDARY_SOCKET_NAME);
}
- fetchBlastulaPoolPolicyProps();
+ fetchUsapPoolPolicyProps();
- mBlastulaPoolSupported = true;
+ mUsapPoolSupported = true;
}
void setForkChild() {
mIsForkChild = true;
}
- public boolean isBlastulaPoolEnabled() {
- return mBlastulaPoolEnabled;
+ public boolean isUsapPoolEnabled() {
+ return mUsapPoolEnabled;
}
/**
@@ -240,95 +240,95 @@ class ZygoteServer {
return mZygoteSocket.getFileDescriptor();
}
- private void fetchBlastulaPoolPolicyProps() {
- if (mBlastulaPoolSupported) {
- final String blastulaPoolSizeMaxPropString =
+ private void fetchUsapPoolPolicyProps() {
+ if (mUsapPoolSupported) {
+ final String usapPoolSizeMaxPropString =
Zygote.getSystemProperty(
- DeviceConfig.RuntimeNative.BLASTULA_POOL_SIZE_MAX,
- BLASTULA_POOL_SIZE_MAX_DEFAULT);
+ DeviceConfig.RuntimeNative.USAP_POOL_SIZE_MAX,
+ USAP_POOL_SIZE_MAX_DEFAULT);
- if (!blastulaPoolSizeMaxPropString.isEmpty()) {
- mBlastulaPoolSizeMax =
+ if (!usapPoolSizeMaxPropString.isEmpty()) {
+ mUsapPoolSizeMax =
Integer.min(
- Integer.parseInt(blastulaPoolSizeMaxPropString),
- BLASTULA_POOL_SIZE_MAX_LIMIT);
+ Integer.parseInt(usapPoolSizeMaxPropString),
+ USAP_POOL_SIZE_MAX_LIMIT);
}
- final String blastulaPoolSizeMinPropString =
+ final String usapPoolSizeMinPropString =
Zygote.getSystemProperty(
- DeviceConfig.RuntimeNative.BLASTULA_POOL_SIZE_MIN,
- BLASTULA_POOL_SIZE_MIN_DEFAULT);
+ DeviceConfig.RuntimeNative.USAP_POOL_SIZE_MIN,
+ USAP_POOL_SIZE_MIN_DEFAULT);
- if (!blastulaPoolSizeMinPropString.isEmpty()) {
- mBlastulaPoolSizeMin =
+ if (!usapPoolSizeMinPropString.isEmpty()) {
+ mUsapPoolSizeMin =
Integer.max(
- Integer.parseInt(blastulaPoolSizeMinPropString),
- BLASTULA_POOL_SIZE_MIN_LIMIT);
+ Integer.parseInt(usapPoolSizeMinPropString),
+ USAP_POOL_SIZE_MIN_LIMIT);
}
- final String blastulaPoolRefillThresholdPropString =
+ final String usapPoolRefillThresholdPropString =
Zygote.getSystemProperty(
- DeviceConfig.RuntimeNative.BLASTULA_POOL_REFILL_THRESHOLD,
- Integer.toString(mBlastulaPoolSizeMax / 2));
+ DeviceConfig.RuntimeNative.USAP_POOL_REFILL_THRESHOLD,
+ Integer.toString(mUsapPoolSizeMax / 2));
- if (!blastulaPoolRefillThresholdPropString.isEmpty()) {
- mBlastulaPoolRefillThreshold =
+ if (!usapPoolRefillThresholdPropString.isEmpty()) {
+ mUsapPoolRefillThreshold =
Integer.min(
- Integer.parseInt(blastulaPoolRefillThresholdPropString),
- mBlastulaPoolSizeMax);
+ Integer.parseInt(usapPoolRefillThresholdPropString),
+ mUsapPoolSizeMax);
}
}
}
private long mLastPropCheckTimestamp = 0;
- private void fetchBlastulaPoolPolicyPropsWithMinInterval() {
+ private void fetchUsapPoolPolicyPropsWithMinInterval() {
final long currentTimestamp = SystemClock.elapsedRealtime();
if (currentTimestamp - mLastPropCheckTimestamp >= Zygote.PROPERTY_CHECK_INTERVAL) {
- fetchBlastulaPoolPolicyProps();
+ fetchUsapPoolPolicyProps();
mLastPropCheckTimestamp = currentTimestamp;
}
}
/**
- * Checks to see if the current policy says that pool should be refilled, and spawns new
- * blastulas if necessary.
+ * Checks to see if the current policy says that pool should be refilled, and spawns new USAPs
+ * if necessary.
*
* @param sessionSocketRawFDs Anonymous session sockets that are currently open
- * @return In the Zygote process this function will always return null; in blastula processes
- * this function will return a Runnable object representing the new application that is
- * passed up from blastulaMain.
+ * @return In the Zygote process this function will always return null; in unspecialized app
+ * processes this function will return a Runnable object representing the new
+ * application that is passed up from usapMain.
*/
- Runnable fillBlastulaPool(int[] sessionSocketRawFDs) {
- Trace.traceBegin(Trace.TRACE_TAG_ACTIVITY_MANAGER, "Zygote:FillBlastulaPool");
+ Runnable fillUsapPool(int[] sessionSocketRawFDs) {
+ Trace.traceBegin(Trace.TRACE_TAG_ACTIVITY_MANAGER, "Zygote:FillUsapPool");
- int blastulaPoolCount = Zygote.getBlastulaPoolCount();
- int numBlastulasToSpawn = mBlastulaPoolSizeMax - blastulaPoolCount;
+ int usapPoolCount = Zygote.getUsapPoolCount();
+ int numUsapsToSpawn = mUsapPoolSizeMax - usapPoolCount;
- if (blastulaPoolCount < mBlastulaPoolSizeMin
- || numBlastulasToSpawn >= mBlastulaPoolRefillThreshold) {
+ if (usapPoolCount < mUsapPoolSizeMin
+ || numUsapsToSpawn >= mUsapPoolRefillThreshold) {
// Disable some VM functionality and reset some system values
// before forking.
ZygoteHooks.preFork();
Zygote.resetNicePriority();
- while (blastulaPoolCount++ < mBlastulaPoolSizeMax) {
- Runnable caller = Zygote.forkBlastula(mBlastulaPoolSocket, sessionSocketRawFDs);
+ while (usapPoolCount++ < mUsapPoolSizeMax) {
+ Runnable caller = Zygote.forkUsap(mUsapPoolSocket, sessionSocketRawFDs);
if (caller != null) {
return caller;
}
}
- // Re-enable runtime services for the Zygote. Blastula services
- // are re-enabled in specializeBlastula.
+ // Re-enable runtime services for the Zygote. Services for unspecialized app process
+ // are re-enabled in specializeAppProcess.
ZygoteHooks.postForkCommon();
Log.i("zygote",
- "Filled the blastula pool. New blastulas: " + numBlastulasToSpawn);
+ "Filled the USAP pool. New USAPs: " + numUsapsToSpawn);
}
Trace.traceEnd(Trace.TRACE_TAG_ACTIVITY_MANAGER);
@@ -337,23 +337,23 @@ class ZygoteServer {
}
/**
- * Empty or fill the blastula pool as dictated by the current and new blastula pool statuses.
+ * Empty or fill the USAP pool as dictated by the current and new USAP pool statuses.
*/
- Runnable setBlastulaPoolStatus(boolean newStatus, LocalSocket sessionSocket) {
- if (!mBlastulaPoolSupported) {
+ Runnable setUsapPoolStatus(boolean newStatus, LocalSocket sessionSocket) {
+ if (!mUsapPoolSupported) {
Log.w(TAG,
- "Attempting to enable a blastula pool for a Zygote that doesn't support it.");
+ "Attempting to enable a USAP pool for a Zygote that doesn't support it.");
return null;
- } else if (mBlastulaPoolEnabled == newStatus) {
+ } else if (mUsapPoolEnabled == newStatus) {
return null;
}
- mBlastulaPoolEnabled = newStatus;
+ mUsapPoolEnabled = newStatus;
if (newStatus) {
- return fillBlastulaPool(new int[]{ sessionSocket.getFileDescriptor().getInt$() });
+ return fillUsapPool(new int[]{ sessionSocket.getFileDescriptor().getInt$() });
} else {
- Zygote.emptyBlastulaPool();
+ Zygote.emptyUsapPool();
return null;
}
}
@@ -371,25 +371,25 @@ class ZygoteServer {
peers.add(null);
while (true) {
- fetchBlastulaPoolPolicyPropsWithMinInterval();
+ fetchUsapPoolPolicyPropsWithMinInterval();
- int[] blastulaPipeFDs = null;
+ int[] usapPipeFDs = null;
StructPollfd[] pollFDs = null;
// Allocate enough space for the poll structs, taking into account
- // the state of the blastula pool for this Zygote (could be a
+ // the state of the USAP pool for this Zygote (could be a
// regular Zygote, a WebView Zygote, or an AppZygote).
- if (mBlastulaPoolEnabled) {
- blastulaPipeFDs = Zygote.getBlastulaPipeFDs();
- pollFDs = new StructPollfd[socketFDs.size() + 1 + blastulaPipeFDs.length];
+ if (mUsapPoolEnabled) {
+ usapPipeFDs = Zygote.getUsapPipeFDs();
+ pollFDs = new StructPollfd[socketFDs.size() + 1 + usapPipeFDs.length];
} else {
pollFDs = new StructPollfd[socketFDs.size()];
}
/*
- * For reasons of correctness the blastula pool pipe and event FDs
+ * For reasons of correctness the USAP pool pipe and event FDs
* must be processed before the session and server sockets. This
- * is to ensure that the blastula pool accounting information is
+ * is to ensure that the USAP pool accounting information is
* accurate when handling other requests like API blacklist
* exemptions.
*/
@@ -402,17 +402,17 @@ class ZygoteServer {
++pollIndex;
}
- final int blastulaPoolEventFDIndex = pollIndex;
+ final int usapPoolEventFDIndex = pollIndex;
- if (mBlastulaPoolEnabled) {
+ if (mUsapPoolEnabled) {
pollFDs[pollIndex] = new StructPollfd();
- pollFDs[pollIndex].fd = mBlastulaPoolEventFD;
+ pollFDs[pollIndex].fd = mUsapPoolEventFD;
pollFDs[pollIndex].events = (short) POLLIN;
++pollIndex;
- for (int blastulaPipeFD : blastulaPipeFDs) {
+ for (int usapPipeFD : usapPipeFDs) {
FileDescriptor managedFd = new FileDescriptor();
- managedFd.setInt$(blastulaPipeFD);
+ managedFd.setInt$(usapPipeFD);
pollFDs[pollIndex] = new StructPollfd();
pollFDs[pollIndex].fd = managedFd;
@@ -427,7 +427,7 @@ class ZygoteServer {
throw new RuntimeException("poll failed", ex);
}
- boolean blastulaPoolFDRead = false;
+ boolean usapPoolFDRead = false;
while (--pollIndex >= 0) {
if ((pollFDs[pollIndex].revents & POLLIN) == 0) {
@@ -441,7 +441,7 @@ class ZygoteServer {
peers.add(newPeer);
socketFDs.add(newPeer.getFileDescriptor());
- } else if (pollIndex < blastulaPoolEventFDIndex) {
+ } else if (pollIndex < usapPoolEventFDIndex) {
// Session socket accepted from the Zygote server socket
try {
@@ -502,56 +502,56 @@ class ZygoteServer {
mIsForkChild = false;
}
} else {
- // Either the blastula pool event FD or a blastula reporting pipe.
+ // Either the USAP pool event FD or a USAP reporting pipe.
- // If this is the event FD the payload will be the number of blastulas removed.
- // If this is a reporting pipe FD the payload will be the PID of the blastula
+ // If this is the event FD the payload will be the number of USAPs removed.
+ // If this is a reporting pipe FD the payload will be the PID of the USAP
// that was just specialized.
long messagePayload = -1;
try {
- byte[] buffer = new byte[Zygote.BLASTULA_MANAGEMENT_MESSAGE_BYTES];
+ byte[] buffer = new byte[Zygote.USAP_MANAGEMENT_MESSAGE_BYTES];
int readBytes = Os.read(pollFDs[pollIndex].fd, buffer, 0, buffer.length);
- if (readBytes == Zygote.BLASTULA_MANAGEMENT_MESSAGE_BYTES) {
+ if (readBytes == Zygote.USAP_MANAGEMENT_MESSAGE_BYTES) {
DataInputStream inputStream =
new DataInputStream(new ByteArrayInputStream(buffer));
messagePayload = inputStream.readLong();
} else {
- Log.e(TAG, "Incomplete read from blastula management FD of size "
+ Log.e(TAG, "Incomplete read from USAP management FD of size "
+ readBytes);
continue;
}
} catch (Exception ex) {
- if (pollIndex == blastulaPoolEventFDIndex) {
- Log.e(TAG, "Failed to read from blastula pool event FD: "
+ if (pollIndex == usapPoolEventFDIndex) {
+ Log.e(TAG, "Failed to read from USAP pool event FD: "
+ ex.getMessage());
} else {
- Log.e(TAG, "Failed to read from blastula reporting pipe: "
+ Log.e(TAG, "Failed to read from USAP reporting pipe: "
+ ex.getMessage());
}
continue;
}
- if (pollIndex > blastulaPoolEventFDIndex) {
- Zygote.removeBlastulaTableEntry((int) messagePayload);
+ if (pollIndex > usapPoolEventFDIndex) {
+ Zygote.removeUsapTableEntry((int) messagePayload);
}
- blastulaPoolFDRead = true;
+ usapPoolFDRead = true;
}
}
- // Check to see if the blastula pool needs to be refilled.
- if (blastulaPoolFDRead) {
+ // Check to see if the USAP pool needs to be refilled.
+ if (usapPoolFDRead) {
int[] sessionSocketRawFDs =
socketFDs.subList(1, socketFDs.size())
.stream()
.mapToInt(fd -> fd.getInt$())
.toArray();
- final Runnable command = fillBlastulaPool(sessionSocketRawFDs);
+ final Runnable command = fillUsapPool(sessionSocketRawFDs);
if (command != null) {
return command;
diff --git a/core/java/com/android/internal/policy/DecorView.java b/core/java/com/android/internal/policy/DecorView.java
index cdaf33f03528..c4626c2093e8 100644
--- a/core/java/com/android/internal/policy/DecorView.java
+++ b/core/java/com/android/internal/policy/DecorView.java
@@ -1639,6 +1639,9 @@ public class DecorView extends FrameLayout implements RootViewSurfaceTaker, Wind
@Override
public void onRootViewScrollYChanged(int rootScrollY) {
mRootScrollY = rootScrollY;
+ if (mDecorCaptionView != null) {
+ mDecorCaptionView.onRootViewScrollYChanged(rootScrollY);
+ }
updateColorViewTranslations();
}
diff --git a/core/java/com/android/internal/widget/DecorCaptionView.java b/core/java/com/android/internal/widget/DecorCaptionView.java
index e90a8d5826f2..19b68e5c467f 100644
--- a/core/java/com/android/internal/widget/DecorCaptionView.java
+++ b/core/java/com/android/internal/widget/DecorCaptionView.java
@@ -103,6 +103,7 @@ public class DecorCaptionView extends ViewGroup implements View.OnTouchListener,
private final Rect mCloseRect = new Rect();
private final Rect mMaximizeRect = new Rect();
private View mClickTarget;
+ private int mRootScrollY;
public DecorCaptionView(Context context) {
super(context);
@@ -154,10 +155,11 @@ public class DecorCaptionView extends ViewGroup implements View.OnTouchListener,
if (ev.getAction() == MotionEvent.ACTION_DOWN) {
final int x = (int) ev.getX();
final int y = (int) ev.getY();
- if (mMaximizeRect.contains(x, y)) {
+ // Only offset y for containment tests because the actual views are already translated.
+ if (mMaximizeRect.contains(x, y - mRootScrollY)) {
mClickTarget = mMaximize;
}
- if (mCloseRect.contains(x, y)) {
+ if (mCloseRect.contains(x, y - mRootScrollY)) {
mClickTarget = mClose;
}
}
@@ -417,4 +419,16 @@ public class DecorCaptionView extends ViewGroup implements View.OnTouchListener,
public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {
return false;
}
+
+ /**
+ * Called when {@link android.view.ViewRootImpl} scrolls for adjustPan.
+ */
+ public void onRootViewScrollYChanged(int scrollY) {
+ // Offset the caption opposite the root scroll. This keeps the caption at the
+ // top of the window during adjustPan.
+ if (mCaption != null) {
+ mRootScrollY = scrollY;
+ mCaption.setTranslationY(scrollY);
+ }
+ }
}
diff --git a/core/java/com/android/server/SystemConfig.java b/core/java/com/android/server/SystemConfig.java
index 3537465db682..958bb18192fb 100644
--- a/core/java/com/android/server/SystemConfig.java
+++ b/core/java/com/android/server/SystemConfig.java
@@ -206,6 +206,8 @@ public class SystemConfig {
// associate with any other apps, but does not limit what apps B can associate with.
final ArrayMap<String, ArraySet<String>> mAllowedAssociations = new ArrayMap<>();
+ private final ArraySet<String> mBugreportWhitelistedPackages = new ArraySet<>();
+
public static SystemConfig getInstance() {
synchronized (SystemConfig.class) {
if (sInstance == null) {
@@ -339,6 +341,10 @@ public class SystemConfig {
return mAllowedAssociations;
}
+ public ArraySet<String> getBugreportWhitelistedPackages() {
+ return mBugreportWhitelistedPackages;
+ }
+
SystemConfig() {
// Read configuration from system
readPermissions(Environment.buildPath(
@@ -924,6 +930,15 @@ public class SystemConfig {
}
XmlUtils.skipCurrentTag(parser);
} break;
+ case "bugreport-whitelisted": {
+ String pkgname = parser.getAttributeValue(null, "package");
+ if (pkgname == null) {
+ Slog.w(TAG, "<" + name + "> without package in " + permFile
+ + " at " + parser.getPositionDescription());
+ } else {
+ mBugreportWhitelistedPackages.add(pkgname);
+ }
+ } break;
default: {
Slog.w(TAG, "Tag " + name + " is unknown in "
+ permFile + " at " + parser.getPositionDescription());
diff --git a/core/jni/com_android_internal_os_Zygote.cpp b/core/jni/com_android_internal_os_Zygote.cpp
index 2ccb01adfd3e..c6f62ca5ae5b 100644
--- a/core/jni/com_android_internal_os_Zygote.cpp
+++ b/core/jni/com_android_internal_os_Zygote.cpp
@@ -138,32 +138,32 @@ static constexpr std::string_view ANDROID_SOCKET_PREFIX("ANDROID_SOCKET_");
static int gZygoteSocketFD = -1;
/**
- * The file descriptor for the Blastula pool socket opened by init.
+ * The file descriptor for the unspecialized app process (USAP) pool socket opened by init.
*/
-static int gBlastulaPoolSocketFD = -1;
+static int gUsapPoolSocketFD = -1;
/**
- * The number of Blastulas currently in this Zygote's pool.
+ * The number of USAPs currently in this Zygote's pool.
*/
-static std::atomic_uint32_t gBlastulaPoolCount = 0;
+static std::atomic_uint32_t gUsapPoolCount = 0;
/**
- * Event file descriptor used to communicate reaped blastulas to the
+ * Event file descriptor used to communicate reaped USAPs to the
* ZygoteServer.
*/
-static int gBlastulaPoolEventFD = -1;
+static int gUsapPoolEventFD = -1;
/**
- * The maximum value that the gBlastulaPoolSizeMax variable may take. This value
- * is a mirror of ZygoteServer.BLASTULA_POOL_SIZE_MAX_LIMIT
+ * The maximum value that the gUSAPPoolSizeMax variable may take. This value
+ * is a mirror of ZygoteServer.USAP_POOL_SIZE_MAX_LIMIT
*/
-static constexpr int BLASTULA_POOL_SIZE_MAX_LIMIT = 100;
+static constexpr int USAP_POOL_SIZE_MAX_LIMIT = 100;
/**
- * A helper class containing accounting information for Blastulas.
+ * A helper class containing accounting information for USAPs.
*/
-class BlastulaTableEntry {
+class UsapTableEntry {
public:
struct EntryStorage {
int32_t pid;
@@ -181,7 +181,7 @@ class BlastulaTableEntry {
static_assert(decltype(mStorage)::is_always_lock_free);
public:
- constexpr BlastulaTableEntry() : mStorage(INVALID_ENTRY_VALUE) {}
+ constexpr UsapTableEntry() : mStorage(INVALID_ENTRY_VALUE) {}
/**
* If the provided PID matches the one stored in this entry, the entry will
@@ -246,7 +246,7 @@ class BlastulaTableEntry {
* Sets the entry to the given values if it is currently invalid.
*
* @param pid The process ID for the new entry.
- * @param read_pipe_fd The read end of the blastula control pipe for this
+ * @param read_pipe_fd The read end of the USAP control pipe for this
* process.
* @return True if the entry was set; false otherwise.
*/
@@ -263,14 +263,14 @@ class BlastulaTableEntry {
};
/**
- * A table containing information about the Blastulas currently in the pool.
+ * A table containing information about the USAPs currently in the pool.
*
* Multiple threads may be attempting to modify the table, either from the
* signal handler or from the ZygoteServer poll loop. Atomic loads/stores in
- * the BlastulaTableEntry class prevent data races during these concurrent
+ * the USAPTableEntry class prevent data races during these concurrent
* operations.
*/
-static std::array<BlastulaTableEntry, BLASTULA_POOL_SIZE_MAX_LIMIT> gBlastulaTable;
+static std::array<UsapTableEntry, USAP_POOL_SIZE_MAX_LIMIT> gUsapTable;
/**
* The list of open zygote file descriptors.
@@ -295,7 +295,7 @@ enum RuntimeFlags : uint32_t {
};
// Forward declaration so we don't have to move the signal handler.
-static bool RemoveBlastulaTableEntry(pid_t blastula_pid);
+static bool RemoveUsapTableEntry(pid_t usap_pid);
static void RuntimeAbort(JNIEnv* env, int line, const char* msg) {
std::ostringstream oss;
@@ -307,7 +307,7 @@ static void RuntimeAbort(JNIEnv* env, int line, const char* msg) {
static void SigChldHandler(int /*signal_number*/) {
pid_t pid;
int status;
- int64_t blastulas_removed = 0;
+ int64_t usaps_removed = 0;
// It's necessary to save and restore the errno during this function.
// Since errno is stored per thread, changing it here modifies the errno
@@ -338,9 +338,9 @@ static void SigChldHandler(int /*signal_number*/) {
kill(getpid(), SIGKILL);
}
- // Check to see if the PID is in the blastula pool and remove it if it is.
- if (RemoveBlastulaTableEntry(pid)) {
- ++blastulas_removed;
+ // Check to see if the PID is in the USAP pool and remove it if it is.
+ if (RemoveUsapTableEntry(pid)) {
+ ++usaps_removed;
}
}
@@ -351,12 +351,12 @@ static void SigChldHandler(int /*signal_number*/) {
"Zygote SIGCHLD error in waitpid: %s", strerror(errno));
}
- if (blastulas_removed > 0) {
- if (write(gBlastulaPoolEventFD, &blastulas_removed, sizeof(blastulas_removed)) == -1) {
+ if (usaps_removed > 0) {
+ if (write(gUsapPoolEventFD, &usaps_removed, sizeof(usaps_removed)) == -1) {
// If this write fails something went terribly wrong. We will now kill
// the zygote and let the system bring it back up.
async_safe_format_log(ANDROID_LOG_ERROR, LOG_TAG,
- "Zygote failed to write to blastula pool event FD: %s",
+ "Zygote failed to write to USAP pool event FD: %s",
strerror(errno));
kill(getpid(), SIGKILL);
}
@@ -1181,12 +1181,12 @@ static void UnblockSignal(int signum, fail_fn_t fail_fn) {
}
}
-static void ClearBlastulaTable() {
- for (BlastulaTableEntry& entry : gBlastulaTable) {
+static void ClearUsapTable() {
+ for (UsapTableEntry& entry : gUsapTable) {
entry.Clear();
}
- gBlastulaPoolCount = 0;
+ gUsapPoolCount = 0;
}
// Utility routine to fork a process from the zygote.
@@ -1231,8 +1231,8 @@ static pid_t ForkCommon(JNIEnv* env, bool is_system_server,
// Clean up any descriptors which must be closed immediately
DetachDescriptors(env, fds_to_close, fail_fn);
- // Invalidate the entries in the blastula table.
- ClearBlastulaTable();
+ // Invalidate the entries in the USAP table.
+ ClearUsapTable();
// Re-open all remaining open file descriptors so that they aren't shared
// with the zygote across a fork.
@@ -1525,47 +1525,47 @@ static jlong CalculateCapabilities(JNIEnv* env, jint uid, jint gid, jintArray gi
}
/**
- * Adds the given information about a newly created blastula to the Zygote's
- * blastula table.
+ * Adds the given information about a newly created unspecialized app
+ * processes to the Zygote's USAP table.
*
- * @param blastula_pid Process ID of the newly created blastula
- * @param read_pipe_fd File descriptor for the read end of the blastula
- * reporting pipe. Used in the ZygoteServer poll loop to track blastula
+ * @param usap_pid Process ID of the newly created USAP
+ * @param read_pipe_fd File descriptor for the read end of the USAP
+ * reporting pipe. Used in the ZygoteServer poll loop to track USAP
* specialization.
*/
-static void AddBlastulaTableEntry(pid_t blastula_pid, int read_pipe_fd) {
- static int sBlastulaTableInsertIndex = 0;
+static void AddUsapTableEntry(pid_t usap_pid, int read_pipe_fd) {
+ static int sUsapTableInsertIndex = 0;
- int search_index = sBlastulaTableInsertIndex;
+ int search_index = sUsapTableInsertIndex;
do {
- if (gBlastulaTable[search_index].SetIfInvalid(blastula_pid, read_pipe_fd)) {
+ if (gUsapTable[search_index].SetIfInvalid(usap_pid, read_pipe_fd)) {
// Start our next search right after where we finished this one.
- sBlastulaTableInsertIndex = (search_index + 1) % gBlastulaTable.size();
+ sUsapTableInsertIndex = (search_index + 1) % gUsapTable.size();
return;
}
- search_index = (search_index + 1) % gBlastulaTable.size();
- } while (search_index != sBlastulaTableInsertIndex);
+ search_index = (search_index + 1) % gUsapTable.size();
+ } while (search_index != sUsapTableInsertIndex);
// Much like money in the banana stand, there should always be an entry
- // in the blastula table.
+ // in the USAP table.
__builtin_unreachable();
}
/**
- * Invalidates the entry in the BlastulaTable corresponding to the provided
- * process ID if it is present. If an entry was removed the blastula pool
+ * Invalidates the entry in the USAPTable corresponding to the provided
+ * process ID if it is present. If an entry was removed the USAP pool
* count is decremented.
*
- * @param blastula_pid Process ID of the blastula entry to invalidate
+ * @param usap_pid Process ID of the USAP entry to invalidate
* @return True if an entry was invalidated; false otherwise
*/
-static bool RemoveBlastulaTableEntry(pid_t blastula_pid) {
- for (BlastulaTableEntry& entry : gBlastulaTable) {
- if (entry.ClearForPID(blastula_pid)) {
- --gBlastulaPoolCount;
+static bool RemoveUsapTableEntry(pid_t usap_pid) {
+ for (UsapTableEntry& entry : gUsapTable) {
+ if (entry.ClearForPID(usap_pid)) {
+ --gUsapPoolCount;
return true;
}
}
@@ -1574,13 +1574,13 @@ static bool RemoveBlastulaTableEntry(pid_t blastula_pid) {
}
/**
- * @return A vector of the read pipe FDs for each of the active blastulas.
+ * @return A vector of the read pipe FDs for each of the active USAPs.
*/
-std::vector<int> MakeBlastulaPipeReadFDVector() {
+std::vector<int> MakeUsapPipeReadFDVector() {
std::vector<int> fd_vec;
- fd_vec.reserve(gBlastulaTable.size());
+ fd_vec.reserve(gUsapTable.size());
- for (BlastulaTableEntry& entry : gBlastulaTable) {
+ for (UsapTableEntry& entry : gUsapTable) {
auto entry_values = entry.GetValues();
if (entry_values.has_value()) {
@@ -1624,16 +1624,16 @@ static jint com_android_internal_os_Zygote_nativeForkAndSpecialize(
ExtractJIntArray(env, "zygote", nice_name, managed_fds_to_ignore)
.value_or(std::vector<int>());
- std::vector<int> blastula_pipes = MakeBlastulaPipeReadFDVector();
+ std::vector<int> usap_pipes = MakeUsapPipeReadFDVector();
- fds_to_close.insert(fds_to_close.end(), blastula_pipes.begin(), blastula_pipes.end());
- fds_to_ignore.insert(fds_to_ignore.end(), blastula_pipes.begin(), blastula_pipes.end());
+ fds_to_close.insert(fds_to_close.end(), usap_pipes.begin(), usap_pipes.end());
+ fds_to_ignore.insert(fds_to_ignore.end(), usap_pipes.begin(), usap_pipes.end());
- fds_to_close.push_back(gBlastulaPoolSocketFD);
+ fds_to_close.push_back(gUsapPoolSocketFD);
- if (gBlastulaPoolEventFD != -1) {
- fds_to_close.push_back(gBlastulaPoolEventFD);
- fds_to_ignore.push_back(gBlastulaPoolEventFD);
+ if (gUsapPoolEventFD != -1) {
+ fds_to_close.push_back(gUsapPoolEventFD);
+ fds_to_ignore.push_back(gUsapPoolEventFD);
}
pid_t pid = ForkCommon(env, false, fds_to_close, fds_to_ignore);
@@ -1652,14 +1652,14 @@ static jint com_android_internal_os_Zygote_nativeForkSystemServer(
JNIEnv* env, jclass, uid_t uid, gid_t gid, jintArray gids,
jint runtime_flags, jobjectArray rlimits, jlong permitted_capabilities,
jlong effective_capabilities) {
- std::vector<int> fds_to_close(MakeBlastulaPipeReadFDVector()),
+ std::vector<int> fds_to_close(MakeUsapPipeReadFDVector()),
fds_to_ignore(fds_to_close);
- fds_to_close.push_back(gBlastulaPoolSocketFD);
+ fds_to_close.push_back(gUsapPoolSocketFD);
- if (gBlastulaPoolEventFD != -1) {
- fds_to_close.push_back(gBlastulaPoolEventFD);
- fds_to_ignore.push_back(gBlastulaPoolEventFD);
+ if (gUsapPoolEventFD != -1) {
+ fds_to_close.push_back(gUsapPoolEventFD);
+ fds_to_ignore.push_back(gUsapPoolEventFD);
}
pid_t pid = ForkCommon(env, true,
@@ -1696,49 +1696,52 @@ static jint com_android_internal_os_Zygote_nativeForkSystemServer(
}
/**
- * A JNI function that forks a blastula from the Zygote while ensuring proper
- * file descriptor hygiene.
+ * A JNI function that forks an unspecialized app process from the Zygote while
+ * ensuring proper file descriptor hygiene.
*
* @param env Managed runtime environment
- * @param read_pipe_fd The read FD for the blastula reporting pipe. Manually closed by blastlas
+ * @param read_pipe_fd The read FD for the USAP reporting pipe. Manually closed by blastlas
* in managed code.
- * @param write_pipe_fd The write FD for the blastula reporting pipe. Manually closed by the
+ * @param write_pipe_fd The write FD for the USAP reporting pipe. Manually closed by the
* zygote in managed code.
* @param managed_session_socket_fds A list of anonymous session sockets that must be ignored by
- * the FD hygiene code and automatically "closed" in the new blastula.
+ * the FD hygiene code and automatically "closed" in the new USAP.
* @return
*/
-static jint com_android_internal_os_Zygote_nativeForkBlastula(JNIEnv* env, jclass,
- jint read_pipe_fd, jint write_pipe_fd, jintArray managed_session_socket_fds) {
- std::vector<int> fds_to_close(MakeBlastulaPipeReadFDVector()),
+static jint com_android_internal_os_Zygote_nativeForkUsap(JNIEnv* env,
+ jclass,
+ jint read_pipe_fd,
+ jint write_pipe_fd,
+ jintArray managed_session_socket_fds) {
+ std::vector<int> fds_to_close(MakeUsapPipeReadFDVector()),
fds_to_ignore(fds_to_close);
std::vector<int> session_socket_fds =
- ExtractJIntArray(env, "blastula", nullptr, managed_session_socket_fds)
+ ExtractJIntArray(env, "USAP", nullptr, managed_session_socket_fds)
.value_or(std::vector<int>());
- // The Blastula Pool Event FD is created during the initialization of the
- // blastula pool and should always be valid here.
+ // The USAP Pool Event FD is created during the initialization of the
+ // USAP pool and should always be valid here.
fds_to_close.push_back(gZygoteSocketFD);
- fds_to_close.push_back(gBlastulaPoolEventFD);
+ fds_to_close.push_back(gUsapPoolEventFD);
fds_to_close.insert(fds_to_close.end(), session_socket_fds.begin(), session_socket_fds.end());
fds_to_ignore.push_back(gZygoteSocketFD);
- fds_to_ignore.push_back(gBlastulaPoolSocketFD);
- fds_to_ignore.push_back(gBlastulaPoolEventFD);
+ fds_to_ignore.push_back(gUsapPoolSocketFD);
+ fds_to_ignore.push_back(gUsapPoolEventFD);
fds_to_ignore.push_back(read_pipe_fd);
fds_to_ignore.push_back(write_pipe_fd);
fds_to_ignore.insert(fds_to_ignore.end(), session_socket_fds.begin(), session_socket_fds.end());
- pid_t blastula_pid = ForkCommon(env, /* is_system_server= */ false, fds_to_close, fds_to_ignore);
+ pid_t usap_pid = ForkCommon(env, /* is_system_server= */ false, fds_to_close, fds_to_ignore);
- if (blastula_pid != 0) {
- ++gBlastulaPoolCount;
- AddBlastulaTableEntry(blastula_pid, read_pipe_fd);
+ if (usap_pid != 0) {
+ ++gUsapPoolCount;
+ AddUsapTableEntry(usap_pid, read_pipe_fd);
}
- return blastula_pid;
+ return usap_pid;
}
static void com_android_internal_os_Zygote_nativeAllowFileAcrossFork(
@@ -1803,7 +1806,8 @@ static void com_android_internal_os_Zygote_nativeInstallSeccompUidGidFilter(
}
/**
- * Called from a blastula to specialize the process for a specific application.
+ * Called from an unspecialized app process to specialize the process for a
+ * given application.
*
* @param env Managed runtime environment
* @param uid User ID of the new application
@@ -1818,7 +1822,7 @@ static void com_android_internal_os_Zygote_nativeInstallSeccompUidGidFilter(
* @param instruction_set The instruction set expected/requested by the new application
* @param app_data_dir Path to the application's data directory
*/
-static void com_android_internal_os_Zygote_nativeSpecializeBlastula(
+static void com_android_internal_os_Zygote_nativeSpecializeAppProcess(
JNIEnv* env, jclass, jint uid, jint gid, jintArray gids,
jint runtime_flags, jobjectArray rlimits,
jint mount_external, jstring se_info, jstring nice_name,
@@ -1855,77 +1859,77 @@ static void com_android_internal_os_Zygote_nativeGetSocketFDs(JNIEnv* env, jclas
ALOGE("Unable to fetch Zygote socket file descriptor");
}
- env_var_name = android_socket_prefix + (is_primary ? "blastula_pool" : "blastula_pool_secondary");
+ env_var_name = android_socket_prefix + (is_primary ? "usap_pool_primary" : "usap_pool_secondary");
env_var_val = getenv(env_var_name.c_str());
if (env_var_val != nullptr) {
- gBlastulaPoolSocketFD = atoi(env_var_val);
- ALOGV("Zygote:blastulaPoolSocketFD = %d", gBlastulaPoolSocketFD);
+ gUsapPoolSocketFD = atoi(env_var_val);
+ ALOGV("Zygote:usapPoolSocketFD = %d", gUsapPoolSocketFD);
} else {
- ALOGE("Unable to fetch Blastula pool socket file descriptor");
+ ALOGE("Unable to fetch USAP pool socket file descriptor");
}
}
/**
* @param env Managed runtime environment
- * @return A managed array of raw file descriptors for the read ends of the blastula reporting
+ * @return A managed array of raw file descriptors for the read ends of the USAP reporting
* pipes.
*/
-static jintArray com_android_internal_os_Zygote_nativeGetBlastulaPipeFDs(JNIEnv* env, jclass) {
- std::vector<int> blastula_fds = MakeBlastulaPipeReadFDVector();
+static jintArray com_android_internal_os_Zygote_nativeGetUsapPipeFDs(JNIEnv* env, jclass) {
+ std::vector<int> usap_fds = MakeUsapPipeReadFDVector();
- jintArray managed_blastula_fds = env->NewIntArray(blastula_fds.size());
- env->SetIntArrayRegion(managed_blastula_fds, 0, blastula_fds.size(), blastula_fds.data());
+ jintArray managed_usap_fds = env->NewIntArray(usap_fds.size());
+ env->SetIntArrayRegion(managed_usap_fds, 0, usap_fds.size(), usap_fds.data());
- return managed_blastula_fds;
+ return managed_usap_fds;
}
/**
- * A JNI wrapper around RemoveBlastulaTableEntry.
+ * A JNI wrapper around RemoveUsapTableEntry.
*
* @param env Managed runtime environment
- * @param blastula_pid Process ID of the blastula entry to invalidate
+ * @param usap_pid Process ID of the USAP entry to invalidate
* @return True if an entry was invalidated; false otherwise.
*/
-static jboolean com_android_internal_os_Zygote_nativeRemoveBlastulaTableEntry(JNIEnv* env, jclass,
- jint blastula_pid) {
- return RemoveBlastulaTableEntry(blastula_pid);
+static jboolean com_android_internal_os_Zygote_nativeRemoveUsapTableEntry(JNIEnv* env, jclass,
+ jint usap_pid) {
+ return RemoveUsapTableEntry(usap_pid);
}
/**
- * Creates the blastula pool event FD if it doesn't exist and returns it. This is used by the
- * ZygoteServer poll loop to know when to re-fill the blastula pool.
+ * Creates the USAP pool event FD if it doesn't exist and returns it. This is used by the
+ * ZygoteServer poll loop to know when to re-fill the USAP pool.
*
* @param env Managed runtime environment
* @return A raw event file descriptor used to communicate (from the signal handler) when the
- * Zygote receives a SIGCHLD for a blastula
+ * Zygote receives a SIGCHLD for a USAP
*/
-static jint com_android_internal_os_Zygote_nativeGetBlastulaPoolEventFD(JNIEnv* env, jclass) {
- if (gBlastulaPoolEventFD == -1) {
- if ((gBlastulaPoolEventFD = eventfd(0, 0)) == -1) {
+static jint com_android_internal_os_Zygote_nativeGetUsapPoolEventFD(JNIEnv* env, jclass) {
+ if (gUsapPoolEventFD == -1) {
+ if ((gUsapPoolEventFD = eventfd(0, 0)) == -1) {
ZygoteFailure(env, "zygote", nullptr, StringPrintf("Unable to create eventfd: %s", strerror(errno)));
}
}
- return gBlastulaPoolEventFD;
+ return gUsapPoolEventFD;
}
/**
* @param env Managed runtime environment
- * @return The number of blastulas currently in the blastula pool
+ * @return The number of USAPs currently in the USAP pool
*/
-static jint com_android_internal_os_Zygote_nativeGetBlastulaPoolCount(JNIEnv* env, jclass) {
- return gBlastulaPoolCount;
+static jint com_android_internal_os_Zygote_nativeGetUsapPoolCount(JNIEnv* env, jclass) {
+ return gUsapPoolCount;
}
/**
- * Kills all processes currently in the blastula pool.
+ * Kills all processes currently in the USAP pool and closes their read pipe
+ * FDs.
*
* @param env Managed runtime environment
- * @return The number of blastulas currently in the blastula pool
*/
-static void com_android_internal_os_Zygote_nativeEmptyBlastulaPool(JNIEnv* env, jclass) {
- for (auto& entry : gBlastulaTable) {
+static void com_android_internal_os_Zygote_nativeEmptyUsapPool(JNIEnv* env, jclass) {
+ for (auto& entry : gUsapTable) {
auto entry_storage = entry.GetValues();
if (entry_storage.has_value()) {
@@ -1934,7 +1938,7 @@ static void com_android_internal_os_Zygote_nativeEmptyBlastulaPool(JNIEnv* env,
// Avoid a second atomic load by invalidating instead of clearing.
entry.Invalidate();
- --gBlastulaPoolCount;
+ --gUsapPoolCount;
}
}
}
@@ -1955,23 +1959,23 @@ static const JNINativeMethod gMethods[] = {
(void *) com_android_internal_os_Zygote_nativePreApplicationInit },
{ "nativeInstallSeccompUidGidFilter", "(II)V",
(void *) com_android_internal_os_Zygote_nativeInstallSeccompUidGidFilter },
- { "nativeForkBlastula", "(II[I)I",
- (void *) com_android_internal_os_Zygote_nativeForkBlastula },
- { "nativeSpecializeBlastula",
+ { "nativeForkUsap", "(II[I)I",
+ (void *) com_android_internal_os_Zygote_nativeForkUsap },
+ { "nativeSpecializeAppProcess",
"(II[II[[IILjava/lang/String;Ljava/lang/String;ZLjava/lang/String;Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)V",
- (void *) com_android_internal_os_Zygote_nativeSpecializeBlastula },
+ (void *) com_android_internal_os_Zygote_nativeSpecializeAppProcess },
{ "nativeGetSocketFDs", "(Z)V",
(void *) com_android_internal_os_Zygote_nativeGetSocketFDs },
- { "nativeGetBlastulaPipeFDs", "()[I",
- (void *) com_android_internal_os_Zygote_nativeGetBlastulaPipeFDs },
- { "nativeRemoveBlastulaTableEntry", "(I)Z",
- (void *) com_android_internal_os_Zygote_nativeRemoveBlastulaTableEntry },
- { "nativeGetBlastulaPoolEventFD", "()I",
- (void *) com_android_internal_os_Zygote_nativeGetBlastulaPoolEventFD },
- { "nativeGetBlastulaPoolCount", "()I",
- (void *) com_android_internal_os_Zygote_nativeGetBlastulaPoolCount },
- { "nativeEmptyBlastulaPool", "()V",
- (void *) com_android_internal_os_Zygote_nativeEmptyBlastulaPool }
+ { "nativeGetUsapPipeFDs", "()[I",
+ (void *) com_android_internal_os_Zygote_nativeGetUsapPipeFDs },
+ { "nativeRemoveUsapTableEntry", "(I)Z",
+ (void *) com_android_internal_os_Zygote_nativeRemoveUsapTableEntry },
+ { "nativeGetUsapPoolEventFD", "()I",
+ (void *) com_android_internal_os_Zygote_nativeGetUsapPoolEventFD },
+ { "nativeGetUsapPoolCount", "()I",
+ (void *) com_android_internal_os_Zygote_nativeGetUsapPoolCount },
+ { "nativeEmptyUsapPool", "()V",
+ (void *) com_android_internal_os_Zygote_nativeEmptyUsapPool }
};
int register_com_android_internal_os_Zygote(JNIEnv* env) {
diff --git a/core/jni/fd_utils.cpp b/core/jni/fd_utils.cpp
index 4b37f13cbb33..d8d46560876d 100644
--- a/core/jni/fd_utils.cpp
+++ b/core/jni/fd_utils.cpp
@@ -38,8 +38,8 @@ static const char* kPathWhitelist[] = {
"/dev/null",
"/dev/socket/zygote",
"/dev/socket/zygote_secondary",
- "/dev/socket/blastula_pool",
- "/dev/socket/blastula_pool_secondary",
+ "/dev/socket/usap_pool_primary",
+ "/dev/socket/usap_pool_secondary",
"/dev/socket/webview_zygote",
"/dev/socket/heapprofd",
"/sys/kernel/debug/tracing/trace_marker",
@@ -215,7 +215,7 @@ FileDescriptorInfo* FileDescriptorInfo::CreateFromFd(int fd, fail_fn_t fail_fn)
// S_ISDIR : Not supported. (We could if we wanted to, but it's unused).
// S_ISLINK : Not supported.
// S_ISBLK : Not supported.
- // S_ISFIFO : Not supported. Note that the Zygote and blastulas use pipes to
+ // S_ISFIFO : Not supported. Note that the Zygote and USAPs use pipes to
// communicate with the child processes across forks but those should have been
// added to the redirection exemption list.
if (!S_ISCHR(f_stat.st_mode) && !S_ISREG(f_stat.st_mode)) {
diff --git a/core/jni/runtime_native_boot-flags-test.sh b/core/jni/runtime_native_boot-flags-test.sh
index a5d7a5a9ca61..cdfeffcc7bbb 100755
--- a/core/jni/runtime_native_boot-flags-test.sh
+++ b/core/jni/runtime_native_boot-flags-test.sh
@@ -139,35 +139,33 @@ function find_zygote_runtime_option {
adb logcat -d -s "$zygote" | grep -q -e "option\[[0-9]\+\]=$runtime_option"
}
-# check_zygote_gc_runtime_option CONTEXT VALUE
-# --------------------------------------------
-# Check that all zygote processes are passed device configuration flag VALUE as
-# GC runtime option. Use CONTEXT in logging.
-function check_zygote_gc_runtime_option {
+# check_zygote_runtime_option CONTEXT RUNTIME_OPTION
+# --------------------------------------------------
+# Check that all zygote processes are passed RUNTIME_OPTION as runtime option. Use
+# CONTEXT in logging.
+function check_zygote_runtime_option {
local context=$1
- local value=$2
+ local runtime_option=$2
say \
- "[$context] Check that all zygote processes are passed the flag value as a GC runtime option..."
- local runtime_option="-Xgc:$value"
+ "[$context] Check that all zygote processes are passed \`$runtime_option\` as runtime option..."
for zygote in $zygotes; do
- find_zygote_runtime_option "$zygote" "$runtime_option"\
+ find_zygote_runtime_option "$zygote" "$runtime_option" \
|| fail "Found no \`$runtime_option\` among runtime options passed to \`$zygote\`"
done
}
-# check_no_zygote_gc_runtime_option CONTEXT VALUE
-# -----------------------------------------------
-# Check that no zygote process is passed device configuration flag VALUE as GC
-# runtime option. Use CONTEXT in logging.
-function check_no_zygote_gc_runtime_option {
+# check_no_zygote_runtime_option CONTEXT RUNTIME_OPTION
+# -----------------------------------------------------
+# Check that no zygote process is passed RUNTIME_OPTION as runtime option. Use
+# CONTEXT in logging.
+function check_no_zygote_runtime_option {
local context=$1
- local value=$2
+ local runtime_option=$2
- say "[$context] Check no zygote process is passed the flag value as a GC runtime option..."
- local runtime_option="-Xgc:$value"
+ say "[$context] Check that no zygote process is passed \`$runtime_option\` as runtime option..."
for zygote in $zygotes; do
- find_zygote_runtime_option "$zygote" "$runtime_option"\
+ find_zygote_runtime_option "$zygote" "$runtime_option" \
&& fail "Found \`$runtime_option\` among runtime options passed to \`$zygote\`"
done
}
@@ -270,17 +268,17 @@ esac
# ==========================================
function check_nogenerational_cc {
- check_zygote_gc_runtime_option "$1" nogenerational_cc
+ check_zygote_runtime_option "$1" "-Xgc:nogenerational_cc"
}
function check_no_nogenerational_cc {
- check_no_zygote_gc_runtime_option "$1" nogenerational_cc
+ check_no_zygote_runtime_option "$1" "-Xgc:nogenerational_cc"
}
function check_generational_cc {
- check_zygote_gc_runtime_option "$1" generational_cc
+ check_zygote_runtime_option "$1" "-Xgc:generational_cc"
}
function check_no_generational_cc {
- check_no_zygote_gc_runtime_option "$1" generational_cc
+ check_no_zygote_runtime_option "$1" "-Xgc:generational_cc"
}
test_android_runtime_flag \
@@ -299,11 +297,14 @@ function check_no_default_boot_image {
check_no_android_runtime_message "$1" "$default_boot_image_message"
}
-apex_boot_image_message="Using Apex boot image: '-Ximage:/system/framework/apex.art'"
+apex_boot_image_option="-Ximage:/system/framework/apex.art"
+apex_boot_image_message="Using Apex boot image: '$apex_boot_image_option'"
function check_apex_boot_image {
+ check_zygote_runtime_option "$1" "$apex_boot_image_option"
check_android_runtime_message "$1" "$apex_boot_image_message"
}
function check_no_apex_boot_image {
+ check_no_zygote_runtime_option "$1" "$apex_boot_image_option"
check_no_android_runtime_message "$1" "$apex_boot_image_message"
}
diff --git a/core/res/res/color-car/car_borderless_button_text_color.xml b/core/res/res/color-car/car_borderless_button_text_color.xml
new file mode 100644
index 000000000000..1cdd6cd901af
--- /dev/null
+++ b/core/res/res/color-car/car_borderless_button_text_color.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2019 The Android Open Source Project
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+<!-- Default text colors for car buttons when enabled/disabled. -->
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:color="@*android:color/car_grey_700" android:state_enabled="false"/>
+ <item android:color="?android:attr/colorButtonNormal"/>
+</selector>
diff --git a/core/res/res/color-car/car_button_text_color.xml b/core/res/res/color-car/car_button_text_color.xml
new file mode 100644
index 000000000000..eda54d9abbb2
--- /dev/null
+++ b/core/res/res/color-car/car_button_text_color.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2019 The Android Open Source Project
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+<!-- Default text colors for car buttons when enabled/disabled. -->
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:color="@*android:color/car_grey_700" android:state_enabled="false"/>
+ <item android:color="@*android:color/car_action1"/>
+</selector>
diff --git a/core/res/res/color-car/car_switch.xml b/core/res/res/color-car/car_switch.xml
new file mode 100644
index 000000000000..ebf3841ca9d2
--- /dev/null
+++ b/core/res/res/color-car/car_switch.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright 2019 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item
+ android:color="?attr/colorControlActivated"
+ android:state_checked="true"/>
+ <item
+ android:color="?attr/colorSwitchThumbNormal"/>
+</selector>
diff --git a/core/res/res/drawable-car/car_button_background.xml b/core/res/res/drawable-car/car_button_background.xml
new file mode 100644
index 000000000000..3e2610c5047b
--- /dev/null
+++ b/core/res/res/drawable-car/car_button_background.xml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2019 The Android Open Source Project
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+<!-- Default background styles for car buttons when enabled/disabled. -->
+<ripple
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:color="?android:attr/colorControlHighlight">
+ <item>
+ <selector>
+ <item android:state_enabled="false">
+ <shape android:shape="rectangle">
+ <corners android:radius="@*android:dimen/car_button_radius"/>
+ <solid android:color="@*android:color/car_grey_300"/>
+ </shape>
+ </item>
+ <item>
+ <shape android:shape="rectangle">
+ <corners android:radius="@*android:dimen/car_button_radius"/>
+ <solid android:color="?android:attr/colorButtonNormal"/>
+ </shape>
+ </item>
+ </selector>
+ </item>
+</ripple>
diff --git a/core/res/res/drawable-car/car_checkbox.xml b/core/res/res/drawable-car/car_checkbox.xml
new file mode 100644
index 000000000000..651e6786c460
--- /dev/null
+++ b/core/res/res/drawable-car/car_checkbox.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright 2019 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
+ <item
+ android:width="@*android:dimen/car_primary_icon_size"
+ android:height="@*android:dimen/car_primary_icon_size"
+ android:drawable="@drawable/btn_check_material_anim"/>
+</layer-list>
diff --git a/core/res/res/drawable-car/car_dialog_button_background.xml b/core/res/res/drawable-car/car_dialog_button_background.xml
new file mode 100644
index 000000000000..dc742d57b147
--- /dev/null
+++ b/core/res/res/drawable-car/car_dialog_button_background.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2019 The Android Open Source Project
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+<ripple xmlns:android="http://schemas.android.com/apk/res/android"
+ android:color="@*android:color/car_card_ripple_background">
+ <item android:id="@android:id/mask">
+ <color android:color="@*android:color/car_white_1000" />
+ </item>
+</ripple>
diff --git a/core/res/res/drawable-car/car_seekbar_thumb.xml b/core/res/res/drawable-car/car_seekbar_thumb.xml
new file mode 100644
index 000000000000..fe9c7732bdcc
--- /dev/null
+++ b/core/res/res/drawable-car/car_seekbar_thumb.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2019 The Android Open Source Project
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+<shape
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:shape="oval">
+ <solid android:color="@*android:color/car_accent" />
+ <size
+ android:width="@*android:dimen/car_seekbar_thumb_size"
+ android:height="@*android:dimen/car_seekbar_thumb_size" />
+</shape>
diff --git a/core/res/res/drawable-car/car_seekbar_thumb_dark.xml b/core/res/res/drawable-car/car_seekbar_thumb_dark.xml
new file mode 100644
index 000000000000..8ac9975816a6
--- /dev/null
+++ b/core/res/res/drawable-car/car_seekbar_thumb_dark.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2019 The Android Open Source Project
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+<shape
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:shape="oval">
+ <solid android:color="@*android:color/car_accent_dark" />
+ <size
+ android:width="@*android:dimen/car_seekbar_thumb_size"
+ android:height="@*android:dimen/car_seekbar_thumb_size" />
+</shape>
diff --git a/core/res/res/drawable-car/car_seekbar_thumb_light.xml b/core/res/res/drawable-car/car_seekbar_thumb_light.xml
new file mode 100644
index 000000000000..b212b766b9f0
--- /dev/null
+++ b/core/res/res/drawable-car/car_seekbar_thumb_light.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2019 The Android Open Source Project
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+<shape
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:shape="oval">
+ <solid android:color="@*android:color/car_accent_light" />
+ <size
+ android:width="@*android:dimen/car_seekbar_thumb_size"
+ android:height="@*android:dimen/car_seekbar_thumb_size" />
+</shape>
diff --git a/core/res/res/drawable-car/car_seekbar_track.xml b/core/res/res/drawable-car/car_seekbar_track.xml
new file mode 100644
index 000000000000..5ea7b2257fe6
--- /dev/null
+++ b/core/res/res/drawable-car/car_seekbar_track.xml
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2019 The Android Open Source Project
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:id="@android:id/background">
+ <shape android:shape="line">
+ <stroke
+ android:width="@*android:dimen/car_seekbar_height"
+ android:color="@*android:color/car_seekbar_track_background" />
+ </shape>
+ </item>
+ <item android:id="@android:id/secondaryProgress">
+ <clip>
+ <shape android:shape="line">
+ <stroke
+ android:width="@*android:dimen/car_seekbar_height"
+ android:color="@*android:color/car_seekbar_track_secondary_progress" />
+ </shape>
+ </clip>
+ </item>
+ <item android:id="@android:id/progress">
+ <clip>
+ <shape android:shape="line">
+ <stroke
+ android:width="@*android:dimen/car_seekbar_height"
+ android:color="@*android:color/car_accent" />
+ </shape>
+ </clip>
+ </item>
+</layer-list>
diff --git a/core/res/res/drawable-car/car_seekbar_track_dark.xml b/core/res/res/drawable-car/car_seekbar_track_dark.xml
new file mode 100644
index 000000000000..19f6340521cd
--- /dev/null
+++ b/core/res/res/drawable-car/car_seekbar_track_dark.xml
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2019 The Android Open Source Project
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+<!-- Drawable of seekbar track. Uses dark color for track. -->
+<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:id="@android:id/background">
+ <shape android:shape="line">
+ <stroke
+ android:width="@*android:dimen/car_seekbar_height"
+ android:color="@*android:color/car_seekbar_track_background_dark" />
+ </shape>
+ </item>
+ <item android:id="@android:id/secondaryProgress">
+ <clip>
+ <shape android:shape="line">
+ <stroke
+ android:width="@*android:dimen/car_seekbar_height"
+ android:color="@*android:color/car_seekbar_track_secondary_progress" />
+ </shape>
+ </clip>
+ </item>
+ <item android:id="@android:id/progress">
+ <clip>
+ <shape android:shape="line">
+ <stroke
+ android:width="@*android:dimen/car_seekbar_height"
+ android:color="@*android:color/car_accent_light" />
+ </shape>
+ </clip>
+ </item>
+</layer-list>
diff --git a/core/res/res/drawable-car/car_seekbar_track_light.xml b/core/res/res/drawable-car/car_seekbar_track_light.xml
new file mode 100644
index 000000000000..d23ca33e04c3
--- /dev/null
+++ b/core/res/res/drawable-car/car_seekbar_track_light.xml
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2019 The Android Open Source Project
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+<!-- Drawable of seekbar track. Uses light color for track. -->
+<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:id="@android:id/background">
+ <shape android:shape="line">
+ <stroke
+ android:width="@*android:dimen/car_seekbar_height"
+ android:color="@*android:color/car_seekbar_track_background_light" />
+ </shape>
+ </item>
+ <item android:id="@android:id/secondaryProgress">
+ <clip>
+ <shape android:shape="line">
+ <stroke
+ android:width="@*android:dimen/car_seekbar_height"
+ android:color="@*android:color/car_seekbar_track_secondary_progress" />
+ </shape>
+ </clip>
+ </item>
+ <item android:id="@android:id/progress">
+ <clip>
+ <shape android:shape="line">
+ <stroke
+ android:width="@*android:dimen/car_seekbar_height"
+ android:color="@*android:color/car_accent_dark" />
+ </shape>
+ </clip>
+ </item>
+</layer-list>
diff --git a/core/res/res/drawable-car/car_switch_thumb.xml b/core/res/res/drawable-car/car_switch_thumb.xml
new file mode 100644
index 000000000000..03efc189aa95
--- /dev/null
+++ b/core/res/res/drawable-car/car_switch_thumb.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright 2019 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<shape
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:shape="oval">
+ <solid android:color="@color/car_switch"/>
+ <size
+ android:width="@dimen/car_seekbar_thumb_size"
+ android:height="@dimen/car_seekbar_thumb_size"/>
+</shape>
diff --git a/core/res/res/drawable-nodpi/stat_sys_adb.xml b/core/res/res/drawable-nodpi/stat_sys_adb.xml
index 6839e39a87d6..08e9fada2f12 100644
--- a/core/res/res/drawable-nodpi/stat_sys_adb.xml
+++ b/core/res/res/drawable-nodpi/stat_sys_adb.xml
@@ -1,11 +1,11 @@
<!--
Copyright (C) 2019 The Android Open Source Project
- Licensed under the Apache License, Version 2 (the "License");
+ 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
+ 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,
@@ -16,19 +16,15 @@ Copyright (C) 2019 The Android Open Source Project
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
- android:viewportWidth="24"
- android:viewportHeight="24">
+ android:viewportWidth="24.0"
+ android:viewportHeight="24.0">
<path
- android:pathData="M12,12m-7,0a7,7,0,1,1,14,0a7,7,0,1,1,-14,0"
- android:strokeColor="#FF0000"
- android:strokeWidth="4"/>
+ android:fillColor="#FF000000"
+ android:pathData="M16.28,16.19A6,6 0,1 0,6 12c0,0.1 0,0.19 0,0.29L9.2,9.11Z"/>
<path
- android:pathData="M19,19 L12,12"
- android:strokeLineCap="round"
- android:strokeColor="#FF0000"
- android:strokeWidth="4"
- android:strokeAlpha=".5"/>
+ android:fillColor="#FF000000"
+ android:pathData="M16,19.48a8.57,8.57 0,1 1,2 -1.52l1.77,1.77a11.07,11.07 0,1 0,-2 1.57Z"/>
<path
- android:pathData="M12,12m-2,0a2,2,0,1,1,4,0a2,2,0,1,1,-4,0"
- android:fillColor="#FF0000"/>
+ android:fillColor="#FF000000"
+ android:pathData="M12,18a5.77,5.77 0,0 0,2 -0.34l0.19,-0.07 -0.87,-0.87L9.2,12.64 6.82,15A6,6 0,0 0,12 18Z"/>
</vector>
diff --git a/core/res/res/layout-car/car_preference.xml b/core/res/res/layout-car/car_preference.xml
new file mode 100644
index 000000000000..939c3fbc521d
--- /dev/null
+++ b/core/res/res/layout-car/car_preference.xml
@@ -0,0 +1,72 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright 2019 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<RelativeLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:background="?android:attr/selectableItemBackground"
+ android:focusable="true"
+ android:minHeight="?android:attr/listPreferredItemHeightSmall"
+ android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
+ android:paddingStart="?android:attr/listPreferredItemPaddingStart">
+
+ <com.android.internal.widget.PreferenceImageView
+ android:id="@id/icon"
+ android:layout_width="@*android:dimen/car_primary_icon_size"
+ android:layout_height="@*android:dimen/car_primary_icon_size"
+ android:layout_alignParentStart="true"
+ android:layout_centerVertical="true"
+ android:layout_marginBottom="@*android:dimen/car_padding_2"
+ android:layout_marginEnd="?android:attr/listPreferredItemPaddingEnd"
+ android:layout_marginTop="@android:dimen/car_padding_2"/>
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_centerVertical="true"
+ android:layout_marginBottom="@*android:dimen/car_padding_2"
+ android:layout_marginTop="@*android:dimen/car_padding_2"
+ android:layout_toEndOf="@id/icon"
+ android:layout_toStartOf="@id/widget_frame"
+ android:orientation="vertical">
+
+ <TextView
+ android:id="@id/title"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:ellipsize="end"
+ android:singleLine="true"
+ android:textAppearance="?android:attr/textAppearanceListItem"/>
+
+ <TextView
+ android:id="@id/summary"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textAppearance="?android:attr/textAppearanceListItemSecondary"/>
+
+ </LinearLayout>
+
+ <!-- Preference should place its actual preference widget here. -->
+ <FrameLayout
+ android:id="@id/widget_frame"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignParentEnd="true"
+ android:layout_centerVertical="true"/>
+
+</RelativeLayout>
diff --git a/core/res/res/layout-car/car_preference_category.xml b/core/res/res/layout-car/car_preference_category.xml
new file mode 100644
index 000000000000..d1f73421e185
--- /dev/null
+++ b/core/res/res/layout-car/car_preference_category.xml
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright 2019 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<LinearLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:background="?android:attr/selectableItemBackground"
+ android:focusable="true"
+ android:gravity="center_vertical"
+ android:minHeight="@*android:dimen/car_card_header_height"
+ android:orientation="horizontal"
+ android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
+ android:paddingStart="?android:attr/listPreferredItemPaddingStart">
+
+ <com.android.internal.widget.PreferenceImageView
+ android:id="@id/icon"
+ android:layout_width="@*android:dimen/car_primary_icon_size"
+ android:layout_height="@*android:dimen/car_primary_icon_size"
+ android:layout_gravity="center_vertical"
+ android:layout_marginBottom="@dimen/car_padding_2"
+ android:layout_marginEnd="?android:attr/listPreferredItemPaddingEnd"
+ android:layout_marginTop="@*android:dimen/car_padding_2"/>
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginBottom="@*android:dimen/car_padding_2"
+ android:layout_marginTop="@*android:dimen/car_padding_2"
+ android:orientation="vertical">
+
+ <TextView
+ android:id="@id/title"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:fontFamily="sans-serif-medium"
+ android:textAlignment="viewStart"
+ android:textAppearance="?android:attr/textAppearanceSmall"
+ android:textColor="?android:attr/colorAccent"/>
+
+ <TextView
+ android:id="@id/summary"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:ellipsize="end"
+ android:singleLine="true"
+ android:textColor="?android:attr/textColorSecondary"/>
+
+ </LinearLayout>
+
+</LinearLayout>
diff --git a/core/res/res/layout-car/car_resolver_different_item_header.xml b/core/res/res/layout-car/car_resolver_different_item_header.xml
new file mode 100644
index 000000000000..222ecc689792
--- /dev/null
+++ b/core/res/res/layout-car/car_resolver_different_item_header.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+ * Copyright 2019, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+-->
+<TextView
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_alwaysShow="true"
+ android:text="@*android:string/use_a_different_app"
+ android:minHeight="56dp"
+ android:textAppearance="?android:attr/textAppearanceLarge"
+ android:gravity="start|center_vertical"
+ android:paddingStart="16dp"
+ android:paddingEnd="16dp"
+ android:paddingTop="8dp"
+ android:paddingBottom="8dp"
+ android:elevation="8dp"
+/> \ No newline at end of file
diff --git a/core/res/res/layout-car/car_resolver_list.xml b/core/res/res/layout-car/car_resolver_list.xml
new file mode 100644
index 000000000000..15a864505d3f
--- /dev/null
+++ b/core/res/res/layout-car/car_resolver_list.xml
@@ -0,0 +1,112 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+* Copyright 2019, The Android Open Source Project
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+-->
+<com.android.internal.widget.ResolverDrawerLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:id="@id/contentPanel">
+
+ <LinearLayout
+ android:id="@+id/button_bar"
+ android:visibility="gone"
+ style="?attr/buttonBarStyle"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_ignoreOffset="true"
+ android:layout_alwaysShow="true"
+ android:layout_hasNestedScrollIndicator="true"
+ android:background="?attr/colorBackgroundFloating"
+ android:orientation="horizontal"
+ android:paddingTop="8dp"
+ android:paddingBottom="8dp"
+ android:paddingStart="12dp"
+ android:weightSum="5"
+ android:paddingEnd="12dp"
+ android:elevation="8dp">
+
+ <TextView
+ android:id="@+id/profile_button"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginEnd="8dp"
+ android:paddingStart="8dp"
+ android:paddingEnd="8dp"
+ android:textSize="40sp"
+ android:layout_weight="5"
+ android:layout_gravity = "left"
+ android:visibility="gone"
+ android:textColor="?attr/colorAccent"
+ android:singleLine="true"/>
+
+ <TextView
+ android:id="@+id/title"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:minHeight="56dp"
+ android:layout_gravity = "left"
+ android:layout_weight="3"
+ android:paddingTop="8dp"
+ android:layout_below="@id/profile_button"
+ android:paddingBottom="8dp"/>
+
+ <Button
+ android:id="@+id/button_once"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:enabled="false"
+ android:layout_gravity = "right"
+ android:text="@string/activity_resolver_use_once"
+ android:layout_weight="1"
+ android:onClick="onButtonClick"/>
+
+ <Button
+ android:id="@+id/button_always"
+ android:layout_marginLeft="10dp"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:enabled="false"
+ android:layout_gravity = "right"
+ android:text="@string/activity_resolver_use_always"
+ android:layout_weight="1"
+ android:onClick="onButtonClick"/>
+ </LinearLayout>
+
+ <ListView
+ android:layout_width="match_parent"
+ android:layout_height="500dp"
+ android:id="@+id/resolver_list"
+ android:clipToPadding="false"
+ android:scrollbarStyle="outsideOverlay"
+ android:background="?attr/colorBackgroundFloating"
+ android:elevation="8dp"
+ android:nestedScrollingEnabled="true"
+ android:scrollIndicators="top|bottom"/>
+
+ <TextView android:id="@+id/empty"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:background="?attr/colorBackgroundFloating"
+ android:elevation="8dp"
+ android:layout_alwaysShow="true"
+ android:text="@string/noApplications"
+ android:padding="32dp"
+ android:gravity="center"
+ android:visibility="gone"/>
+
+</com.android.internal.widget.ResolverDrawerLayout>
diff --git a/core/res/res/layout-car/car_resolver_list_with_default.xml b/core/res/res/layout-car/car_resolver_list_with_default.xml
new file mode 100644
index 000000000000..2aed00bea14e
--- /dev/null
+++ b/core/res/res/layout-car/car_resolver_list_with_default.xml
@@ -0,0 +1,161 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+* Copyright 2019, The Android Open Source Project
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+-->
+<com.android.internal.widget.ResolverDrawerLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:maxCollapsedHeight="200dp"
+ android:id="@id/contentPanel">
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:weightSum="5"
+ android:layout_alwaysShow="true"
+ android:orientation="vertical"
+ android:background="?attr/colorBackgroundFloating"
+ android:elevation="8dp">
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_weight="0.5"
+ android:orientation="horizontal">
+
+ <ImageView
+ android:id="@+id/icon"
+ android:layout_width="24dp"
+ android:layout_height="24dp"
+ android:layout_gravity="start|top"
+ android:layout_marginStart="16dp"
+ android:layout_marginEnd="16dp"
+ android:layout_marginTop="20dp"
+ android:src="@drawable/resolver_icon_placeholder"
+ android:scaleType="fitCenter"/>
+
+ <TextView
+ android:id="@+id/title"
+ android:layout_width="0dp"
+ android:layout_weight="1"
+ android:layout_height="?attr/listPreferredItemHeight"
+ android:layout_marginStart="16dp"
+ android:textAppearance="?attr/textAppearanceMedium"
+ android:gravity="start|center_vertical"
+ android:paddingEnd="16dp"/>
+
+ <LinearLayout
+ android:id="@+id/profile_button"
+ android:layout_width="wrap_content"
+ android:layout_height="48dp"
+ android:layout_marginTop="4dp"
+ android:layout_marginEnd="4dp"
+ android:paddingStart="8dp"
+ android:paddingEnd="8dp"
+ android:paddingTop="4dp"
+ android:paddingBottom="4dp"
+ android:focusable="true"
+ android:visibility="gone"
+ style="?attr/borderlessButtonStyle">
+
+ <ImageView
+ android:id="@+id/icon"
+ android:layout_width="24dp"
+ android:layout_height="24dp"
+ android:layout_gravity="start|center_vertical"
+ android:layout_marginEnd="?attr/listPreferredItemPaddingEnd"
+ android:layout_marginTop="12dp"
+ android:layout_marginBottom="12dp"
+ android:scaleType="fitCenter"/>
+
+ <TextView
+ android:id="@id/text1"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="start|center_vertical"
+ android:layout_marginEnd="?attr/listPreferredItemPaddingEnd"
+ android:textAppearance="?attr/textAppearanceButton"
+ android:textColor="?attr/textColorPrimary"
+ android:minLines="1"
+ android:maxLines="1"
+ android:ellipsize="marquee"/>
+ </LinearLayout>
+ </LinearLayout>
+
+ <LinearLayout
+ android:id="@+id/button_bar"
+ android:visibility="gone"
+ style="?attr/buttonBarStyle"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_alwaysShow="true"
+ android:gravity="end|center_vertical"
+ android:layout_weight="0.5"
+ android:orientation="horizontal"
+ android:layoutDirection="locale"
+ android:measureWithLargestChild="true"
+ android:paddingTop="8dp"
+ android:paddingBottom="8dp"
+ android:paddingStart="12dp"
+ android:paddingEnd="12dp"
+ android:elevation="8dp">
+
+ <Button
+ android:id="@+id/button_once"
+ android:layout_width="wrap_content"
+ android:layout_gravity="start"
+ android:maxLines="2"
+ style="?attr/buttonBarNegativeButtonStyle"
+ android:minHeight="@dimen/alert_dialog_button_bar_height"
+ android:layout_height="wrap_content"
+ android:enabled="false"
+ android:text="@string/activity_resolver_use_once"
+ android:onClick="onButtonClick"/>
+
+ <Button
+ android:id="@+id/button_always"
+ android:layout_width="wrap_content"
+ android:layout_gravity="end"
+ android:maxLines="2"
+ android:minHeight="@dimen/alert_dialog_button_bar_height"
+ style="?attr/buttonBarPositiveButtonStyle"
+ android:layout_height="wrap_content"
+ android:enabled="false"
+ android:text="@string/activity_resolver_use_always"
+ android:onClick="onButtonClick"/>
+ </LinearLayout>
+
+ <View
+ android:layout_width="match_parent"
+ android:layout_height="1dp"
+ android:background="?attr/dividerVertical"/>
+
+ <ListView
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:id="@+id/resolver_list"
+ android:layout_weight="4"
+ android:clipToPadding="false"
+ android:scrollbarStyle="outsideOverlay"
+ android:background="?attr/colorBackgroundFloating"
+ android:elevation="8dp"
+ android:nestedScrollingEnabled="true"
+ android:divider="@null"/>
+ </LinearLayout>
+
+</com.android.internal.widget.ResolverDrawerLayout>
diff --git a/location/java/android/location/ILocationManager.aidl b/location/java/android/location/ILocationManager.aidl
index bb75c77f7e64..c371c5fa0448 100644
--- a/location/java/android/location/ILocationManager.aidl
+++ b/location/java/android/location/ILocationManager.aidl
@@ -103,6 +103,7 @@ interface ILocationManager
void removeTestProvider(String provider, String opPackageName);
void setTestProviderLocation(String provider, in Location loc, String opPackageName);
void setTestProviderEnabled(String provider, boolean enabled, String opPackageName);
+ List<LocationRequest> getTestProviderCurrentRequests(String provider, String opPackageName);
// --- deprecated ---
void setTestProviderStatus(String provider, int status, in Bundle extras, long updateTime,
diff --git a/location/java/android/location/Location.java b/location/java/android/location/Location.java
index 17e25097cef8..ed74333da895 100644
--- a/location/java/android/location/Location.java
+++ b/location/java/android/location/Location.java
@@ -113,6 +113,10 @@ public class Location implements Parcelable {
* Bit mask for mFieldsMask indicating the presence of mBearingAccuracy.
*/
private static final int HAS_BEARING_ACCURACY_MASK = 128;
+ /**
+ * Bit mask for mFieldsMask indicating the presence of mElapsedRealtimeUncertaintyNanos.
+ */
+ private static final int HAS_ELAPSED_REALTIME_UNCERTAINTY_MASK = 256;
// Cached data to make bearing/distance computations more efficient for the case
// where distanceTo and bearingTo are called in sequence. Assume this typically happens
@@ -130,6 +134,9 @@ public class Location implements Parcelable {
private long mTime = 0;
@UnsupportedAppUsage
private long mElapsedRealtimeNanos = 0;
+ // Estimate of the relative precision of the alignment of this SystemClock
+ // timestamp, with the reported measurements in nanoseconds (68% confidence).
+ private long mElapsedRealtimeUncertaintyNanos = 0;
private double mLatitude = 0.0;
private double mLongitude = 0.0;
private double mAltitude = 0.0f;
@@ -171,6 +178,7 @@ public class Location implements Parcelable {
mProvider = l.mProvider;
mTime = l.mTime;
mElapsedRealtimeNanos = l.mElapsedRealtimeNanos;
+ mElapsedRealtimeUncertaintyNanos = l.mElapsedRealtimeUncertaintyNanos;
mFieldsMask = l.mFieldsMask;
mLatitude = l.mLatitude;
mLongitude = l.mLongitude;
@@ -191,6 +199,7 @@ public class Location implements Parcelable {
mProvider = null;
mTime = 0;
mElapsedRealtimeNanos = 0;
+ mElapsedRealtimeUncertaintyNanos = 0;
mFieldsMask = 0;
mLatitude = 0;
mLongitude = 0;
@@ -586,6 +595,37 @@ public class Location implements Parcelable {
}
/**
+ * Get estimate of the relative precision of the alignment of the
+ * ElapsedRealtimeNanos timestamp, with the reported measurements in
+ * nanoseconds (68% confidence).
+ *
+ * @return uncertainty of elapsed real-time of fix, in nanoseconds.
+ */
+ public long getElapsedRealtimeUncertaintyNanos() {
+ return mElapsedRealtimeUncertaintyNanos;
+ }
+
+ /**
+ * Set estimate of the relative precision of the alignment of the
+ * ElapsedRealtimeNanos timestamp, with the reported measurements in
+ * nanoseconds (68% confidence).
+ *
+ * @param time uncertainty of the elapsed real-time of fix, in nanoseconds.
+ */
+ public void setElapsedRealtimeUncertaintyNanos(long time) {
+ mElapsedRealtimeUncertaintyNanos = time;
+ mFieldsMask |= HAS_ELAPSED_REALTIME_UNCERTAINTY_MASK;
+ }
+
+ /**
+ * True if this location has a elapsed realtime accuracy.
+ */
+ public boolean hasElapsedRealtimeUncertaintyNanos() {
+ return (mFieldsMask & HAS_ELAPSED_REALTIME_UNCERTAINTY_MASK) != 0;
+ }
+
+
+ /**
* Get the latitude, in degrees.
*
* <p>All locations generated by the {@link LocationManager}
@@ -1062,6 +1102,10 @@ public class Location implements Parcelable {
s.append(" et=");
TimeUtils.formatDuration(mElapsedRealtimeNanos / 1000000L, s);
}
+ if (hasElapsedRealtimeUncertaintyNanos()) {
+ s.append(" etAcc=");
+ TimeUtils.formatDuration(mElapsedRealtimeUncertaintyNanos / 1000000L, s);
+ }
if (hasAltitude()) s.append(" alt=").append(mAltitude);
if (hasSpeed()) s.append(" vel=").append(mSpeed);
if (hasBearing()) s.append(" bear=").append(mBearing);
@@ -1092,6 +1136,7 @@ public class Location implements Parcelable {
Location l = new Location(provider);
l.mTime = in.readLong();
l.mElapsedRealtimeNanos = in.readLong();
+ l.mElapsedRealtimeUncertaintyNanos = in.readLong();
l.mFieldsMask = in.readByte();
l.mLatitude = in.readDouble();
l.mLongitude = in.readDouble();
@@ -1122,6 +1167,7 @@ public class Location implements Parcelable {
parcel.writeString(mProvider);
parcel.writeLong(mTime);
parcel.writeLong(mElapsedRealtimeNanos);
+ parcel.writeLong(mElapsedRealtimeUncertaintyNanos);
parcel.writeByte(mFieldsMask);
parcel.writeDouble(mLatitude);
parcel.writeDouble(mLongitude);
diff --git a/location/java/android/location/LocationManager.java b/location/java/android/location/LocationManager.java
index 586ee2a43683..6828c597fe9a 100644
--- a/location/java/android/location/LocationManager.java
+++ b/location/java/android/location/LocationManager.java
@@ -1626,6 +1626,23 @@ public class LocationManager {
setTestProviderStatus(provider, LocationProvider.AVAILABLE, null, 0L);
}
+ /**
+ * Get the last list of {@link LocationRequest}s sent to the provider.
+ *
+ * @hide
+ */
+ @TestApi
+ @NonNull
+ public List<LocationRequest> getTestProviderCurrentRequests(String providerName) {
+ checkProvider(providerName);
+ try {
+ return mService.getTestProviderCurrentRequests(providerName,
+ mContext.getOpPackageName());
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
+ }
+
// --- GPS-specific support ---
// This class is used to send Gnss status events to the client's specific thread.
diff --git a/location/java/android/location/LocationRequest.java b/location/java/android/location/LocationRequest.java
index 99b2dee0d3a7..6fd063eb62f0 100644
--- a/location/java/android/location/LocationRequest.java
+++ b/location/java/android/location/LocationRequest.java
@@ -270,7 +270,7 @@ public final class LocationRequest implements Parcelable {
* Set the quality of the request.
*
* <p>Use with a accuracy constant such as {@link #ACCURACY_FINE}, or a power
- * constant such as {@link #POWER_LOW}. You cannot request both and accuracy and
+ * constant such as {@link #POWER_LOW}. You cannot request both accuracy and
* power, only one or the other can be specified. The system will then
* maximize accuracy or minimize power as appropriate.
*
@@ -384,10 +384,8 @@ public final class LocationRequest implements Parcelable {
*
* @param locationSettingsIgnored Whether to ignore location settings
* @return the same object, so that setters can be chained
- * @hide
*/
@RequiresPermission(Manifest.permission.WRITE_SECURE_SETTINGS)
- @SystemApi
public LocationRequest setLocationSettingsIgnored(boolean locationSettingsIgnored) {
mLocationSettingsIgnored = locationSettingsIgnored;
return this;
@@ -395,10 +393,7 @@ public final class LocationRequest implements Parcelable {
/**
* Returns true if location settings will be ignored in order to satisfy this request.
- *
- * @hide
*/
- @SystemApi
public boolean isLocationSettingsIgnored() {
return mLocationSettingsIgnored;
}
@@ -558,9 +553,6 @@ public final class LocationRequest implements Parcelable {
}
}
-
- /** @hide */
- @SystemApi
public LocationRequest setProvider(String provider) {
checkProvider(provider);
mProvider = provider;
diff --git a/location/java/com/android/internal/location/ProviderRequest.java b/location/java/com/android/internal/location/ProviderRequest.java
index af8123ac52f4..155f788cb33e 100644
--- a/location/java/com/android/internal/location/ProviderRequest.java
+++ b/location/java/com/android/internal/location/ProviderRequest.java
@@ -56,7 +56,7 @@ public final class ProviderRequest implements Parcelable {
* low power fast interval request.
*/
@UnsupportedAppUsage
- public List<LocationRequest> locationRequests = new ArrayList<LocationRequest>();
+ public final List<LocationRequest> locationRequests = new ArrayList<>();
@UnsupportedAppUsage
public ProviderRequest() {
diff --git a/packages/BackupRestoreConfirmation/res/values-de/strings.xml b/packages/BackupRestoreConfirmation/res/values-de/strings.xml
index fbfe78b5135b..1913578b58e5 100644
--- a/packages/BackupRestoreConfirmation/res/values-de/strings.xml
+++ b/packages/BackupRestoreConfirmation/res/values-de/strings.xml
@@ -21,7 +21,7 @@
<string name="backup_confirm_text" msgid="1878021282758896593">"Es wurde eine vollständige Sicherung sämtlicher Daten auf einen verbundenen Computer angefordert. Möchtest du dies zulassen?\n\nWenn du die Sicherung nicht selbst angefordert hast, solltest du dem Vorgang nicht zustimmen."</string>
<string name="allow_backup_button_label" msgid="4217228747769644068">"Meine Daten sichern"</string>
<string name="deny_backup_button_label" msgid="6009119115581097708">"Nicht sichern"</string>
- <string name="restore_confirm_text" msgid="7499866728030461776">"Es wurde eine vollständige Wiederherstellung aller Daten von einem verbundenen Desktop-Computer angefordert. Möchtest du dies zulassen?\n\nWenn du die Wiederherstellung nicht selbst angefordert hast, solltest du dem Vorgang nicht zustimmen. Dadurch werden alle derzeit auf dem Gerät befindlichen Daten ersetzt!"</string>
+ <string name="restore_confirm_text" msgid="7499866728030461776">"Es wurde eine vollständige Wiederherstellung aller Daten von einem verbundenen Computer angefordert. Möchtest du dies zulassen?\n\nWenn du die Wiederherstellung nicht selbst angefordert hast, solltest du dem Vorgang nicht zustimmen. Dadurch werden alle derzeit auf dem Gerät befindlichen Daten ersetzt!"</string>
<string name="allow_restore_button_label" msgid="3081286752277127827">"Meine Daten wiederherstellen"</string>
<string name="deny_restore_button_label" msgid="1724367334453104378">"Nicht wiederherstellen"</string>
<string name="current_password_text" msgid="8268189555578298067">"Gib dein aktuelles Sicherungspasswort unten ein:"</string>
diff --git a/packages/SettingsLib/res/values-de/strings.xml b/packages/SettingsLib/res/values-de/strings.xml
index c1d502e30717..bb420a6c4d12 100644
--- a/packages/SettingsLib/res/values-de/strings.xml
+++ b/packages/SettingsLib/res/values-de/strings.xml
@@ -209,7 +209,7 @@
<string name="oem_unlock_enable" msgid="6040763321967327691">"OEM-Entsperrung"</string>
<string name="oem_unlock_enable_summary" msgid="4720281828891618376">"Bootloader-Entsperrung zulassen"</string>
<string name="confirm_enable_oem_unlock_title" msgid="4802157344812385674">"OEM-Entsperrung zulassen?"</string>
- <string name="confirm_enable_oem_unlock_text" msgid="5517144575601647022">"Achtung: Die Geräteschutzfunktionen funktionieren auf diesem Gerät nicht, solange diese Einstellung aktiviert ist."</string>
+ <string name="confirm_enable_oem_unlock_text" msgid="5517144575601647022">"Achtung: Der Geräteschutz funktioniert auf diesem Gerät nicht, solange diese Einstellung aktiviert ist."</string>
<string name="mock_location_app" msgid="7966220972812881854">"App für simulierte Standorte auswählen"</string>
<string name="mock_location_app_not_set" msgid="809543285495344223">"Keine App für simulierte Standorte eingerichtet"</string>
<string name="mock_location_app_set" msgid="8966420655295102685">"App für simulierte Standorte: <xliff:g id="APP_NAME">%1$s</xliff:g>"</string>
diff --git a/packages/SettingsLib/res/values-es/strings.xml b/packages/SettingsLib/res/values-es/strings.xml
index 293eff121b2a..f336f1b465cd 100644
--- a/packages/SettingsLib/res/values-es/strings.xml
+++ b/packages/SettingsLib/res/values-es/strings.xml
@@ -379,9 +379,9 @@
<string name="power_discharging_duration_enhanced" msgid="1992003260664804080">"Tiempo restante aproximado según tu uso: <xliff:g id="TIME_REMAINING">%1$s</xliff:g> (<xliff:g id="LEVEL">%2$s</xliff:g>)"</string>
<string name="power_remaining_duration_only_short" msgid="3463575350656389957">"Tiempo restante: <xliff:g id="TIME_REMAINING">%1$s</xliff:g>"</string>
<string name="power_discharge_by_enhanced" msgid="2095821536747992464">"Debería durar aproximadamente hasta <xliff:g id="TIME">%1$s</xliff:g> según el uso (<xliff:g id="LEVEL">%2$s</xliff:g>)"</string>
- <string name="power_discharge_by_only_enhanced" msgid="2175151772952365149">"Debería durar aproximadamente hasta <xliff:g id="TIME">%1$s</xliff:g> según el uso"</string>
+ <string name="power_discharge_by_only_enhanced" msgid="2175151772952365149">"Duración aproximada hasta: <xliff:g id="TIME">%1$s</xliff:g> (según el uso)"</string>
<string name="power_discharge_by" msgid="6453537733650125582">"Debería durar aproximadamente hasta <xliff:g id="TIME">%1$s</xliff:g> (<xliff:g id="LEVEL">%2$s</xliff:g>)"</string>
- <string name="power_discharge_by_only" msgid="107616694963545745">"Debería durar aproximadamente hasta <xliff:g id="TIME">%1$s</xliff:g>"</string>
+ <string name="power_discharge_by_only" msgid="107616694963545745">"Duración aproximada hasta: <xliff:g id="TIME">%1$s</xliff:g>"</string>
<string name="power_discharge_by_only_short" msgid="1372817269546888804">"Hasta: <xliff:g id="TIME">%1$s</xliff:g>"</string>
<string name="power_remaining_less_than_duration_only" msgid="5996752448813295329">"Tiempo restante: menos de <xliff:g id="THRESHOLD">%1$s</xliff:g>"</string>
<string name="power_remaining_less_than_duration" msgid="5751885147712659423">"Queda menos del <xliff:g id="THRESHOLD">%1$s</xliff:g> (<xliff:g id="LEVEL">%2$s</xliff:g>)"</string>
diff --git a/packages/SettingsLib/res/values-hy/strings.xml b/packages/SettingsLib/res/values-hy/strings.xml
index 736b4c3d88c9..ba62c84407a9 100644
--- a/packages/SettingsLib/res/values-hy/strings.xml
+++ b/packages/SettingsLib/res/values-hy/strings.xml
@@ -234,7 +234,7 @@
<string name="bluetooth_select_a2dp_codec_ldac_playback_quality_dialog_title" msgid="6893955536658137179">"Գործարկել Bluetooth աուդիո LDAC կոդեկը\nԸնտրություն՝ նվագարկման որակ"</string>
<string name="bluetooth_select_a2dp_codec_streaming_label" msgid="5347862512596240506">"Հեռարձակում՝ <xliff:g id="STREAMING_PARAMETER">%1$s</xliff:g>"</string>
<string name="select_private_dns_configuration_title" msgid="3700456559305263922">"Մասնավոր DNS սերվեր"</string>
- <string name="select_private_dns_configuration_dialog_title" msgid="9221994415765826811">"Ընտրեք անհատական DNS սերվերի ռեժիմը"</string>
+ <string name="select_private_dns_configuration_dialog_title" msgid="9221994415765826811">"Ընտրեք մասնավոր DNS-ի ռեժիմը"</string>
<string name="private_dns_mode_off" msgid="8236575187318721684">"Անջատված է"</string>
<string name="private_dns_mode_opportunistic" msgid="8314986739896927399">"Ավտոմատ"</string>
<string name="private_dns_mode_provider" msgid="8354935160639360804">"Մասնավոր DNS ծառայության մատակարարի խնամորդի անունը"</string>
diff --git a/packages/SystemUI/Android.bp b/packages/SystemUI/Android.bp
index c2495b586144..94259416d274 100644
--- a/packages/SystemUI/Android.bp
+++ b/packages/SystemUI/Android.bp
@@ -58,6 +58,7 @@ android_library {
"androidx.arch.core_core-runtime",
"androidx.lifecycle_lifecycle-extensions",
"androidx.dynamicanimation_dynamicanimation",
+ "iconloader_base",
"SystemUI-tags",
"SystemUI-proto",
"dagger2-2.19",
diff --git a/packages/SystemUI/res-keyguard/layout/bubble_clock.xml b/packages/SystemUI/res-keyguard/layout/bubble_clock.xml
index 0bc13199d71e..f945b1014610 100644
--- a/packages/SystemUI/res-keyguard/layout/bubble_clock.xml
+++ b/packages/SystemUI/res-keyguard/layout/bubble_clock.xml
@@ -21,9 +21,9 @@
>
<TextClock
android:id="@+id/digital_clock"
- android:layout_marginLeft="20dp"
+ android:paddingStart="20dp"
android:layout_marginTop="72dp"
- android:layout_width="wrap_content"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="top|left"
android:textSize="44dp"
diff --git a/packages/SystemUI/res-keyguard/layout/stretchanalog_clock.xml b/packages/SystemUI/res-keyguard/layout/stretchanalog_clock.xml
index 116a044a7075..dd25df864733 100644
--- a/packages/SystemUI/res-keyguard/layout/stretchanalog_clock.xml
+++ b/packages/SystemUI/res-keyguard/layout/stretchanalog_clock.xml
@@ -21,9 +21,9 @@
>
<TextClock
android:id="@+id/digital_clock"
- android:layout_marginLeft="20dp"
+ android:paddingStart="20dp"
android:layout_marginTop="72dp"
- android:layout_width="wrap_content"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="top|left"
android:textSize="44dp"
diff --git a/packages/SystemUI/shared/src/com/android/systemui/shared/recents/ISystemUiProxy.aidl b/packages/SystemUI/shared/src/com/android/systemui/shared/recents/ISystemUiProxy.aidl
index 078947ca0468..953816e8bf12 100644
--- a/packages/SystemUI/shared/src/com/android/systemui/shared/recents/ISystemUiProxy.aidl
+++ b/packages/SystemUI/shared/src/com/android/systemui/shared/recents/ISystemUiProxy.aidl
@@ -17,6 +17,7 @@
package com.android.systemui.shared.recents;
import android.graphics.Rect;
+import android.os.Bundle;
import android.view.MotionEvent;
/**
@@ -82,4 +83,13 @@ interface ISystemUiProxy {
*/
boolean supportsRoundedCornersOnWindows() = 11;
+ /**
+ * Proxies the assistant gesture's progress started from navigation bar.
+ */
+ void onAssistantProgress(float progress) = 12;
+
+ /**
+ * Start the assistant.
+ */
+ void startAssistant(in Bundle bundle) = 13;
}
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardStatusView.java b/packages/SystemUI/src/com/android/keyguard/KeyguardStatusView.java
index b0670fd0a91a..17546c512778 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardStatusView.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardStatusView.java
@@ -27,7 +27,6 @@ import android.os.RemoteException;
import android.os.UserHandle;
import android.text.TextUtils;
import android.text.format.DateFormat;
-import android.util.ArraySet;
import android.util.AttributeSet;
import android.util.Log;
import android.util.Slog;
@@ -42,8 +41,6 @@ import com.android.internal.widget.LockPatternUtils;
import com.android.systemui.Dependency;
import com.android.systemui.statusbar.policy.ConfigurationController;
-import com.google.android.collect.Sets;
-
import java.util.Locale;
import java.util.TimeZone;
@@ -63,7 +60,6 @@ public class KeyguardStatusView extends GridLayout implements
private Runnable mPendingMarqueeStart;
private Handler mHandler;
- private ArraySet<View> mVisibleInDoze;
private boolean mPulsing;
private float mDarkAmount = 0;
private int mTextColor;
@@ -175,7 +171,6 @@ public class KeyguardStatusView extends GridLayout implements
}
mOwnerInfo = findViewById(R.id.owner_info);
mKeyguardSlice = findViewById(R.id.keyguard_status_area);
- mVisibleInDoze = Sets.newArraySet(mClockView, mKeyguardSlice);
mTextColor = mClockView.getCurrentTextColor();
mKeyguardSlice.setContentChangeListener(this::onSliceContentChanged);
@@ -348,7 +343,6 @@ public class KeyguardStatusView extends GridLayout implements
}
final int blendedTextColor = ColorUtils.blendARGB(mTextColor, Color.WHITE, mDarkAmount);
- updateDozeVisibleViews();
mKeyguardSlice.setDarkAmount(mDarkAmount);
mClockView.setTextColor(blendedTextColor);
}
@@ -372,13 +366,6 @@ public class KeyguardStatusView extends GridLayout implements
return;
}
mPulsing = pulsing;
- updateDozeVisibleViews();
- }
-
- private void updateDozeVisibleViews() {
- for (View child : mVisibleInDoze) {
- child.setAlpha(mDarkAmount == 1 && mPulsing ? 0.8f : 1);
- }
}
private boolean shouldShowLogout() {
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java b/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java
index 3ac7fd4c61c1..f20811856706 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java
@@ -196,6 +196,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
private static KeyguardUpdateMonitor sInstance;
private final Context mContext;
+ private final boolean mIsPrimaryUser;
HashMap<Integer, SimData> mSimDatas = new HashMap<Integer, SimData>();
HashMap<Integer, ServiceState> mServiceStates = new HashMap<Integer, ServiceState>();
@@ -242,8 +243,6 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
private boolean mIsDreaming;
private final DevicePolicyManager mDevicePolicyManager;
private boolean mLogoutEnabled;
- private boolean mFingerprintLockedOut;
- private boolean mFaceLockedOut;
/**
* Short delay before restarting biometric authentication after a successful try
@@ -648,11 +647,6 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
}
}
- if (msgId == FingerprintManager.FINGERPRINT_ERROR_LOCKOUT
- || msgId == FingerprintManager.FINGERPRINT_ERROR_LOCKOUT_PERMANENT) {
- mFingerprintLockedOut = true;
- }
-
if (msgId == FingerprintManager.FINGERPRINT_ERROR_LOCKOUT_PERMANENT) {
mLockPatternUtils.requireStrongAuth(
LockPatternUtils.StrongAuthTracker.STRONG_AUTH_REQUIRED_AFTER_LOCKOUT,
@@ -668,7 +662,6 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
}
private void handleFingerprintLockoutReset() {
- mFingerprintLockedOut = false;
updateFingerprintListeningState();
}
@@ -806,11 +799,6 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
}
}
- if (msgId == FaceManager.FACE_ERROR_LOCKOUT
- || msgId == FaceManager.FACE_ERROR_LOCKOUT_PERMANENT) {
- mFaceLockedOut = true;
- }
-
if (msgId == FaceManager.FACE_ERROR_LOCKOUT_PERMANENT) {
mLockPatternUtils.requireStrongAuth(
LockPatternUtils.StrongAuthTracker.STRONG_AUTH_REQUIRED_AFTER_LOCKOUT,
@@ -827,7 +815,6 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
}
private void handleFaceLockoutReset() {
- mFaceLockedOut = false;
updateFaceListeningState();
}
@@ -1530,6 +1517,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
ActivityManagerWrapper.getInstance().registerTaskStackListener(mTaskStackListener);
mUserManager = context.getSystemService(UserManager.class);
+ mIsPrimaryUser = mUserManager.isPrimaryUser();
mDevicePolicyManager = context.getSystemService(DevicePolicyManager.class);
mLogoutEnabled = mDevicePolicyManager.isLogoutEnabled();
updateAirplaneModeState();
@@ -1608,21 +1596,25 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
}
private boolean shouldListenForFingerprint() {
- return (mKeyguardIsVisible || !mDeviceInteractive ||
+ // Only listen if this KeyguardUpdateMonitor belongs to the primary user. There is an
+ // instance of KeyguardUpdateMonitor for each user but KeyguardUpdateMonitor is user-aware.
+ final boolean shouldListen = (mKeyguardIsVisible || !mDeviceInteractive ||
(mBouncer && !mKeyguardGoingAway) || mGoingToSleep ||
shouldListenForFingerprintAssistant() || (mKeyguardOccluded && mIsDreaming))
&& !mSwitchingUser && !isFingerprintDisabled(getCurrentUser())
- && !mKeyguardGoingAway && !mFingerprintLockedOut;
+ && !mKeyguardGoingAway && mIsPrimaryUser;
+ return shouldListen;
}
private boolean shouldListenForFace() {
final boolean awakeKeyguard = mKeyguardIsVisible && mDeviceInteractive && !mGoingToSleep;
final int user = getCurrentUser();
-
+ // Only listen if this KeyguardUpdateMonitor belongs to the primary user. There is an
+ // instance of KeyguardUpdateMonitor for each user but KeyguardUpdateMonitor is user-aware.
return (mBouncer || mAuthInterruptActive || awakeKeyguard || shouldListenForFaceAssistant())
&& !mSwitchingUser && !getUserCanSkipBouncer(user) && !isFaceDisabled(user)
- && !mKeyguardGoingAway && !mFaceLockedOut && mFaceSettingEnabledForUser
- && mUserManager.isUserUnlocked(user);
+ && !mKeyguardGoingAway && mFaceSettingEnabledForUser
+ && mUserManager.isUserUnlocked(user) && mIsPrimaryUser;
}
diff --git a/packages/SystemUI/src/com/android/systemui/analytics/DataCollector.java b/packages/SystemUI/src/com/android/systemui/analytics/DataCollector.java
index 46e004c5304a..0db5bef783c0 100644
--- a/packages/SystemUI/src/com/android/systemui/analytics/DataCollector.java
+++ b/packages/SystemUI/src/com/android/systemui/analytics/DataCollector.java
@@ -380,6 +380,20 @@ public class DataCollector implements SensorEventListener {
addEvent(PhoneEvent.ON_NOTIFICATION_START_DRAGGING_DOWN);
}
+ public void onStartExpandingFromPulse() {
+ if (DEBUG) {
+ Log.d(TAG, "onStartExpandingFromPulse");
+ }
+ // TODO: maybe add event
+ }
+
+ public void onExpansionFromPulseStopped() {
+ if (DEBUG) {
+ Log.d(TAG, "onExpansionFromPulseStopped");
+ }
+ // TODO: maybe add event
+ }
+
public void onNotificatonStopDraggingDown() {
if (DEBUG) {
Log.d(TAG, "onNotificationStopDraggingDown");
diff --git a/packages/SystemUI/src/com/android/systemui/classifier/Classifier.java b/packages/SystemUI/src/com/android/systemui/classifier/Classifier.java
index 909896eb6c55..f8856ce15f83 100644
--- a/packages/SystemUI/src/com/android/systemui/classifier/Classifier.java
+++ b/packages/SystemUI/src/com/android/systemui/classifier/Classifier.java
@@ -32,6 +32,7 @@ public abstract class Classifier {
public static final int RIGHT_AFFORDANCE = 6;
public static final int GENERIC = 7;
public static final int BOUNCER_UNLOCK = 8;
+ public static final int PULSE_EXPAND = 9;
/**
* Contains all the information about touch events from which the classifier can query
diff --git a/packages/SystemUI/src/com/android/systemui/classifier/DirectionEvaluator.java b/packages/SystemUI/src/com/android/systemui/classifier/DirectionEvaluator.java
index 5f04222197ab..78b41683a32b 100644
--- a/packages/SystemUI/src/com/android/systemui/classifier/DirectionEvaluator.java
+++ b/packages/SystemUI/src/com/android/systemui/classifier/DirectionEvaluator.java
@@ -22,6 +22,7 @@ public class DirectionEvaluator {
boolean vertical = Math.abs(yDiff) >= Math.abs(xDiff);
switch (type) {
case Classifier.QUICK_SETTINGS:
+ case Classifier.PULSE_EXPAND:
case Classifier.NOTIFICATION_DRAG_DOWN:
if (!vertical || yDiff <= 0.0) {
return falsingEvaluation;
diff --git a/packages/SystemUI/src/com/android/systemui/classifier/FalsingManager.java b/packages/SystemUI/src/com/android/systemui/classifier/FalsingManager.java
index 8f215ff47855..a63fdbd63e02 100644
--- a/packages/SystemUI/src/com/android/systemui/classifier/FalsingManager.java
+++ b/packages/SystemUI/src/com/android/systemui/classifier/FalsingManager.java
@@ -408,10 +408,22 @@ public class FalsingManager implements SensorEventListener, StateListener {
mDataCollector.onNotificatonStartDraggingDown();
}
+ public void onStartExpandingFromPulse() {
+ if (FalsingLog.ENABLED) {
+ FalsingLog.i("onStartExpandingFromPulse", "");
+ }
+ mHumanInteractionClassifier.setType(Classifier.PULSE_EXPAND);
+ mDataCollector.onStartExpandingFromPulse();
+ }
+
public void onNotificatonStopDraggingDown() {
mDataCollector.onNotificatonStopDraggingDown();
}
+ public void onExpansionFromPulseStopped() {
+ mDataCollector.onExpansionFromPulseStopped();
+ }
+
public void onNotificationDismissed() {
mDataCollector.onNotificationDismissed();
}
diff --git a/packages/SystemUI/src/com/android/systemui/classifier/HumanInteractionClassifier.java b/packages/SystemUI/src/com/android/systemui/classifier/HumanInteractionClassifier.java
index 577d57a9990e..0cc50cddbfc6 100644
--- a/packages/SystemUI/src/com/android/systemui/classifier/HumanInteractionClassifier.java
+++ b/packages/SystemUI/src/com/android/systemui/classifier/HumanInteractionClassifier.java
@@ -128,7 +128,8 @@ public class HumanInteractionClassifier extends Classifier {
// sent to the classifiers until the finger moves far enough. When the finger if lifted
// up, the last MotionEvent which was far enough from the finger is set as the final
// MotionEvent and sent to the Classifiers.
- if (mCurrentType == Classifier.NOTIFICATION_DRAG_DOWN) {
+ if (mCurrentType == Classifier.NOTIFICATION_DRAG_DOWN
+ || mCurrentType == Classifier.PULSE_EXPAND) {
mBufferedEvents.add(MotionEvent.obtain(event));
Point pointEnd = new Point(event.getX() / mDpi, event.getY() / mDpi);
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
index 172746e2ffbe..0be9e25bfc27 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
@@ -1787,6 +1787,7 @@ public class KeyguardViewMediator extends SystemUI {
mHideAnimationRun = false;
adjustStatusBarLocked();
userActivity();
+ mUpdateMonitor.setKeyguardGoingAway(false /* away */);
mShowKeyguardWakeLock.release();
}
mKeyguardDisplayManager.show();
@@ -1907,7 +1908,6 @@ public class KeyguardViewMediator extends SystemUI {
mHideAnimationRun = false;
adjustStatusBarLocked();
sendUserPresentBroadcast();
- mUpdateMonitor.setKeyguardGoingAway(false /* goingAway */);
}
Trace.endSection();
}
diff --git a/packages/SystemUI/src/com/android/systemui/recents/OverviewProxyService.java b/packages/SystemUI/src/com/android/systemui/recents/OverviewProxyService.java
index 83c4cfc6c126..b7948882208d 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/OverviewProxyService.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/OverviewProxyService.java
@@ -29,6 +29,7 @@ import static com.android.systemui.shared.system.QuickStepContract.KEY_EXTRA_SUP
import static com.android.systemui.shared.system.QuickStepContract.KEY_EXTRA_SYSUI_PROXY;
import static com.android.systemui.shared.system.QuickStepContract.KEY_EXTRA_WINDOW_CORNER_RADIUS;
+import android.annotation.FloatRange;
import android.content.BroadcastReceiver;
import android.content.ComponentName;
import android.content.Context;
@@ -269,6 +270,30 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis
}
}
+ public void onAssistantProgress(@FloatRange(from = 0.0, to = 1.0) float progress) {
+ if (!verifyCaller("onAssistantProgress")) {
+ return;
+ }
+ long token = Binder.clearCallingIdentity();
+ try {
+ mHandler.post(() -> notifyAssistantProgress(progress));
+ } finally {
+ Binder.restoreCallingIdentity(token);
+ }
+ }
+
+ public void startAssistant(Bundle bundle) {
+ if (!verifyCaller("startAssistant")) {
+ return;
+ }
+ long token = Binder.clearCallingIdentity();
+ try {
+ mHandler.post(() -> notifyStartAssistant(bundle));
+ } finally {
+ Binder.restoreCallingIdentity(token);
+ }
+ }
+
private boolean verifyCaller(String reason) {
final int callerId = Binder.getCallingUserHandle().getIdentifier();
if (callerId != mCurrentBoundedUserId) {
@@ -590,6 +615,18 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis
}
}
+ private void notifyAssistantProgress(@FloatRange(from = 0.0, to = 1.0) float progress) {
+ for (int i = mConnectionCallbacks.size() - 1; i >= 0; --i) {
+ mConnectionCallbacks.get(i).onAssistantProgress(progress);
+ }
+ }
+
+ private void notifyStartAssistant(Bundle bundle) {
+ for (int i = mConnectionCallbacks.size() - 1; i >= 0; --i) {
+ mConnectionCallbacks.get(i).startAssistant(bundle);
+ }
+ }
+
private void updateEnabledState() {
mIsEnabled = mContext.getPackageManager().resolveServiceAsUser(mQuickStepIntent,
MATCH_DIRECT_BOOT_UNAWARE,
@@ -637,5 +674,7 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis
default void onOverviewShown(boolean fromHome) {}
default void onQuickScrubStarted() {}
default void onBackButtonAlphaChanged(float alpha, boolean animate) {}
+ default void onAssistantProgress(@FloatRange(from = 0.0, to = 1.0) float progress) {}
+ default void startAssistant(Bundle bundle) {}
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/AlertingNotificationManager.java b/packages/SystemUI/src/com/android/systemui/statusbar/AlertingNotificationManager.java
index a6af82a28bce..33bcefb323f8 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/AlertingNotificationManager.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/AlertingNotificationManager.java
@@ -237,7 +237,8 @@ public abstract class AlertingNotificationManager implements NotificationLifetim
*/
protected boolean canRemoveImmediately(String key) {
AlertEntry alertEntry = mAlertEntries.get(key);
- return alertEntry == null || alertEntry.wasShownLongEnough();
+ return alertEntry == null || alertEntry.wasShownLongEnough()
+ || alertEntry.mEntry.isRowDismissed();
}
///////////////////////////////////////////////////////////////////////////////////////////////
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/AmbientPulseManager.java b/packages/SystemUI/src/com/android/systemui/statusbar/AmbientPulseManager.java
index 57d058880118..5f878cee12d6 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/AmbientPulseManager.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/AmbientPulseManager.java
@@ -131,7 +131,7 @@ public class AmbientPulseManager extends AlertingNotificationManager {
* @param entry the entry that changed
* @param isPulsing true if the entry is now pulsing, false otherwise
*/
- void onAmbientStateChanged(NotificationEntry entry, boolean isPulsing);
+ void onAmbientStateChanged(@NonNull NotificationEntry entry, boolean isPulsing);
}
private final class AmbientEntry extends AlertEntry {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NavigationBarController.java b/packages/SystemUI/src/com/android/systemui/statusbar/NavigationBarController.java
index 2edea789d820..9f382eabc180 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/NavigationBarController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/NavigationBarController.java
@@ -110,9 +110,7 @@ public class NavigationBarController implements DisplayListener, Callbacks {
* @param display the display to add navigation bar on.
*/
private void createNavigationBar(Display display) {
- if (display == null
- || (display.getDisplayId() != DEFAULT_DISPLAY
- && !display.supportsSystemDecorations())) {
+ if (display == null) {
return;
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java
index 110d51563e2c..2cca701ef582 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java
@@ -232,7 +232,7 @@ public class NotificationShelf extends ActivatableNotificationView implements
openedAmount = Math.min(1.0f, openedAmount);
viewState.openedAmount = openedAmount;
viewState.clipTopAmount = 0;
- viewState.alpha = mAmbientState.hasPulsingNotifications() ? 0 : 1;
+ viewState.alpha = 1;
viewState.belowSpeedBump = mAmbientState.getSpeedBumpIndex() == 0;
viewState.hideSensitive = false;
viewState.xTranslation = getTranslationX();
@@ -290,6 +290,7 @@ public class NotificationShelf extends ActivatableNotificationView implements
&& !mAmbientState.isPanelTracking();
int baseZHeight = mAmbientState.getBaseZHeight();
int backgroundTop = 0;
+ int clipTopAmount = 0;
float firstElementRoundness = 0.0f;
ExpandableNotificationRow previousRow = null;
@@ -319,7 +320,8 @@ public class NotificationShelf extends ActivatableNotificationView implements
rowTranslationY + getNotificationMergeSize());
}
}
- updateNotificationClipHeight(row, notificationClipEnd);
+ int clipTop = updateNotificationClipHeight(row, notificationClipEnd, notGoneIndex);
+ clipTopAmount = Math.max(clipTop, clipTopAmount);
float inShelfAmount = updateIconAppearance(row, expandAmount, scrolling, scrollingFast,
expandingAnimated, isLastChild);
numViewsInShelf += inShelfAmount;
@@ -379,9 +381,9 @@ public class NotificationShelf extends ActivatableNotificationView implements
previousColor = ownColorUntinted;
previousRow = row;
}
-
clipTransientViews();
+ setClipTopAmount(clipTopAmount);
setBackgroundTop(backgroundTop);
setFirstElementRoundness(firstElementRoundness);
mShelfIcons.setSpeedBumpIndex(mAmbientState.getSpeedBumpIndex());
@@ -415,7 +417,7 @@ public class NotificationShelf extends ActivatableNotificationView implements
View transientView = mHostLayout.getTransientView(i);
if (transientView instanceof ExpandableNotificationRow) {
ExpandableNotificationRow transientRow = (ExpandableNotificationRow) transientView;
- updateNotificationClipHeight(transientRow, getTranslationY());
+ updateNotificationClipHeight(transientRow, getTranslationY(), -1);
} else {
Log.e(TAG, "NotificationShelf.clipTransientViews(): "
+ "Trying to clip non-row transient view");
@@ -432,9 +434,13 @@ public class NotificationShelf extends ActivatableNotificationView implements
private void updateIconClipAmount(ExpandableNotificationRow row) {
float maxTop = row.getTranslationY();
+ if (getClipTopAmount() != 0) {
+ // if the shelf is clipped, lets make sure we also clip the icon
+ maxTop = Math.max(maxTop, getTranslationY() + getClipTopAmount());
+ }
StatusBarIconView icon = row.getEntry().expandedIcon;
float shelfIconPosition = getTranslationY() + icon.getTop() + icon.getTranslationY();
- if (shelfIconPosition < maxTop && !mAmbientState.isDark()) {
+ if (shelfIconPosition < maxTop && !mAmbientState.isFullyDark()) {
int top = (int) (maxTop - shelfIconPosition);
Rect clipRect = new Rect(0, top, icon.getWidth(), Math.max(top, icon.getHeight()));
icon.setClipBounds(clipRect);
@@ -485,12 +491,18 @@ public class NotificationShelf extends ActivatableNotificationView implements
}
}
- private void updateNotificationClipHeight(ExpandableNotificationRow row,
- float notificationClipEnd) {
+ /**
+ * Update the clipping of this view.
+ * @return the amount that our own top should be clipped
+ */
+ private int updateNotificationClipHeight(ExpandableNotificationRow row,
+ float notificationClipEnd, int childIndex) {
float viewEnd = row.getTranslationY() + row.getActualHeight();
boolean isPinned = (row.isPinned() || row.isHeadsUpAnimatingAway())
&& !mAmbientState.isDozingAndNotPulsing(row);
- if (viewEnd > notificationClipEnd
+ boolean shouldClipOwnTop = row.showingAmbientPulsing()
+ || (mAmbientState.isPulseExpanding() && childIndex == 0);
+ if (viewEnd > notificationClipEnd && !shouldClipOwnTop
&& (mAmbientState.isShadeExpanded() || !isPinned)) {
int clipBottomAmount = (int) (viewEnd - notificationClipEnd);
if (isPinned) {
@@ -501,6 +513,11 @@ public class NotificationShelf extends ActivatableNotificationView implements
} else {
row.setClipBottomAmount(0);
}
+ if (shouldClipOwnTop) {
+ return (int) (viewEnd - getTranslationY());
+ } else {
+ return 0;
+ }
}
@Override
@@ -653,7 +670,7 @@ public class NotificationShelf extends ActivatableNotificationView implements
? fullTransitionAmount
: transitionAmount;
iconState.clampedAppearAmount = clampedAmount;
- float contentTransformationAmount = !mAmbientState.isAboveShelf(row)
+ float contentTransformationAmount = !row.isAboveShelf()
&& (isLastChild || iconState.translateContent)
? iconTransitionAmount
: 0.0f;
@@ -722,7 +739,7 @@ public class NotificationShelf extends ActivatableNotificationView implements
iconState.scaleY = 1.0f;
iconState.hidden = false;
}
- if (mAmbientState.isAboveShelf(row) || (!row.isInShelf() && (isLastChild && row.areGutsExposed()
+ if (row.isAboveShelf() || (!row.isInShelf() && (isLastChild && row.areGutsExposed()
|| row.getTranslationZ() > mAmbientState.getBaseZHeight()))) {
iconState.hidden = true;
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/PulseExpansionHandler.kt b/packages/SystemUI/src/com/android/systemui/statusbar/PulseExpansionHandler.kt
new file mode 100644
index 000000000000..e5dbcd374169
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/PulseExpansionHandler.kt
@@ -0,0 +1,272 @@
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License
+ */
+
+package com.android.systemui.statusbar
+
+import android.animation.Animator
+import android.animation.AnimatorListenerAdapter
+import android.animation.ObjectAnimator
+import android.animation.ValueAnimator
+import android.content.Context
+import android.os.PowerManager
+import android.os.PowerManager.WAKE_REASON_GESTURE
+import android.os.SystemClock
+import android.view.MotionEvent
+import android.view.ViewConfiguration
+
+import com.android.systemui.Gefingerpoken
+import com.android.systemui.Interpolators
+import com.android.systemui.R
+import com.android.systemui.classifier.FalsingManager
+import com.android.systemui.statusbar.notification.NotificationWakeUpCoordinator
+import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow
+import com.android.systemui.statusbar.notification.row.ExpandableView
+import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayout
+import com.android.systemui.statusbar.phone.ShadeController
+
+import javax.inject.Inject
+import javax.inject.Singleton
+import kotlin.math.max
+
+/**
+ * A utility class to enable the downward swipe on when pulsing.
+ */
+@Singleton
+class PulseExpansionHandler @Inject
+constructor(context: Context,
+ private val mWakeUpCoordinator: NotificationWakeUpCoordinator) : Gefingerpoken {
+ companion object {
+ private val RUBBERBAND_FACTOR_STATIC = 0.25f
+ private val SPRING_BACK_ANIMATION_LENGTH_MS = 375
+ }
+ private val mPowerManager: PowerManager?
+ private var mShadeController: ShadeController? = null
+
+ private val mMinDragDistance: Int
+ private var mInitialTouchX: Float = 0.0f
+ private var mInitialTouchY: Float = 0.0f
+ var isExpanding: Boolean = false
+ private set
+ private val mTouchSlop: Float
+ private var mExpansionCallback: ExpansionCallback? = null
+ private lateinit var mStackScroller: NotificationStackScrollLayout
+ private val mTemp2 = IntArray(2)
+ private var mDraggedFarEnough: Boolean = false
+ private var mStartingChild: ExpandableView? = null
+ private val mFalsingManager: FalsingManager
+ private var mPulsing: Boolean = false
+ var isWakingToShadeLocked: Boolean = false
+ private set
+ private var mEmptyDragAmount: Float = 0.0f
+ private var mWakeUpHeight: Float = 0.0f
+ private var mReachedWakeUpHeight: Boolean = false
+
+ private val isFalseTouch: Boolean
+ get() = mFalsingManager.isFalseTouch
+
+ init {
+ mMinDragDistance = context.resources.getDimensionPixelSize(
+ R.dimen.keyguard_drag_down_min_distance)
+ mTouchSlop = ViewConfiguration.get(context).scaledTouchSlop.toFloat()
+ mFalsingManager = FalsingManager.getInstance(context)
+ mPowerManager = context.getSystemService(PowerManager::class.java)
+ }
+
+ override fun onInterceptTouchEvent(event: MotionEvent): Boolean {
+ return maybeStartExpansion(event)
+ }
+
+ private fun maybeStartExpansion(event: MotionEvent): Boolean {
+ if (!mPulsing) {
+ return false
+ }
+ val x = event.x
+ val y = event.y
+
+ when (event.actionMasked) {
+ MotionEvent.ACTION_DOWN -> {
+ mDraggedFarEnough = false
+ isExpanding = false
+ mStartingChild = null
+ mInitialTouchY = y
+ mInitialTouchX = x
+ }
+
+ MotionEvent.ACTION_MOVE -> {
+ val h = y - mInitialTouchY
+ if (h > mTouchSlop && h > Math.abs(x - mInitialTouchX)) {
+ mFalsingManager.onStartExpandingFromPulse()
+ isExpanding = true
+ captureStartingChild(mInitialTouchX, mInitialTouchY)
+ mInitialTouchY = y
+ mInitialTouchX = x
+ mWakeUpHeight = mWakeUpCoordinator.getWakeUpHeight()
+ mReachedWakeUpHeight = false
+ return true
+ }
+ }
+ }
+ return false
+ }
+
+ override fun onTouchEvent(event: MotionEvent): Boolean {
+ if (!isExpanding) {
+ return maybeStartExpansion(event)
+ }
+ val y = event.y
+
+ when (event.actionMasked) {
+ MotionEvent.ACTION_MOVE -> updateExpansionHeight(y - mInitialTouchY)
+ MotionEvent.ACTION_UP -> if (!mFalsingManager.isUnlockingDisabled && !isFalseTouch) {
+ finishExpansion()
+ } else {
+ cancelExpansion()
+ }
+ MotionEvent.ACTION_CANCEL -> cancelExpansion()
+ }
+ return isExpanding
+ }
+
+ private fun finishExpansion() {
+ resetClock()
+ if (mStartingChild != null) {
+ setUserLocked(mStartingChild!!, false)
+ mStartingChild = null
+ }
+ isExpanding = false
+ isWakingToShadeLocked = true
+ mPowerManager!!.wakeUp(SystemClock.uptimeMillis(), WAKE_REASON_GESTURE,
+ "com.android.systemui:PULSEDRAG")
+ mShadeController!!.goToLockedShade(mStartingChild)
+ if (mStartingChild is ExpandableNotificationRow) {
+ val row = mStartingChild as ExpandableNotificationRow?
+ row!!.onExpandedByGesture(true /* userExpanded */)
+ }
+ }
+
+ private fun updateExpansionHeight(height: Float) {
+ var expansionHeight = max(height, 0.0f)
+ if (!mReachedWakeUpHeight && height > mWakeUpHeight) {
+ mReachedWakeUpHeight = true;
+ }
+ if (mStartingChild != null) {
+ val child = mStartingChild!!
+ val newHeight = Math.min((child.collapsedHeight + expansionHeight).toInt(),
+ child.maxContentHeight)
+ child.actualHeight = newHeight
+ expansionHeight = max(newHeight.toFloat(), expansionHeight)
+ } else {
+ val target = if (mReachedWakeUpHeight) mWakeUpHeight else 0.0f
+ mWakeUpCoordinator.setNotificationsVisibleForExpansion(height > target,
+ true /* animate */,
+ true /* increaseSpeed */)
+ expansionHeight = max(mWakeUpHeight, expansionHeight)
+ }
+ val emptyDragAmount = mWakeUpCoordinator.setPulseHeight(expansionHeight)
+ setEmptyDragAmount(emptyDragAmount * RUBBERBAND_FACTOR_STATIC)
+ }
+
+ private fun captureStartingChild(x: Float, y: Float) {
+ if (mStartingChild == null) {
+ mStartingChild = findView(x, y)
+ if (mStartingChild != null) {
+ setUserLocked(mStartingChild!!, true)
+ }
+ }
+ }
+
+ private fun setEmptyDragAmount(amount: Float) {
+ mEmptyDragAmount = amount
+ mExpansionCallback!!.setEmptyDragAmount(amount)
+ }
+
+ private fun reset(child: ExpandableView) {
+ if (child.actualHeight == child.collapsedHeight) {
+ setUserLocked(child, false)
+ return
+ }
+ val anim = ObjectAnimator.ofInt(child, "actualHeight",
+ child.actualHeight, child.collapsedHeight)
+ anim.interpolator = Interpolators.FAST_OUT_SLOW_IN
+ anim.duration = SPRING_BACK_ANIMATION_LENGTH_MS.toLong()
+ anim.addListener(object : AnimatorListenerAdapter() {
+ override fun onAnimationEnd(animation: Animator) {
+ setUserLocked(child, false)
+ }
+ })
+ anim.start()
+ }
+
+ private fun setUserLocked(child: ExpandableView, userLocked: Boolean) {
+ if (child is ExpandableNotificationRow) {
+ child.isUserLocked = userLocked
+ }
+ }
+
+ private fun resetClock() {
+ val anim = ValueAnimator.ofFloat(mEmptyDragAmount, 0f)
+ anim.interpolator = Interpolators.FAST_OUT_SLOW_IN
+ anim.duration = SPRING_BACK_ANIMATION_LENGTH_MS.toLong()
+ anim.addUpdateListener { animation -> setEmptyDragAmount(animation.animatedValue as Float) }
+ anim.start()
+ }
+
+ private fun cancelExpansion() {
+ mFalsingManager.onExpansionFromPulseStopped()
+ if (mStartingChild != null) {
+ reset(mStartingChild!!)
+ mStartingChild = null
+ } else {
+ resetClock()
+ }
+ mWakeUpCoordinator.setNotificationsVisibleForExpansion(false /* visible */,
+ true /* animate */,
+ false /* increaseSpeed */)
+ isExpanding = false
+ }
+
+ private fun findView(x: Float, y: Float): ExpandableView? {
+ var totalX = x
+ var totalY = y
+ mStackScroller.getLocationOnScreen(mTemp2)
+ totalX += mTemp2[0].toFloat()
+ totalY += mTemp2[1].toFloat()
+ val childAtRawPosition = mStackScroller.getChildAtRawPosition(totalX, totalY)
+ return if (childAtRawPosition != null && childAtRawPosition.isContentExpandable) {
+ childAtRawPosition
+ } else null
+ }
+
+ fun setUp(notificationStackScroller: NotificationStackScrollLayout,
+ expansionCallback: ExpansionCallback,
+ shadeController: ShadeController) {
+ mExpansionCallback = expansionCallback
+ mShadeController = shadeController
+ mStackScroller = notificationStackScroller
+ }
+
+ fun setPulsing(pulsing: Boolean) {
+ mPulsing = pulsing
+ }
+
+ fun onStartedWakingUp() {
+ isWakingToShadeLocked = false
+ }
+
+ interface ExpansionCallback {
+ fun setEmptyDragAmount(amount: Float)
+ }
+}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationWakeUpCoordinator.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationWakeUpCoordinator.kt
new file mode 100644
index 000000000000..ccb8d9bf46c1
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationWakeUpCoordinator.kt
@@ -0,0 +1,215 @@
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License
+ */
+
+package com.android.systemui.statusbar.notification
+
+import android.animation.ObjectAnimator
+import android.util.FloatProperty
+import com.android.systemui.Interpolators
+import com.android.systemui.plugins.statusbar.StatusBarStateController
+import com.android.systemui.statusbar.AmbientPulseManager
+import com.android.systemui.statusbar.SysuiStatusBarStateController
+import com.android.systemui.statusbar.notification.collection.NotificationEntry
+import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayout
+import com.android.systemui.statusbar.notification.stack.StackStateAnimator
+
+import javax.inject.Inject
+import javax.inject.Singleton
+
+@Singleton
+class NotificationWakeUpCoordinator @Inject constructor(
+ private val mAmbientPulseManager: AmbientPulseManager,
+ private val mStatusBarStateController: StatusBarStateController)
+ : AmbientPulseManager.OnAmbientChangedListener, StatusBarStateController.StateListener {
+
+ private val mNotificationVisibility
+ = object : FloatProperty<NotificationWakeUpCoordinator>("notificationVisibility") {
+
+ override fun setValue(coordinator: NotificationWakeUpCoordinator, value: Float) {
+ coordinator.setVisibilityAmount(value)
+ }
+
+ override fun get(coordinator: NotificationWakeUpCoordinator): Float? {
+ return coordinator.mLinearVisibilityAmount
+ }
+ }
+ private lateinit var mStackScroller: NotificationStackScrollLayout
+ private var mVisibilityInterpolator = Interpolators.FAST_OUT_SLOW_IN_REVERSE
+
+ private var mLinearDozeAmount: Float = 0.0f
+ private var mDozeAmount: Float = 0.0f
+ private var mNotificationVisibleAmount = 0.0f
+ private var mNotificationsVisible = false
+ private var mNotificationsVisibleForExpansion = false
+ private var mDarkAnimator: ObjectAnimator? = null
+ private var mVisibilityAmount = 0.0f
+ private var mLinearVisibilityAmount = 0.0f
+ private var mWakingUp = false
+ private val mEntrySetToClearWhenFinished = mutableSetOf<NotificationEntry>()
+
+ init {
+ mAmbientPulseManager.addListener(this)
+ mStatusBarStateController.addCallback(this)
+ }
+
+ fun setStackScroller(stackScroller: NotificationStackScrollLayout) {
+ mStackScroller = stackScroller
+ }
+
+ /**
+ * @param visible should notifications be visible
+ * @param animate should this change be animated
+ * @param increaseSpeed should the speed be increased of the animation
+ */
+ fun setNotificationsVisibleForExpansion(visible: Boolean, animate: Boolean,
+ increaseSpeed: Boolean) {
+ mNotificationsVisibleForExpansion = visible
+ updateNotificationVisibility(animate, increaseSpeed)
+ if (!visible && mNotificationsVisible) {
+ // If we stopped expanding and we're still visible because we had a pulse that hasn't
+ // times out, let's release them all to make sure were not stuck in a state where
+ // notifications are visible
+ mAmbientPulseManager.releaseAllImmediately()
+ }
+ }
+
+ private fun updateNotificationVisibility(animate: Boolean, increaseSpeed: Boolean) {
+ var visible = mNotificationsVisibleForExpansion || mAmbientPulseManager.hasNotifications()
+ if (!visible && mNotificationsVisible && mWakingUp && mDozeAmount != 0.0f) {
+ // let's not make notifications invisible while waking up, otherwise the animation
+ // is strange
+ return;
+ }
+ setNotificationsVisible(visible, animate, increaseSpeed)
+ }
+
+ private fun setNotificationsVisible(visible: Boolean, animate: Boolean,
+ increaseSpeed: Boolean) {
+ if (mNotificationsVisible == visible) {
+ return
+ }
+ mNotificationsVisible = visible
+ mDarkAnimator?.cancel();
+ if (animate) {
+ notifyAnimationStart(visible)
+ startVisibilityAnimation(increaseSpeed)
+ } else {
+ setVisibilityAmount(if (visible) 1.0f else 0.0f)
+ }
+ }
+
+ override fun onDozeAmountChanged(linear: Float, eased: Float) {
+ if (linear != 1.0f && linear != 0.0f
+ && (mLinearDozeAmount == 0.0f || mLinearDozeAmount == 1.0f)) {
+ // Let's notify the scroller that an animation started
+ notifyAnimationStart(mLinearDozeAmount == 1.0f)
+ }
+ mLinearDozeAmount = linear
+ mDozeAmount = eased
+ mStackScroller.setDozeAmount(mDozeAmount)
+ updateDarkAmount()
+ if (linear == 0.0f) {
+ setNotificationsVisible(visible = false, animate = false, increaseSpeed = false);
+ setNotificationsVisibleForExpansion(visible = false, animate = false,
+ increaseSpeed = false)
+ }
+ }
+
+ private fun startVisibilityAnimation(increaseSpeed: Boolean) {
+ if (mNotificationVisibleAmount == 0f || mNotificationVisibleAmount == 1f) {
+ mVisibilityInterpolator = if (mNotificationsVisible)
+ Interpolators.TOUCH_RESPONSE
+ else
+ Interpolators.FAST_OUT_SLOW_IN_REVERSE
+ }
+ val target = if (mNotificationsVisible) 1.0f else 0.0f
+ val darkAnimator = ObjectAnimator.ofFloat(this, mNotificationVisibility, target)
+ darkAnimator.setInterpolator(Interpolators.LINEAR)
+ var duration = StackStateAnimator.ANIMATION_DURATION_WAKEUP.toLong()
+ if (increaseSpeed) {
+ duration = (duration.toFloat() / 1.5F).toLong();
+ }
+ darkAnimator.setDuration(duration)
+ darkAnimator.start()
+ mDarkAnimator = darkAnimator
+ }
+
+ private fun setVisibilityAmount(visibilityAmount: Float) {
+ mLinearVisibilityAmount = visibilityAmount
+ mVisibilityAmount = mVisibilityInterpolator.getInterpolation(
+ visibilityAmount)
+ handleAnimationFinished();
+ updateDarkAmount()
+ }
+
+ private fun handleAnimationFinished() {
+ if (mLinearDozeAmount == 0.0f || mLinearVisibilityAmount == 0.0f) {
+ mEntrySetToClearWhenFinished.forEach { it.setAmbientGoingAway(false) }
+ }
+ }
+
+ fun getWakeUpHeight() : Float {
+ return mStackScroller.pulseHeight
+ }
+
+ private fun updateDarkAmount() {
+ val linearAmount = Math.min(1.0f - mLinearVisibilityAmount, mLinearDozeAmount)
+ val amount = Math.min(1.0f - mVisibilityAmount, mDozeAmount)
+ mStackScroller.setDarkAmount(linearAmount, amount)
+ }
+
+ private fun notifyAnimationStart(awake: Boolean) {
+ mStackScroller.notifyDarkAnimationStart(!awake)
+ }
+
+ override fun onDozingChanged(isDozing: Boolean) {
+ if (isDozing) {
+ setNotificationsVisible(visible = false, animate = false, increaseSpeed = false)
+ }
+ }
+
+ fun setPulseHeight(height: Float): Float {
+ return mStackScroller.setPulseHeight(height)
+ }
+
+ fun setWakingUp(wakingUp: Boolean) {
+ mWakingUp = wakingUp
+ if (wakingUp && mNotificationsVisible && !mNotificationsVisibleForExpansion) {
+ // We're waking up while pulsing, let's make sure the animation looks nice
+ mStackScroller.wakeUpFromPulse();
+ }
+ }
+
+ override fun onAmbientStateChanged(entry: NotificationEntry, isPulsing: Boolean) {
+ var animate = true
+ if (!isPulsing) {
+ if (mLinearDozeAmount != 0.0f) {
+ if (entry.isRowDismissed) {
+ // if we animate, we see the shelf briefly visible. Instead we fully animate
+ // the notification and its background out
+ animate = false
+ } else {
+ entry.setAmbientGoingAway(true)
+ mEntrySetToClearWhenFinished.add(entry)
+ }
+ }
+ } else if (mEntrySetToClearWhenFinished.contains(entry)) {
+ mEntrySetToClearWhenFinished.remove(entry)
+ entry.setAmbientGoingAway(false)
+ }
+ updateNotificationVisibility(animate, increaseSpeed = false)
+ }
+} \ No newline at end of file
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/NotificationData.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/NotificationData.java
index 8b522a2033f8..04ff58b36c94 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/NotificationData.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/NotificationData.java
@@ -112,8 +112,8 @@ public class NotificationData {
} else if (isHeadsUp) {
// Provide consistent ranking with headsUpManager
return mHeadsUpManager.compare(a, b);
- } else if (a.getRow().isAmbientPulsing() != b.getRow().isAmbientPulsing()) {
- return a.getRow().isAmbientPulsing() ? -1 : 1;
+ } else if (a.getRow().showingAmbientPulsing() != b.getRow().showingAmbientPulsing()) {
+ return a.getRow().showingAmbientPulsing() ? -1 : 1;
} else if (aMedia != bMedia) {
// Upsort current media notification.
return aMedia ? -1 : 1;
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/NotificationEntry.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/NotificationEntry.java
index 3bf4d4beb4f9..5cd1210f7c9f 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/NotificationEntry.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/NotificationEntry.java
@@ -571,6 +571,12 @@ public final class NotificationEntry {
if (row != null) row.setHeadsUp(shouldHeadsUp);
}
+
+ public void setAmbientGoingAway(boolean goingAway) {
+ if (row != null) row.setAmbientGoingAway(goingAway);
+ }
+
+
public boolean mustStayOnScreen() {
return row != null && row.mustStayOnScreen();
}
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 0fbc55bc08bf..767e14c42365 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
@@ -215,6 +215,11 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
private boolean mIsAmbientPulsing;
/**
+ * Happens when the notification was pulsing before and goes away to ensure smooth animations.
+ */
+ private boolean mAmbientGoingAway;
+
+ /**
* Whether or not the notification should be redacted on the lock screen, i.e has sensitive
* content which should be redacted on the lock screen.
*/
@@ -721,8 +726,9 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
}
}
- public boolean isAmbientPulsing() {
- return mIsAmbientPulsing;
+ @Override
+ public boolean showingAmbientPulsing() {
+ return mIsAmbientPulsing || mAmbientGoingAway;
}
public void setAmbientPulsing(boolean isAmbientPulsing) {
@@ -3004,9 +3010,9 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
@Override
public boolean isAboveShelf() {
- return !isOnKeyguard()
+ return showingAmbientPulsing() || (!isOnKeyguard()
&& (mIsPinned || mHeadsupDisappearRunning || (mIsHeadsUp && mAboveShelf)
- || mExpandAnimationRunning || mChildIsExpanding);
+ || mExpandAnimationRunning || mChildIsExpanding));
}
public void setOnAmbient(boolean onAmbient) {
@@ -3161,6 +3167,10 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
}
}
+ public void setAmbientGoingAway(boolean goingAway) {
+ mAmbientGoingAway = goingAway;
+ }
+
@VisibleForTesting
protected void setChildrenContainer(NotificationChildrenContainer childrenContainer) {
mChildrenContainer = childrenContainer;
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableView.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableView.java
index d1a89b4e493f..cac41da52120 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableView.java
@@ -527,6 +527,10 @@ public abstract class ExpandableView extends FrameLayout implements Dumpable {
public void setHeadsUpIsVisible() {
}
+ public boolean showingAmbientPulsing() {
+ return false;
+ }
+
public boolean isChildInGroup() {
return false;
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationContentView.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationContentView.java
index 646617c72128..3cc2e83f7934 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationContentView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationContentView.java
@@ -793,11 +793,11 @@ public class NotificationContentView extends FrameLayout {
}
public int getMaxHeight() {
- if (mContainingNotification.isOnAmbient() && getShowingAmbientView() != null) {
- return getShowingAmbientView().getHeight();
- } else if (mExpandedChild != null) {
+ if (mExpandedChild != null) {
return getViewHeight(VISIBLE_TYPE_EXPANDED)
+ getExtraRemoteInputHeight(mExpandedRemoteInput);
+ } else if (mContainingNotification.isOnAmbient() && getShowingAmbientView() != null) {
+ return getShowingAmbientView().getHeight();
} else if (mIsHeadsUp && mHeadsUpChild != null && !mContainingNotification.isOnKeyguard()) {
return getViewHeight(VISIBLE_TYPE_HEADSUP)
+ getExtraRemoteInputHeight(mHeadsUpRemoteInput);
@@ -1113,15 +1113,6 @@ public class NotificationContentView extends FrameLayout {
* @return one of the static enum types in this view, calculated form the current state
*/
public int calculateVisibleType() {
- if (mContainingNotification.isOnAmbient()) {
- if (mIsChildInGroup && mAmbientSingleLineChild != null) {
- return VISIBLE_TYPE_AMBIENT_SINGLELINE;
- } else if (mAmbientChild != null) {
- return VISIBLE_TYPE_AMBIENT;
- } else {
- return VISIBLE_TYPE_CONTRACTED;
- }
- }
if (mUserExpanding) {
int height = !mIsChildInGroup || isGroupExpanded()
|| mContainingNotification.isExpanded(true /* allowOnKeyguard */)
@@ -1152,8 +1143,10 @@ public class NotificationContentView extends FrameLayout {
if (!noExpandedChild && viewHeight == getViewHeight(VISIBLE_TYPE_EXPANDED)) {
return VISIBLE_TYPE_EXPANDED;
}
+ boolean onAmbient = mContainingNotification.isOnAmbient();
if (!mUserExpanding && mIsChildInGroup && !isGroupExpanded()) {
- return VISIBLE_TYPE_SINGLELINE;
+ return onAmbient ? VISIBLE_TYPE_AMBIENT_SINGLELINE
+ : VISIBLE_TYPE_SINGLELINE;
}
if ((mIsHeadsUp || mHeadsUpAnimatingAway) && mHeadsUpChild != null
@@ -1164,11 +1157,13 @@ public class NotificationContentView extends FrameLayout {
return VISIBLE_TYPE_EXPANDED;
}
} else {
+ int collapsedType = onAmbient && mAmbientChild != null ? VISIBLE_TYPE_AMBIENT :
+ VISIBLE_TYPE_CONTRACTED;
if (noExpandedChild || (mContractedChild != null
- && viewHeight <= getViewHeight(VISIBLE_TYPE_CONTRACTED)
+ && viewHeight <= getViewHeight(collapsedType)
&& (!mIsChildInGroup || isGroupExpanded()
|| !mContainingNotification.isExpanded(true /* allowOnKeyguard */)))) {
- return VISIBLE_TYPE_CONTRACTED;
+ return collapsedType;
} else {
return VISIBLE_TYPE_EXPANDED;
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/AmbientState.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/AmbientState.java
index c246af57504c..ce922801551b 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/AmbientState.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/AmbientState.java
@@ -18,6 +18,7 @@ package com.android.systemui.statusbar.notification.stack;
import android.annotation.Nullable;
import android.content.Context;
+import android.util.MathUtils;
import android.view.View;
import com.android.systemui.Dependency;
@@ -39,6 +40,7 @@ import java.util.List;
public class AmbientState {
private static final int NO_SECTION_BOUNDARY = -1;
+ private static final float MAX_PULSE_HEIGHT = 100000f;
private ArrayList<ExpandableView> mDraggedViews = new ArrayList<>();
private int mScrollY;
@@ -79,6 +81,8 @@ public class AmbientState {
private ExpandableNotificationRow mExpandingNotification;
private float mDarkAmount;
private boolean mAppearing;
+ private float mPulseHeight = MAX_PULSE_HEIGHT;
+ private float mDozeAmount = 0.0f;
public AmbientState(Context context) {
mSectionBoundaryIndices.add(NO_SECTION_BOUNDARY);
@@ -181,6 +185,10 @@ public class AmbientState {
/** Dark ratio of the status bar **/
public void setDarkAmount(float darkAmount) {
+ if (darkAmount == 1.0f && mDarkAmount != darkAmount) {
+ // Whenever we are fully dark, let's reset the pulseHeight again
+ mPulseHeight = MAX_PULSE_HEIGHT;
+ }
mDarkAmount = darkAmount;
}
@@ -279,7 +287,28 @@ public class AmbientState {
}
public int getInnerHeight() {
- return Math.max(Math.min(mLayoutHeight, mMaxLayoutHeight) - mTopPadding, mLayoutMinHeight);
+ return getInnerHeight(false /* ignorePulseHeight */);
+ }
+
+ /**
+ * @param ignorePulseHeight ignore the pulse height for this request
+ * @return the inner height of the algorithm.
+ */
+ public int getInnerHeight(boolean ignorePulseHeight) {
+ if (mDozeAmount == 1.0f && !isPulseExpanding()) {
+ return mShelf.getHeight();
+ }
+ int height = Math.max(mLayoutMinHeight,
+ Math.min(mLayoutHeight, mMaxLayoutHeight) - mTopPadding);
+ if (ignorePulseHeight) {
+ return height;
+ }
+ float pulseHeight = Math.min(mPulseHeight, (float) height);
+ return (int) MathUtils.lerp(height, pulseHeight, mDozeAmount);
+ }
+
+ public boolean isPulseExpanding() {
+ return mPulseHeight != MAX_PULSE_HEIGHT && mDozeAmount != 0.0f && mDarkAmount != 1.0f;
}
public boolean isShadeExpanded() {
@@ -425,19 +454,6 @@ public class AmbientState {
}
/**
- * Similar to the normal is above shelf logic but doesn't allow it to be above in AOD1.
- *
- * @param expandableView the view to check
- */
- public boolean isAboveShelf(ExpandableView expandableView) {
- if (!(expandableView instanceof ExpandableNotificationRow)) {
- return expandableView.isAboveShelf();
- }
- ExpandableNotificationRow row = (ExpandableNotificationRow) expandableView;
- return row.isAboveShelf() && !isDozingAndNotPulsing(row);
- }
-
- /**
* @return whether a view is dozing and not pulsing right now
*/
public boolean isDozingAndNotPulsing(ExpandableView view) {
@@ -488,4 +504,26 @@ public class AmbientState {
public boolean isAppearing() {
return mAppearing;
}
+
+ public void setPulseHeight(float height) {
+ mPulseHeight = height;
+ }
+
+ public void setDozeAmount(float dozeAmount) {
+ if (dozeAmount != mDozeAmount) {
+ mDozeAmount = dozeAmount;
+ if (dozeAmount == 0.0f || dozeAmount == 1.0f) {
+ // We woke all the way up, let's reset the pulse height
+ mPulseHeight = MAX_PULSE_HEIGHT;
+ }
+ }
+ }
+
+ /**
+ * Is the device fully awake, which is different from not tark at all when there are pulsing
+ * notifications.
+ */
+ public boolean isFullyAwake() {
+ return mDozeAmount == 0.0f;
+ }
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/AnimationFilter.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/AnimationFilter.java
index 507cf079e1f3..a471d8784c54 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/AnimationFilter.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/AnimationFilter.java
@@ -132,10 +132,6 @@ public class AnimationFilter {
// to look nice
customDelay = StackStateAnimator.ANIMATION_DELAY_HEADS_UP_CLICKED
+ StackStateAnimator.ANIMATION_DELAY_HEADS_UP;
- } else if (ev.animationType == NotificationStackScrollLayout.AnimationEvent
- .ANIMATION_TYPE_PULSE_APPEAR || ev.animationType ==
- NotificationStackScrollLayout.AnimationEvent.ANIMATION_TYPE_PULSE_DISAPPEAR) {
- customDelay = StackStateAnimator.ANIMATION_DURATION_PULSE_APPEAR / 2;
}
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationSection.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationSection.java
index 40cfd4d4aef9..dd6d3833f147 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationSection.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationSection.java
@@ -228,4 +228,67 @@ class NotificationSection {
return (mBottomAnimator == null && mCurrentBounds.bottom == bottom)
|| (mBottomAnimator != null && mEndAnimationRect.bottom == bottom);
}
+
+ /**
+ * Update the bounds of this section based on it's views
+ *
+ * @param minTopPosition the minimum position that the top needs to have
+ * @param minBottomPosition the minimum position that the bottom needs to have
+ * @return the position of the new bottom
+ */
+ public int updateBounds(int minTopPosition, int minBottomPosition,
+ boolean shiftBackgroundWithFirst) {
+ int top = minTopPosition;
+ int bottom = minTopPosition;
+ ActivatableNotificationView firstView = getFirstVisibleChild();
+ if (firstView != null) {
+ // Round Y up to avoid seeing the background during animation
+ int finalTranslationY = (int) Math.ceil(ViewState.getFinalTranslationY(firstView));
+ // TODO: look into the already animating part
+ int newTop;
+ if (isTargetTop(finalTranslationY)) {
+ // we're ending up at the same location as we are now, let's just skip the
+ // animation
+ newTop = finalTranslationY;
+ } else {
+ newTop = (int) Math.ceil(firstView.getTranslationY());
+ }
+ top = Math.max(newTop, top);
+ if (firstView.showingAmbientPulsing()) {
+ // If we're pulsing, the notification can actually go below!
+ bottom = Math.max(bottom, finalTranslationY
+ + ExpandableViewState.getFinalActualHeight(firstView));
+ if (shiftBackgroundWithFirst) {
+ mBounds.left += Math.max(firstView.getTranslation(), 0);
+ }
+ }
+ }
+ top = Math.max(minTopPosition, top);
+ ActivatableNotificationView lastView = getLastVisibleChild();
+ if (lastView != null) {
+ float finalTranslationY = ViewState.getFinalTranslationY(lastView);
+ int finalHeight = ExpandableViewState.getFinalActualHeight(lastView);
+ // Round Y down to avoid seeing the background during animation
+ int finalBottom = (int) Math.floor(
+ finalTranslationY + finalHeight - lastView.getClipBottomAmount());
+ int newBottom;
+ if (isTargetBottom(finalBottom)) {
+ // we're ending up at the same location as we are now, lets just skip the animation
+ newBottom = finalBottom;
+ } else {
+ newBottom = (int) (lastView.getTranslationY() + lastView.getActualHeight()
+ - lastView.getClipBottomAmount());
+ // The background can never be lower than the end of the last view
+ minBottomPosition = (int) Math.min(
+ lastView.getTranslationY() + lastView.getActualHeight(),
+ minBottomPosition);
+ }
+ bottom = Math.max(bottom, Math.max(newBottom, minBottomPosition));
+ }
+ bottom = Math.max(top, bottom);
+ mBounds.top = top;
+ mBounds.bottom = bottom;
+ return bottom;
+ }
+
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java
index fbf1e310abf2..a54de5f0f5a9 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java
@@ -88,6 +88,7 @@ import com.android.systemui.plugins.statusbar.NotificationMenuRowPlugin.OnMenuEv
import com.android.systemui.plugins.statusbar.NotificationSwipeActionHelper;
import com.android.systemui.plugins.statusbar.StatusBarStateController;
import com.android.systemui.plugins.statusbar.StatusBarStateController.StateListener;
+import com.android.systemui.statusbar.AmbientPulseManager;
import com.android.systemui.statusbar.CommandQueue;
import com.android.systemui.statusbar.DragDownHelper.DragDownCallback;
import com.android.systemui.statusbar.EmptyShadeView;
@@ -167,6 +168,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd
* gap is drawn between them). In this case we don't want to round their corners.
*/
private static final int DISTANCE_BETWEEN_ADJACENT_SECTIONS_PX = 1;
+ private final AmbientPulseManager mAmbientPulseManager;
private ExpandHelper mExpandHelper;
private final NotificationSwipeHelper mSwipeHelper;
@@ -363,6 +365,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd
};
protected ViewGroup mQsContainer;
private boolean mContinuousShadowUpdate;
+ private boolean mContinuousBackgroundUpdate;
private ViewTreeObserver.OnPreDrawListener mShadowUpdater
= new ViewTreeObserver.OnPreDrawListener() {
@@ -372,6 +375,10 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd
return true;
}
};
+ private ViewTreeObserver.OnPreDrawListener mBackgroundUpdater = () -> {
+ updateBackground();
+ return true;
+ };
private Comparator<ExpandableView> mViewPositionComparator = new Comparator<ExpandableView>() {
@Override
public int compare(ExpandableView view, ExpandableView otherView) {
@@ -392,7 +399,6 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd
private boolean mGroupExpandedForMeasure;
private boolean mScrollable;
private View mForcedScroll;
- private ExpandableView mNeedingPulseAnimation;
/**
* @see #setDarkAmount(float, float)
@@ -481,7 +487,8 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd
@Named(VIEW_CONTEXT) Context context,
AttributeSet attrs,
@Named(ALLOW_NOTIFICATION_LONG_PRESS_NAME) boolean allowLongPress,
- NotificationRoundnessManager notificationRoundnessManager) {
+ NotificationRoundnessManager notificationRoundnessManager,
+ AmbientPulseManager ambientPulseManager) {
super(context, attrs, 0, 0);
Resources res = getResources();
@@ -491,6 +498,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd
mSections[i] = new NotificationSection(this);
}
+ mAmbientPulseManager = ambientPulseManager;
mAmbientState = new AmbientState(context);
mRoundnessManager = notificationRoundnessManager;
mBgColor = context.getColor(R.color.notification_shade_background_color);
@@ -575,6 +583,17 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd
}
}
+ /**
+ * @return the height at which we will wake up when pulsing
+ */
+ public float getPulseHeight() {
+ ActivatableNotificationView firstChild = getFirstChildWithBackground();
+ if (firstChild != null) {
+ return firstChild.getCollapsedHeight();
+ }
+ return 0f;
+ }
+
@Override
@ShadeViewRefactor(RefactorComponent.SHADE_VIEW)
public void onDensityOrFontScaleChanged() {
@@ -802,26 +821,32 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd
int backgroundRectTop = top;
int lastSectionBottom =
mSections[0].getCurrentBounds().bottom + animationYOffset;
+ int previousLeft = left;
+ boolean first = true;
for (NotificationSection section : mSections) {
if (section.getFirstVisibleChild() == null) {
continue;
}
int sectionTop = section.getCurrentBounds().top + animationYOffset;
+ int ownLeft = Math.min(Math.max(left, section.getCurrentBounds().left), right);
// If sections are directly adjacent to each other, we don't want to draw them
// as separate roundrects, as the rounded corners right next to each other look
// bad.
- if (sectionTop - lastSectionBottom > DISTANCE_BETWEEN_ADJACENT_SECTIONS_PX) {
- canvas.drawRoundRect(left,
+ if (sectionTop - lastSectionBottom > DISTANCE_BETWEEN_ADJACENT_SECTIONS_PX
+ || (previousLeft != ownLeft && !first)) {
+ canvas.drawRoundRect(ownLeft,
backgroundRectTop,
right,
lastSectionBottom,
mCornerRadius, mCornerRadius, mBackgroundPaint);
backgroundRectTop = sectionTop;
}
+ previousLeft = ownLeft;
lastSectionBottom =
section.getCurrentBounds().bottom + animationYOffset;
+ first = false;
}
- canvas.drawRoundRect(left,
+ canvas.drawRoundRect(previousLeft,
backgroundRectTop,
right,
lastSectionBottom,
@@ -1277,7 +1302,8 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd
mIsClipped = clipped;
}
- if (mPulsing || mAmbientState.isFullyDark() && mShowDarkShelf) {
+ if (!mAmbientPulseManager.hasNotifications()
+ && mAmbientState.isFullyDark() && mShowDarkShelf) {
setClipBounds(null);
} else if (mAmbientState.isDarkAtAll()) {
setClipBounds(mBackgroundAnimationRect);
@@ -1360,7 +1386,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd
private boolean isHeadsUpTransition() {
NotificationSection firstVisibleSection = getFirstVisibleSection();
return mTrackingHeadsUp && firstVisibleSection != null
- && mAmbientState.isAboveShelf(firstVisibleSection.getFirstVisibleChild());
+ && firstVisibleSection.getFirstVisibleChild().isAboveShelf();
}
/**
@@ -1514,7 +1540,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd
return null;
}
- private ExpandableView getChildAtRawPosition(float touchX, float touchY) {
+ public ExpandableView getChildAtRawPosition(float touchX, float touchY) {
getLocationOnScreen(mTempInt2);
return getChildAtPosition(touchX - mTempInt2[0], touchY - mTempInt2[1]);
}
@@ -2258,9 +2284,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd
float previousPaddingAmount = 0.0f;
int numShownItems = 0;
boolean finish = false;
- int maxDisplayedNotifications = mAmbientState.isFullyDark()
- ? (hasPulsingNotifications() ? 1 : 0)
- : mMaxDisplayedNotifications;
+ int maxDisplayedNotifications = mMaxDisplayedNotifications;
for (int i = 0; i < getChildCount(); i++) {
ExpandableView expandableView = (ExpandableView) getChildAt(i);
@@ -2269,11 +2293,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd
&& !expandableView.hasNoContentHeight() && !footerViewOnLockScreen) {
boolean limitReached = maxDisplayedNotifications != -1
&& numShownItems >= maxDisplayedNotifications;
- boolean notificationOnAmbientThatIsNotPulsing = mAmbientState.isFullyDark()
- && hasPulsingNotifications()
- && expandableView instanceof ExpandableNotificationRow
- && !isPulsing(((ExpandableNotificationRow) expandableView).getEntry());
- if (limitReached || notificationOnAmbientThatIsNotPulsing) {
+ if (limitReached) {
expandableView = mShelf;
finish = true;
}
@@ -2450,129 +2470,24 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd
}
return;
}
- int top = getSectionTopOrFinalTop(getFirstVisibleSection(), mAnimateNextBackgroundTop);
+ int minTopPosition = 0;
NotificationSection lastSection = getLastVisibleSection();
- ActivatableNotificationView lastView =
- mShelf.hasItemsInStableShelf() && mShelf.getVisibility() != GONE
- ? mShelf
- : lastSection == null ? null : lastSection.getLastVisibleChild();
- int bottom;
- if (lastView != null) {
- bottom = getSectionBottomOrFinalBottom(
- lastSection, lastView, mAnimateNextBackgroundBottom);
- } else {
- top = mTopPadding;
- bottom = top;
- }
if (mStatusBarState != StatusBarState.KEYGUARD) {
- top = (int) Math.max(mTopPadding + mStackTranslation, top);
- } else {
- // otherwise the animation from the shade to the keyguard will jump as it's maxed
- top = Math.max(0, top);
- }
- bottom = Math.max(bottom, top);
-
- setSectionBoundsByPriority(left, right, top, bottom, mSections[0], mSections[1]);
- }
-
- private int getSectionTopOrFinalTop(
- @Nullable NotificationSection section, boolean alreadyAnimating) {
- int top = 0;
- if (section != null) {
- ActivatableNotificationView firstView = section.getFirstVisibleChild();
- if (firstView != null) {
- // Round Y up to avoid seeing the background during animation
- int finalTranslationY = (int) Math.ceil(ViewState.getFinalTranslationY(firstView));
- if (alreadyAnimating || section.isTargetTop(finalTranslationY)) {
- // we're ending up at the same location as we are now, let's just skip the
- // animation
- top = finalTranslationY;
- } else {
- top = (int) Math.ceil(firstView.getTranslationY());
- }
- }
+ minTopPosition = (int) (mTopPadding + mStackTranslation);
+ } else if (lastSection == null) {
+ minTopPosition = mTopPadding;
}
- return top;
- }
-
- private int getSectionBottomOrFinalBottom(
- @Nullable NotificationSection section, boolean alreadyAnimating) {
- return section == null ? 0
- : getSectionBottomOrFinalBottom(
- section, section.getLastVisibleChild(), alreadyAnimating);
- }
-
- private int getSectionBottomOrFinalBottom(
- NotificationSection section,
- ActivatableNotificationView lastView,
- boolean alreadyAnimating) {
- int bottom = 0;
- if (lastView != null) {
- float finalTranslationY;
- if (lastView == mShelf) {
- finalTranslationY = mShelf.getTranslationY();
- } else {
- finalTranslationY = ViewState.getFinalTranslationY(lastView);
- }
- int finalHeight = ExpandableViewState.getFinalActualHeight(lastView);
- // Round Y down to avoid seeing the background during animation
- int finalBottom = (int) Math.floor(
- finalTranslationY + finalHeight - lastView.getClipBottomAmount());
- if (alreadyAnimating || section.isTargetBottom(finalBottom)) {
- // we're ending up at the same location as we are now, lets just skip the animation
- bottom = finalBottom;
- } else {
- bottom = (int) (lastView.getTranslationY() + lastView.getActualHeight()
- - lastView.getClipBottomAmount());
- }
- }
- return bottom;
- }
-
- private void setSectionBoundsByPriority(int left, int right, int top, int bottom,
- NotificationSection highPrioritySection, NotificationSection lowPrioritySection) {
- if (NotificationUtils.useNewInterruptionModel(mContext)) {
- // TODO(kprevas): can we use section boundary indices from mAmbientState instead?
- ActivatableNotificationView lastChildAboveGap = getLastHighPriorityChild();
- ActivatableNotificationView firstChildBelowGap = getFirstLowPriorityChild();
- if (lastChildAboveGap != null && firstChildBelowGap != null) {
- int gapTop = getSectionBottomOrFinalBottom(
- highPrioritySection, mAnimateNextSectionBoundsChange);
- gapTop = Math.max(top, Math.min(gapTop, bottom));
-
- int gapBottom = getSectionTopOrFinalTop(
- lowPrioritySection, mAnimateNextSectionBoundsChange);
- gapBottom = Math.max(top, Math.min(gapBottom, bottom));
-
- highPrioritySection.getBounds().set(left, top, right, gapTop);
- lowPrioritySection.getBounds().set(left, gapBottom, right, bottom);
- } else if (lastChildAboveGap != null) {
- highPrioritySection.getBounds().set(left, top, right, bottom);
- lowPrioritySection.getBounds().set(left, bottom, right, bottom);
- } else {
- highPrioritySection.getBounds().set(left, top, right, top);
- lowPrioritySection.getBounds().set(left, top, right, bottom);
- }
- } else {
- highPrioritySection.getBounds().set(left, top, right, bottom);
- lowPrioritySection.getBounds().set(left, bottom, right, bottom);
- }
- }
-
- @ShadeViewRefactor(RefactorComponent.COORDINATOR)
- private ActivatableNotificationView getFirstPinnedHeadsUp() {
- int childCount = getChildCount();
- for (int i = 0; i < childCount; i++) {
- View child = getChildAt(i);
- if (child.getVisibility() != View.GONE
- && child instanceof ExpandableNotificationRow) {
- ExpandableNotificationRow row = (ExpandableNotificationRow) child;
- if (row.isPinned()) {
- return row;
- }
+ boolean shiftPulsingWithFirst = mAmbientPulseManager.getAllEntries().count() <= 1;
+ for (NotificationSection section : mSections) {
+ int minBottomPosition = minTopPosition;
+ if (section == lastSection) {
+ // We need to make sure the section goes all the way to the shelf
+ minBottomPosition = (int) (mShelf.getTranslationY() + mShelf.getIntrinsicHeight());
}
+ minTopPosition = section.updateBounds(minTopPosition, minBottomPosition,
+ shiftPulsingWithFirst);
+ shiftPulsingWithFirst = false;
}
- return null;
}
private NotificationSection getFirstVisibleSection() {
@@ -3462,7 +3377,6 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd
generateViewResizeEvent();
generateGroupExpansionEvent();
generateAnimateEverythingEvent();
- generatePulsingAnimationEvent();
}
@ShadeViewRefactor(RefactorComponent.STATE_RESOLVER)
@@ -4462,10 +4376,12 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd
}
@ShadeViewRefactor(RefactorComponent.COORDINATOR)
- public void setIsExpanded(boolean isExpanded) {
+ private void setIsExpanded(boolean isExpanded) {
boolean changed = isExpanded != mIsExpanded;
mIsExpanded = isExpanded;
mStackScrollAlgorithm.setIsExpanded(isExpanded);
+ mAmbientState.setShadeExpanded(isExpanded);
+ mStateAnimator.setShadeExpanded(isExpanded);
if (changed) {
if (!mIsExpanded) {
mGroupManager.collapseAllGroups();
@@ -5207,12 +5123,6 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd
}
}
- @ShadeViewRefactor(RefactorComponent.SHADE_VIEW)
- public void setShadeExpanded(boolean shadeExpanded) {
- mAmbientState.setShadeExpanded(shadeExpanded);
- mStateAnimator.setShadeExpanded(shadeExpanded);
- }
-
/**
* Set the boundary for the bottom heads up position. The heads up will always be above this
* position.
@@ -5274,24 +5184,12 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd
return;
}
mPulsing = pulsing;
- mNeedingPulseAnimation = animated ? getFirstChildNotGone() : null;
mAmbientState.setPulsing(pulsing);
updateNotificationAnimationStates();
updateAlgorithmHeightAndPadding();
updateContentHeight();
requestChildrenUpdate();
notifyHeightChangeListener(null, animated);
- mNeedsAnimation |= animated;
- }
-
- @ShadeViewRefactor(RefactorComponent.SHADE_VIEW)
- private void generatePulsingAnimationEvent() {
- if (mNeedingPulseAnimation != null) {
- int type = mPulsing ? AnimationEvent.ANIMATION_TYPE_PULSE_APPEAR
- : AnimationEvent.ANIMATION_TYPE_PULSE_DISAPPEAR;
- mAnimationEvents.add(new AnimationEvent(mNeedingPulseAnimation, type));
- mNeedingPulseAnimation = null;
- }
}
@ShadeViewRefactor(RefactorComponent.SHADE_VIEW)
@@ -5734,6 +5632,56 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd
}
/**
+ * Set how far the wake up is when waking up from pulsing. This is a height and will adjust the
+ * notification positions accordingly.
+ * @param height the new wake up height
+ * @return the overflow how much the height is further than he lowest notification
+ */
+ public float setPulseHeight(float height) {
+ mAmbientState.setPulseHeight(height);
+ requestChildrenUpdate();
+ return Math.max(0, height - mAmbientState.getInnerHeight(true /* ignorePulseHeight */));
+ }
+
+ /**
+ * Set the amount how much we're dozing. This is different from how dark the shade is, when
+ * the notification is pulsing.
+ */
+ public void setDozeAmount(float dozeAmount) {
+ mAmbientState.setDozeAmount(dozeAmount);
+ updateContinuousBackgroundDrawing();
+ requestChildrenUpdate();
+ }
+
+ public void wakeUpFromPulse() {
+ setPulseHeight(getPulseHeight());
+ // Let's place the hidden views at the end of the pulsing notification to make sure we have
+ // a smooth animation
+ boolean firstVisibleView = true;
+ float wakeUplocation = -1f;
+ int childCount = getChildCount();
+ for (int i = 0; i < childCount; i++) {
+ ExpandableView view = (ExpandableView) getChildAt(i);
+ if (view.getVisibility() == View.GONE) {
+ continue;
+ }
+ boolean isShelf = view == mShelf;
+ if (!(view instanceof ExpandableNotificationRow) && !isShelf) {
+ continue;
+ }
+ if (view.getVisibility() == View.VISIBLE && !isShelf) {
+ if (firstVisibleView) {
+ firstVisibleView = false;
+ wakeUplocation = view.getTranslationY()
+ + view.getActualHeight() - mShelf.getIntrinsicHeight();
+ }
+ } else if (!firstVisibleView) {
+ view.setTranslationY(wakeUplocation);
+ }
+ }
+ }
+
+ /**
* A listener that is notified when the empty space below the notifications is clicked on
*/
@ShadeViewRefactor(RefactorComponent.SHADE_VIEW)
@@ -5825,6 +5773,19 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd
mAmbientState.setSectionBoundaryIndex(0, gapIndex);
}
+ private void updateContinuousBackgroundDrawing() {
+ boolean continuousBackground = !mAmbientState.isFullyAwake()
+ && !mAmbientState.getDraggedViews().isEmpty();
+ if (continuousBackground != mContinuousBackgroundUpdate) {
+ mContinuousBackgroundUpdate = continuousBackground;
+ if (continuousBackground) {
+ getViewTreeObserver().addOnPreDrawListener(mBackgroundUpdater);
+ } else {
+ getViewTreeObserver().removeOnPreDrawListener(mBackgroundUpdater);
+ }
+ }
+ }
+
@ShadeViewRefactor(RefactorComponent.STATE_RESOLVER)
private void updateContinuousShadowDrawing() {
boolean continuousShadowUpdate = mAnimationRunning
@@ -5969,18 +5930,6 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd
.animateTopInset()
.animateY()
.animateZ(),
-
- // ANIMATION_TYPE_PULSE_APPEAR
- new AnimationFilter()
- .animateAlpha()
- .hasDelays()
- .animateY(),
-
- // ANIMATION_TYPE_PULSE_DISAPPEAR
- new AnimationFilter()
- .animateAlpha()
- .hasDelays()
- .animateY(),
};
static int[] LENGTHS = new int[]{
@@ -6035,12 +5984,6 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd
// ANIMATION_TYPE_EVERYTHING
StackStateAnimator.ANIMATION_DURATION_STANDARD,
-
- // ANIMATION_TYPE_PULSE_APPEAR
- StackStateAnimator.ANIMATION_DURATION_PULSE_APPEAR,
-
- // ANIMATION_TYPE_PULSE_DISAPPEAR
- StackStateAnimator.ANIMATION_DURATION_PULSE_APPEAR / 2,
};
static final int ANIMATION_TYPE_ADD = 0;
@@ -6060,8 +6003,6 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd
static final int ANIMATION_TYPE_HEADS_UP_DISAPPEAR_CLICK = 14;
static final int ANIMATION_TYPE_HEADS_UP_OTHER = 15;
static final int ANIMATION_TYPE_EVERYTHING = 16;
- static final int ANIMATION_TYPE_PULSE_APPEAR = 17;
- static final int ANIMATION_TYPE_PULSE_DISAPPEAR = 18;
static final int DARK_ANIMATION_ORIGIN_INDEX_ABOVE = -1;
static final int DARK_ANIMATION_ORIGIN_INDEX_BELOW = -2;
@@ -6198,8 +6139,8 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd
}
@Override
- public boolean isExpanded() {
- return NotificationStackScrollLayout.this.isExpanded();
+ public boolean shouldDismissQuickly() {
+ return NotificationStackScrollLayout.this.isExpanded() && mAmbientState.isFullyAwake();
}
@Override
@@ -6299,6 +6240,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd
setSwipingInProgress(true);
mAmbientState.onBeginDrag((ExpandableView) v);
updateContinuousShadowDrawing();
+ updateContinuousBackgroundDrawing();
requestChildrenUpdate();
}
@@ -6306,6 +6248,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd
public void onChildSnappedBack(View animView, float targetLeft) {
mAmbientState.onDragFinished(animView);
updateContinuousShadowDrawing();
+ updateContinuousBackgroundDrawing();
NotificationMenuRowPlugin menuRow = mSwipeHelper.getCurrentMenuRow();
if (menuRow != null && targetLeft == 0) {
menuRow.resetMenu();
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationSwipeHelper.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationSwipeHelper.java
index 975aee51228b..478427cc32a0 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationSwipeHelper.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationSwipeHelper.java
@@ -231,7 +231,7 @@ class NotificationSwipeHelper extends SwipeHelper
public void dismissChild(final View view, float velocity,
boolean useAccelerateInterpolator) {
superDismissChild(view, velocity, useAccelerateInterpolator);
- if (mCallback.isExpanded()) {
+ if (mCallback.shouldDismissQuickly()) {
// We don't want to quick-dismiss when it's a heads up as this might lead to closing
// of the panel early.
mCallback.handleChildViewDismissed(view);
@@ -418,7 +418,11 @@ class NotificationSwipeHelper extends SwipeHelper
}
public interface NotificationCallback extends SwipeHelper.Callback{
- boolean isExpanded();
+ /**
+ * @return if the view should be dismissed as soon as the touch is released, otherwise its
+ * removed when the animation finishes.
+ */
+ boolean shouldDismissQuickly();
void handleChildViewDismissed(View view);
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithm.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithm.java
index 7882fd32e044..f97a7e653104 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithm.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithm.java
@@ -101,6 +101,7 @@ public class StackScrollAlgorithm {
updateZValuesForState(algorithmState, ambientState);
updateHeadsUpStates(algorithmState, ambientState);
+ updatePulsingStates(algorithmState, ambientState);
updateDimmedActivatedHideSensitive(ambientState, algorithmState);
updateClipping(algorithmState, ambientState);
@@ -477,6 +478,23 @@ public class StackScrollAlgorithm {
return algorithmState.getPaddingAfterChild(child);
}
+ private void updatePulsingStates(StackScrollAlgorithmState algorithmState,
+ AmbientState ambientState) {
+ int childCount = algorithmState.visibleChildren.size();
+ for (int i = 0; i < childCount; i++) {
+ View child = algorithmState.visibleChildren.get(i);
+ if (!(child instanceof ExpandableNotificationRow)) {
+ continue;
+ }
+ ExpandableNotificationRow row = (ExpandableNotificationRow) child;
+ if (!row.showingAmbientPulsing() || (i == 0 && ambientState.isPulseExpanding())) {
+ continue;
+ }
+ ExpandableViewState viewState = row.getViewState();
+ viewState.hidden = false;
+ }
+ }
+
private void updateHeadsUpStates(StackScrollAlgorithmState algorithmState,
AmbientState ambientState) {
int childCount = algorithmState.visibleChildren.size();
@@ -501,7 +519,7 @@ public class StackScrollAlgorithm {
if (row.mustStayOnScreen() && !childState.headsUpIsVisible) {
// Ensure that the heads up is always visible even when scrolled off
clampHunToTop(ambientState, row, childState);
- if (i == 0 && ambientState.isAboveShelf(row)) {
+ if (i == 0 && row.isAboveShelf()) {
// the first hun can't get off screen.
clampHunToMaxTranslation(ambientState, row, childState);
childState.hidden = false;
@@ -635,7 +653,7 @@ public class StackScrollAlgorithm {
}
childViewState.zTranslation = baseZ
+ childrenOnTop * zDistanceBetweenElements;
- } else if (i == 0 && ambientState.isAboveShelf(child)) {
+ } else if (i == 0 && child.isAboveShelf()) {
// In case this is a new view that has never been measured before, we don't want to
// elevate if we are currently expanded more then the notification
int shelfHeight = ambientState.getShelf() == null ? 0 :
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackStateAnimator.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackStateAnimator.java
index b4c205ab980c..7332b034b9bf 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackStateAnimator.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackStateAnimator.java
@@ -419,32 +419,6 @@ public class StackStateAnimator {
ExpandableNotificationRow row = (ExpandableNotificationRow) event.mChangingView;
row.prepareExpansionChanged();
} else if (event.animationType == NotificationStackScrollLayout
- .AnimationEvent.ANIMATION_TYPE_PULSE_APPEAR) {
- ExpandableViewState viewState = changingView.getViewState();
- if (viewState != null) {
- mTmpState.copyFrom(viewState);
- mTmpState.yTranslation += mPulsingAppearingTranslation;
- mTmpState.alpha = 0;
- mTmpState.applyToView(changingView);
-
- mTmpState.copyFrom(mShelf.getViewState());
- mTmpState.applyToView(mShelf);
- }
- } else if (event.animationType == NotificationStackScrollLayout
- .AnimationEvent.ANIMATION_TYPE_PULSE_DISAPPEAR) {
- ExpandableViewState viewState = changingView.getViewState();
- if (viewState != null) {
- viewState.alpha = 0;
- // We want to animate the alpha away before the view starts translating,
- // otherwise everything will overlap and look xtra ugly.
- float originalYTranslation = viewState.yTranslation;
- viewState.yTranslation = changingView.getTranslationY();
- mAnimationFilter.animateAlpha = true;
- mAnimationProperties.duration = ANIMATION_DURATION_PULSE_APPEAR / 2;
- viewState.animateTo(changingView, mAnimationProperties);
- viewState.yTranslation = originalYTranslation;
- }
- } else if (event.animationType == NotificationStackScrollLayout
.AnimationEvent.ANIMATION_TYPE_HEADS_UP_APPEAR) {
// This item is added, initialize it's properties.
ExpandableViewState viewState = changingView.getViewState();
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarFragment.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarFragment.java
index 1eb499048db8..9be47f742ed9 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarFragment.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarFragment.java
@@ -185,6 +185,11 @@ public class NavigationBarFragment extends LifecycleFragment implements Callback
}
@Override
+ public void startAssistant(Bundle bundle) {
+ mAssistManager.startAssist(bundle);
+ }
+
+ @Override
public void onBackButtonAlphaChanged(float alpha, boolean animate) {
final ButtonDispatcher backButton = mNavigationBarView.getBackButton();
if (QuickStepController.shouldhideBackButton(getContext())) {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
index f4fa1e8246e6..a35488518faa 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
@@ -18,6 +18,10 @@ package com.android.systemui.statusbar.phone;
import static com.android.systemui.SysUiServiceProvider.getComponent;
import static com.android.systemui.statusbar.notification.ActivityLaunchAnimator.ExpandAnimationParameters;
+import static com.android.systemui.util.InjectionInflationController.VIEW_CONTEXT;
+
+
+import static com.android.systemui.util.InjectionInflationController.VIEW_CONTEXT;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
@@ -72,11 +76,13 @@ import com.android.systemui.statusbar.KeyguardAffordanceView;
import com.android.systemui.statusbar.KeyguardIndicationController;
import com.android.systemui.statusbar.NotificationLockscreenUserManager;
import com.android.systemui.statusbar.NotificationShelf;
+import com.android.systemui.statusbar.PulseExpansionHandler;
import com.android.systemui.statusbar.RemoteInputController;
import com.android.systemui.statusbar.StatusBarState;
import com.android.systemui.statusbar.notification.ActivityLaunchAnimator;
import com.android.systemui.statusbar.notification.AnimatableProperty;
import com.android.systemui.statusbar.notification.NotificationEntryManager;
+import com.android.systemui.statusbar.notification.NotificationWakeUpCoordinator;
import com.android.systemui.statusbar.notification.PropertyAnimator;
import com.android.systemui.statusbar.notification.collection.NotificationEntry;
import com.android.systemui.statusbar.notification.row.ActivatableNotificationView;
@@ -96,12 +102,16 @@ import java.util.ArrayList;
import java.util.List;
import java.util.function.Consumer;
+import javax.inject.Inject;
+import javax.inject.Named;
+
public class NotificationPanelView extends PanelView implements
ExpandableView.OnHeightChangedListener,
View.OnClickListener, NotificationStackScrollLayout.OnOverscrollTopChangedListener,
KeyguardAffordanceHelper.Callback, NotificationStackScrollLayout.OnEmptySpaceClickListener,
OnHeadsUpChangedListener, QS.HeightListener, ZenModeController.Callback,
- ConfigurationController.ConfigurationListener, StateListener {
+ ConfigurationController.ConfigurationListener, StateListener,
+ PulseExpansionHandler.ExpansionCallback {
private static final boolean DEBUG = false;
@@ -136,6 +146,8 @@ public class NotificationPanelView extends PanelView implements
private final PowerManager mPowerManager;
private final AccessibilityManager mAccessibilityManager;
+ private final NotificationWakeUpCoordinator mWakeUpCoordinator;
+ private final PulseExpansionHandler mPulseExpansionHandler;
private KeyguardAffordanceHelper mAffordanceHelper;
private KeyguardUserSwitcher mKeyguardUserSwitcher;
@@ -317,17 +329,22 @@ public class NotificationPanelView extends PanelView implements
Dependency.get(ShadeController.class);
private int mDisplayId;
- public NotificationPanelView(Context context, AttributeSet attrs) {
+ @Inject
+ public NotificationPanelView(@Named(VIEW_CONTEXT) Context context, AttributeSet attrs,
+ NotificationWakeUpCoordinator coordinator,
+ PulseExpansionHandler pulseExpansionHandler) {
super(context, attrs);
setWillNotDraw(!DEBUG);
mFalsingManager = FalsingManager.getInstance(context);
mPowerManager = context.getSystemService(PowerManager.class);
+ mWakeUpCoordinator = coordinator;
mAccessibilityManager = context.getSystemService(AccessibilityManager.class);
setAccessibilityPaneTitle(determineAccessibilityPaneTitle());
mAlphaPaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.MULTIPLY));
setPanelAlpha(255, false /* animate */);
mCommandQueue = getComponent(context, CommandQueue.class);
mDisplayId = context.getDisplayId();
+ mPulseExpansionHandler = pulseExpansionHandler;
}
/**
@@ -364,7 +381,9 @@ public class NotificationPanelView extends PanelView implements
initBottomArea();
+ mWakeUpCoordinator.setStackScroller(mNotificationStackScroller);
mQsFrame = findViewById(R.id.qs_frame);
+ mPulseExpansionHandler.setUp(mNotificationStackScroller, this, mShadeController);
}
@Override
@@ -594,8 +613,7 @@ public class NotificationPanelView extends PanelView implements
stackScrollerPadding = mClockPositionResult.stackScrollerPadding;
}
mNotificationStackScroller.setIntrinsicPadding(stackScrollerPadding);
- int burnInXOffset = mPulsing ? 0 : mClockPositionResult.clockX;
- mNotificationStackScroller.setAntiBurnInOffsetX(burnInXOffset);
+ mNotificationStackScroller.setAntiBurnInOffsetX(mClockPositionResult.clockX);
mStackScrollerMeasuringPass++;
requestScrollerTopPaddingUpdate(animate);
@@ -786,6 +804,9 @@ public class NotificationPanelView extends PanelView implements
MetricsLogger.count(mContext, COUNTER_PANEL_OPEN_PEEK, 1);
return true;
}
+ if (mPulseExpansionHandler.onInterceptTouchEvent(event)) {
+ return true;
+ }
if (!isFullyCollapsed() && onQsIntercept(event)) {
return true;
@@ -945,6 +966,10 @@ public class NotificationPanelView extends PanelView implements
return false;
}
initDownStates(event);
+ if (!mIsExpanding && mPulseExpansionHandler.onTouchEvent(event)) {
+ // We're expanding all the other ones shouldn't get this anymore
+ return true;
+ }
if (mListenForHeadsUp && !mHeadsUpTouchHelper.isTrackingHeadsUp()
&& mHeadsUpTouchHelper.onInterceptTouchEvent(event)) {
mIsExpansionFromHeadsUp = true;
@@ -1488,16 +1513,16 @@ public class NotificationPanelView extends PanelView implements
int max = mBarState == StatusBarState.KEYGUARD
? Math.max(maxNotificationPadding, maxQsPadding)
: maxQsPadding;
- return (int) interpolate(getExpandedFraction(),
- mQsMinExpansionHeight, max);
+ return (int) MathUtils.lerp((float) mQsMinExpansionHeight, (float) max,
+ getExpandedFraction());
} else if (mQsSizeChangeAnimator != null) {
return (int) mQsSizeChangeAnimator.getAnimatedValue();
} else if (mKeyguardShowing) {
// We can only do the smoother transition on Keyguard when we also are not collapsing
// from a scrolled quick settings.
- return interpolate(getQsExpansionFraction(),
- mNotificationStackScroller.getIntrinsicPadding(),
- mQsMaxExpansionHeight + mQsNotificationTopPadding);
+ return MathUtils.lerp((float) mNotificationStackScroller.getIntrinsicPadding(),
+ (float) (mQsMaxExpansionHeight + mQsNotificationTopPadding),
+ getQsExpansionFraction());
} else {
return mQsExpansionHeight + mQsNotificationTopPadding;
}
@@ -1698,7 +1723,6 @@ public class NotificationPanelView extends PanelView implements
updateUnlockIcon();
updateNotificationTranslucency();
updatePanelExpanded();
- mNotificationStackScroller.setShadeExpanded(!isFullyCollapsed());
if (DEBUG) {
invalidate();
}
@@ -2812,9 +2836,6 @@ public class NotificationPanelView extends PanelView implements
final float darkAmount = dozing ? 1 : 0;
mStatusBarStateController.setDozeAmount(darkAmount, animate);
- if (animate) {
- mNotificationStackScroller.notifyDarkAnimationStart(mDozing);
- }
}
@Override
@@ -2825,7 +2846,6 @@ public class NotificationPanelView extends PanelView implements
mKeyguardStatusView.setDarkAmount(mInterpolatedDarkAmount);
mKeyguardBottomArea.setDarkAmount(mInterpolatedDarkAmount);
positionClockAndNotifications();
- mNotificationStackScroller.setDarkAmount(linearAmount, mInterpolatedDarkAmount);
}
public void setPulsing(boolean pulsing) {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java
index 4d0c8c3a7fb6..2495d2253abb 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java
@@ -1172,9 +1172,11 @@ public abstract class PanelView extends FrameLayout {
}
protected void notifyBarPanelExpansionChanged() {
- mBar.panelExpansionChanged(mExpandedFraction, mExpandedFraction > 0f
- || mPeekAnimator != null || mInstantExpanding || isPanelVisibleBecauseOfHeadsUp()
- || mTracking || mHeightAnimator != null);
+ if (mBar != null) {
+ mBar.panelExpansionChanged(mExpandedFraction, mExpandedFraction > 0f
+ || mPeekAnimator != null || mInstantExpanding
+ || isPanelVisibleBecauseOfHeadsUp() || mTracking || mHeightAnimator != null);
+ }
if (mExpansionListener != null) {
mExpansionListener.accept(mExpandedFraction, mTracking);
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
index 41580f6146de..d18b4190400a 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
@@ -184,6 +184,7 @@ import com.android.systemui.statusbar.NotificationPresenter;
import com.android.systemui.statusbar.NotificationRemoteInputManager;
import com.android.systemui.statusbar.NotificationShelf;
import com.android.systemui.statusbar.NotificationViewHierarchyManager;
+import com.android.systemui.statusbar.PulseExpansionHandler;
import com.android.systemui.statusbar.ScrimView;
import com.android.systemui.statusbar.StatusBarState;
import com.android.systemui.statusbar.SysuiStatusBarStateController;
@@ -195,6 +196,7 @@ import com.android.systemui.statusbar.notification.NotificationClicker;
import com.android.systemui.statusbar.notification.NotificationEntryManager;
import com.android.systemui.statusbar.notification.NotificationInterruptionStateProvider;
import com.android.systemui.statusbar.notification.NotificationListController;
+import com.android.systemui.statusbar.notification.NotificationWakeUpCoordinator;
import com.android.systemui.statusbar.notification.VisualStabilityManager;
import com.android.systemui.statusbar.notification.collection.NotificationEntry;
import com.android.systemui.statusbar.notification.collection.NotificationRowBinderImpl;
@@ -363,6 +365,10 @@ public class StatusBar extends SystemUI implements DemoMode,
protected StatusBarIconController mIconController;
@Inject
InjectionInflationController mInjectionInflater;
+ @Inject
+ PulseExpansionHandler mPulseExpansionHandler;
+ @Inject
+ NotificationWakeUpCoordinator mWakeUpCoordinator;
// expanded notifications
protected NotificationPanelView mNotificationPanel; // the sliding/resizing panel within the notification window
@@ -1079,7 +1085,7 @@ public class StatusBar extends SystemUI implements DemoMode,
@Override
public boolean isDozing() {
- return mDozing && mNotificationPanel.isFullyDark();
+ return mDozing;
}
@Override
@@ -2965,7 +2971,7 @@ public class StatusBar extends SystemUI implements DemoMode,
mHandler.removeMessages(MSG_LAUNCH_TRANSITION_TIMEOUT);
if (mUserSwitcherController != null && mUserSwitcherController.useFullscreenUserSwitcher()) {
mStatusBarStateController.setState(StatusBarState.FULLSCREEN_USER_SWITCHER);
- } else {
+ } else if (!mPulseExpansionHandler.isWakingToShadeLocked()){
mStatusBarStateController.setState(StatusBarState.KEYGUARD);
}
updatePanelExpansionForKeyguard();
@@ -3588,12 +3594,19 @@ public class StatusBar extends SystemUI implements DemoMode,
@Override
public void onStartedWakingUp() {
mDeviceInteractive = true;
+ mWakeUpCoordinator.setWakingUp(true);
mAmbientPulseManager.releaseAllImmediately();
mVisualStabilityManager.setScreenOn(true);
updateNotificationPanelTouchState();
updateVisibleToUser();
updateIsKeyguard();
mDozeServiceHost.stopDozing();
+ mPulseExpansionHandler.onStartedWakingUp();
+ }
+
+ @Override
+ public void onFinishedWakingUp() {
+ mWakeUpCoordinator.setWakingUp(false);
}
};
@@ -3896,6 +3909,7 @@ public class StatusBar extends SystemUI implements DemoMode,
mKeyguardUpdateMonitor.onAuthInterruptDetected(pulsing /* active */);
}
updateScrimController();
+ mPulseExpansionHandler.setPulsing(pulsing);
}
}, reason);
// DozeScrimController is in pulse state, now let's ask ScrimController to start
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowView.java
index 50c4fac31bbf..a8ae5f65a2a0 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowView.java
@@ -388,7 +388,8 @@ public class StatusBarWindowView extends FrameLayout {
if (mNotificationPanel.isFullyExpanded()
&& stackScrollLayout.getVisibility() == View.VISIBLE
&& mStatusBarStateController.getState() == StatusBarState.KEYGUARD
- && !mService.isBouncerShowing()) {
+ && !mService.isBouncerShowing()
+ && !mService.isDozing()) {
intercept = mDragDownHelper.onInterceptTouchEvent(ev);
}
if (!intercept) {
diff --git a/packages/SystemUI/src/com/android/systemui/util/InjectionInflationController.java b/packages/SystemUI/src/com/android/systemui/util/InjectionInflationController.java
index faebf60dc688..c6636b480bfa 100644
--- a/packages/SystemUI/src/com/android/systemui/util/InjectionInflationController.java
+++ b/packages/SystemUI/src/com/android/systemui/util/InjectionInflationController.java
@@ -27,6 +27,7 @@ import com.android.systemui.SystemUIFactory;
import com.android.systemui.qs.QSFooterImpl;
import com.android.systemui.qs.QuickStatusBarHeader;
import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayout;
+import com.android.systemui.statusbar.phone.NotificationPanelView;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
@@ -118,6 +119,11 @@ public class InjectionInflationController {
* Creates the NotificationStackScrollLayout.
*/
NotificationStackScrollLayout createNotificationStackScrollLayout();
+
+ /**
+ * Creates the NotificationPanelView.
+ */
+ NotificationPanelView createPanelView();
}
/**
diff --git a/packages/SystemUI/tests/src/com/android/keyguard/KeyguardUpdateMonitorTest.java b/packages/SystemUI/tests/src/com/android/keyguard/KeyguardUpdateMonitorTest.java
index d5a275ebd78e..ffe3ece52e45 100644
--- a/packages/SystemUI/tests/src/com/android/keyguard/KeyguardUpdateMonitorTest.java
+++ b/packages/SystemUI/tests/src/com/android/keyguard/KeyguardUpdateMonitorTest.java
@@ -106,6 +106,7 @@ public class KeyguardUpdateMonitorTest extends SysuiTestCase {
when(mFaceManager.hasEnrolledTemplates()).thenReturn(true);
when(mFaceManager.hasEnrolledTemplates(anyInt())).thenReturn(true);
when(mUserManager.isUserUnlocked(anyInt())).thenReturn(true);
+ when(mUserManager.isPrimaryUser()).thenReturn(true);
when(mStrongAuthTracker.isUnlockingWithBiometricAllowed()).thenReturn(true);
context.addMockSystemService(TrustManager.class, mTrustManager);
context.addMockSystemService(FingerprintManager.class, mFingerprintManager);
@@ -320,16 +321,6 @@ public class KeyguardUpdateMonitorTest extends SysuiTestCase {
}
@Test
- public void testNeverAuthenticates_whenFaceLockout() {
- mKeyguardUpdateMonitor.mFaceAuthenticationCallback
- .onAuthenticationError(FaceManager.FACE_ERROR_LOCKOUT, "lockout");
- mKeyguardUpdateMonitor.sendKeyguardBouncerChanged(true);
- mTestableLooper.processAllMessages();
-
- verify(mFaceManager, never()).authenticate(any(), any(), anyInt(), any(), any());
- }
-
- @Test
public void testOnFaceAuthenticated_skipsFaceWhenAuthenticated() {
mKeyguardUpdateMonitor.onFaceAuthenticated(KeyguardUpdateMonitor.getCurrentUser());
mKeyguardUpdateMonitor.sendKeyguardBouncerChanged(true);
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutTest.java
index 85eb8be8cad8..1f5759357d8e 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutTest.java
@@ -53,6 +53,7 @@ import com.android.systemui.R;
import com.android.systemui.SysuiTestCase;
import com.android.systemui.plugins.statusbar.NotificationMenuRowPlugin;
import com.android.systemui.plugins.statusbar.StatusBarStateController;
+import com.android.systemui.statusbar.AmbientPulseManager;
import com.android.systemui.statusbar.EmptyShadeView;
import com.android.systemui.statusbar.NotificationPresenter;
import com.android.systemui.statusbar.NotificationRemoteInputManager;
@@ -142,7 +143,8 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase {
// holds a copy of the CUT's instances of these classes, so they still refer to the CUT's
// member variables, not the spy's member variables.
mStackScrollerInternal = new NotificationStackScrollLayout(getContext(), null,
- true /* allowLongPress */, mNotificationRoundnessManager);
+ true /* allowLongPress */, mNotificationRoundnessManager,
+ new AmbientPulseManager(mContext));
mStackScroller = spy(mStackScrollerInternal);
mStackScroller.setShelf(notificationShelf);
mStackScroller.setStatusBar(mBar);
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationSwipeHelperTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationSwipeHelperTest.java
index 84a0d3c7d779..b24c3ddc1199 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationSwipeHelperTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationSwipeHelperTest.java
@@ -212,7 +212,7 @@ public class NotificationSwipeHelperTest extends SysuiTestCase {
@Test
public void testDismissChild_notExpanded() {
- when(mCallback.isExpanded()).thenReturn(false);
+ when(mCallback.shouldDismissQuickly()).thenReturn(false);
doNothing().when(mSwipeHelper).superDismissChild(mView, 0, false);
doNothing().when(mSwipeHelper).handleMenuCoveredOrDismissed();
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationPanelViewTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationPanelViewTest.java
index b7bcba433186..db8357a5a9db 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationPanelViewTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationPanelViewTest.java
@@ -29,8 +29,12 @@ import androidx.test.filters.SmallTest;
import com.android.keyguard.KeyguardStatusView;
import com.android.systemui.SysuiTestCase;
import com.android.systemui.plugins.statusbar.StatusBarStateController;
+import com.android.systemui.statusbar.AmbientPulseManager;
import com.android.systemui.statusbar.NotificationLockscreenUserManager;
+import com.android.systemui.statusbar.PulseExpansionHandler;
+import com.android.systemui.statusbar.StatusBarStateControllerImpl;
import com.android.systemui.statusbar.SysuiStatusBarStateController;
+import com.android.systemui.statusbar.notification.NotificationWakeUpCoordinator;
import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayout;
import com.android.systemui.statusbar.policy.ConfigurationController;
import com.android.systemui.statusbar.policy.ZenModeController;
@@ -66,7 +70,12 @@ public class NotificationPanelViewTest extends SysuiTestCase {
mDependency.injectMockDependency(NotificationLockscreenUserManager.class);
mDependency.injectMockDependency(ConfigurationController.class);
mDependency.injectMockDependency(ZenModeController.class);
- mNotificationPanelView = new TestableNotificationPanelView();
+ NotificationWakeUpCoordinator coordinator =
+ new NotificationWakeUpCoordinator(
+ new AmbientPulseManager(mContext),
+ new StatusBarStateControllerImpl());
+ PulseExpansionHandler expansionHandler = new PulseExpansionHandler(mContext, coordinator);
+ mNotificationPanelView = new TestableNotificationPanelView(coordinator, expansionHandler);
}
@Test
@@ -93,8 +102,9 @@ public class NotificationPanelViewTest extends SysuiTestCase {
}
private class TestableNotificationPanelView extends NotificationPanelView {
- TestableNotificationPanelView() {
- super(NotificationPanelViewTest.this.mContext, null);
+ TestableNotificationPanelView(NotificationWakeUpCoordinator coordinator,
+ PulseExpansionHandler expansionHandler) {
+ super(NotificationPanelViewTest.this.mContext, null, coordinator, expansionHandler);
mNotificationStackScroller = mNotificationStackScrollLayout;
mKeyguardStatusView = NotificationPanelViewTest.this.mKeyguardStatusView;
mKeyguardStatusBar = NotificationPanelViewTest.this.mKeyguardStatusBar;
diff --git a/proto/src/wifi.proto b/proto/src/wifi.proto
index 2214ac54c3e4..f106ced8e484 100644
--- a/proto/src/wifi.proto
+++ b/proto/src/wifi.proto
@@ -660,6 +660,26 @@ message ConnectionEvent {
HLF_UNWANTED = 4;
}
+ // Level 2 failure reason.
+ enum Level2FailureReason {
+
+ // Unknown default
+ FAILURE_REASON_UNKNOWN = 0;
+
+ // The reason code if there is no error during authentication. It could
+ // also imply that there no authentication in progress.
+ AUTH_FAILURE_NONE = 1;
+
+ // The reason code if there was a timeout authenticating.
+ AUTH_FAILURE_TIMEOUT = 2;
+
+ // The reason code if there was a wrong password while authenticating.
+ AUTH_FAILURE_WRONG_PSWD = 3;
+
+ // The reason code if there was EAP failure while authenticating.
+ AUTH_FAILURE_EAP_FAILURE = 4;
+ }
+
// Entity that recommended connecting to this network.
enum ConnectionNominator {
// Unknown nominator
@@ -728,6 +748,10 @@ message ConnectionEvent {
// The currently running network selector when this connection event occurred.
optional int32 network_selector_experiment_id = 12;
+
+ // Breakdown of level_2_failure_code with more detailed reason.
+ optional Level2FailureReason level_2_failure_reason = 13
+ [default = FAILURE_REASON_UNKNOWN];
}
// Number of occurrences of a specific RSSI poll rssi value
diff --git a/services/core/java/com/android/server/ConnectivityService.java b/services/core/java/com/android/server/ConnectivityService.java
index 9dc673b848e5..d2c39eaeafb7 100644
--- a/services/core/java/com/android/server/ConnectivityService.java
+++ b/services/core/java/com/android/server/ConnectivityService.java
@@ -5631,6 +5631,8 @@ public class ConnectivityService extends IConnectivityManager.Stub
}
public void handleUpdateLinkProperties(NetworkAgentInfo nai, LinkProperties newLp) {
+ ensureRunningOnConnectivityServiceThread();
+
if (getNetworkAgentInfoForNetId(nai.network.netId) != nai) {
// Ignore updates for disconnected networks
return;
diff --git a/services/core/java/com/android/server/LocationManagerService.java b/services/core/java/com/android/server/LocationManagerService.java
index d7cc19b6dbd4..18e990676fbc 100644
--- a/services/core/java/com/android/server/LocationManagerService.java
+++ b/services/core/java/com/android/server/LocationManagerService.java
@@ -22,6 +22,7 @@ import static android.location.LocationManager.GPS_PROVIDER;
import static android.location.LocationManager.NETWORK_PROVIDER;
import static android.location.LocationManager.PASSIVE_PROVIDER;
import static android.location.LocationProvider.AVAILABLE;
+import static android.os.PowerManager.locationPowerSaveModeToString;
import static android.provider.Settings.Global.LOCATION_DISABLE_STATUS_CALLBACKS;
import static com.android.internal.util.Preconditions.checkNotNull;
@@ -69,6 +70,8 @@ import android.os.Handler;
import android.os.IBinder;
import android.os.IInterface;
import android.os.PowerManager;
+import android.os.PowerManager.ServiceType;
+import android.os.PowerManagerInternal;
import android.os.Process;
import android.os.RemoteException;
import android.os.SystemClock;
@@ -254,6 +257,10 @@ public class LocationManagerService extends ILocationManager.Stub {
@GuardedBy("mLock")
private boolean mGnssBatchingInProgress = false;
+ @GuardedBy("mLock")
+ @PowerManager.LocationPowerSaveMode
+ private int mBatterySaverMode;
+
public LocationManagerService(Context context) {
super();
mContext = context;
@@ -376,6 +383,14 @@ public class LocationManagerService extends ILocationManager.Stub {
}
}
}, UserHandle.USER_ALL);
+ PowerManagerInternal localPowerManager =
+ LocalServices.getService(PowerManagerInternal.class);
+ localPowerManager.registerLowPowerModeObserver(ServiceType.LOCATION,
+ state -> {
+ synchronized (mLock) {
+ onBatterySaverModeChangedLocked(state.locationMode);
+ }
+ });
new PackageMonitor() {
@Override
@@ -390,17 +405,29 @@ public class LocationManagerService extends ILocationManager.Stub {
intentFilter.addAction(Intent.ACTION_USER_SWITCHED);
intentFilter.addAction(Intent.ACTION_MANAGED_PROFILE_ADDED);
intentFilter.addAction(Intent.ACTION_MANAGED_PROFILE_REMOVED);
+ intentFilter.addAction(Intent.ACTION_SCREEN_OFF);
+ intentFilter.addAction(Intent.ACTION_SCREEN_ON);
mContext.registerReceiverAsUser(new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
+ final String action = intent.getAction();
+ if (action == null) {
+ return;
+ }
synchronized (mLock) {
- String action = intent.getAction();
- if (Intent.ACTION_USER_SWITCHED.equals(action)) {
- onUserChangedLocked(intent.getIntExtra(Intent.EXTRA_USER_HANDLE, 0));
- } else if (Intent.ACTION_MANAGED_PROFILE_ADDED.equals(action)
- || Intent.ACTION_MANAGED_PROFILE_REMOVED.equals(action)) {
- onUserProfilesChangedLocked();
+ switch (action) {
+ case Intent.ACTION_USER_SWITCHED:
+ onUserChangedLocked(intent.getIntExtra(Intent.EXTRA_USER_HANDLE, 0));
+ break;
+ case Intent.ACTION_MANAGED_PROFILE_ADDED:
+ case Intent.ACTION_MANAGED_PROFILE_REMOVED:
+ onUserProfilesChangedLocked();
+ break;
+ case Intent.ACTION_SCREEN_ON:
+ case Intent.ACTION_SCREEN_OFF:
+ onScreenStateChangedLocked();
+ break;
}
}
}
@@ -415,6 +442,7 @@ public class LocationManagerService extends ILocationManager.Stub {
// initialize in-memory settings values
onBackgroundThrottleWhitelistChangedLocked();
onIgnoreSettingsWhitelistChangedLocked();
+ onBatterySaverModeChangedLocked(mPowerManager.getLocationPowerSaveMode());
}
@GuardedBy("mLock")
@@ -435,6 +463,34 @@ public class LocationManagerService extends ILocationManager.Stub {
}
@GuardedBy("mLock")
+ private void onBatterySaverModeChangedLocked(int newLocationMode) {
+ if (D) {
+ Slog.d(TAG,
+ "Battery Saver location mode changed from "
+ + locationPowerSaveModeToString(mBatterySaverMode) + " to "
+ + locationPowerSaveModeToString(newLocationMode));
+ }
+
+ if (mBatterySaverMode == newLocationMode) {
+ return;
+ }
+
+ mBatterySaverMode = newLocationMode;
+ for (LocationProvider p : mProviders) {
+ applyRequirementsLocked(p);
+ }
+ }
+
+ @GuardedBy("mLock")
+ private void onScreenStateChangedLocked() {
+ if (mBatterySaverMode == PowerManager.LOCATION_MODE_THROTTLE_REQUESTS_WHEN_SCREEN_OFF) {
+ for (LocationProvider p : mProviders) {
+ applyRequirementsLocked(p);
+ }
+ }
+ }
+
+ @GuardedBy("mLock")
private void onLocationModeChangedLocked(boolean broadcast) {
if (D) {
Log.d(TAG, "location enabled is now " + isLocationEnabled());
@@ -1194,6 +1250,8 @@ public class LocationManagerService extends ILocationManager.Stub {
private class MockLocationProvider extends LocationProvider {
+ private ProviderRequest mCurrentRequest;
+
private MockLocationProvider(String name) {
super(name);
}
@@ -1232,6 +1290,13 @@ public class LocationManagerService extends ILocationManager.Stub {
}
}
+ @Override
+ @GuardedBy("mLock")
+ public void setRequestLocked(ProviderRequest request, WorkSource workSource) {
+ super.setRequestLocked(request, workSource);
+ mCurrentRequest = request;
+ }
+
@GuardedBy("mLock")
public void setStatusLocked(int status, Bundle extras, long updateTime) {
if (mProvider != null) {
@@ -2044,8 +2109,11 @@ public class LocationManagerService extends ILocationManager.Stub {
}
final boolean isForegroundOnlyMode =
- mPowerManager.getLocationPowerSaveMode()
- == PowerManager.LOCATION_MODE_FOREGROUND_ONLY;
+ mBatterySaverMode == PowerManager.LOCATION_MODE_FOREGROUND_ONLY;
+ final boolean shouldThrottleRequests =
+ mBatterySaverMode
+ == PowerManager.LOCATION_MODE_THROTTLE_REQUESTS_WHEN_SCREEN_OFF
+ && !mPowerManager.isInteractive();
// initialize the low power mode to true and set to false if any of the records requires
providerRequest.lowPowerMode = true;
for (UpdateRecord record : records) {
@@ -2060,8 +2128,8 @@ public class LocationManagerService extends ILocationManager.Stub {
record.mReceiver.mAllowedResolutionLevel)) {
continue;
}
- final boolean isBatterySaverDisablingLocation =
- isForegroundOnlyMode && !record.mIsForegroundUid;
+ final boolean isBatterySaverDisablingLocation = shouldThrottleRequests
+ || (isForegroundOnlyMode && !record.mIsForegroundUid);
if (!provider.isUseableLocked() || isBatterySaverDisablingLocation) {
if (isSettingsExemptLocked(record)) {
providerRequest.locationSettingsIgnored = true;
@@ -3415,6 +3483,32 @@ public class LocationManagerService extends ILocationManager.Stub {
}
@Override
+ @NonNull
+ public List<LocationRequest> getTestProviderCurrentRequests(String providerName,
+ String opPackageName) {
+ if (!canCallerAccessMockLocation(opPackageName)) {
+ return Collections.emptyList();
+ }
+
+ synchronized (mLock) {
+ LocationProvider testProvider = getLocationProviderLocked(providerName);
+ if (testProvider == null || !testProvider.isMock()) {
+ throw new IllegalArgumentException("Provider \"" + providerName + "\" unknown");
+ }
+
+ MockLocationProvider provider = (MockLocationProvider) testProvider;
+ if (provider.mCurrentRequest == null) {
+ return Collections.emptyList();
+ }
+ List<LocationRequest> requests = new ArrayList<>();
+ for (LocationRequest request : provider.mCurrentRequest.locationRequests) {
+ requests.add(new LocationRequest(request));
+ }
+ return requests;
+ }
+ }
+
+ @Override
protected void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
if (!DumpUtils.checkDumpPermission(mContext, TAG, pw)) return;
@@ -3429,6 +3523,8 @@ public class LocationManagerService extends ILocationManager.Stub {
pw.println(" Current user: " + mCurrentUserId + " " + Arrays.toString(
mCurrentUserProfiles));
pw.println(" Location mode: " + isLocationEnabled());
+ pw.println(" Battery Saver Location Mode: "
+ + locationPowerSaveModeToString(mBatterySaverMode));
pw.println(" Location Listeners:");
for (Receiver receiver : mReceivers.values()) {
pw.println(" " + receiver);
diff --git a/services/core/java/com/android/server/am/ActiveServices.java b/services/core/java/com/android/server/am/ActiveServices.java
index 346492fccc21..85ec2dd55e89 100644
--- a/services/core/java/com/android/server/am/ActiveServices.java
+++ b/services/core/java/com/android/server/am/ActiveServices.java
@@ -2211,7 +2211,7 @@ public final class ActiveServices {
return new ServiceLookupResult(null, r.permission);
} else if (r.permission != null && callingPackage != null) {
final int opCode = AppOpsManager.permissionToOpCode(r.permission);
- if (opCode != AppOpsManager.OP_NONE && mAm.mAppOpsService.noteOperation(
+ if (opCode != AppOpsManager.OP_NONE && mAm.mAppOpsService.checkOperation(
opCode, callingUid, callingPackage) != AppOpsManager.MODE_ALLOWED) {
Slog.w(TAG, "Appop Denial: Accessing service " + r.shortInstanceName
+ " from pid=" + callingPid
diff --git a/services/core/java/com/android/server/am/ProcessList.java b/services/core/java/com/android/server/am/ProcessList.java
index 30798a87a060..399b818659a4 100644
--- a/services/core/java/com/android/server/am/ProcessList.java
+++ b/services/core/java/com/android/server/am/ProcessList.java
@@ -1783,7 +1783,7 @@ public final class ProcessList {
app.processName, uid, uid, gids, runtimeFlags, mountExternal,
app.info.targetSdkVersion, seInfo, requiredAbi, instructionSet,
app.info.dataDir, null, app.info.packageName,
- packageNames, sandboxId, /*useBlastulaPool=*/ false,
+ packageNames, sandboxId, /*useUnspecializedAppProcessPool=*/ false,
new String[] {PROC_START_SEQ_IDENT + app.startSeq});
} else {
startResult = Process.start(entryPoint,
diff --git a/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java b/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java
index 96ba0841855c..b4a93d3bf08d 100644
--- a/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java
+++ b/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java
@@ -64,7 +64,6 @@ import android.content.res.Resources;
import android.content.res.TypedArray;
import android.database.ContentObserver;
import android.graphics.drawable.Drawable;
-import android.hardware.display.DisplayManagerInternal;
import android.inputmethodservice.InputMethodService;
import android.net.Uri;
import android.os.Binder;
@@ -99,8 +98,6 @@ import android.util.PrintWriterPrinter;
import android.util.Printer;
import android.util.Slog;
import android.view.ContextThemeWrapper;
-import android.view.Display;
-import android.view.DisplayInfo;
import android.view.IWindowManager;
import android.view.InputChannel;
import android.view.LayoutInflater;
@@ -1374,13 +1371,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
mIWindowManager = IWindowManager.Stub.asInterface(
ServiceManager.getService(Context.WINDOW_SERVICE));
mWindowManagerInternal = LocalServices.getService(WindowManagerInternal.class);
- final DisplayManagerInternal displayManagerInternal = LocalServices.getService(
- DisplayManagerInternal.class);
- mImeDisplayValidator = (displayId) -> {
- final DisplayInfo displayInfo = displayManagerInternal.getDisplayInfo(displayId);
- return displayInfo != null
- && (displayInfo.flags & Display.FLAG_SHOULD_SHOW_SYSTEM_DECORATIONS) != 0;
- };
+ mImeDisplayValidator = mWindowManagerInternal::shouldShowSystemDecorOnDisplay;
mCaller = new HandlerCaller(context, null, new HandlerCaller.Callback() {
@Override
public void executeMessage(Message msg) {
diff --git a/services/core/java/com/android/server/location/GnssLocationProvider.java b/services/core/java/com/android/server/location/GnssLocationProvider.java
index ae915037947e..8e8477ac5487 100644
--- a/services/core/java/com/android/server/location/GnssLocationProvider.java
+++ b/services/core/java/com/android/server/location/GnssLocationProvider.java
@@ -142,6 +142,7 @@ public class GnssLocationProvider extends AbstractLocationProvider implements
// these need to match ElapsedRealtimeFlags enum in types.hal
private static final int ELAPSED_REALTIME_HAS_TIMESTAMP_NS = 1;
+ private static final int ELAPSED_REALTIME_HAS_TIME_UNCERTAINTY_NS = 2;
// IMPORTANT - the GPS_DELETE_* symbols here must match GnssAidingData enum in IGnss.hal
private static final int GPS_DELETE_EPHEMERIS = 0x0001;
@@ -769,15 +770,18 @@ public class GnssLocationProvider extends AbstractLocationProvider implements
float bearingAccuracyDegrees = location.getBearingAccuracyDegrees();
long timestamp = location.getTime();
- int elapsedRealtimeFlags = ELAPSED_REALTIME_HAS_TIMESTAMP_NS;
+ int elapsedRealtimeFlags = ELAPSED_REALTIME_HAS_TIMESTAMP_NS
+ | (location.hasElapsedRealtimeUncertaintyNanos()
+ ? ELAPSED_REALTIME_HAS_TIME_UNCERTAINTY_NS : 0);
long elapsedRealtimeNanos = location.getElapsedRealtimeNanos();
+ long elapsedRealtimeUncertaintyNanos = location.getElapsedRealtimeUncertaintyNanos();
native_inject_best_location(
gnssLocationFlags, latitudeDegrees, longitudeDegrees,
altitudeMeters, speedMetersPerSec, bearingDegrees,
horizontalAccuracyMeters, verticalAccuracyMeters,
speedAccuracyMetersPerSecond, bearingAccuracyDegrees, timestamp,
- elapsedRealtimeFlags, elapsedRealtimeNanos);
+ elapsedRealtimeFlags, elapsedRealtimeNanos, elapsedRealtimeUncertaintyNanos);
}
/** Returns true if the location request is too frequent. */
@@ -2171,7 +2175,8 @@ public class GnssLocationProvider extends AbstractLocationProvider implements
double altitudeMeters, float speedMetersPerSec, float bearingDegrees,
float horizontalAccuracyMeters, float verticalAccuracyMeters,
float speedAccuracyMetersPerSecond, float bearingAccuracyDegrees,
- long timestamp, int elapsedRealtimeFlags, long elapsedRealtimeNanos);
+ long timestamp, int elapsedRealtimeFlags, long elapsedRealtimeNanos,
+ long elapsedRealtimeUncertaintyNanos);
private native void native_inject_location(double latitude, double longitude, float accuracy);
diff --git a/services/core/java/com/android/server/os/BugreportManagerServiceImpl.java b/services/core/java/com/android/server/os/BugreportManagerServiceImpl.java
index 85a3ba1a8559..64f31cd2b119 100644
--- a/services/core/java/com/android/server/os/BugreportManagerServiceImpl.java
+++ b/services/core/java/com/android/server/os/BugreportManagerServiceImpl.java
@@ -31,10 +31,12 @@ import android.os.ServiceManager;
import android.os.SystemClock;
import android.os.SystemProperties;
import android.os.UserManager;
+import android.util.ArraySet;
import android.util.Slog;
import com.android.internal.annotations.GuardedBy;
import com.android.internal.util.Preconditions;
+import com.android.server.SystemConfig;
import java.io.FileDescriptor;
@@ -55,10 +57,13 @@ class BugreportManagerServiceImpl extends IDumpstate.Stub {
private final Object mLock = new Object();
private final Context mContext;
private final AppOpsManager mAppOps;
+ private final ArraySet<String> mBugreportWhitelistedPackages;
BugreportManagerServiceImpl(Context context) {
mContext = context;
mAppOps = (AppOpsManager) context.getSystemService(Context.APP_OPS_SERVICE);
+ mBugreportWhitelistedPackages =
+ SystemConfig.getInstance().getBugreportWhitelistedPackages();
}
@Override
@@ -88,6 +93,10 @@ class BugreportManagerServiceImpl extends IDumpstate.Stub {
int callingUid = Binder.getCallingUid();
mAppOps.checkPackage(callingUid, callingPackage);
+ if (!mBugreportWhitelistedPackages.contains(callingPackage)) {
+ throw new SecurityException(
+ callingPackage + " is not whitelisted to use Bugreport API");
+ }
synchronized (mLock) {
startBugreportLocked(callingUid, callingPackage, bugreportFd, screenshotFd,
bugreportMode, listener);
diff --git a/services/core/java/com/android/server/pm/permission/DefaultPermissionGrantPolicy.java b/services/core/java/com/android/server/pm/permission/DefaultPermissionGrantPolicy.java
index 447234ed290b..1d6e5818389b 100644
--- a/services/core/java/com/android/server/pm/permission/DefaultPermissionGrantPolicy.java
+++ b/services/core/java/com/android/server/pm/permission/DefaultPermissionGrantPolicy.java
@@ -1473,6 +1473,13 @@ public final class DefaultPermissionGrantPolicy {
if (packageExceptions == null) {
// The package must be on the system image
PackageInfo packageInfo = getSystemPackageInfo(packageName);
+
+ if (packageInfo == null) {
+ Log.w(TAG, "No such package:" + packageName);
+ XmlUtils.skipCurrentTag(parser);
+ continue;
+ }
+
if (!isSystemPackage(packageInfo)) {
Log.w(TAG, "Unknown system package:" + packageName);
XmlUtils.skipCurrentTag(parser);
diff --git a/services/core/java/com/android/server/power/batterysaver/BatterySaverController.java b/services/core/java/com/android/server/power/batterysaver/BatterySaverController.java
index 94bb3ea09d93..5adcf352e260 100644
--- a/services/core/java/com/android/server/power/batterysaver/BatterySaverController.java
+++ b/services/core/java/com/android/server/power/batterysaver/BatterySaverController.java
@@ -384,7 +384,7 @@ public class BatterySaverController implements BatterySaverPolicyListener {
* - When battery saver is on and the battery saver policy changes.
* - When adaptive battery saver becomes activated.
* - When adaptive battery saver becomes deactivated.
- * - When adaptive battery saver policy changes.
+ * - When adaptive battery saver is active (and full is off) and the policy changes.
*/
void handleBatterySaverStateChanged(boolean sendBroadcast, int reason) {
final LowPowerModeListener[] listeners;
diff --git a/services/core/java/com/android/server/wallpaper/WallpaperManagerInternal.java b/services/core/java/com/android/server/wallpaper/WallpaperManagerInternal.java
new file mode 100644
index 000000000000..584fbddee478
--- /dev/null
+++ b/services/core/java/com/android/server/wallpaper/WallpaperManagerInternal.java
@@ -0,0 +1,30 @@
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.server.wallpaper;
+
+/**
+ * Wallpaper manager local system service interface.
+ *
+ * @hide Only for use within the system server.
+ */
+public abstract class WallpaperManagerInternal {
+
+ /**
+ * Notifies the display is ready for adding wallpaper on it.
+ */
+ public abstract void onDisplayReady(int displayId);
+}
diff --git a/services/core/java/com/android/server/wallpaper/WallpaperManagerService.java b/services/core/java/com/android/server/wallpaper/WallpaperManagerService.java
index 4aeba153cc68..bb1e00113174 100644
--- a/services/core/java/com/android/server/wallpaper/WallpaperManagerService.java
+++ b/services/core/java/com/android/server/wallpaper/WallpaperManagerService.java
@@ -100,7 +100,9 @@ import com.android.internal.util.FastXmlSerializer;
import com.android.internal.util.JournaledFile;
import com.android.server.EventLogTags;
import com.android.server.FgThread;
+import com.android.server.LocalServices;
import com.android.server.SystemService;
+import com.android.server.wm.WindowManagerInternal;
import libcore.io.IoUtils;
@@ -743,6 +745,7 @@ public class WallpaperManagerService extends IWallpaperManager.Stub
private final Context mContext;
private final IWindowManager mIWindowManager;
+ private final WindowManagerInternal mWindowManagerInternal;
private final IPackageManager mIPackageManager;
private final MyPackageMonitor mMonitor;
private final AppOpsManager mAppOpsManager;
@@ -753,27 +756,6 @@ public class WallpaperManagerService extends IWallpaperManager.Stub
@Override
public void onDisplayAdded(int displayId) {
- synchronized (mLock) {
- if (mLastWallpaper != null) {
- if (supportsMultiDisplay(mLastWallpaper.connection)) {
- final WallpaperConnection.DisplayConnector connector =
- mLastWallpaper.connection.getDisplayConnectorOrCreate(displayId);
- if (connector == null) return;
- connector.connectLocked(mLastWallpaper.connection, mLastWallpaper);
- return;
- }
- // System wallpaper does not support multiple displays, attach this display to
- // the fallback wallpaper.
- if (mFallbackWallpaper != null) {
- final WallpaperConnection.DisplayConnector connector = mFallbackWallpaper
- .connection.getDisplayConnectorOrCreate(displayId);
- if (connector == null) return;
- connector.connectLocked(mFallbackWallpaper.connection, mFallbackWallpaper);
- } else {
- Slog.w(TAG, "No wallpaper can be added to the new display");
- }
- }
- }
}
@Override
@@ -1185,9 +1167,12 @@ public class WallpaperManagerService extends IWallpaperManager.Stub
}
private boolean isUsableDisplay(Display display) {
- return display != null && display.hasAccess(mClientUid)
- && (display.supportsSystemDecorations()
- || display.getDisplayId() == DEFAULT_DISPLAY);
+ if (display == null || !display.hasAccess(mClientUid)) {
+ return false;
+ }
+ final int displayId = display.getDisplayId();
+ return displayId == DEFAULT_DISPLAY
+ || mWindowManagerInternal.shouldShowSystemDecorOnDisplay(displayId);
}
void forEachDisplayConnector(Consumer<DisplayConnector> action) {
@@ -1577,12 +1562,22 @@ public class WallpaperManagerService extends IWallpaperManager.Stub
mDefaultWallpaperComponent = WallpaperManager.getDefaultWallpaperComponent(context);
mIWindowManager = IWindowManager.Stub.asInterface(
ServiceManager.getService(Context.WINDOW_SERVICE));
+ mWindowManagerInternal = LocalServices.getService(WindowManagerInternal.class);
mIPackageManager = AppGlobals.getPackageManager();
mAppOpsManager = (AppOpsManager) mContext.getSystemService(Context.APP_OPS_SERVICE);
mDisplayManager = mContext.getSystemService(DisplayManager.class);
mDisplayManager.registerDisplayListener(mDisplayListener, null /* handler */);
mMonitor = new MyPackageMonitor();
mColorsChangedListeners = new SparseArray<>();
+
+ LocalServices.addService(WallpaperManagerInternal.class, new LocalService());
+ }
+
+ private final class LocalService extends WallpaperManagerInternal {
+ @Override
+ public void onDisplayReady(int displayId) {
+ onDisplayReadyInternal(displayId);
+ }
}
void initialize() {
@@ -2768,6 +2763,31 @@ public class WallpaperManagerService extends IWallpaperManager.Stub
return (wallpaper != null) ? wallpaper.allowBackup : false;
}
+ private void onDisplayReadyInternal(int displayId) {
+ synchronized (mLock) {
+ if (mLastWallpaper == null) {
+ return;
+ }
+ if (supportsMultiDisplay(mLastWallpaper.connection)) {
+ final WallpaperConnection.DisplayConnector connector =
+ mLastWallpaper.connection.getDisplayConnectorOrCreate(displayId);
+ if (connector == null) return;
+ connector.connectLocked(mLastWallpaper.connection, mLastWallpaper);
+ return;
+ }
+ // System wallpaper does not support multiple displays, attach this display to
+ // the fallback wallpaper.
+ if (mFallbackWallpaper != null) {
+ final WallpaperConnection.DisplayConnector connector = mFallbackWallpaper
+ .connection.getDisplayConnectorOrCreate(displayId);
+ if (connector == null) return;
+ connector.connectLocked(mFallbackWallpaper.connection, mFallbackWallpaper);
+ } else {
+ Slog.w(TAG, "No wallpaper can be added to the new display");
+ }
+ }
+ }
+
private static JournaledFile makeJournaledFile(int userId) {
final String base = new File(getWallpaperDir(userId), WALLPAPER_INFO).getAbsolutePath();
return new JournaledFile(new File(base), new File(base + ".tmp"));
diff --git a/services/core/java/com/android/server/wm/DisplayContent.java b/services/core/java/com/android/server/wm/DisplayContent.java
index ae76740b5d26..515ac52178a8 100644
--- a/services/core/java/com/android/server/wm/DisplayContent.java
+++ b/services/core/java/com/android/server/wm/DisplayContent.java
@@ -30,6 +30,7 @@ import static android.content.res.Configuration.ORIENTATION_LANDSCAPE;
import static android.content.res.Configuration.ORIENTATION_PORTRAIT;
import static android.view.Display.DEFAULT_DISPLAY;
import static android.view.Display.FLAG_PRIVATE;
+import static android.view.Display.FLAG_SHOULD_SHOW_SYSTEM_DECORATIONS;
import static android.view.Display.INVALID_DISPLAY;
import static android.view.InsetsState.TYPE_IME;
import static android.view.Surface.ROTATION_0;
@@ -4904,10 +4905,10 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo
* @see Display#FLAG_SHOULD_SHOW_SYSTEM_DECORATIONS
*/
boolean supportsSystemDecorations() {
- // TODO(b/114338689): Read the setting from DisplaySettings.
- return mDisplay.supportsSystemDecorations()
+ return mWmService.mDisplayWindowSettings.shouldShowSystemDecorsLocked(this)
+ || (mDisplay.getFlags() & FLAG_SHOULD_SHOW_SYSTEM_DECORATIONS) != 0
// TODO (b/111363427): Remove this and set the new FLAG_SHOULD_SHOW_LAUNCHER flag
- // (b/114338689) whenever vr 2d display id is set.
+ // whenever vr 2d display id is set.
|| mDisplayId == mWmService.mVr2dDisplayId
|| mWmService.mForceDesktopModeOnExternalDisplays;
}
diff --git a/services/core/java/com/android/server/wm/DisplayPolicy.java b/services/core/java/com/android/server/wm/DisplayPolicy.java
index b028569ccb08..5862d43d663d 100644
--- a/services/core/java/com/android/server/wm/DisplayPolicy.java
+++ b/services/core/java/com/android/server/wm/DisplayPolicy.java
@@ -158,6 +158,7 @@ import com.android.server.policy.WindowManagerPolicy.ScreenOnListener;
import com.android.server.policy.WindowManagerPolicy.WindowManagerFuncs;
import com.android.server.policy.WindowOrientationListener;
import com.android.server.statusbar.StatusBarManagerInternal;
+import com.android.server.wallpaper.WallpaperManagerInternal;
import com.android.server.wm.utils.InsetUtils;
import java.io.PrintWriter;
@@ -535,7 +536,7 @@ public class DisplayPolicy {
}
} else {
mHasStatusBar = false;
- mHasNavigationBar = mDisplayContent.getDisplay().supportsSystemDecorations();
+ mHasNavigationBar = mDisplayContent.supportsSystemDecorations();
}
}
@@ -1944,10 +1945,6 @@ public class DisplayPolicy {
} else {
vf.set(cf);
}
-
- // EXPERIMENT TODO(b/113952590): Remove once experiment in bug is completed
- mExperiments.offsetWindowFramesForNavBar(mNavigationBarPosition, win);
- // EXPERIMENT END
}
} else if (layoutInScreen || (sysUiFl
& (View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
@@ -2605,7 +2602,11 @@ public class DisplayPolicy {
}
void notifyDisplayReady() {
- mHandler.post(() -> getStatusBarManagerInternal().onDisplayReady(getDisplayId()));
+ mHandler.post(() -> {
+ final int displayId = getDisplayId();
+ getStatusBarManagerInternal().onDisplayReady(displayId);
+ LocalServices.getService(WallpaperManagerInternal.class).onDisplayReady(displayId);
+ });
}
/**
diff --git a/services/core/java/com/android/server/wm/TaskPositioner.java b/services/core/java/com/android/server/wm/TaskPositioner.java
index b88e581d5783..4a0831e39100 100644
--- a/services/core/java/com/android/server/wm/TaskPositioner.java
+++ b/services/core/java/com/android/server/wm/TaskPositioner.java
@@ -43,16 +43,15 @@ import android.util.Slog;
import android.view.BatchedInputEventReceiver;
import android.view.Choreographer;
import android.view.Display;
+import android.view.InputApplicationHandle;
import android.view.InputChannel;
import android.view.InputDevice;
import android.view.InputEvent;
+import android.view.InputWindowHandle;
import android.view.MotionEvent;
import android.view.WindowManager;
import com.android.internal.annotations.VisibleForTesting;
-import android.view.InputApplicationHandle;
-import android.view.InputWindowHandle;
-import com.android.server.wm.WindowManagerService.H;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@@ -356,12 +355,10 @@ class TaskPositioner {
+ startY + "}");
}
mTask = win.getTask();
- // Use the dim bounds, not the original task bounds. The cursor
- // movement should be calculated relative to the visible bounds.
- // Also, use the dim bounds of the task which accounts for
+ // Use the bounds of the task which accounts for
// multiple app windows. Don't use any bounds from win itself as it
// may not be the same size as the task.
- mTask.getDimBounds(mTmpRect);
+ mTask.getBounds(mTmpRect);
startDrag(resize, preserveOrientation, startX, startY, mTmpRect);
}
diff --git a/services/core/java/com/android/server/wm/WindowManagerInternal.java b/services/core/java/com/android/server/wm/WindowManagerInternal.java
index 33e46f4af301..d3f3711db0d8 100644
--- a/services/core/java/com/android/server/wm/WindowManagerInternal.java
+++ b/services/core/java/com/android/server/wm/WindowManagerInternal.java
@@ -474,4 +474,9 @@ public abstract class WindowManagerInternal {
* Return the display Id for given window.
*/
public abstract int getDisplayIdForWindow(IBinder windowToken);
+
+ /**
+ * Checks whether this display should support showing system decorations.
+ */
+ public abstract boolean shouldShowSystemDecorOnDisplay(int displayId);
}
diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java
index 1bd1795dadd8..d58e20437889 100644
--- a/services/core/java/com/android/server/wm/WindowManagerService.java
+++ b/services/core/java/com/android/server/wm/WindowManagerService.java
@@ -6776,7 +6776,7 @@ public class WindowManagerService extends IWindowManager.Stub
+ "not exist: " + displayId);
return false;
}
- return mDisplayWindowSettings.shouldShowSystemDecorsLocked(displayContent);
+ return displayContent.supportsSystemDecorations();
}
}
@@ -7245,6 +7245,13 @@ public class WindowManagerService extends IWindowManager.Stub
return Display.INVALID_DISPLAY;
}
}
+
+ @Override
+ public boolean shouldShowSystemDecorOnDisplay(int displayId) {
+ synchronized (mGlobalLock) {
+ return WindowManagerService.this.shouldShowSystemDecors(displayId);
+ }
+ }
}
void registerAppFreezeListener(AppFreezeListener listener) {
diff --git a/services/core/java/com/android/server/wm/WindowState.java b/services/core/java/com/android/server/wm/WindowState.java
index b7925f20be86..d5a6f00ff30d 100644
--- a/services/core/java/com/android/server/wm/WindowState.java
+++ b/services/core/java/com/android/server/wm/WindowState.java
@@ -842,6 +842,9 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
// The offset from the layout containing frame to the actual containing frame.
final int layoutXDiff;
final int layoutYDiff;
+ final WindowState imeWin = mWmService.mRoot.getCurrentInputMethodWindow();
+ final boolean isImeTarget =
+ imeWin != null && imeWin.isVisibleNow() && isInputMethodTarget();
if (inFullscreenContainer || layoutInParentFrame()) {
// We use the parent frame as the containing frame for fullscreen and child windows
mWindowFrames.mContainingFrame.set(mWindowFrames.mParentFrame);
@@ -861,15 +864,19 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
mWindowFrames.mContainingFrame.bottom =
mWindowFrames.mContainingFrame.top + frozen.height();
}
- final WindowState imeWin = mWmService.mRoot.getCurrentInputMethodWindow();
// IME is up and obscuring this window. Adjust the window position so it is visible.
- if (imeWin != null && imeWin.isVisibleNow() && isInputMethodTarget()) {
- if (inFreeformWindowingMode() && mWindowFrames.mContainingFrame.bottom
- > mWindowFrames.mContentFrame.bottom) {
- // In freeform we want to move the top up directly.
- // TODO: Investigate why this is contentFrame not parentFrame.
- mWindowFrames.mContainingFrame.top -= mWindowFrames.mContainingFrame.bottom
- - mWindowFrames.mContentFrame.bottom;
+ if (isImeTarget) {
+ if (inFreeformWindowingMode()) {
+ // Push the freeform window up to make room for the IME. However, don't push
+ // it up past the top of the screen.
+ final int bottomOverlap = mWindowFrames.mContainingFrame.bottom
+ - mWindowFrames.mVisibleFrame.bottom;
+ if (bottomOverlap > 0) {
+ final int distanceToTop = Math.max(mWindowFrames.mContainingFrame.top
+ - mWindowFrames.mDisplayFrame.top, 0);
+ int offs = Math.min(bottomOverlap, distanceToTop);
+ mWindowFrames.mContainingFrame.top -= offs;
+ }
} else if (!inPinnedWindowingMode() && mWindowFrames.mContainingFrame.bottom
> mWindowFrames.mParentFrame.bottom) {
// But in docked we want to behave like fullscreen and behave as if the task
@@ -955,9 +962,21 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
final int left = Math.max(limitFrame.left + minVisibleWidth - width,
Math.min( mWindowFrames.mFrame.left, limitFrame.right - minVisibleWidth));
mWindowFrames.mFrame.set(left, top, left + width, top + height);
+ final int visBottom = mWindowFrames.mVisibleFrame.bottom;
+ final int contentBottom = mWindowFrames.mContentFrame.bottom;
mWindowFrames.mContentFrame.set( mWindowFrames.mFrame);
mWindowFrames.mVisibleFrame.set(mWindowFrames.mContentFrame);
mWindowFrames.mStableFrame.set(mWindowFrames.mContentFrame);
+ if (isImeTarget && inFreeformWindowingMode()) {
+ // After displacing a freeform window to make room for the ime, any part of
+ // the window still covered by IME should be inset.
+ if (contentBottom + layoutYDiff < mWindowFrames.mContentFrame.bottom) {
+ mWindowFrames.mContentFrame.bottom = contentBottom + layoutYDiff;
+ }
+ if (visBottom + layoutYDiff < mWindowFrames.mVisibleFrame.bottom) {
+ mWindowFrames.mVisibleFrame.bottom = visBottom + layoutYDiff;
+ }
+ }
} else if (mAttrs.type == TYPE_DOCK_DIVIDER) {
dc.getDockedDividerController().positionDockedStackedDivider(mWindowFrames.mFrame);
mWindowFrames.mContentFrame.set(mWindowFrames.mFrame);
diff --git a/services/core/jni/com_android_server_location_GnssLocationProvider.cpp b/services/core/jni/com_android_server_location_GnssLocationProvider.cpp
index d39f20c0f214..e8882ec12244 100644
--- a/services/core/jni/com_android_server_location_GnssLocationProvider.cpp
+++ b/services/core/jni/com_android_server_location_GnssLocationProvider.cpp
@@ -491,6 +491,10 @@ static jobject translateGnssLocation(JNIEnv* env,
SET(ElapsedRealtimeNanos, location.elapsedRealtime.timestampNs);
}
+ if (flags & ElapsedRealtimeFlags::HAS_TIME_UNCERTAINTY_NS) {
+ SET(ElapsedUncertaintyRealtimeNanos, location.elapsedRealtime.timeUncertaintyNs);
+ }
+
return object.get();
}
@@ -521,7 +525,8 @@ static GnssLocation_V2_0 createGnssLocation_V2_0(
jdouble altitudeMeters, jfloat speedMetersPerSec, jfloat bearingDegrees,
jfloat horizontalAccuracyMeters, jfloat verticalAccuracyMeters,
jfloat speedAccuracyMetersPerSecond, jfloat bearingAccuracyDegrees,
- jlong timestamp, jint elapsedRealtimeFlags, jlong elapsedRealtimeNanos) {
+ jlong timestamp, jint elapsedRealtimeFlags, jlong elapsedRealtimeNanos,
+ jlong elapsedRealtimeUncertaintyNanos) {
GnssLocation_V2_0 location;
location.v1_0 = createGnssLocation_V1_0(
gnssLocationFlags, latitudeDegrees, longitudeDegrees, altitudeMeters,
@@ -531,6 +536,7 @@ static GnssLocation_V2_0 createGnssLocation_V2_0(
location.elapsedRealtime.flags = static_cast<uint16_t>(elapsedRealtimeFlags);
location.elapsedRealtime.timestampNs = static_cast<uint64_t>(elapsedRealtimeNanos);
+ location.elapsedRealtime.timeUncertaintyNs = static_cast<uint64_t>(elapsedRealtimeUncertaintyNanos);
return location;
}
@@ -1887,7 +1893,8 @@ static void android_location_GnssLocationProvider_inject_best_location(
jfloat bearingAccuracyDegrees,
jlong timestamp,
jint elapsedRealtimeFlags,
- jlong elapsedRealtimeNanos) {
+ jlong elapsedRealtimeNanos,
+ jlong elapsedRealtimeUncertaintyNanos) {
if (gnssHal_V2_0 != nullptr) {
GnssLocation_V2_0 location = createGnssLocation_V2_0(
gnssLocationFlags,
@@ -1902,7 +1909,8 @@ static void android_location_GnssLocationProvider_inject_best_location(
bearingAccuracyDegrees,
timestamp,
elapsedRealtimeFlags,
- elapsedRealtimeNanos);
+ elapsedRealtimeNanos,
+ elapsedRealtimeUncertaintyNanos);
auto result = gnssHal_V2_0->injectBestLocation_2_0(location);
if (!result.isOk() || !result) {
@@ -2813,7 +2821,7 @@ static const JNINativeMethod sMethods[] = {
android_location_GnssLocationProvider_read_nmea)},
{"native_inject_time", "(JJI)V", reinterpret_cast<void *>(
android_location_GnssLocationProvider_inject_time)},
- {"native_inject_best_location", "(IDDDFFFFFFJIJ)V", reinterpret_cast<void *>(
+ {"native_inject_best_location", "(IDDDFFFFFFJIJJ)V", reinterpret_cast<void *>(
android_location_GnssLocationProvider_inject_best_location)},
{"native_inject_location", "(DDF)V", reinterpret_cast<void *>(
android_location_GnssLocationProvider_inject_location)},
diff --git a/services/tests/servicestests/src/com/android/server/usage/AppStandbyControllerTests.java b/services/tests/servicestests/src/com/android/server/usage/AppStandbyControllerTests.java
index 8171469d4da4..6ec864c05258 100644
--- a/services/tests/servicestests/src/com/android/server/usage/AppStandbyControllerTests.java
+++ b/services/tests/servicestests/src/com/android/server/usage/AppStandbyControllerTests.java
@@ -61,7 +61,6 @@ import android.util.ArraySet;
import android.view.Display;
import androidx.test.InstrumentationRegistry;
-import androidx.test.filters.FlakyTest;
import androidx.test.filters.SmallTest;
import androidx.test.runner.AndroidJUnit4;
@@ -323,6 +322,8 @@ public class AppStandbyControllerTests {
private boolean mOnParole = false;
private CountDownLatch mLatch;
private long mLastParoleChangeTime;
+ private boolean mIsExpecting = false;
+ private boolean mExpectedParoleState;
public boolean getParoleState() {
synchronized (this) {
@@ -333,6 +334,15 @@ public class AppStandbyControllerTests {
public void rearmLatch() {
synchronized (this) {
mLatch = new CountDownLatch(1);
+ mIsExpecting = false;
+ }
+ }
+
+ public void rearmLatch(boolean expectedParoleState) {
+ synchronized (this) {
+ mLatch = new CountDownLatch(1);
+ mIsExpecting = true;
+ mExpectedParoleState = expectedParoleState;
}
}
@@ -358,7 +368,9 @@ public class AppStandbyControllerTests {
if (mLatch != null && mLatch.getCount() > 0) {
mOnParole = isParoleOn;
mLastParoleChangeTime = getCurrentTime();
- mLatch.countDown();
+ if (!mIsExpecting || isParoleOn == mExpectedParoleState) {
+ mLatch.countDown();
+ }
}
}
}
@@ -417,17 +429,23 @@ public class AppStandbyControllerTests {
}
@Test
- @FlakyTest(bugId = 119774928)
public void testEnabledState() throws Exception {
TestParoleListener paroleListener = new TestParoleListener();
+ paroleListener.rearmLatch(true);
mController.addListener(paroleListener);
long lastUpdateTime;
// Test that listeners are notified if enabled changes when the device is not in parole.
setChargingState(mController, false);
- // Start off not enabled. Device is effectively on permanent parole.
+ // Start off not enabled. Device is effectively in permanent parole.
setAppIdleEnabled(mController, false);
+ // Since AppStandbyController uses a handler to notify listeners of a state change, there is
+ // some inherent latency between changing the state and getting the notification. We need to
+ // wait until the paroleListener has been notified that parole is on before continuing with
+ // the test.
+ paroleListener.awaitOnLatch(STABLE_CHARGING_THRESHOLD * 3 / 2);
+ assertTrue(paroleListener.mOnParole);
// Enable controller
paroleListener.rearmLatch();
diff --git a/services/tests/wmtests/src/com/android/server/wm/WindowFrameTests.java b/services/tests/wmtests/src/com/android/server/wm/WindowFrameTests.java
index 61c1d39e420f..2ccdb9ea068c 100644
--- a/services/tests/wmtests/src/com/android/server/wm/WindowFrameTests.java
+++ b/services/tests/wmtests/src/com/android/server/wm/WindowFrameTests.java
@@ -17,6 +17,7 @@
package com.android.server.wm;
import static android.app.WindowConfiguration.ACTIVITY_TYPE_STANDARD;
+import static android.app.WindowConfiguration.WINDOWING_MODE_FREEFORM;
import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
import static android.view.DisplayCutout.BOUNDS_POSITION_TOP;
import static android.view.DisplayCutout.fromBoundingRect;
@@ -41,6 +42,7 @@ import com.android.server.wm.utils.WmDisplayCutout;
import org.junit.Before;
import org.junit.Test;
+import org.mockito.Mockito;
/**
* Tests for the {@link WindowState#computeFrameLw} method and other window frame machinery.
@@ -78,17 +80,22 @@ public class WindowFrameTests extends WindowTestsBase {
}
private static class TaskWithBounds extends Task {
- final Rect mBounds;
+ Rect mBounds;
final Rect mOverrideDisplayedBounds = new Rect();
boolean mFullscreenForTest = true;
TaskWithBounds(TaskStack stack, WindowManagerService wm, Rect bounds) {
super(0, stack, 0, wm, 0, false, new TaskDescription(), null);
- mBounds = bounds;
setBounds(bounds);
}
@Override
+ public int setBounds(Rect bounds) {
+ mBounds = bounds;
+ return super.setBounds(bounds);
+ }
+
+ @Override
public Rect getBounds() {
return mBounds;
}
@@ -513,6 +520,66 @@ public class WindowFrameTests extends WindowTestsBase {
assertEquals(w.getWmDisplayCutout().getDisplayCutout().getSafeInsetRight(), 0);
}
+ @Test
+ public void testFreeformContentInsets() {
+ // fullscreen task doesn't use bounds for computeFrame
+ final Task task = new TaskWithBounds(mStubStack, mWm, null);
+ WindowState w = createWindow(task, MATCH_PARENT, MATCH_PARENT);
+ w.mAttrs.gravity = Gravity.LEFT | Gravity.TOP;
+ task.setWindowingMode(WINDOWING_MODE_FREEFORM);
+ ((TaskWithBounds) task).mFullscreenForTest = false;
+ w.setWindowingMode(WINDOWING_MODE_FREEFORM);
+
+ DisplayContent dc = mWm.getDefaultDisplayContentLocked();
+ dc.mInputMethodTarget = w;
+ WindowState mockIme = mock(WindowState.class);
+ Mockito.doReturn(true).when(mockIme).isVisibleNow();
+ dc.mInputMethodWindow = mockIme;
+
+ // With no insets or system decor all the frames incoming from PhoneWindowManager
+ // are identical.
+ final Rect pf = new Rect(0, 0, 1000, 800);
+ final Rect df = pf;
+ final Rect of = df;
+ final Rect cf = new Rect(pf);
+ cf.bottom -= 400;
+ final Rect vf = new Rect(cf);
+ final Rect sf = new Rect(pf);
+ final Rect dcf = pf;
+
+ // First check that it only gets moved up enough to show window.
+ final Rect winRect = new Rect(200, 200, 300, 500);
+
+ task.setBounds(winRect);
+ w.setBounds(winRect);
+ w.getWindowFrames().setFrames(pf, df, of, cf, vf, dcf, sf, mEmptyRect);
+ w.computeFrameLw();
+
+ final Rect expected = new Rect(winRect.left, cf.bottom - winRect.height(),
+ winRect.right, cf.bottom);
+ assertEquals(expected, w.getFrameLw());
+ assertEquals(expected, w.getContentFrameLw());
+ assertEquals(expected, w.getVisibleFrameLw());
+
+ // Now check that it won't get moved beyond the top and then has appropriate insets
+ winRect.bottom = 600;
+ task.setBounds(winRect);
+ w.setBounds(winRect);
+ w.getWindowFrames().setFrames(pf, df, of, cf, vf, dcf, sf, mEmptyRect);
+ w.computeFrameLw();
+
+ assertFrame(w, winRect.left, 0, winRect.right, winRect.height());
+ expected.top = 0;
+ expected.bottom = cf.bottom;
+ assertContentFrame(w, expected);
+ assertVisibleFrame(w, expected);
+
+ // Check that it's moved back without ime insets
+ w.getWindowFrames().setFrames(pf, df, of, pf, pf, dcf, sf, mEmptyRect);
+ w.computeFrameLw();
+ assertEquals(winRect, w.getFrameLw());
+ }
+
private WindowStateWithTask createWindow(Task task, int width, int height) {
final WindowManager.LayoutParams attrs = new WindowManager.LayoutParams(TYPE_APPLICATION);
attrs.width = width;
diff --git a/services/usage/java/com/android/server/usage/UsageStatsDatabase.java b/services/usage/java/com/android/server/usage/UsageStatsDatabase.java
index 4756fb4d4948..485a79d63862 100644
--- a/services/usage/java/com/android/server/usage/UsageStatsDatabase.java
+++ b/services/usage/java/com/android/server/usage/UsageStatsDatabase.java
@@ -27,6 +27,7 @@ import android.util.Slog;
import android.util.TimeUtils;
import com.android.internal.annotations.VisibleForTesting;
+import com.android.internal.util.IndentingPrintWriter;
import libcore.io.IoUtils;
@@ -1246,4 +1247,36 @@ public class UsageStatsDatabase {
}
directory.delete();
}
+
+ /**
+ * print total number and list of stats files for each interval type.
+ * @param pw
+ */
+ public void dump(IndentingPrintWriter pw, boolean compact) {
+ synchronized (mLock) {
+ pw.println("UsageStatsDatabase:");
+ pw.increaseIndent();
+ for (int i = 0; i < mSortedStatFiles.length; i++) {
+ final TimeSparseArray<AtomicFile> files = mSortedStatFiles[i];
+ final int size = files.size();
+ pw.print(UserUsageStatsService.intervalToString(i));
+ pw.print(" stats files: ");
+ pw.print(size);
+ pw.println(", sorted list of files:");
+ pw.increaseIndent();
+ for (int f = 0; f < size; f++) {
+ final long fileName = files.keyAt(f);
+ if (compact) {
+ pw.print(UserUsageStatsService.formatDateTime(fileName, false));
+ } else {
+ pw.printPair(Long.toString(fileName),
+ UserUsageStatsService.formatDateTime(fileName, true));
+ }
+ pw.println();
+ }
+ pw.decreaseIndent();
+ }
+ pw.decreaseIndent();
+ }
+ }
}
diff --git a/services/usage/java/com/android/server/usage/UserUsageStatsService.java b/services/usage/java/com/android/server/usage/UserUsageStatsService.java
index ebd8e36aa07d..b9a5676a84ef 100644
--- a/services/usage/java/com/android/server/usage/UserUsageStatsService.java
+++ b/services/usage/java/com/android/server/usage/UserUsageStatsService.java
@@ -658,9 +658,10 @@ class UserUsageStatsService {
pw.println(" stats");
printIntervalStats(pw, mCurrentStats[interval], !compact, true, pkg);
}
+ mDatabase.dump(pw, compact);
}
- private String formatDateTime(long dateTime, boolean pretty) {
+ static String formatDateTime(long dateTime, boolean pretty) {
if (pretty) {
return "\"" + sDateFormat.format(dateTime)+ "\"";
}
@@ -888,7 +889,7 @@ class UserUsageStatsService {
pw.decreaseIndent();
}
- private static String intervalToString(int interval) {
+ public static String intervalToString(int interval) {
switch (interval) {
case INTERVAL_DAILY:
return "daily";
diff --git a/telecomm/java/android/telecom/PhoneAccountSuggestion.java b/telecomm/java/android/telecom/PhoneAccountSuggestion.java
index 05b23956fa51..3799cf332d7a 100644
--- a/telecomm/java/android/telecom/PhoneAccountSuggestion.java
+++ b/telecomm/java/android/telecom/PhoneAccountSuggestion.java
@@ -17,6 +17,7 @@
package android.telecom;
import android.annotation.IntDef;
+import android.annotation.NonNull;
import android.annotation.SystemApi;
import android.annotation.TestApi;
import android.os.Parcel;
@@ -72,7 +73,7 @@ public final class PhoneAccountSuggestion implements Parcelable {
*/
@SystemApi
@TestApi
- public PhoneAccountSuggestion(PhoneAccountHandle handle, @SuggestionReason int reason,
+ public PhoneAccountSuggestion(@NonNull PhoneAccountHandle handle, @SuggestionReason int reason,
boolean shouldAutoSelect) {
this.mHandle = handle;
this.mReason = reason;
@@ -101,7 +102,7 @@ public final class PhoneAccountSuggestion implements Parcelable {
/**
* @return The {@link PhoneAccountHandle} for this suggestion.
*/
- public PhoneAccountHandle getPhoneAccountHandle() {
+ @NonNull public PhoneAccountHandle getPhoneAccountHandle() {
return mHandle;
}
diff --git a/telephony/java/android/telephony/PhoneNumberRange.java b/telephony/java/android/telephony/PhoneNumberRange.java
index 2c66503a1ee7..c35a485d613f 100644
--- a/telephony/java/android/telephony/PhoneNumberRange.java
+++ b/telephony/java/android/telephony/PhoneNumberRange.java
@@ -149,7 +149,7 @@ public final class PhoneNumberRange implements Parcelable {
* @param number A phone number, with or without separators or a country code.
* @return {@code true} if the number matches, {@code false} otherwise.
*/
- public boolean matches(String number) {
+ public boolean matches(@NonNull String number) {
// Check the prefix, make sure it matches either with or without the country code.
String normalizedNumber = number.replaceAll("[^0-9]", "");
String prefixWithCountryCode = mCountryCode + mPrefix;
diff --git a/telephony/java/android/telephony/SubscriptionManager.java b/telephony/java/android/telephony/SubscriptionManager.java
index e0b7fc44ffaf..d7a0e50e5df7 100644
--- a/telephony/java/android/telephony/SubscriptionManager.java
+++ b/telephony/java/android/telephony/SubscriptionManager.java
@@ -1270,7 +1270,7 @@ public class SubscriptionManager {
if (!userVisibleOnly || activeList == null) {
return activeList;
} else {
- return activeList.stream().filter(subInfo -> !shouldHideSubscription(subInfo))
+ return activeList.stream().filter(subInfo -> isSubscriptionVisible(subInfo))
.collect(Collectors.toList());
}
}
@@ -2867,32 +2867,27 @@ public class SubscriptionManager {
}
/**
- * Whether system UI should hide a subscription. If it's a bundled opportunistic
- * subscription, it shouldn't show up in anywhere in Settings app, dialer app,
- * or status bar. Exception is if caller is carrier app, in which case they will
+ * Whether a subscription is visible to API caller. If it's a bundled opportunistic
+ * subscription, it should be hidden anywhere in Settings, dialer, status bar etc.
+ * Exception is if caller owns carrier privilege, in which case they will
* want to see their own hidden subscriptions.
*
* @param info the subscriptionInfo to check against.
- * @return true if this subscription should be hidden.
+ * @return true if this subscription should be visible to the API caller.
*
- * @hide
*/
- public boolean shouldHideSubscription(SubscriptionInfo info) {
+ private boolean isSubscriptionVisible(SubscriptionInfo info) {
if (info == null) return false;
- // If hasCarrierPrivileges or canManageSubscription returns true, it means caller
- // has carrier privilege.
- boolean hasCarrierPrivilegePermission = (info.isEmbedded() && canManageSubscription(info))
- || TelephonyManager.from(mContext).hasCarrierPrivileges(info.getSubscriptionId());
-
- return isInvisibleSubscription(info) && !hasCarrierPrivilegePermission;
- }
+ // If subscription is NOT grouped opportunistic subscription, it's visible.
+ if (TextUtils.isEmpty(info.getGroupUuid()) || !info.isOpportunistic()) return true;
- /**
- * @hide
- */
- public static boolean isInvisibleSubscription(SubscriptionInfo info) {
- return info != null && !TextUtils.isEmpty(info.getGroupUuid()) && info.isOpportunistic();
+ // If the caller is the carrier app and owns the subscription, it should be visible
+ // to the caller.
+ boolean hasCarrierPrivilegePermission = TelephonyManager.from(mContext)
+ .hasCarrierPrivileges(info.getSubscriptionId())
+ || (info.isEmbedded() && canManageSubscription(info));
+ return hasCarrierPrivilegePermission;
}
/**
@@ -2920,7 +2915,7 @@ public class SubscriptionManager {
for (SubscriptionInfo info : availableList) {
// Opportunistic subscriptions are considered invisible
// to users so they should never be returned.
- if (isInvisibleSubscription(info)) continue;
+ if (!isSubscriptionVisible(info)) continue;
String groupUuid = info.getGroupUuid();
if (groupUuid == null) {
diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java
index 31d8ddbbd35f..7b4029309b51 100644
--- a/telephony/java/android/telephony/TelephonyManager.java
+++ b/telephony/java/android/telephony/TelephonyManager.java
@@ -1355,12 +1355,7 @@ public class TelephonyManager {
*/
public static final String EXTRA_RECOVERY_ACTION = "recoveryAction";
- /**
- * The max value for the timeout passed in {@link #requestNumberVerification}.
- * @hide
- */
- @SystemApi
- public static final long MAX_NUMBER_VERIFICATION_TIMEOUT_MILLIS = 60000;
+ private static final long MAX_NUMBER_VERIFICATION_TIMEOUT_MILLIS = 60000;
/**
* Intent sent when an error occurs that debug tools should log and possibly take further
@@ -2027,6 +2022,15 @@ public class TelephonyManager {
return cmdline;
}
+ /**
+ * @return The max value for the timeout passed in {@link #requestNumberVerification}.
+ * @hide
+ */
+ @SystemApi
+ public static long getMaxNumberVerificationTimeoutMillis() {
+ return MAX_NUMBER_VERIFICATION_TIMEOUT_MILLIS;
+ }
+
/** Kernel command line */
private static final String sKernelCmdLine = getProcCmdLine();
@@ -4495,6 +4499,7 @@ public class TelephonyManager {
* {@link android.Manifest.permission#READ_PRIVILEGED_PHONE_STATE READ_PRIVILEGED_PHONE_STATE}
* @hide
*/
+ @Nullable
@SystemApi
@RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE)
public String getIsimDomain() {
@@ -5743,8 +5748,8 @@ public class TelephonyManager {
*
* @hide
* @param range The range of phone numbers the caller expects a phone call from.
- * @param timeoutMillis The amount of time to wait for such a call, or
- * {@link #MAX_NUMBER_VERIFICATION_TIMEOUT_MILLIS}, whichever is lesser.
+ * @param timeoutMillis The amount of time to wait for such a call, or the value of
+ * {@link #getMaxNumberVerificationTimeoutMillis()}, whichever is lesser.
* @param executor The {@link Executor} that callbacks should be executed on.
* @param callback The callback to use for delivering results.
*/
@@ -9071,6 +9076,7 @@ public class TelephonyManager {
* @return Application ID for specified app type or {@code null} if no uicc or error.
* @hide
*/
+ @Nullable
@SystemApi
@RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE)
public String getAidForAppType(@UiccAppType int appType) {
diff --git a/telephony/java/android/telephony/mbms/vendor/MbmsGroupCallServiceBase.java b/telephony/java/android/telephony/mbms/vendor/MbmsGroupCallServiceBase.java
index e86a47d5bfa1..1335b52673d2 100644
--- a/telephony/java/android/telephony/mbms/vendor/MbmsGroupCallServiceBase.java
+++ b/telephony/java/android/telephony/mbms/vendor/MbmsGroupCallServiceBase.java
@@ -16,6 +16,7 @@
package android.telephony.mbms.vendor;
+import android.annotation.NonNull;
import android.annotation.SystemApi;
import android.annotation.TestApi;
import android.app.Service;
@@ -187,7 +188,7 @@ public class MbmsGroupCallServiceBase extends Service {
*
* May throw an {@link IllegalArgumentException} or a {@link SecurityException}, which
* will be intercepted and passed to the app as
- * {@link MbmsErrors.InitializationErrors#ERROR_UNABLE_TO_INITIALIZE}
+ * {@link MbmsErrors.InitializationErrtrors#ERROR_UNABLE_TO_INITIALIZE}
*
* May return any value from {@link MbmsErrors.InitializationErrors}
* or {@link MbmsErrors#SUCCESS}. Non-successful error codes will be passed to the app via
@@ -196,7 +197,7 @@ public class MbmsGroupCallServiceBase extends Service {
* @param callback The callback to use to communicate with the app.
* @param subscriptionId The subscription ID to use.
*/
- public int initialize(MbmsGroupCallSessionCallback callback, int subscriptionId)
+ public int initialize(@NonNull MbmsGroupCallSessionCallback callback, int subscriptionId)
throws RemoteException {
throw new UnsupportedOperationException("Not implemented");
}
@@ -215,8 +216,8 @@ public class MbmsGroupCallServiceBase extends Service {
* @param callback The callback object on which the app wishes to receive updates.
* @return Any error in {@link MbmsErrors.GeneralErrors}
*/
- public int startGroupCall(int subscriptionId, long tmgi, List<Integer> saiList,
- List<Integer> frequencyList, GroupCallCallback callback) {
+ public int startGroupCall(int subscriptionId, long tmgi, @NonNull List<Integer> saiList,
+ @NonNull List<Integer> frequencyList, @NonNull GroupCallCallback callback) {
throw new UnsupportedOperationException("Not implemented");
}
@@ -241,8 +242,8 @@ public class MbmsGroupCallServiceBase extends Service {
* @param saiList New list of SAIs that the call is available on.
* @param frequencyList New list of frequencies that the call is available on.
*/
- public void updateGroupCall(int subscriptionId, long tmgi, List<Integer> saiList,
- List<Integer> frequencyList) {
+ public void updateGroupCall(int subscriptionId, long tmgi, @NonNull List<Integer> saiList,
+ @NonNull List<Integer> frequencyList) {
throw new UnsupportedOperationException("Not implemented");
}