summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--AconfigFlags.bp14
-rw-r--r--Android.bp3
-rw-r--r--cmds/idmap2/libidmap2/RawPrintVisitor.cpp2
-rw-r--r--core/api/current.txt730
-rw-r--r--core/api/module-lib-current.txt10
-rw-r--r--core/api/module-lib-lint-baseline.txt12
-rw-r--r--core/api/system-current.txt641
-rw-r--r--core/api/system-lint-baseline.txt10
-rw-r--r--core/api/system-removed.txt14
-rw-r--r--core/api/test-current.txt107
-rw-r--r--core/api/test-lint-baseline.txt52
-rw-r--r--core/java/android/app/WindowConfiguration.java17
-rw-r--r--core/java/android/companion/virtual/IVirtualDevice.aidl10
-rw-r--r--core/java/android/companion/virtual/IVirtualDeviceListener.aidl35
-rw-r--r--core/java/android/companion/virtual/IVirtualDeviceManager.aidl20
-rw-r--r--core/java/android/companion/virtual/VirtualDevice.java70
-rw-r--r--core/java/android/companion/virtual/VirtualDeviceManager.java145
-rw-r--r--core/java/android/companion/virtual/VirtualDeviceParams.java100
-rw-r--r--core/java/android/companion/virtual/flags.aconfig7
-rw-r--r--core/java/android/content/pm/ArchivedPackageParcel.aidl1
-rw-r--r--core/java/android/content/pm/parsing/ApkLite.java19
-rw-r--r--core/java/android/content/pm/parsing/PackageLite.java17
-rw-r--r--core/java/android/hardware/SystemSensorManager.java41
-rw-r--r--core/java/android/hardware/camera2/CameraCharacteristics.java2
-rw-r--r--core/java/android/hardware/camera2/CaptureRequest.java3
-rw-r--r--core/java/android/hardware/camera2/CaptureResult.java3
-rw-r--r--core/java/android/location/GeocoderParams.java (renamed from location/java/android/location/GeocoderParams.java)0
-rw-r--r--core/java/android/location/Geofence.java (renamed from location/java/android/location/Geofence.java)0
-rw-r--r--core/java/android/location/GnssSignalQuality.java (renamed from location/java/android/location/GnssSignalQuality.java)0
-rw-r--r--core/java/android/location/IFusedGeofenceHardware.aidl (renamed from location/java/android/location/IFusedGeofenceHardware.aidl)0
-rw-r--r--core/java/android/location/IGpsGeofenceHardware.aidl (renamed from location/java/android/location/IGpsGeofenceHardware.aidl)0
-rw-r--r--core/java/android/location/Location.aidl (renamed from location/java/android/location/Location.aidl)0
-rw-r--r--core/java/android/location/Location.java (renamed from location/java/android/location/Location.java)0
-rw-r--r--core/java/android/location/LocationTime.java (renamed from location/java/android/location/LocationTime.java)0
-rw-r--r--core/java/android/os/vibrator/flags.aconfig7
-rw-r--r--core/java/android/provider/Settings.java4
-rw-r--r--core/java/android/view/View.java152
-rw-r--r--core/java/com/android/internal/content/InstallLocationUtils.java6
-rw-r--r--core/java/com/android/internal/policy/DecorView.java3
-rw-r--r--core/java/com/android/internal/util/SettingsWrapper.java36
-rw-r--r--core/res/res/values/config.xml3
-rw-r--r--core/res/res/values/symbols.xml1
-rw-r--r--libs/WindowManager/Jetpack/src/androidx/window/util/ExtensionHelper.java41
-rw-r--r--libs/WindowManager/Jetpack/tests/unittest/src/androidx/window/extensions/WindowExtensionsTest.java2
-rw-r--r--libs/WindowManager/Jetpack/tests/unittest/src/androidx/window/util/ExtensionHelperTest.java130
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/Bubble.java4
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleController.java12
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleData.java13
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleDebugConfig.java13
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleExpandedView.java8
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleStackView.java6
-rw-r--r--libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/DragPositioningCallbackUtilityTest.kt2
-rw-r--r--libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/FluidResizeTaskPositionerTest.kt2
-rw-r--r--libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/VeiledResizeTaskPositionerTest.kt2
-rw-r--r--libs/androidfw/tests/ConfigDescription_test.cpp6
-rw-r--r--libs/androidfw/tests/ResTable_test.cpp2
-rw-r--r--libs/input/PointerController.cpp8
-rw-r--r--libs/input/PointerController.h2
-rw-r--r--location/Android.bp8
-rw-r--r--location/api/current.txt724
-rw-r--r--location/api/module-lib-current.txt10
-rw-r--r--location/api/module-lib-lint-baseline.txt13
-rw-r--r--location/api/system-current.txt645
-rw-r--r--location/api/system-lint-baseline.txt11
-rw-r--r--location/api/system-removed.txt14
-rw-r--r--location/api/test-current.txt103
-rw-r--r--location/api/test-lint-baseline.txt54
-rw-r--r--location/java/Android.bp17
-rw-r--r--media/java/android/media/AudioManager.java4
-rw-r--r--media/java/android/media/flags.aconfig8
-rw-r--r--packages/SettingsProvider/src/android/provider/settings/backup/SystemSettings.java2
-rw-r--r--packages/SettingsProvider/src/android/provider/settings/validators/SystemSettingsValidators.java2
-rw-r--r--packages/SystemUI/Android.bp2
-rw-r--r--packages/SystemUI/compose/features/src/com/android/systemui/qs/footer/ui/compose/FooterActions.kt3
-rw-r--r--packages/SystemUI/res-keyguard/layout-land/keyguard_pin_view.xml25
-rw-r--r--packages/SystemUI/res-keyguard/layout-sw600dp-land/keyguard_pin_view.xml25
-rw-r--r--packages/SystemUI/res-keyguard/layout/keyguard_pin_view.xml203
-rw-r--r--packages/SystemUI/res-keyguard/layout/keyguard_pin_view_landscape.xml231
-rw-r--r--packages/SystemUI/res-keyguard/layout/keyguard_pin_view_portrait.xml218
-rw-r--r--packages/SystemUI/res/values-sw600dp/bools.xml8
-rw-r--r--packages/SystemUI/res/values/bools.xml8
-rw-r--r--packages/SystemUI/res/values/config.xml8
-rw-r--r--packages/SystemUI/res/values/ids.xml3
-rw-r--r--packages/SystemUI/res/xml/media_session_expanded.xml4
-rw-r--r--packages/SystemUI/src/com/android/keyguard/KeyguardInputView.java5
-rw-r--r--packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainerController.java8
-rw-r--r--packages/SystemUI/src/com/android/keyguard/KeyguardSecurityViewFlipper.java8
-rw-r--r--packages/SystemUI/src/com/android/keyguard/KeyguardSecurityViewFlipperController.java40
-rw-r--r--packages/SystemUI/src/com/android/systemui/controls/ui/ThumbnailBehavior.kt5
-rw-r--r--packages/SystemUI/src/com/android/systemui/dagger/SystemUIModule.java2
-rw-r--r--packages/SystemUI/src/com/android/systemui/flags/Flags.kt13
-rw-r--r--packages/SystemUI/src/com/android/systemui/qs/QSContainerImpl.java14
-rw-r--r--packages/SystemUI/src/com/android/systemui/qs/QSFragment.java11
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java37
-rw-r--r--packages/SystemUI/tests/src/com/android/keyguard/KeyguardSecurityContainerControllerTest.kt45
-rw-r--r--packages/SystemUI/tests/src/com/android/keyguard/KeyguardSecurityViewFlipperControllerTest.java5
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/controls/ui/TemperatureControlBehaviorTest.kt98
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/screenshot/ScreenshotPolicyImplTest.kt8
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/CentralSurfacesImplTest.java5
-rw-r--r--services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java35
-rw-r--r--services/autofill/java/com/android/server/autofill/AutofillManagerService.java4
-rw-r--r--services/companion/java/com/android/server/companion/virtual/GenericWindowPolicyController.java113
-rw-r--r--services/companion/java/com/android/server/companion/virtual/VirtualDeviceImpl.java73
-rw-r--r--services/companion/java/com/android/server/companion/virtual/VirtualDeviceManagerService.java56
-rw-r--r--services/core/java/com/android/server/clipboard/ClipboardService.java26
-rw-r--r--services/core/java/com/android/server/display/BrightnessMappingStrategy.java43
-rw-r--r--services/core/java/com/android/server/display/DisplayManagerService.java9
-rw-r--r--services/core/java/com/android/server/display/LogicalDisplayMapper.java31
-rw-r--r--services/core/java/com/android/server/pm/DeletePackageHelper.java7
-rw-r--r--services/core/java/com/android/server/pm/InstallPackageHelper.java8
-rw-r--r--services/core/java/com/android/server/pm/InstallRequest.java5
-rw-r--r--services/core/java/com/android/server/pm/PackageArchiverService.java33
-rw-r--r--services/core/java/com/android/server/pm/PackageInstallerSession.java36
-rw-r--r--services/core/java/com/android/server/pm/PackageManagerService.java2
-rw-r--r--services/core/java/com/android/server/pm/PackageMetrics.java2
-rw-r--r--services/core/java/com/android/server/pm/PackageRemovedInfo.java7
-rw-r--r--services/core/java/com/android/server/pm/PackageSetting.java2
-rw-r--r--services/core/java/com/android/server/pm/RemovePackageHelper.java14
-rw-r--r--services/core/java/com/android/server/pm/flags.aconfig8
-rw-r--r--services/core/java/com/android/server/pm/pkg/PackageUserState.java7
-rw-r--r--services/core/java/com/android/server/pm/pkg/PackageUserStateDefault.java5
-rw-r--r--services/core/java/com/android/server/pm/pkg/PackageUserStateImpl.java4
-rw-r--r--services/core/java/com/android/server/pm/pkg/PackageUserStateUtils.java34
-rw-r--r--services/core/java/com/android/server/pm/pkg/parsing/ParsingPackageUtils.java3
-rw-r--r--services/core/java/com/android/server/policy/PhoneWindowManager.java61
-rw-r--r--services/core/java/com/android/server/utils/FoldSettingProvider.java102
-rw-r--r--services/core/java/com/android/server/utils/FoldSettingWrapper.java48
-rw-r--r--services/core/java/com/android/server/wm/Dimmer.java20
-rw-r--r--services/core/java/com/android/server/wm/DisplayContent.java22
-rw-r--r--services/core/java/com/android/server/wm/DisplayRotation.java4
-rw-r--r--services/core/java/com/android/server/wm/LetterboxConfiguration.java4
-rw-r--r--services/core/java/com/android/server/wm/RootWindowContainer.java4
-rw-r--r--services/core/java/com/android/server/wm/Task.java5
-rw-r--r--services/core/java/com/android/server/wm/Transition.java9
-rw-r--r--services/core/java/com/android/server/wm/WindowContainer.java7
-rw-r--r--services/core/java/com/android/server/wm/WindowState.java35
-rw-r--r--services/core/java/com/android/server/wm/WindowToken.java12
-rw-r--r--services/core/jni/com_android_server_input_InputManagerService.cpp9
-rw-r--r--services/devicepolicy/java/com/android/server/devicepolicy/RemoteBugreportManager.java31
-rw-r--r--services/tests/PackageManagerServiceTests/server/src/com/android/server/pm/PackageManagerServiceTest.java12
-rw-r--r--services/tests/displayservicetests/src/com/android/server/display/AutomaticBrightnessControllerTest.java20
-rw-r--r--services/tests/displayservicetests/src/com/android/server/display/BrightnessMappingStrategyTest.java14
-rw-r--r--services/tests/displayservicetests/src/com/android/server/display/LogicalDisplayMapperTest.java54
-rw-r--r--services/tests/mockingservicestests/src/com/android/server/pm/PackageArchiverServiceTest.java5
-rw-r--r--services/tests/mockingservicestests/src/com/android/server/utils/FoldSettingProviderTest.java143
-rw-r--r--services/tests/servicestests/src/com/android/server/companion/virtual/VirtualDeviceTest.java59
-rw-r--r--services/tests/servicestests/src/com/android/server/companion/virtual/audio/VirtualAudioControllerTest.java10
-rw-r--r--services/tests/wmtests/src/com/android/server/policy/ShortcutKeyTestBase.java35
-rw-r--r--services/tests/wmtests/src/com/android/server/policy/ShortcutLoggingTests.java84
-rw-r--r--services/tests/wmtests/src/com/android/server/policy/TestPhoneWindowManager.java8
-rw-r--r--services/tests/wmtests/src/com/android/server/wm/DisplayRotationTests.java4
-rw-r--r--telecomm/java/android/telecom/CallEndpoint.java2
-rw-r--r--tests/TrustTests/src/android/trust/test/IsActiveUnlockRunningTest.kt (renamed from tests/TrustTests/src/android/trust/test/CanUnlockWithActiveUnlockTest.kt)0
153 files changed, 3698 insertions, 2899 deletions
diff --git a/AconfigFlags.bp b/AconfigFlags.bp
index 6b5554bdd05a..aabe87f9787e 100644
--- a/AconfigFlags.bp
+++ b/AconfigFlags.bp
@@ -22,7 +22,6 @@ java_defaults {
":android.os.flags-aconfig-java{.generated_srcjars}",
":android.os.vibrator.flags-aconfig-java{.generated_srcjars}",
":android.security.flags-aconfig-java{.generated_srcjars}",
- ":android.media.flags-aconfig-java{.generated_srcjars}",
":camera_platform_flags_core_java_lib{.generated_srcjars}",
":com.android.window.flags.window-aconfig-java{.generated_srcjars}",
":com.android.text.flags-aconfig-java{.generated_srcjars}",
@@ -172,16 +171,3 @@ java_aconfig_library {
aconfig_declarations: "android.os.vibrator.flags-aconfig",
defaults: ["framework-minus-apex-aconfig-java-defaults"],
}
-
-// Media
-aconfig_declarations {
- name: "android.media.flags-aconfig",
- package: "android.media",
- srcs: ["media/java/android/media/*.aconfig"],
-}
-
-java_aconfig_library {
- name: "android.media.flags-aconfig-java",
- aconfig_declarations: "android.media.flags-aconfig",
- defaults: ["framework-minus-apex-aconfig-java-defaults"],
-}
diff --git a/Android.bp b/Android.bp
index 8eebcbbf77d7..57a5a3c6bff1 100644
--- a/Android.bp
+++ b/Android.bp
@@ -71,7 +71,6 @@ filegroup {
":framework-jobscheduler-sources", // jobscheduler is not a module for R
":framework-keystore-sources",
":framework-identity-sources",
- ":framework-location-sources",
":framework-mca-effect-sources",
":framework-mca-filterfw-sources",
":framework-mca-filterpacks-sources",
@@ -183,7 +182,6 @@ java_defaults {
"graphics/java",
"identity/java",
"keystore/java",
- "location/java",
"media/java",
"media/mca/effect/java",
"media/mca/filterfw/java",
@@ -293,7 +291,6 @@ java_defaults {
":framework-jobscheduler-sources",
":framework-keystore-sources",
":framework-identity-sources",
- ":framework-location-sources",
":framework-mca-effect-sources",
":framework-mca-filterfw-sources",
":framework-mca-filterpacks-sources",
diff --git a/cmds/idmap2/libidmap2/RawPrintVisitor.cpp b/cmds/idmap2/libidmap2/RawPrintVisitor.cpp
index 174d85c71828..9d04a7f87400 100644
--- a/cmds/idmap2/libidmap2/RawPrintVisitor.cpp
+++ b/cmds/idmap2/libidmap2/RawPrintVisitor.cpp
@@ -96,7 +96,7 @@ void RawPrintVisitor::visit(const IdmapData& data ATTRIBUTE_UNUSED) {
auto value = target_entry_value.second;
print(target_entry_value.first.to_string(), false, "config: %s",
- target_entry_value.first.toString().string());
+ target_entry_value.first.toString().c_str());
print(value.data_type, "type: %s",
utils::DataTypeToString(value.data_type).data());
diff --git a/core/api/current.txt b/core/api/current.txt
index df41b1ff6066..0e5a5157c090 100644
--- a/core/api/current.txt
+++ b/core/api/current.txt
@@ -9681,14 +9681,24 @@ package android.companion.virtual {
public final class VirtualDevice implements android.os.Parcelable {
method public int describeContents();
method public int getDeviceId();
+ method @FlaggedApi(Flags.FLAG_VDM_PUBLIC_APIS) @NonNull public int[] getDisplayIds();
method @Nullable public String getName();
method @Nullable public String getPersistentDeviceId();
+ method @FlaggedApi(Flags.FLAG_VDM_PUBLIC_APIS) public boolean hasCustomSensorSupport();
method public void writeToParcel(@NonNull android.os.Parcel, int);
field @NonNull public static final android.os.Parcelable.Creator<android.companion.virtual.VirtualDevice> CREATOR;
}
public final class VirtualDeviceManager {
+ method @FlaggedApi(Flags.FLAG_VDM_PUBLIC_APIS) @Nullable public android.companion.virtual.VirtualDevice getVirtualDevice(int);
method @NonNull public java.util.List<android.companion.virtual.VirtualDevice> getVirtualDevices();
+ method @FlaggedApi(Flags.FLAG_VDM_PUBLIC_APIS) public void registerVirtualDeviceListener(@NonNull java.util.concurrent.Executor, @NonNull android.companion.virtual.VirtualDeviceManager.VirtualDeviceListener);
+ method @FlaggedApi(Flags.FLAG_VDM_PUBLIC_APIS) public void unregisterVirtualDeviceListener(@NonNull android.companion.virtual.VirtualDeviceManager.VirtualDeviceListener);
+ }
+
+ @FlaggedApi(Flags.FLAG_VDM_PUBLIC_APIS) public static interface VirtualDeviceManager.VirtualDeviceListener {
+ method public default void onVirtualDeviceClosed(int);
+ method public default void onVirtualDeviceCreated(int);
}
}
@@ -20405,513 +20415,6 @@ package android.inputmethodservice {
package android.location {
- public class Address implements android.os.Parcelable {
- ctor public Address(java.util.Locale);
- method public void clearLatitude();
- method public void clearLongitude();
- method public int describeContents();
- method public String getAddressLine(int);
- method public String getAdminArea();
- method public String getCountryCode();
- method public String getCountryName();
- method public android.os.Bundle getExtras();
- method public String getFeatureName();
- method public double getLatitude();
- method public java.util.Locale getLocale();
- method public String getLocality();
- method public double getLongitude();
- method public int getMaxAddressLineIndex();
- method public String getPhone();
- method public String getPostalCode();
- method public String getPremises();
- method public String getSubAdminArea();
- method public String getSubLocality();
- method public String getSubThoroughfare();
- method public String getThoroughfare();
- method public String getUrl();
- method public boolean hasLatitude();
- method public boolean hasLongitude();
- method public void setAddressLine(int, String);
- method public void setAdminArea(String);
- method public void setCountryCode(String);
- method public void setCountryName(String);
- method public void setExtras(android.os.Bundle);
- method public void setFeatureName(String);
- method public void setLatitude(double);
- method public void setLocality(String);
- method public void setLongitude(double);
- method public void setPhone(String);
- method public void setPostalCode(String);
- method public void setPremises(String);
- method public void setSubAdminArea(String);
- method public void setSubLocality(String);
- method public void setSubThoroughfare(String);
- method public void setThoroughfare(String);
- method public void setUrl(String);
- method public void writeToParcel(android.os.Parcel, int);
- field @NonNull public static final android.os.Parcelable.Creator<android.location.Address> CREATOR;
- }
-
- @Deprecated public class Criteria implements android.os.Parcelable {
- ctor @Deprecated public Criteria();
- ctor @Deprecated public Criteria(android.location.Criteria);
- method @Deprecated public int describeContents();
- method @Deprecated public int getAccuracy();
- method @Deprecated public int getBearingAccuracy();
- method @Deprecated public int getHorizontalAccuracy();
- method @Deprecated public int getPowerRequirement();
- method @Deprecated public int getSpeedAccuracy();
- method @Deprecated public int getVerticalAccuracy();
- method @Deprecated public boolean isAltitudeRequired();
- method @Deprecated public boolean isBearingRequired();
- method @Deprecated public boolean isCostAllowed();
- method @Deprecated public boolean isSpeedRequired();
- method @Deprecated public void setAccuracy(int);
- method @Deprecated public void setAltitudeRequired(boolean);
- method @Deprecated public void setBearingAccuracy(int);
- method @Deprecated public void setBearingRequired(boolean);
- method @Deprecated public void setCostAllowed(boolean);
- method @Deprecated public void setHorizontalAccuracy(int);
- method @Deprecated public void setPowerRequirement(int);
- method @Deprecated public void setSpeedAccuracy(int);
- method @Deprecated public void setSpeedRequired(boolean);
- method @Deprecated public void setVerticalAccuracy(int);
- method @Deprecated public void writeToParcel(android.os.Parcel, int);
- field @Deprecated public static final int ACCURACY_COARSE = 2; // 0x2
- field @Deprecated public static final int ACCURACY_FINE = 1; // 0x1
- field @Deprecated public static final int ACCURACY_HIGH = 3; // 0x3
- field @Deprecated public static final int ACCURACY_LOW = 1; // 0x1
- field @Deprecated public static final int ACCURACY_MEDIUM = 2; // 0x2
- field @Deprecated @NonNull public static final android.os.Parcelable.Creator<android.location.Criteria> CREATOR;
- field @Deprecated public static final int NO_REQUIREMENT = 0; // 0x0
- field @Deprecated public static final int POWER_HIGH = 3; // 0x3
- field @Deprecated public static final int POWER_LOW = 1; // 0x1
- field @Deprecated public static final int POWER_MEDIUM = 2; // 0x2
- }
-
- public final class Geocoder {
- ctor public Geocoder(@NonNull android.content.Context);
- ctor public Geocoder(@NonNull android.content.Context, @NonNull java.util.Locale);
- method @Deprecated @Nullable public java.util.List<android.location.Address> getFromLocation(@FloatRange(from=-90.0, to=90.0) double, @FloatRange(from=-180.0, to=180.0) double, @IntRange int) throws java.io.IOException;
- method public void getFromLocation(@FloatRange(from=-90.0, to=90.0) double, @FloatRange(from=-180.0, to=180.0) double, @IntRange int, @NonNull android.location.Geocoder.GeocodeListener);
- method @Deprecated @Nullable public java.util.List<android.location.Address> getFromLocationName(@NonNull String, @IntRange int) throws java.io.IOException;
- method public void getFromLocationName(@NonNull String, @IntRange int, @NonNull android.location.Geocoder.GeocodeListener);
- method @Deprecated @Nullable public java.util.List<android.location.Address> getFromLocationName(@NonNull String, @IntRange int, @FloatRange(from=-90.0, to=90.0) double, @FloatRange(from=-180.0, to=180.0) double, @FloatRange(from=-90.0, to=90.0) double, @FloatRange(from=-180.0, to=180.0) double) throws java.io.IOException;
- method public void getFromLocationName(@NonNull String, @IntRange int, @FloatRange(from=-90.0, to=90.0) double, @FloatRange(from=-180.0, to=180.0) double, @FloatRange(from=-90.0, to=90.0) double, @FloatRange(from=-180.0, to=180.0) double, @NonNull android.location.Geocoder.GeocodeListener);
- method public static boolean isPresent();
- }
-
- public static interface Geocoder.GeocodeListener {
- method public default void onError(@Nullable String);
- method public void onGeocode(@NonNull java.util.List<android.location.Address>);
- }
-
- public final class GnssAntennaInfo implements android.os.Parcelable {
- method public int describeContents();
- method @FloatRange(from=0.0f) public double getCarrierFrequencyMHz();
- method @NonNull public android.location.GnssAntennaInfo.PhaseCenterOffset getPhaseCenterOffset();
- method @Nullable public android.location.GnssAntennaInfo.SphericalCorrections getPhaseCenterVariationCorrections();
- method @Nullable public android.location.GnssAntennaInfo.SphericalCorrections getSignalGainCorrections();
- method public void writeToParcel(@NonNull android.os.Parcel, int);
- field @NonNull public static final android.os.Parcelable.Creator<android.location.GnssAntennaInfo> CREATOR;
- }
-
- public static class GnssAntennaInfo.Builder {
- ctor @Deprecated public GnssAntennaInfo.Builder();
- ctor public GnssAntennaInfo.Builder(double, @NonNull android.location.GnssAntennaInfo.PhaseCenterOffset);
- ctor public GnssAntennaInfo.Builder(@NonNull android.location.GnssAntennaInfo);
- method @NonNull public android.location.GnssAntennaInfo build();
- method @NonNull public android.location.GnssAntennaInfo.Builder setCarrierFrequencyMHz(@FloatRange(from=0.0f) double);
- method @NonNull public android.location.GnssAntennaInfo.Builder setPhaseCenterOffset(@NonNull android.location.GnssAntennaInfo.PhaseCenterOffset);
- method @NonNull public android.location.GnssAntennaInfo.Builder setPhaseCenterVariationCorrections(@Nullable android.location.GnssAntennaInfo.SphericalCorrections);
- method @NonNull public android.location.GnssAntennaInfo.Builder setSignalGainCorrections(@Nullable android.location.GnssAntennaInfo.SphericalCorrections);
- }
-
- public static interface GnssAntennaInfo.Listener {
- method public void onGnssAntennaInfoReceived(@NonNull java.util.List<android.location.GnssAntennaInfo>);
- }
-
- public static final class GnssAntennaInfo.PhaseCenterOffset implements android.os.Parcelable {
- ctor public GnssAntennaInfo.PhaseCenterOffset(double, double, double, double, double, double);
- method public int describeContents();
- method @FloatRange public double getXOffsetMm();
- method @FloatRange public double getXOffsetUncertaintyMm();
- method @FloatRange public double getYOffsetMm();
- method @FloatRange public double getYOffsetUncertaintyMm();
- method @FloatRange public double getZOffsetMm();
- method @FloatRange public double getZOffsetUncertaintyMm();
- method public void writeToParcel(@NonNull android.os.Parcel, int);
- field @NonNull public static final android.os.Parcelable.Creator<android.location.GnssAntennaInfo.PhaseCenterOffset> CREATOR;
- }
-
- public static final class GnssAntennaInfo.SphericalCorrections implements android.os.Parcelable {
- ctor public GnssAntennaInfo.SphericalCorrections(@NonNull double[][], @NonNull double[][]);
- method public int describeContents();
- method @NonNull public double[][] getCorrectionUncertaintiesArray();
- method @NonNull public double[][] getCorrectionsArray();
- method @FloatRange(from=0.0f, to=180.0f) public double getDeltaPhi();
- method @FloatRange(from=0.0f, to=360.0f) public double getDeltaTheta();
- method public void writeToParcel(@NonNull android.os.Parcel, int);
- field @NonNull public static final android.os.Parcelable.Creator<android.location.GnssAntennaInfo.SphericalCorrections> CREATOR;
- }
-
- public final class GnssAutomaticGainControl implements android.os.Parcelable {
- method public int describeContents();
- method @IntRange(from=0) public long getCarrierFrequencyHz();
- method public int getConstellationType();
- method @FloatRange(from=0xffffd8f0, to=10000) public double getLevelDb();
- method public void writeToParcel(@NonNull android.os.Parcel, int);
- field @NonNull public static final android.os.Parcelable.Creator<android.location.GnssAutomaticGainControl> CREATOR;
- }
-
- public static final class GnssAutomaticGainControl.Builder {
- ctor public GnssAutomaticGainControl.Builder();
- ctor public GnssAutomaticGainControl.Builder(@NonNull android.location.GnssAutomaticGainControl);
- method @NonNull public android.location.GnssAutomaticGainControl build();
- method @NonNull public android.location.GnssAutomaticGainControl.Builder setCarrierFrequencyHz(@IntRange(from=0) long);
- method @NonNull public android.location.GnssAutomaticGainControl.Builder setConstellationType(int);
- method @NonNull public android.location.GnssAutomaticGainControl.Builder setLevelDb(@FloatRange(from=0xffffd8f0, to=10000) double);
- }
-
- public final class GnssCapabilities implements android.os.Parcelable {
- method public int describeContents();
- method @NonNull public java.util.List<android.location.GnssSignalType> getGnssSignalTypes();
- method public int hasAccumulatedDeltaRange();
- method public boolean hasAntennaInfo();
- method public boolean hasGeofencing();
- method @Deprecated public boolean hasGnssAntennaInfo();
- method public boolean hasLowPowerMode();
- method public boolean hasMeasurementCorrections();
- method public boolean hasMeasurementCorrectionsExcessPathLength();
- method public boolean hasMeasurementCorrectionsForDriving();
- method public boolean hasMeasurementCorrectionsLosSats();
- method public boolean hasMeasurementCorrectionsReflectingPlane();
- method public boolean hasMeasurementCorrelationVectors();
- method public boolean hasMeasurements();
- method public boolean hasMsa();
- method public boolean hasMsb();
- method public boolean hasNavigationMessages();
- method public boolean hasOnDemandTime();
- method public boolean hasPowerMultibandAcquisition();
- method public boolean hasPowerMultibandTracking();
- method public boolean hasPowerOtherModes();
- method public boolean hasPowerSinglebandAcquisition();
- method public boolean hasPowerSinglebandTracking();
- method public boolean hasPowerTotal();
- method public boolean hasSatelliteBlocklist();
- method public boolean hasSatellitePvt();
- method public boolean hasScheduling();
- method public boolean hasSingleShotFix();
- method public void writeToParcel(@NonNull android.os.Parcel, int);
- field public static final int CAPABILITY_SUPPORTED = 1; // 0x1
- field public static final int CAPABILITY_UNKNOWN = 0; // 0x0
- field public static final int CAPABILITY_UNSUPPORTED = 2; // 0x2
- field @NonNull public static final android.os.Parcelable.Creator<android.location.GnssCapabilities> CREATOR;
- }
-
- public static final class GnssCapabilities.Builder {
- ctor public GnssCapabilities.Builder();
- ctor public GnssCapabilities.Builder(@NonNull android.location.GnssCapabilities);
- method @NonNull public android.location.GnssCapabilities build();
- method @NonNull public android.location.GnssCapabilities.Builder setGnssSignalTypes(@NonNull java.util.List<android.location.GnssSignalType>);
- method @NonNull public android.location.GnssCapabilities.Builder setHasAccumulatedDeltaRange(int);
- method @NonNull public android.location.GnssCapabilities.Builder setHasAntennaInfo(boolean);
- method @NonNull public android.location.GnssCapabilities.Builder setHasGeofencing(boolean);
- method @NonNull public android.location.GnssCapabilities.Builder setHasLowPowerMode(boolean);
- method @NonNull public android.location.GnssCapabilities.Builder setHasMeasurementCorrections(boolean);
- method @NonNull public android.location.GnssCapabilities.Builder setHasMeasurementCorrectionsExcessPathLength(boolean);
- method @NonNull public android.location.GnssCapabilities.Builder setHasMeasurementCorrectionsForDriving(boolean);
- method @NonNull public android.location.GnssCapabilities.Builder setHasMeasurementCorrectionsLosSats(boolean);
- method @NonNull public android.location.GnssCapabilities.Builder setHasMeasurementCorrectionsReflectingPlane(boolean);
- method @NonNull public android.location.GnssCapabilities.Builder setHasMeasurementCorrelationVectors(boolean);
- method @NonNull public android.location.GnssCapabilities.Builder setHasMeasurements(boolean);
- method @NonNull public android.location.GnssCapabilities.Builder setHasMsa(boolean);
- method @NonNull public android.location.GnssCapabilities.Builder setHasMsb(boolean);
- method @NonNull public android.location.GnssCapabilities.Builder setHasNavigationMessages(boolean);
- method @NonNull public android.location.GnssCapabilities.Builder setHasOnDemandTime(boolean);
- method @NonNull public android.location.GnssCapabilities.Builder setHasPowerMultibandAcquisition(boolean);
- method @NonNull public android.location.GnssCapabilities.Builder setHasPowerMultibandTracking(boolean);
- method @NonNull public android.location.GnssCapabilities.Builder setHasPowerOtherModes(boolean);
- method @NonNull public android.location.GnssCapabilities.Builder setHasPowerSinglebandAcquisition(boolean);
- method @NonNull public android.location.GnssCapabilities.Builder setHasPowerSinglebandTracking(boolean);
- method @NonNull public android.location.GnssCapabilities.Builder setHasPowerTotal(boolean);
- method @NonNull public android.location.GnssCapabilities.Builder setHasSatelliteBlocklist(boolean);
- method @NonNull public android.location.GnssCapabilities.Builder setHasSatellitePvt(boolean);
- method @NonNull public android.location.GnssCapabilities.Builder setHasScheduling(boolean);
- method @NonNull public android.location.GnssCapabilities.Builder setHasSingleShotFix(boolean);
- }
-
- public final class GnssClock implements android.os.Parcelable {
- method public int describeContents();
- method public double getBiasNanos();
- method @FloatRange(from=0.0f) public double getBiasUncertaintyNanos();
- method public double getDriftNanosPerSecond();
- method @FloatRange(from=0.0f) public double getDriftUncertaintyNanosPerSecond();
- method public long getElapsedRealtimeNanos();
- method @FloatRange(from=0.0f) public double getElapsedRealtimeUncertaintyNanos();
- method public long getFullBiasNanos();
- method public int getHardwareClockDiscontinuityCount();
- method public int getLeapSecond();
- method @FloatRange(from=0.0) public double getReferenceCarrierFrequencyHzForIsb();
- method @NonNull public String getReferenceCodeTypeForIsb();
- method public int getReferenceConstellationTypeForIsb();
- method public long getTimeNanos();
- method @FloatRange(from=0.0f) public double getTimeUncertaintyNanos();
- method public boolean hasBiasNanos();
- method public boolean hasBiasUncertaintyNanos();
- method public boolean hasDriftNanosPerSecond();
- method public boolean hasDriftUncertaintyNanosPerSecond();
- method public boolean hasElapsedRealtimeNanos();
- method public boolean hasElapsedRealtimeUncertaintyNanos();
- method public boolean hasFullBiasNanos();
- method public boolean hasLeapSecond();
- method public boolean hasReferenceCarrierFrequencyHzForIsb();
- method public boolean hasReferenceCodeTypeForIsb();
- method public boolean hasReferenceConstellationTypeForIsb();
- method public boolean hasTimeUncertaintyNanos();
- method public void writeToParcel(android.os.Parcel, int);
- field @NonNull public static final android.os.Parcelable.Creator<android.location.GnssClock> CREATOR;
- }
-
- public final class GnssMeasurement implements android.os.Parcelable {
- method public int describeContents();
- method public double getAccumulatedDeltaRangeMeters();
- method public int getAccumulatedDeltaRangeState();
- method public double getAccumulatedDeltaRangeUncertaintyMeters();
- method @Deprecated public double getAutomaticGainControlLevelDb();
- method @FloatRange(from=0, to=63) public double getBasebandCn0DbHz();
- method @Deprecated public long getCarrierCycles();
- method public float getCarrierFrequencyHz();
- method @Deprecated public double getCarrierPhase();
- method @Deprecated public double getCarrierPhaseUncertainty();
- method @FloatRange(from=0, to=63) public double getCn0DbHz();
- method @NonNull public String getCodeType();
- method public int getConstellationType();
- method public double getFullInterSignalBiasNanos();
- method @FloatRange(from=0.0) public double getFullInterSignalBiasUncertaintyNanos();
- method public int getMultipathIndicator();
- method public double getPseudorangeRateMetersPerSecond();
- method public double getPseudorangeRateUncertaintyMetersPerSecond();
- method public long getReceivedSvTimeNanos();
- method public long getReceivedSvTimeUncertaintyNanos();
- method public double getSatelliteInterSignalBiasNanos();
- method @FloatRange(from=0.0) public double getSatelliteInterSignalBiasUncertaintyNanos();
- method public double getSnrInDb();
- method public int getState();
- method public int getSvid();
- method public double getTimeOffsetNanos();
- method @Deprecated public boolean hasAutomaticGainControlLevelDb();
- method public boolean hasBasebandCn0DbHz();
- method @Deprecated public boolean hasCarrierCycles();
- method public boolean hasCarrierFrequencyHz();
- method @Deprecated public boolean hasCarrierPhase();
- method @Deprecated public boolean hasCarrierPhaseUncertainty();
- method public boolean hasCodeType();
- method public boolean hasFullInterSignalBiasNanos();
- method public boolean hasFullInterSignalBiasUncertaintyNanos();
- method public boolean hasSatelliteInterSignalBiasNanos();
- method public boolean hasSatelliteInterSignalBiasUncertaintyNanos();
- method public boolean hasSnrInDb();
- method public void writeToParcel(android.os.Parcel, int);
- field public static final int ADR_STATE_CYCLE_SLIP = 4; // 0x4
- field public static final int ADR_STATE_HALF_CYCLE_REPORTED = 16; // 0x10
- field public static final int ADR_STATE_HALF_CYCLE_RESOLVED = 8; // 0x8
- field public static final int ADR_STATE_RESET = 2; // 0x2
- field public static final int ADR_STATE_UNKNOWN = 0; // 0x0
- field public static final int ADR_STATE_VALID = 1; // 0x1
- field @NonNull public static final android.os.Parcelable.Creator<android.location.GnssMeasurement> CREATOR;
- field public static final int MULTIPATH_INDICATOR_DETECTED = 1; // 0x1
- field public static final int MULTIPATH_INDICATOR_NOT_DETECTED = 2; // 0x2
- field public static final int MULTIPATH_INDICATOR_UNKNOWN = 0; // 0x0
- field public static final int STATE_2ND_CODE_LOCK = 65536; // 0x10000
- field public static final int STATE_BDS_D2_BIT_SYNC = 256; // 0x100
- field public static final int STATE_BDS_D2_SUBFRAME_SYNC = 512; // 0x200
- field public static final int STATE_BIT_SYNC = 2; // 0x2
- field public static final int STATE_CODE_LOCK = 1; // 0x1
- field public static final int STATE_GAL_E1BC_CODE_LOCK = 1024; // 0x400
- field public static final int STATE_GAL_E1B_PAGE_SYNC = 4096; // 0x1000
- field public static final int STATE_GAL_E1C_2ND_CODE_LOCK = 2048; // 0x800
- field public static final int STATE_GLO_STRING_SYNC = 64; // 0x40
- field public static final int STATE_GLO_TOD_DECODED = 128; // 0x80
- field public static final int STATE_GLO_TOD_KNOWN = 32768; // 0x8000
- field public static final int STATE_MSEC_AMBIGUOUS = 16; // 0x10
- field public static final int STATE_SBAS_SYNC = 8192; // 0x2000
- field public static final int STATE_SUBFRAME_SYNC = 4; // 0x4
- field public static final int STATE_SYMBOL_SYNC = 32; // 0x20
- field public static final int STATE_TOW_DECODED = 8; // 0x8
- field public static final int STATE_TOW_KNOWN = 16384; // 0x4000
- field public static final int STATE_UNKNOWN = 0; // 0x0
- }
-
- public final class GnssMeasurementRequest implements android.os.Parcelable {
- method public int describeContents();
- method @IntRange(from=0) public int getIntervalMillis();
- method public boolean isFullTracking();
- method public void writeToParcel(@NonNull android.os.Parcel, int);
- field @NonNull public static final android.os.Parcelable.Creator<android.location.GnssMeasurementRequest> CREATOR;
- field public static final int PASSIVE_INTERVAL = 2147483647; // 0x7fffffff
- }
-
- public static final class GnssMeasurementRequest.Builder {
- ctor public GnssMeasurementRequest.Builder();
- ctor public GnssMeasurementRequest.Builder(@NonNull android.location.GnssMeasurementRequest);
- method @NonNull public android.location.GnssMeasurementRequest build();
- method @NonNull public android.location.GnssMeasurementRequest.Builder setFullTracking(boolean);
- method @NonNull public android.location.GnssMeasurementRequest.Builder setIntervalMillis(@IntRange(from=0) int);
- }
-
- public final class GnssMeasurementsEvent implements android.os.Parcelable {
- method public int describeContents();
- method @NonNull public android.location.GnssClock getClock();
- method @NonNull public java.util.Collection<android.location.GnssAutomaticGainControl> getGnssAutomaticGainControls();
- method @NonNull public java.util.Collection<android.location.GnssMeasurement> getMeasurements();
- method public boolean hasIsFullTracking();
- method public boolean isFullTracking();
- method public void writeToParcel(android.os.Parcel, int);
- field @NonNull public static final android.os.Parcelable.Creator<android.location.GnssMeasurementsEvent> CREATOR;
- }
-
- public static final class GnssMeasurementsEvent.Builder {
- ctor public GnssMeasurementsEvent.Builder();
- ctor public GnssMeasurementsEvent.Builder(@NonNull android.location.GnssMeasurementsEvent);
- method @NonNull public android.location.GnssMeasurementsEvent build();
- method @NonNull public android.location.GnssMeasurementsEvent.Builder clearIsFullTracking();
- method @NonNull public android.location.GnssMeasurementsEvent.Builder setClock(@NonNull android.location.GnssClock);
- method @NonNull public android.location.GnssMeasurementsEvent.Builder setGnssAutomaticGainControls(@NonNull java.util.Collection<android.location.GnssAutomaticGainControl>);
- method @NonNull public android.location.GnssMeasurementsEvent.Builder setIsFullTracking(boolean);
- method @NonNull public android.location.GnssMeasurementsEvent.Builder setMeasurements(@NonNull java.util.Collection<android.location.GnssMeasurement>);
- }
-
- public abstract static class GnssMeasurementsEvent.Callback {
- ctor public GnssMeasurementsEvent.Callback();
- method public void onGnssMeasurementsReceived(android.location.GnssMeasurementsEvent);
- method @Deprecated public void onStatusChanged(int);
- field @Deprecated public static final int STATUS_LOCATION_DISABLED = 2; // 0x2
- field @Deprecated public static final int STATUS_NOT_ALLOWED = 3; // 0x3
- field @Deprecated public static final int STATUS_NOT_SUPPORTED = 0; // 0x0
- field @Deprecated public static final int STATUS_READY = 1; // 0x1
- }
-
- public final class GnssNavigationMessage implements android.os.Parcelable {
- method public int describeContents();
- method @NonNull public byte[] getData();
- method @IntRange(from=0xffffffff, to=120) public int getMessageId();
- method public int getStatus();
- method @IntRange(from=1) public int getSubmessageId();
- method @IntRange(from=1, to=200) public int getSvid();
- method public int getType();
- method public void writeToParcel(android.os.Parcel, int);
- field @NonNull public static final android.os.Parcelable.Creator<android.location.GnssNavigationMessage> CREATOR;
- field public static final int STATUS_PARITY_PASSED = 1; // 0x1
- field public static final int STATUS_PARITY_REBUILT = 2; // 0x2
- field public static final int STATUS_UNKNOWN = 0; // 0x0
- field public static final int TYPE_BDS_CNAV1 = 1283; // 0x503
- field public static final int TYPE_BDS_CNAV2 = 1284; // 0x504
- field public static final int TYPE_BDS_D1 = 1281; // 0x501
- field public static final int TYPE_BDS_D2 = 1282; // 0x502
- field public static final int TYPE_GAL_F = 1538; // 0x602
- field public static final int TYPE_GAL_I = 1537; // 0x601
- field public static final int TYPE_GLO_L1CA = 769; // 0x301
- field public static final int TYPE_GPS_CNAV2 = 260; // 0x104
- field public static final int TYPE_GPS_L1CA = 257; // 0x101
- field public static final int TYPE_GPS_L2CNAV = 258; // 0x102
- field public static final int TYPE_GPS_L5CNAV = 259; // 0x103
- field public static final int TYPE_IRN_L5CA = 1793; // 0x701
- field public static final int TYPE_QZS_L1CA = 1025; // 0x401
- field public static final int TYPE_SBS = 513; // 0x201
- field public static final int TYPE_UNKNOWN = 0; // 0x0
- }
-
- public abstract static class GnssNavigationMessage.Callback {
- ctor public GnssNavigationMessage.Callback();
- method public void onGnssNavigationMessageReceived(android.location.GnssNavigationMessage);
- method @Deprecated public void onStatusChanged(int);
- field @Deprecated public static final int STATUS_LOCATION_DISABLED = 2; // 0x2
- field @Deprecated public static final int STATUS_NOT_SUPPORTED = 0; // 0x0
- field @Deprecated public static final int STATUS_READY = 1; // 0x1
- }
-
- public final class GnssSignalType implements android.os.Parcelable {
- method @NonNull public static android.location.GnssSignalType create(int, @FloatRange(from=0.0f, fromInclusive=false) double, @NonNull String);
- method public int describeContents();
- method @FloatRange(from=0.0f, fromInclusive=false) public double getCarrierFrequencyHz();
- method @NonNull public String getCodeType();
- method public int getConstellationType();
- method public void writeToParcel(@NonNull android.os.Parcel, int);
- field @NonNull public static final android.os.Parcelable.Creator<android.location.GnssSignalType> CREATOR;
- }
-
- public final class GnssStatus implements android.os.Parcelable {
- method public int describeContents();
- method @FloatRange(from=0, to=360) public float getAzimuthDegrees(@IntRange(from=0) int);
- method @FloatRange(from=0, to=63) public float getBasebandCn0DbHz(@IntRange(from=0) int);
- method @FloatRange(from=0) public float getCarrierFrequencyHz(@IntRange(from=0) int);
- method @FloatRange(from=0, to=63) public float getCn0DbHz(@IntRange(from=0) int);
- method public int getConstellationType(@IntRange(from=0) int);
- method @FloatRange(from=0xffffffa6, to=90) public float getElevationDegrees(@IntRange(from=0) int);
- method @IntRange(from=0) public int getSatelliteCount();
- method @IntRange(from=1, to=206) public int getSvid(@IntRange(from=0) int);
- method public boolean hasAlmanacData(@IntRange(from=0) int);
- method public boolean hasBasebandCn0DbHz(@IntRange(from=0) int);
- method public boolean hasCarrierFrequencyHz(@IntRange(from=0) int);
- method public boolean hasEphemerisData(@IntRange(from=0) int);
- method public boolean usedInFix(@IntRange(from=0) int);
- method public void writeToParcel(@NonNull android.os.Parcel, int);
- field public static final int CONSTELLATION_BEIDOU = 5; // 0x5
- field public static final int CONSTELLATION_GALILEO = 6; // 0x6
- field public static final int CONSTELLATION_GLONASS = 3; // 0x3
- field public static final int CONSTELLATION_GPS = 1; // 0x1
- field public static final int CONSTELLATION_IRNSS = 7; // 0x7
- field public static final int CONSTELLATION_QZSS = 4; // 0x4
- field public static final int CONSTELLATION_SBAS = 2; // 0x2
- field public static final int CONSTELLATION_UNKNOWN = 0; // 0x0
- field @NonNull public static final android.os.Parcelable.Creator<android.location.GnssStatus> CREATOR;
- }
-
- public static final class GnssStatus.Builder {
- ctor public GnssStatus.Builder();
- method @NonNull public android.location.GnssStatus.Builder addSatellite(int, @IntRange(from=1, to=200) int, @FloatRange(from=0, to=63) float, @FloatRange(from=0xffffffa6, to=90) float, @FloatRange(from=0, to=360) float, boolean, boolean, boolean, boolean, @FloatRange(from=0) float, boolean, @FloatRange(from=0, to=63) float);
- method @NonNull public android.location.GnssStatus build();
- method @NonNull public android.location.GnssStatus.Builder clearSatellites();
- }
-
- public abstract static class GnssStatus.Callback {
- ctor public GnssStatus.Callback();
- method public void onFirstFix(int);
- method public void onSatelliteStatusChanged(@NonNull android.location.GnssStatus);
- method public void onStarted();
- method public void onStopped();
- }
-
- @Deprecated public final class GpsSatellite {
- method @Deprecated public float getAzimuth();
- method @Deprecated public float getElevation();
- method @Deprecated public int getPrn();
- method @Deprecated public float getSnr();
- method @Deprecated public boolean hasAlmanac();
- method @Deprecated public boolean hasEphemeris();
- method @Deprecated public boolean usedInFix();
- }
-
- @Deprecated public final class GpsStatus {
- method @Deprecated @NonNull public static android.location.GpsStatus create(@NonNull android.location.GnssStatus, int);
- method @Deprecated public int getMaxSatellites();
- method @Deprecated public Iterable<android.location.GpsSatellite> getSatellites();
- method @Deprecated public int getTimeToFirstFix();
- field @Deprecated public static final int GPS_EVENT_FIRST_FIX = 3; // 0x3
- field @Deprecated public static final int GPS_EVENT_SATELLITE_STATUS = 4; // 0x4
- field @Deprecated public static final int GPS_EVENT_STARTED = 1; // 0x1
- field @Deprecated public static final int GPS_EVENT_STOPPED = 2; // 0x2
- }
-
- @Deprecated public static interface GpsStatus.Listener {
- method @Deprecated public void onGpsStatusChanged(int);
- }
-
- @Deprecated public static interface GpsStatus.NmeaListener {
- method @Deprecated public void onNmeaReceived(long, String);
- }
-
public class Location implements android.os.Parcelable {
ctor public Location(@Nullable String);
ctor public Location(@NonNull android.location.Location);
@@ -20990,219 +20493,6 @@ package android.location {
field public static final int FORMAT_SECONDS = 2; // 0x2
}
- public interface LocationListener {
- method public default void onFlushComplete(int);
- method public void onLocationChanged(@NonNull android.location.Location);
- method public default void onLocationChanged(@NonNull java.util.List<android.location.Location>);
- method public default void onProviderDisabled(@NonNull String);
- method public default void onProviderEnabled(@NonNull String);
- method @Deprecated public default void onStatusChanged(String, int, android.os.Bundle);
- }
-
- public class LocationManager {
- method @Deprecated @RequiresPermission(android.Manifest.permission.ACCESS_FINE_LOCATION) public boolean addGpsStatusListener(android.location.GpsStatus.Listener);
- method @Deprecated @RequiresPermission(android.Manifest.permission.ACCESS_FINE_LOCATION) public boolean addNmeaListener(@NonNull android.location.GpsStatus.NmeaListener);
- method @Deprecated @RequiresPermission(android.Manifest.permission.ACCESS_FINE_LOCATION) public boolean addNmeaListener(@NonNull android.location.OnNmeaMessageListener);
- method @RequiresPermission(android.Manifest.permission.ACCESS_FINE_LOCATION) public boolean addNmeaListener(@NonNull android.location.OnNmeaMessageListener, @Nullable android.os.Handler);
- method @RequiresPermission(android.Manifest.permission.ACCESS_FINE_LOCATION) public boolean addNmeaListener(@NonNull java.util.concurrent.Executor, @NonNull android.location.OnNmeaMessageListener);
- method @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void addProximityAlert(double, double, float, long, @NonNull android.app.PendingIntent);
- method public void addTestProvider(@NonNull String, boolean, boolean, boolean, boolean, boolean, boolean, boolean, int, int);
- method public void addTestProvider(@NonNull String, @NonNull android.location.provider.ProviderProperties);
- method public void addTestProvider(@NonNull String, @NonNull android.location.provider.ProviderProperties, @NonNull java.util.Set<java.lang.String>);
- method @Deprecated public void clearTestProviderEnabled(@NonNull String);
- method @Deprecated public void clearTestProviderLocation(@NonNull String);
- method @Deprecated public void clearTestProviderStatus(@NonNull String);
- method @NonNull public java.util.List<java.lang.String> getAllProviders();
- method @Deprecated @Nullable public String getBestProvider(@NonNull android.location.Criteria, boolean);
- method @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void getCurrentLocation(@NonNull String, @Nullable android.os.CancellationSignal, @NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer<android.location.Location>);
- method @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void getCurrentLocation(@NonNull String, @NonNull android.location.LocationRequest, @Nullable android.os.CancellationSignal, @NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer<android.location.Location>);
- method @Nullable public java.util.List<android.location.GnssAntennaInfo> getGnssAntennaInfos();
- method @NonNull public android.location.GnssCapabilities getGnssCapabilities();
- method @Nullable public String getGnssHardwareModelName();
- method public int getGnssYearOfHardware();
- method @Deprecated @Nullable @RequiresPermission(android.Manifest.permission.ACCESS_FINE_LOCATION) public android.location.GpsStatus getGpsStatus(@Nullable android.location.GpsStatus);
- method @Nullable @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public android.location.Location getLastKnownLocation(@NonNull String);
- method @Deprecated @Nullable public android.location.LocationProvider getProvider(@NonNull String);
- method @Nullable public android.location.provider.ProviderProperties getProviderProperties(@NonNull String);
- method @NonNull public java.util.List<java.lang.String> getProviders(boolean);
- method @Deprecated @NonNull public java.util.List<java.lang.String> getProviders(@NonNull android.location.Criteria, boolean);
- method public boolean hasProvider(@NonNull String);
- method public boolean isLocationEnabled();
- method public boolean isProviderEnabled(@NonNull String);
- method public boolean registerAntennaInfoListener(@NonNull java.util.concurrent.Executor, @NonNull android.location.GnssAntennaInfo.Listener);
- method @Deprecated @RequiresPermission(android.Manifest.permission.ACCESS_FINE_LOCATION) public boolean registerGnssMeasurementsCallback(@NonNull android.location.GnssMeasurementsEvent.Callback);
- method @RequiresPermission(android.Manifest.permission.ACCESS_FINE_LOCATION) public boolean registerGnssMeasurementsCallback(@NonNull android.location.GnssMeasurementsEvent.Callback, @Nullable android.os.Handler);
- method @RequiresPermission(android.Manifest.permission.ACCESS_FINE_LOCATION) public boolean registerGnssMeasurementsCallback(@NonNull java.util.concurrent.Executor, @NonNull android.location.GnssMeasurementsEvent.Callback);
- method @RequiresPermission(android.Manifest.permission.ACCESS_FINE_LOCATION) public boolean registerGnssMeasurementsCallback(@NonNull android.location.GnssMeasurementRequest, @NonNull java.util.concurrent.Executor, @NonNull android.location.GnssMeasurementsEvent.Callback);
- method @Deprecated public boolean registerGnssNavigationMessageCallback(@NonNull android.location.GnssNavigationMessage.Callback);
- method @RequiresPermission(android.Manifest.permission.ACCESS_FINE_LOCATION) public boolean registerGnssNavigationMessageCallback(@NonNull android.location.GnssNavigationMessage.Callback, @Nullable android.os.Handler);
- method @RequiresPermission(android.Manifest.permission.ACCESS_FINE_LOCATION) public boolean registerGnssNavigationMessageCallback(@NonNull java.util.concurrent.Executor, @NonNull android.location.GnssNavigationMessage.Callback);
- method @Deprecated @RequiresPermission(android.Manifest.permission.ACCESS_FINE_LOCATION) public boolean registerGnssStatusCallback(@NonNull android.location.GnssStatus.Callback);
- method @RequiresPermission(android.Manifest.permission.ACCESS_FINE_LOCATION) public boolean registerGnssStatusCallback(@NonNull android.location.GnssStatus.Callback, @Nullable android.os.Handler);
- method @RequiresPermission(android.Manifest.permission.ACCESS_FINE_LOCATION) public boolean registerGnssStatusCallback(@NonNull java.util.concurrent.Executor, @NonNull android.location.GnssStatus.Callback);
- method @Deprecated public void removeGpsStatusListener(android.location.GpsStatus.Listener);
- method @Deprecated public void removeNmeaListener(@NonNull android.location.GpsStatus.NmeaListener);
- method public void removeNmeaListener(@NonNull android.location.OnNmeaMessageListener);
- method @RequiresPermission(anyOf={"android.permission.ACCESS_COARSE_LOCATION", "android.permission.ACCESS_FINE_LOCATION"}, apis="..22") public void removeProximityAlert(@NonNull android.app.PendingIntent);
- method public void removeTestProvider(@NonNull String);
- method @RequiresPermission(anyOf={"android.permission.ACCESS_COARSE_LOCATION", "android.permission.ACCESS_FINE_LOCATION"}, apis="..22") public void removeUpdates(@NonNull android.location.LocationListener);
- method public void removeUpdates(@NonNull android.app.PendingIntent);
- method public void requestFlush(@NonNull String, @NonNull android.location.LocationListener, int);
- method public void requestFlush(@NonNull String, @NonNull android.app.PendingIntent, int);
- method @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void requestLocationUpdates(@NonNull String, long, float, @NonNull android.location.LocationListener);
- method @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void requestLocationUpdates(@NonNull String, long, float, @NonNull android.location.LocationListener, @Nullable android.os.Looper);
- method @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void requestLocationUpdates(@NonNull String, long, float, @NonNull java.util.concurrent.Executor, @NonNull android.location.LocationListener);
- method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void requestLocationUpdates(long, float, @NonNull android.location.Criteria, @NonNull android.location.LocationListener, @Nullable android.os.Looper);
- method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void requestLocationUpdates(long, float, @NonNull android.location.Criteria, @NonNull java.util.concurrent.Executor, @NonNull android.location.LocationListener);
- method @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void requestLocationUpdates(@NonNull String, long, float, @NonNull android.app.PendingIntent);
- method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void requestLocationUpdates(long, float, @NonNull android.location.Criteria, @NonNull android.app.PendingIntent);
- method @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void requestLocationUpdates(@NonNull String, @NonNull android.location.LocationRequest, @NonNull java.util.concurrent.Executor, @NonNull android.location.LocationListener);
- method @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void requestLocationUpdates(@NonNull String, @NonNull android.location.LocationRequest, @NonNull android.app.PendingIntent);
- method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void requestSingleUpdate(@NonNull String, @NonNull android.location.LocationListener, @Nullable android.os.Looper);
- method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void requestSingleUpdate(@NonNull android.location.Criteria, @NonNull android.location.LocationListener, @Nullable android.os.Looper);
- method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void requestSingleUpdate(@NonNull String, @NonNull android.app.PendingIntent);
- method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void requestSingleUpdate(@NonNull android.location.Criteria, @NonNull android.app.PendingIntent);
- method public boolean sendExtraCommand(@NonNull String, @NonNull String, @Nullable android.os.Bundle);
- method public void setTestProviderEnabled(@NonNull String, boolean);
- method public void setTestProviderLocation(@NonNull String, @NonNull android.location.Location);
- method @Deprecated public void setTestProviderStatus(@NonNull String, int, @Nullable android.os.Bundle, long);
- method public void unregisterAntennaInfoListener(@NonNull android.location.GnssAntennaInfo.Listener);
- method public void unregisterGnssMeasurementsCallback(@NonNull android.location.GnssMeasurementsEvent.Callback);
- method public void unregisterGnssNavigationMessageCallback(@NonNull android.location.GnssNavigationMessage.Callback);
- method public void unregisterGnssStatusCallback(@NonNull android.location.GnssStatus.Callback);
- field public static final String ACTION_GNSS_CAPABILITIES_CHANGED = "android.location.action.GNSS_CAPABILITIES_CHANGED";
- field public static final String EXTRA_GNSS_CAPABILITIES = "android.location.extra.GNSS_CAPABILITIES";
- field public static final String EXTRA_LOCATION_ENABLED = "android.location.extra.LOCATION_ENABLED";
- field public static final String EXTRA_PROVIDER_ENABLED = "android.location.extra.PROVIDER_ENABLED";
- field public static final String EXTRA_PROVIDER_NAME = "android.location.extra.PROVIDER_NAME";
- field public static final String FUSED_PROVIDER = "fused";
- field public static final String GPS_PROVIDER = "gps";
- field public static final String KEY_FLUSH_COMPLETE = "flushComplete";
- field public static final String KEY_LOCATIONS = "locations";
- field public static final String KEY_LOCATION_CHANGED = "location";
- field public static final String KEY_PROVIDER_ENABLED = "providerEnabled";
- field public static final String KEY_PROXIMITY_ENTERING = "entering";
- field @Deprecated public static final String KEY_STATUS_CHANGED = "status";
- field public static final String MODE_CHANGED_ACTION = "android.location.MODE_CHANGED";
- field public static final String NETWORK_PROVIDER = "network";
- field public static final String PASSIVE_PROVIDER = "passive";
- field public static final String PROVIDERS_CHANGED_ACTION = "android.location.PROVIDERS_CHANGED";
- }
-
- @Deprecated public class LocationProvider {
- method @Deprecated public int getAccuracy();
- method @Deprecated public String getName();
- method @Deprecated public int getPowerRequirement();
- method @Deprecated public boolean hasMonetaryCost();
- method @Deprecated public boolean meetsCriteria(android.location.Criteria);
- method @Deprecated public boolean requiresCell();
- method @Deprecated public boolean requiresNetwork();
- method @Deprecated public boolean requiresSatellite();
- method @Deprecated public boolean supportsAltitude();
- method @Deprecated public boolean supportsBearing();
- method @Deprecated public boolean supportsSpeed();
- field @Deprecated public static final int AVAILABLE = 2; // 0x2
- field @Deprecated public static final int OUT_OF_SERVICE = 0; // 0x0
- field @Deprecated public static final int TEMPORARILY_UNAVAILABLE = 1; // 0x1
- }
-
- public final class LocationRequest implements android.os.Parcelable {
- method public int describeContents();
- method @IntRange(from=1) public long getDurationMillis();
- method @IntRange(from=0) public long getIntervalMillis();
- method @IntRange(from=0) public long getMaxUpdateDelayMillis();
- method @IntRange(from=1, to=java.lang.Integer.MAX_VALUE) public int getMaxUpdates();
- method @FloatRange(from=0, to=java.lang.Float.MAX_VALUE) public float getMinUpdateDistanceMeters();
- method @IntRange(from=0) public long getMinUpdateIntervalMillis();
- method public int getQuality();
- method public void writeToParcel(@NonNull android.os.Parcel, int);
- field @NonNull public static final android.os.Parcelable.Creator<android.location.LocationRequest> CREATOR;
- field public static final long PASSIVE_INTERVAL = 9223372036854775807L; // 0x7fffffffffffffffL
- field public static final int QUALITY_BALANCED_POWER_ACCURACY = 102; // 0x66
- field public static final int QUALITY_HIGH_ACCURACY = 100; // 0x64
- field public static final int QUALITY_LOW_POWER = 104; // 0x68
- }
-
- public static final class LocationRequest.Builder {
- ctor public LocationRequest.Builder(long);
- ctor public LocationRequest.Builder(@NonNull android.location.LocationRequest);
- method @NonNull public android.location.LocationRequest build();
- method @NonNull public android.location.LocationRequest.Builder clearMinUpdateIntervalMillis();
- method @NonNull public android.location.LocationRequest.Builder setDurationMillis(@IntRange(from=1) long);
- method @NonNull public android.location.LocationRequest.Builder setIntervalMillis(@IntRange(from=0) long);
- method @NonNull public android.location.LocationRequest.Builder setMaxUpdateDelayMillis(@IntRange(from=0) long);
- method @NonNull public android.location.LocationRequest.Builder setMaxUpdates(@IntRange(from=1, to=java.lang.Integer.MAX_VALUE) int);
- method @NonNull public android.location.LocationRequest.Builder setMinUpdateDistanceMeters(@FloatRange(from=0, to=java.lang.Float.MAX_VALUE) float);
- method @NonNull public android.location.LocationRequest.Builder setMinUpdateIntervalMillis(@IntRange(from=0) long);
- method @NonNull public android.location.LocationRequest.Builder setQuality(int);
- }
-
- public interface OnNmeaMessageListener {
- method public void onNmeaMessage(String, long);
- }
-
- public abstract class SettingInjectorService extends android.app.Service {
- ctor public SettingInjectorService(String);
- method public final android.os.IBinder onBind(android.content.Intent);
- method protected abstract boolean onGetEnabled();
- method protected abstract String onGetSummary();
- method public final void onStart(android.content.Intent, int);
- method public final int onStartCommand(android.content.Intent, int, int);
- method public static final void refreshSettings(@NonNull android.content.Context);
- field public static final String ACTION_INJECTED_SETTING_CHANGED = "android.location.InjectedSettingChanged";
- field public static final String ACTION_SERVICE_INTENT = "android.location.SettingInjectorService";
- field public static final String ATTRIBUTES_NAME = "injected-location-setting";
- field public static final String META_DATA_NAME = "android.location.SettingInjectorService";
- }
-
-}
-
-package android.location.altitude {
-
- public final class AltitudeConverter {
- ctor public AltitudeConverter();
- method @WorkerThread public void addMslAltitudeToLocation(@NonNull android.content.Context, @NonNull android.location.Location) throws java.io.IOException;
- }
-
-}
-
-package android.location.provider {
-
- public final class ProviderProperties implements android.os.Parcelable {
- method public int describeContents();
- method public int getAccuracy();
- method public int getPowerUsage();
- method public boolean hasAltitudeSupport();
- method public boolean hasBearingSupport();
- method public boolean hasCellRequirement();
- method public boolean hasMonetaryCost();
- method public boolean hasNetworkRequirement();
- method public boolean hasSatelliteRequirement();
- method public boolean hasSpeedSupport();
- method public void writeToParcel(@NonNull android.os.Parcel, int);
- field public static final int ACCURACY_COARSE = 2; // 0x2
- field public static final int ACCURACY_FINE = 1; // 0x1
- field @NonNull public static final android.os.Parcelable.Creator<android.location.provider.ProviderProperties> CREATOR;
- field public static final int POWER_USAGE_HIGH = 3; // 0x3
- field public static final int POWER_USAGE_LOW = 1; // 0x1
- field public static final int POWER_USAGE_MEDIUM = 2; // 0x2
- }
-
- public static final class ProviderProperties.Builder {
- ctor public ProviderProperties.Builder();
- ctor public ProviderProperties.Builder(@NonNull android.location.provider.ProviderProperties);
- method @NonNull public android.location.provider.ProviderProperties build();
- method @NonNull public android.location.provider.ProviderProperties.Builder setAccuracy(int);
- method @NonNull public android.location.provider.ProviderProperties.Builder setHasAltitudeSupport(boolean);
- method @NonNull public android.location.provider.ProviderProperties.Builder setHasBearingSupport(boolean);
- method @NonNull public android.location.provider.ProviderProperties.Builder setHasCellRequirement(boolean);
- method @NonNull public android.location.provider.ProviderProperties.Builder setHasMonetaryCost(boolean);
- method @NonNull public android.location.provider.ProviderProperties.Builder setHasNetworkRequirement(boolean);
- method @NonNull public android.location.provider.ProviderProperties.Builder setHasSatelliteRequirement(boolean);
- method @NonNull public android.location.provider.ProviderProperties.Builder setHasSpeedSupport(boolean);
- method @NonNull public android.location.provider.ProviderProperties.Builder setPowerUsage(int);
- }
-
}
package android.media {
diff --git a/core/api/module-lib-current.txt b/core/api/module-lib-current.txt
index e4846b8affd4..3de774868bb7 100644
--- a/core/api/module-lib-current.txt
+++ b/core/api/module-lib-current.txt
@@ -186,16 +186,6 @@ package android.hardware.usb {
}
-package android.location {
-
- public class LocationManager {
- method @RequiresPermission(allOf={android.Manifest.permission.LOCATION_HARDWARE, android.Manifest.permission.ACCESS_FINE_LOCATION}) public boolean injectLocation(@NonNull android.location.Location);
- method @RequiresPermission(android.Manifest.permission.CONTROL_AUTOMOTIVE_GNSS) public boolean isAutomotiveGnssSuspended();
- method @RequiresPermission(android.Manifest.permission.CONTROL_AUTOMOTIVE_GNSS) public void setAutomotiveGnssSuspended(boolean);
- }
-
-}
-
package android.media {
public class AudioManager {
diff --git a/core/api/module-lib-lint-baseline.txt b/core/api/module-lib-lint-baseline.txt
index 27436ce35867..471745ae0c50 100644
--- a/core/api/module-lib-lint-baseline.txt
+++ b/core/api/module-lib-lint-baseline.txt
@@ -17,18 +17,6 @@ SamShouldBeLast: android.content.pm.PackageItemInfo#dumpBack(android.util.Printe
SAM-compatible parameters (such as parameter 1, "pw", in android.content.pm.PackageItemInfo.dumpBack) should be last to improve Kotlin interoperability; see https://kotlinlang.org/docs/reference/java-interop.html#sam-conversions
SamShouldBeLast: android.content.pm.PackageItemInfo#dumpFront(android.util.Printer, String):
SAM-compatible parameters (such as parameter 1, "pw", in android.content.pm.PackageItemInfo.dumpFront) should be last to improve Kotlin interoperability; see https://kotlinlang.org/docs/reference/java-interop.html#sam-conversions
-SamShouldBeLast: android.location.LocationManager#addNmeaListener(android.location.OnNmeaMessageListener, android.os.Handler):
- SAM-compatible parameters (such as parameter 1, "listener", in android.location.LocationManager.addNmeaListener) should be last to improve Kotlin interoperability; see https://kotlinlang.org/docs/reference/java-interop.html#sam-conversions
-SamShouldBeLast: android.location.LocationManager#requestLocationUpdates(String, long, float, android.location.LocationListener, android.os.Looper):
- SAM-compatible parameters (such as parameter 4, "listener", in android.location.LocationManager.requestLocationUpdates) should be last to improve Kotlin interoperability; see https://kotlinlang.org/docs/reference/java-interop.html#sam-conversions
-SamShouldBeLast: android.location.LocationManager#requestLocationUpdates(android.location.LocationRequest, android.location.LocationListener, android.os.Looper):
- SAM-compatible parameters (such as parameter 2, "listener", in android.location.LocationManager.requestLocationUpdates) should be last to improve Kotlin interoperability; see https://kotlinlang.org/docs/reference/java-interop.html#sam-conversions
-SamShouldBeLast: android.location.LocationManager#requestLocationUpdates(long, float, android.location.Criteria, android.location.LocationListener, android.os.Looper):
- SAM-compatible parameters (such as parameter 4, "listener", in android.location.LocationManager.requestLocationUpdates) should be last to improve Kotlin interoperability; see https://kotlinlang.org/docs/reference/java-interop.html#sam-conversions
-SamShouldBeLast: android.location.LocationManager#requestSingleUpdate(String, android.location.LocationListener, android.os.Looper):
- SAM-compatible parameters (such as parameter 2, "listener", in android.location.LocationManager.requestSingleUpdate) should be last to improve Kotlin interoperability; see https://kotlinlang.org/docs/reference/java-interop.html#sam-conversions
-SamShouldBeLast: android.location.LocationManager#requestSingleUpdate(android.location.Criteria, android.location.LocationListener, android.os.Looper):
- SAM-compatible parameters (such as parameter 2, "listener", in android.location.LocationManager.requestSingleUpdate) should be last to improve Kotlin interoperability; see https://kotlinlang.org/docs/reference/java-interop.html#sam-conversions
SamShouldBeLast: android.media.AudioManager#abandonAudioFocus(android.media.AudioManager.OnAudioFocusChangeListener, android.media.AudioAttributes):
SAM-compatible parameters (such as parameter 1, "l", in android.media.AudioManager.abandonAudioFocus) should be last to improve Kotlin interoperability; see https://kotlinlang.org/docs/reference/java-interop.html#sam-conversions
SamShouldBeLast: android.media.AudioManager#requestAudioFocus(android.media.AudioManager.OnAudioFocusChangeListener, android.media.AudioAttributes, int, int):
diff --git a/core/api/system-current.txt b/core/api/system-current.txt
index 0c619815ac78..ff44a1b87e18 100644
--- a/core/api/system-current.txt
+++ b/core/api/system-current.txt
@@ -6182,653 +6182,12 @@ package android.hardware.usb {
package android.location {
- public abstract class BatchedLocationCallback {
- ctor public BatchedLocationCallback();
- method public void onLocationBatch(java.util.List<android.location.Location>);
- }
-
- public final class CorrelationVector implements android.os.Parcelable {
- method public int describeContents();
- method @FloatRange(from=0.0f) public double getFrequencyOffsetMetersPerSecond();
- method @NonNull public int[] getMagnitude();
- method @FloatRange(from=0.0f) public double getSamplingStartMeters();
- method @FloatRange(from=0.0f, fromInclusive=false) public double getSamplingWidthMeters();
- method public void writeToParcel(@NonNull android.os.Parcel, int);
- field @NonNull public static final android.os.Parcelable.Creator<android.location.CorrelationVector> CREATOR;
- }
-
- public static final class CorrelationVector.Builder {
- ctor public CorrelationVector.Builder();
- method @NonNull public android.location.CorrelationVector build();
- method @NonNull public android.location.CorrelationVector.Builder setFrequencyOffsetMetersPerSecond(@FloatRange(from=0.0f) double);
- method @NonNull public android.location.CorrelationVector.Builder setMagnitude(@NonNull int[]);
- method @NonNull public android.location.CorrelationVector.Builder setSamplingStartMeters(@FloatRange(from=0.0f) double);
- method @NonNull public android.location.CorrelationVector.Builder setSamplingWidthMeters(@FloatRange(from=0.0f, fromInclusive=false) double);
- }
-
- public final class Country implements android.os.Parcelable {
- ctor public Country(@NonNull String, int);
- method public int describeContents();
- method @NonNull public String getCountryCode();
- method public int getSource();
- method public void writeToParcel(@NonNull android.os.Parcel, int);
- field public static final int COUNTRY_SOURCE_LOCALE = 3; // 0x3
- field public static final int COUNTRY_SOURCE_LOCATION = 1; // 0x1
- field public static final int COUNTRY_SOURCE_NETWORK = 0; // 0x0
- field public static final int COUNTRY_SOURCE_SIM = 2; // 0x2
- field @NonNull public static final android.os.Parcelable.Creator<android.location.Country> CREATOR;
- }
-
- public class CountryDetector {
- method public void registerCountryDetectorCallback(@NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer<android.location.Country>);
- method public void unregisterCountryDetectorCallback(@NonNull java.util.function.Consumer<android.location.Country>);
- }
-
- public final class GnssCapabilities implements android.os.Parcelable {
- method @Deprecated public boolean hasMeasurementCorrectionsReflectingPane();
- method @Deprecated public boolean hasNavMessages();
- method @Deprecated public boolean hasSatelliteBlacklist();
- }
-
- public final class GnssExcessPathInfo implements android.os.Parcelable {
- method public int describeContents();
- method @FloatRange(from=0.0f) public float getAttenuationDb();
- method @FloatRange(from=0.0f) public float getExcessPathLengthMeters();
- method @FloatRange(from=0.0f) public float getExcessPathLengthUncertaintyMeters();
- method @NonNull public android.location.GnssReflectingPlane getReflectingPlane();
- method public boolean hasAttenuation();
- method public boolean hasExcessPathLength();
- method public boolean hasExcessPathLengthUncertainty();
- method public boolean hasReflectingPlane();
- method public void writeToParcel(@NonNull android.os.Parcel, int);
- field @NonNull public static final android.os.Parcelable.Creator<android.location.GnssExcessPathInfo> CREATOR;
- }
-
- public static final class GnssExcessPathInfo.Builder {
- ctor public GnssExcessPathInfo.Builder();
- method @NonNull public android.location.GnssExcessPathInfo build();
- method @NonNull public android.location.GnssExcessPathInfo.Builder clearAttenuationDb();
- method @NonNull public android.location.GnssExcessPathInfo.Builder clearExcessPathLengthMeters();
- method @NonNull public android.location.GnssExcessPathInfo.Builder clearExcessPathLengthUncertaintyMeters();
- method @NonNull public android.location.GnssExcessPathInfo.Builder setAttenuationDb(@FloatRange(from=0.0f) float);
- method @NonNull public android.location.GnssExcessPathInfo.Builder setExcessPathLengthMeters(@FloatRange(from=0.0f) float);
- method @NonNull public android.location.GnssExcessPathInfo.Builder setExcessPathLengthUncertaintyMeters(@FloatRange(from=0.0f) float);
- method @NonNull public android.location.GnssExcessPathInfo.Builder setReflectingPlane(@Nullable android.location.GnssReflectingPlane);
- }
-
- public final class GnssMeasurement implements android.os.Parcelable {
- method @Nullable public java.util.Collection<android.location.CorrelationVector> getCorrelationVectors();
- method @Nullable public android.location.SatellitePvt getSatellitePvt();
- method public boolean hasCorrelationVectors();
- method public boolean hasSatellitePvt();
- }
-
- public final class GnssMeasurementCorrections implements android.os.Parcelable {
- method public int describeContents();
- method @FloatRange(from=-1000.0F, to=10000.0f) public double getAltitudeMeters();
- method @FloatRange(from=0.0f, to=360.0f) public float getEnvironmentBearingDegrees();
- method @FloatRange(from=0.0f, to=180.0f) public float getEnvironmentBearingUncertaintyDegrees();
- method @FloatRange(from=0.0f) public double getHorizontalPositionUncertaintyMeters();
- method @FloatRange(from=-90.0F, to=90.0f) public double getLatitudeDegrees();
- method @FloatRange(from=-180.0F, to=180.0f) public double getLongitudeDegrees();
- method @NonNull public java.util.List<android.location.GnssSingleSatCorrection> getSingleSatelliteCorrectionList();
- method @IntRange(from=0) public long getToaGpsNanosecondsOfWeek();
- method @FloatRange(from=0.0f) public double getVerticalPositionUncertaintyMeters();
- method public boolean hasEnvironmentBearing();
- method public void writeToParcel(@NonNull android.os.Parcel, int);
- field public static final android.os.Parcelable.Creator<android.location.GnssMeasurementCorrections> CREATOR;
- }
-
- public static final class GnssMeasurementCorrections.Builder {
- ctor public GnssMeasurementCorrections.Builder();
- method @NonNull public android.location.GnssMeasurementCorrections build();
- method @NonNull public android.location.GnssMeasurementCorrections.Builder setAltitudeMeters(@FloatRange(from=-1000.0F, to=10000.0f) double);
- method @NonNull public android.location.GnssMeasurementCorrections.Builder setEnvironmentBearingDegrees(@FloatRange(from=0.0f, to=360.0f) float);
- method @NonNull public android.location.GnssMeasurementCorrections.Builder setEnvironmentBearingUncertaintyDegrees(@FloatRange(from=0.0f, to=180.0f) float);
- method @NonNull public android.location.GnssMeasurementCorrections.Builder setHorizontalPositionUncertaintyMeters(@FloatRange(from=0.0f) double);
- method @NonNull public android.location.GnssMeasurementCorrections.Builder setLatitudeDegrees(@FloatRange(from=-90.0F, to=90.0f) double);
- method @NonNull public android.location.GnssMeasurementCorrections.Builder setLongitudeDegrees(@FloatRange(from=-180.0F, to=180.0f) double);
- method @NonNull public android.location.GnssMeasurementCorrections.Builder setSingleSatelliteCorrectionList(@NonNull java.util.List<android.location.GnssSingleSatCorrection>);
- method @NonNull public android.location.GnssMeasurementCorrections.Builder setToaGpsNanosecondsOfWeek(@IntRange(from=0) long);
- method @NonNull public android.location.GnssMeasurementCorrections.Builder setVerticalPositionUncertaintyMeters(@FloatRange(from=0.0f) double);
- }
-
- public final class GnssMeasurementRequest implements android.os.Parcelable {
- method @NonNull public android.os.WorkSource getWorkSource();
- method public boolean isCorrelationVectorOutputsEnabled();
- }
-
- public static final class GnssMeasurementRequest.Builder {
- method @NonNull public android.location.GnssMeasurementRequest.Builder setCorrelationVectorOutputsEnabled(boolean);
- method @NonNull @RequiresPermission(android.Manifest.permission.UPDATE_DEVICE_STATS) public android.location.GnssMeasurementRequest.Builder setWorkSource(@Nullable android.os.WorkSource);
- }
-
- public final class GnssReflectingPlane implements android.os.Parcelable {
- method public int describeContents();
- method @FloatRange(from=-1000.0F, to=10000.0f) public double getAltitudeMeters();
- method @FloatRange(from=0.0f, to=360.0f) public double getAzimuthDegrees();
- method @FloatRange(from=-90.0F, to=90.0f) public double getLatitudeDegrees();
- method @FloatRange(from=-180.0F, to=180.0f) public double getLongitudeDegrees();
- method public void writeToParcel(@NonNull android.os.Parcel, int);
- field public static final android.os.Parcelable.Creator<android.location.GnssReflectingPlane> CREATOR;
- }
-
- public static final class GnssReflectingPlane.Builder {
- ctor public GnssReflectingPlane.Builder();
- method @NonNull public android.location.GnssReflectingPlane build();
- method @NonNull public android.location.GnssReflectingPlane.Builder setAltitudeMeters(@FloatRange(from=-1000.0F, to=10000.0f) double);
- method @NonNull public android.location.GnssReflectingPlane.Builder setAzimuthDegrees(@FloatRange(from=0.0f, to=360.0f) double);
- method @NonNull public android.location.GnssReflectingPlane.Builder setLatitudeDegrees(@FloatRange(from=-90.0F, to=90.0f) double);
- method @NonNull public android.location.GnssReflectingPlane.Builder setLongitudeDegrees(@FloatRange(from=-180.0F, to=180.0f) double);
- }
-
- public final class GnssRequest implements android.os.Parcelable {
- method public int describeContents();
- method public boolean isFullTracking();
- method public void writeToParcel(@NonNull android.os.Parcel, int);
- field @NonNull public static final android.os.Parcelable.Creator<android.location.GnssRequest> CREATOR;
- }
-
- public static final class GnssRequest.Builder {
- ctor public GnssRequest.Builder();
- ctor public GnssRequest.Builder(@NonNull android.location.GnssRequest);
- method @NonNull public android.location.GnssRequest build();
- method @NonNull public android.location.GnssRequest.Builder setFullTracking(boolean);
- }
-
- public final class GnssSingleSatCorrection implements android.os.Parcelable {
- method public int describeContents();
- method @FloatRange(from=0.0f, fromInclusive=false) public float getCarrierFrequencyHz();
- method @FloatRange(from=0.0f) public float getCombinedAttenuationDb();
- method public int getConstellationType();
- method @FloatRange(from=0.0f) public float getExcessPathLengthMeters();
- method @FloatRange(from=0.0f) public float getExcessPathLengthUncertaintyMeters();
- method @NonNull public java.util.List<android.location.GnssExcessPathInfo> getGnssExcessPathInfoList();
- method @FloatRange(from=0.0f, to=1.0f) public float getProbabilityLineOfSight();
- method @Deprecated @Nullable public android.location.GnssReflectingPlane getReflectingPlane();
- method @IntRange(from=0) public int getSatelliteId();
- method public boolean hasCombinedAttenuation();
- method public boolean hasExcessPathLength();
- method public boolean hasExcessPathLengthUncertainty();
- method @Deprecated public boolean hasReflectingPlane();
- method public boolean hasValidSatelliteLineOfSight();
- method public void writeToParcel(@NonNull android.os.Parcel, int);
- field public static final android.os.Parcelable.Creator<android.location.GnssSingleSatCorrection> CREATOR;
- }
-
- public static final class GnssSingleSatCorrection.Builder {
- ctor public GnssSingleSatCorrection.Builder();
- method @NonNull public android.location.GnssSingleSatCorrection build();
- method @NonNull public android.location.GnssSingleSatCorrection.Builder clearCombinedAttenuationDb();
- method @NonNull public android.location.GnssSingleSatCorrection.Builder clearExcessPathLengthMeters();
- method @NonNull public android.location.GnssSingleSatCorrection.Builder clearExcessPathLengthUncertaintyMeters();
- method @NonNull public android.location.GnssSingleSatCorrection.Builder clearProbabilityLineOfSight();
- method @NonNull public android.location.GnssSingleSatCorrection.Builder setCarrierFrequencyHz(@FloatRange(from=0.0f, fromInclusive=false) float);
- method @NonNull public android.location.GnssSingleSatCorrection.Builder setCombinedAttenuationDb(@FloatRange(from=0.0f) float);
- method @NonNull public android.location.GnssSingleSatCorrection.Builder setConstellationType(int);
- method @NonNull public android.location.GnssSingleSatCorrection.Builder setExcessPathLengthMeters(@FloatRange(from=0.0f) float);
- method @NonNull public android.location.GnssSingleSatCorrection.Builder setExcessPathLengthUncertaintyMeters(@FloatRange(from=0.0f) float);
- method @NonNull public android.location.GnssSingleSatCorrection.Builder setGnssExcessPathInfoList(@NonNull java.util.List<android.location.GnssExcessPathInfo>);
- method @NonNull public android.location.GnssSingleSatCorrection.Builder setProbabilityLineOfSight(@FloatRange(from=0.0f, to=1.0f) float);
- method @Deprecated @NonNull public android.location.GnssSingleSatCorrection.Builder setReflectingPlane(@Nullable android.location.GnssReflectingPlane);
- method @NonNull public android.location.GnssSingleSatCorrection.Builder setSatelliteId(@IntRange(from=0) int);
- }
-
- @Deprecated public class GpsClock implements android.os.Parcelable {
- method @Deprecated public int describeContents();
- method @Deprecated public double getBiasInNs();
- method @Deprecated public double getBiasUncertaintyInNs();
- method @Deprecated public double getDriftInNsPerSec();
- method @Deprecated public double getDriftUncertaintyInNsPerSec();
- method @Deprecated public long getFullBiasInNs();
- method @Deprecated public short getLeapSecond();
- method @Deprecated public long getTimeInNs();
- method @Deprecated public double getTimeUncertaintyInNs();
- method @Deprecated public byte getType();
- method @Deprecated public boolean hasBiasInNs();
- method @Deprecated public boolean hasBiasUncertaintyInNs();
- method @Deprecated public boolean hasDriftInNsPerSec();
- method @Deprecated public boolean hasDriftUncertaintyInNsPerSec();
- method @Deprecated public boolean hasFullBiasInNs();
- method @Deprecated public boolean hasLeapSecond();
- method @Deprecated public boolean hasTimeUncertaintyInNs();
- method @Deprecated public void reset();
- method @Deprecated public void resetBiasInNs();
- method @Deprecated public void resetBiasUncertaintyInNs();
- method @Deprecated public void resetDriftInNsPerSec();
- method @Deprecated public void resetDriftUncertaintyInNsPerSec();
- method @Deprecated public void resetFullBiasInNs();
- method @Deprecated public void resetLeapSecond();
- method @Deprecated public void resetTimeUncertaintyInNs();
- method @Deprecated public void set(android.location.GpsClock);
- method @Deprecated public void setBiasInNs(double);
- method @Deprecated public void setBiasUncertaintyInNs(double);
- method @Deprecated public void setDriftInNsPerSec(double);
- method @Deprecated public void setDriftUncertaintyInNsPerSec(double);
- method @Deprecated public void setFullBiasInNs(long);
- method @Deprecated public void setLeapSecond(short);
- method @Deprecated public void setTimeInNs(long);
- method @Deprecated public void setTimeUncertaintyInNs(double);
- method @Deprecated public void setType(byte);
- method @Deprecated public void writeToParcel(android.os.Parcel, int);
- field @Deprecated @NonNull public static final android.os.Parcelable.Creator<android.location.GpsClock> CREATOR;
- field @Deprecated public static final byte TYPE_GPS_TIME = 2; // 0x2
- field @Deprecated public static final byte TYPE_LOCAL_HW_TIME = 1; // 0x1
- field @Deprecated public static final byte TYPE_UNKNOWN = 0; // 0x0
- }
-
- @Deprecated public class GpsMeasurement implements android.os.Parcelable {
- method @Deprecated public int describeContents();
- method @Deprecated public double getAccumulatedDeltaRangeInMeters();
- method @Deprecated public short getAccumulatedDeltaRangeState();
- method @Deprecated public double getAccumulatedDeltaRangeUncertaintyInMeters();
- method @Deprecated public double getAzimuthInDeg();
- method @Deprecated public double getAzimuthUncertaintyInDeg();
- method @Deprecated public int getBitNumber();
- method @Deprecated public long getCarrierCycles();
- method @Deprecated public float getCarrierFrequencyInHz();
- method @Deprecated public double getCarrierPhase();
- method @Deprecated public double getCarrierPhaseUncertainty();
- method @Deprecated public double getCn0InDbHz();
- method @Deprecated public double getCodePhaseInChips();
- method @Deprecated public double getCodePhaseUncertaintyInChips();
- method @Deprecated public double getDopplerShiftInHz();
- method @Deprecated public double getDopplerShiftUncertaintyInHz();
- method @Deprecated public double getElevationInDeg();
- method @Deprecated public double getElevationUncertaintyInDeg();
- method @Deprecated public byte getLossOfLock();
- method @Deprecated public byte getMultipathIndicator();
- method @Deprecated public byte getPrn();
- method @Deprecated public double getPseudorangeInMeters();
- method @Deprecated public double getPseudorangeRateInMetersPerSec();
- method @Deprecated public double getPseudorangeRateUncertaintyInMetersPerSec();
- method @Deprecated public double getPseudorangeUncertaintyInMeters();
- method @Deprecated public long getReceivedGpsTowInNs();
- method @Deprecated public long getReceivedGpsTowUncertaintyInNs();
- method @Deprecated public double getSnrInDb();
- method @Deprecated public short getState();
- method @Deprecated public short getTimeFromLastBitInMs();
- method @Deprecated public double getTimeOffsetInNs();
- method @Deprecated public boolean hasAzimuthInDeg();
- method @Deprecated public boolean hasAzimuthUncertaintyInDeg();
- method @Deprecated public boolean hasBitNumber();
- method @Deprecated public boolean hasCarrierCycles();
- method @Deprecated public boolean hasCarrierFrequencyInHz();
- method @Deprecated public boolean hasCarrierPhase();
- method @Deprecated public boolean hasCarrierPhaseUncertainty();
- method @Deprecated public boolean hasCodePhaseInChips();
- method @Deprecated public boolean hasCodePhaseUncertaintyInChips();
- method @Deprecated public boolean hasDopplerShiftInHz();
- method @Deprecated public boolean hasDopplerShiftUncertaintyInHz();
- method @Deprecated public boolean hasElevationInDeg();
- method @Deprecated public boolean hasElevationUncertaintyInDeg();
- method @Deprecated public boolean hasPseudorangeInMeters();
- method @Deprecated public boolean hasPseudorangeUncertaintyInMeters();
- method @Deprecated public boolean hasSnrInDb();
- method @Deprecated public boolean hasTimeFromLastBitInMs();
- method @Deprecated public boolean isPseudorangeRateCorrected();
- method @Deprecated public boolean isUsedInFix();
- method @Deprecated public void reset();
- method @Deprecated public void resetAzimuthInDeg();
- method @Deprecated public void resetAzimuthUncertaintyInDeg();
- method @Deprecated public void resetBitNumber();
- method @Deprecated public void resetCarrierCycles();
- method @Deprecated public void resetCarrierFrequencyInHz();
- method @Deprecated public void resetCarrierPhase();
- method @Deprecated public void resetCarrierPhaseUncertainty();
- method @Deprecated public void resetCodePhaseInChips();
- method @Deprecated public void resetCodePhaseUncertaintyInChips();
- method @Deprecated public void resetDopplerShiftInHz();
- method @Deprecated public void resetDopplerShiftUncertaintyInHz();
- method @Deprecated public void resetElevationInDeg();
- method @Deprecated public void resetElevationUncertaintyInDeg();
- method @Deprecated public void resetPseudorangeInMeters();
- method @Deprecated public void resetPseudorangeUncertaintyInMeters();
- method @Deprecated public void resetSnrInDb();
- method @Deprecated public void resetTimeFromLastBitInMs();
- method @Deprecated public void set(android.location.GpsMeasurement);
- method @Deprecated public void setAccumulatedDeltaRangeInMeters(double);
- method @Deprecated public void setAccumulatedDeltaRangeState(short);
- method @Deprecated public void setAccumulatedDeltaRangeUncertaintyInMeters(double);
- method @Deprecated public void setAzimuthInDeg(double);
- method @Deprecated public void setAzimuthUncertaintyInDeg(double);
- method @Deprecated public void setBitNumber(int);
- method @Deprecated public void setCarrierCycles(long);
- method @Deprecated public void setCarrierFrequencyInHz(float);
- method @Deprecated public void setCarrierPhase(double);
- method @Deprecated public void setCarrierPhaseUncertainty(double);
- method @Deprecated public void setCn0InDbHz(double);
- method @Deprecated public void setCodePhaseInChips(double);
- method @Deprecated public void setCodePhaseUncertaintyInChips(double);
- method @Deprecated public void setDopplerShiftInHz(double);
- method @Deprecated public void setDopplerShiftUncertaintyInHz(double);
- method @Deprecated public void setElevationInDeg(double);
- method @Deprecated public void setElevationUncertaintyInDeg(double);
- method @Deprecated public void setLossOfLock(byte);
- method @Deprecated public void setMultipathIndicator(byte);
- method @Deprecated public void setPrn(byte);
- method @Deprecated public void setPseudorangeInMeters(double);
- method @Deprecated public void setPseudorangeRateInMetersPerSec(double);
- method @Deprecated public void setPseudorangeRateUncertaintyInMetersPerSec(double);
- method @Deprecated public void setPseudorangeUncertaintyInMeters(double);
- method @Deprecated public void setReceivedGpsTowInNs(long);
- method @Deprecated public void setReceivedGpsTowUncertaintyInNs(long);
- method @Deprecated public void setSnrInDb(double);
- method @Deprecated public void setState(short);
- method @Deprecated public void setTimeFromLastBitInMs(short);
- method @Deprecated public void setTimeOffsetInNs(double);
- method @Deprecated public void setUsedInFix(boolean);
- method @Deprecated public void writeToParcel(android.os.Parcel, int);
- field @Deprecated public static final short ADR_STATE_CYCLE_SLIP = 4; // 0x4
- field @Deprecated public static final short ADR_STATE_RESET = 2; // 0x2
- field @Deprecated public static final short ADR_STATE_UNKNOWN = 0; // 0x0
- field @Deprecated public static final short ADR_STATE_VALID = 1; // 0x1
- field @Deprecated @NonNull public static final android.os.Parcelable.Creator<android.location.GpsMeasurement> CREATOR;
- field @Deprecated public static final byte LOSS_OF_LOCK_CYCLE_SLIP = 2; // 0x2
- field @Deprecated public static final byte LOSS_OF_LOCK_OK = 1; // 0x1
- field @Deprecated public static final byte LOSS_OF_LOCK_UNKNOWN = 0; // 0x0
- field @Deprecated public static final byte MULTIPATH_INDICATOR_DETECTED = 1; // 0x1
- field @Deprecated public static final byte MULTIPATH_INDICATOR_NOT_USED = 2; // 0x2
- field @Deprecated public static final byte MULTIPATH_INDICATOR_UNKNOWN = 0; // 0x0
- field @Deprecated public static final short STATE_BIT_SYNC = 2; // 0x2
- field @Deprecated public static final short STATE_CODE_LOCK = 1; // 0x1
- field @Deprecated public static final short STATE_MSEC_AMBIGUOUS = 16; // 0x10
- field @Deprecated public static final short STATE_SUBFRAME_SYNC = 4; // 0x4
- field @Deprecated public static final short STATE_TOW_DECODED = 8; // 0x8
- field @Deprecated public static final short STATE_UNKNOWN = 0; // 0x0
- }
-
- @Deprecated public class GpsMeasurementsEvent implements android.os.Parcelable {
- ctor @Deprecated public GpsMeasurementsEvent(android.location.GpsClock, android.location.GpsMeasurement[]);
- method @Deprecated public int describeContents();
- method @Deprecated @NonNull public android.location.GpsClock getClock();
- method @Deprecated @NonNull public java.util.Collection<android.location.GpsMeasurement> getMeasurements();
- method @Deprecated public void writeToParcel(android.os.Parcel, int);
- field @Deprecated @NonNull public static final android.os.Parcelable.Creator<android.location.GpsMeasurementsEvent> CREATOR;
- field @Deprecated public static final int STATUS_GPS_LOCATION_DISABLED = 2; // 0x2
- field @Deprecated public static final int STATUS_NOT_SUPPORTED = 0; // 0x0
- field @Deprecated public static final int STATUS_READY = 1; // 0x1
- }
-
- @Deprecated public static interface GpsMeasurementsEvent.Listener {
- method @Deprecated public void onGpsMeasurementsReceived(android.location.GpsMeasurementsEvent);
- method @Deprecated public void onStatusChanged(int);
- }
-
- @Deprecated public class GpsNavigationMessage implements android.os.Parcelable {
- method @Deprecated public int describeContents();
- method @Deprecated @NonNull public byte[] getData();
- method @Deprecated public short getMessageId();
- method @Deprecated public byte getPrn();
- method @Deprecated public short getStatus();
- method @Deprecated public short getSubmessageId();
- method @Deprecated public byte getType();
- method @Deprecated public void reset();
- method @Deprecated public void set(android.location.GpsNavigationMessage);
- method @Deprecated public void setData(byte[]);
- method @Deprecated public void setMessageId(short);
- method @Deprecated public void setPrn(byte);
- method @Deprecated public void setStatus(short);
- method @Deprecated public void setSubmessageId(short);
- method @Deprecated public void setType(byte);
- method @Deprecated public void writeToParcel(android.os.Parcel, int);
- field @Deprecated @NonNull public static final android.os.Parcelable.Creator<android.location.GpsNavigationMessage> CREATOR;
- field @Deprecated public static final short STATUS_PARITY_PASSED = 1; // 0x1
- field @Deprecated public static final short STATUS_PARITY_REBUILT = 2; // 0x2
- field @Deprecated public static final short STATUS_UNKNOWN = 0; // 0x0
- field @Deprecated public static final byte TYPE_CNAV2 = 4; // 0x4
- field @Deprecated public static final byte TYPE_L1CA = 1; // 0x1
- field @Deprecated public static final byte TYPE_L2CNAV = 2; // 0x2
- field @Deprecated public static final byte TYPE_L5CNAV = 3; // 0x3
- field @Deprecated public static final byte TYPE_UNKNOWN = 0; // 0x0
- }
-
- @Deprecated public class GpsNavigationMessageEvent implements android.os.Parcelable {
- ctor @Deprecated public GpsNavigationMessageEvent(android.location.GpsNavigationMessage);
- method @Deprecated public int describeContents();
- method @Deprecated @NonNull public android.location.GpsNavigationMessage getNavigationMessage();
- method @Deprecated public void writeToParcel(android.os.Parcel, int);
- field @Deprecated @NonNull public static final android.os.Parcelable.Creator<android.location.GpsNavigationMessageEvent> CREATOR;
- field @Deprecated public static int STATUS_GPS_LOCATION_DISABLED;
- field @Deprecated public static int STATUS_NOT_SUPPORTED;
- field @Deprecated public static int STATUS_READY;
- }
-
- @Deprecated public static interface GpsNavigationMessageEvent.Listener {
- method @Deprecated public void onGpsNavigationMessageReceived(android.location.GpsNavigationMessageEvent);
- method @Deprecated public void onStatusChanged(int);
- }
-
- public final class LastLocationRequest implements android.os.Parcelable {
- method public int describeContents();
- method public boolean isAdasGnssBypass();
- method public boolean isHiddenFromAppOps();
- method public boolean isLocationSettingsIgnored();
- method public void writeToParcel(@NonNull android.os.Parcel, int);
- field @NonNull public static final android.os.Parcelable.Creator<android.location.LastLocationRequest> CREATOR;
- }
-
- public static final class LastLocationRequest.Builder {
- ctor public LastLocationRequest.Builder();
- ctor public LastLocationRequest.Builder(@NonNull android.location.LastLocationRequest);
- method @NonNull public android.location.LastLocationRequest build();
- method @NonNull @RequiresPermission(android.Manifest.permission.LOCATION_BYPASS) public android.location.LastLocationRequest.Builder setAdasGnssBypass(boolean);
- method @NonNull @RequiresPermission(android.Manifest.permission.UPDATE_APP_OPS_STATS) public android.location.LastLocationRequest.Builder setHiddenFromAppOps(boolean);
- method @NonNull @RequiresPermission(android.Manifest.permission.LOCATION_BYPASS) public android.location.LastLocationRequest.Builder setLocationSettingsIgnored(boolean);
- }
-
public class Location implements android.os.Parcelable {
method public void makeComplete();
method @Deprecated public void setIsFromMockProvider(boolean);
field @Deprecated public static final String EXTRA_NO_GPS_LOCATION = "noGPSLocation";
}
- public class LocationManager {
- method @RequiresPermission(allOf={android.Manifest.permission.LOCATION_HARDWARE, android.Manifest.permission.INTERACT_ACROSS_USERS}) public void addProviderRequestChangedListener(@NonNull java.util.concurrent.Executor, @NonNull android.location.provider.ProviderRequest.ChangedListener);
- method @Deprecated @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public void flushGnssBatch();
- method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void getCurrentLocation(@NonNull android.location.LocationRequest, @Nullable android.os.CancellationSignal, @NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer<android.location.Location>);
- method @Nullable public String getExtraLocationControllerPackage();
- method @Deprecated public int getGnssBatchSize();
- method @Nullable @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public android.location.Location getLastKnownLocation(@NonNull String, @NonNull android.location.LastLocationRequest);
- method @RequiresPermission(android.Manifest.permission.ACCESS_FINE_LOCATION) public void injectGnssMeasurementCorrections(@NonNull android.location.GnssMeasurementCorrections);
- method public boolean isAdasGnssLocationEnabled();
- method public boolean isExtraLocationControllerPackageEnabled();
- method public boolean isLocationEnabledForUser(@NonNull android.os.UserHandle);
- method public boolean isProviderEnabledForUser(@NonNull String, @NonNull android.os.UserHandle);
- method @Deprecated @RequiresPermission(android.Manifest.permission.READ_DEVICE_CONFIG) public boolean isProviderPackage(@NonNull String);
- method @RequiresPermission(android.Manifest.permission.READ_DEVICE_CONFIG) public boolean isProviderPackage(@Nullable String, @NonNull String, @Nullable String);
- method @Deprecated @RequiresPermission(allOf={android.Manifest.permission.LOCATION_HARDWARE, android.Manifest.permission.UPDATE_APP_OPS_STATS}) public boolean registerGnssBatchedLocationCallback(long, boolean, @NonNull android.location.BatchedLocationCallback, @Nullable android.os.Handler);
- method @Deprecated @RequiresPermission(android.Manifest.permission.ACCESS_FINE_LOCATION) public boolean registerGnssMeasurementsCallback(@NonNull android.location.GnssRequest, @NonNull java.util.concurrent.Executor, @NonNull android.location.GnssMeasurementsEvent.Callback);
- method @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public void removeProviderRequestChangedListener(@NonNull android.location.provider.ProviderRequest.ChangedListener);
- method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void requestLocationUpdates(@Nullable android.location.LocationRequest, @NonNull android.location.LocationListener, @Nullable android.os.Looper);
- method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void requestLocationUpdates(@Nullable android.location.LocationRequest, @NonNull java.util.concurrent.Executor, @NonNull android.location.LocationListener);
- method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void requestLocationUpdates(@Nullable android.location.LocationRequest, @NonNull android.app.PendingIntent);
- method @RequiresPermission(android.Manifest.permission.LOCATION_BYPASS) public void setAdasGnssLocationEnabled(boolean);
- method @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public void setExtraLocationControllerPackage(@Nullable String);
- method @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public void setExtraLocationControllerPackageEnabled(boolean);
- method @RequiresPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) public void setLocationEnabledForUser(boolean, @NonNull android.os.UserHandle);
- method @Deprecated @RequiresPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) public boolean setProviderEnabledForUser(@NonNull String, boolean, @NonNull android.os.UserHandle);
- method @Deprecated @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public boolean unregisterGnssBatchedLocationCallback(@NonNull android.location.BatchedLocationCallback);
- field public static final String ACTION_ADAS_GNSS_ENABLED_CHANGED = "android.location.action.ADAS_GNSS_ENABLED_CHANGED";
- field public static final String EXTRA_ADAS_GNSS_ENABLED = "android.location.extra.ADAS_GNSS_ENABLED";
- field @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public static final String GPS_HARDWARE_PROVIDER = "gps_hardware";
- }
-
- public final class LocationRequest implements android.os.Parcelable {
- method @Deprecated @NonNull public static android.location.LocationRequest create();
- method @Deprecated @NonNull public static android.location.LocationRequest createFromDeprecatedCriteria(@NonNull android.location.Criteria, long, float, boolean);
- method @Deprecated @NonNull public static android.location.LocationRequest createFromDeprecatedProvider(@NonNull String, long, float, boolean);
- method @Deprecated public long getExpireAt();
- method @Deprecated public long getExpireIn();
- method @Deprecated public long getFastestInterval();
- method @Deprecated public boolean getHideFromAppOps();
- method @Deprecated public long getInterval();
- method @Deprecated public int getNumUpdates();
- method @Deprecated @NonNull public String getProvider();
- method @Deprecated public float getSmallestDisplacement();
- method @NonNull public android.os.WorkSource getWorkSource();
- method public boolean isAdasGnssBypass();
- method public boolean isHiddenFromAppOps();
- method public boolean isLocationSettingsIgnored();
- method public boolean isLowPower();
- method @Deprecated public boolean isLowPowerMode();
- method @Deprecated @NonNull public android.location.LocationRequest setExpireAt(long);
- method @Deprecated @NonNull public android.location.LocationRequest setExpireIn(long);
- method @Deprecated @NonNull public android.location.LocationRequest setFastestInterval(long);
- method @Deprecated public void setHideFromAppOps(boolean);
- method @Deprecated @NonNull public android.location.LocationRequest setInterval(long);
- method @Deprecated @NonNull @RequiresPermission(android.Manifest.permission.LOCATION_BYPASS) public android.location.LocationRequest setLocationSettingsIgnored(boolean);
- method @Deprecated @NonNull public android.location.LocationRequest setLowPowerMode(boolean);
- method @Deprecated @NonNull public android.location.LocationRequest setNumUpdates(int);
- method @Deprecated @NonNull public android.location.LocationRequest setProvider(@NonNull String);
- method @Deprecated @NonNull public android.location.LocationRequest setQuality(int);
- method @Deprecated @NonNull public android.location.LocationRequest setSmallestDisplacement(float);
- method @Deprecated public void setWorkSource(@Nullable android.os.WorkSource);
- field @Deprecated public static final int ACCURACY_BLOCK = 102; // 0x66
- field @Deprecated public static final int ACCURACY_CITY = 104; // 0x68
- field @Deprecated public static final int ACCURACY_FINE = 100; // 0x64
- field @Deprecated public static final int POWER_HIGH = 203; // 0xcb
- field @Deprecated public static final int POWER_LOW = 201; // 0xc9
- field @Deprecated public static final int POWER_NONE = 200; // 0xc8
- }
-
- public static final class LocationRequest.Builder {
- method @NonNull @RequiresPermission(android.Manifest.permission.LOCATION_BYPASS) public android.location.LocationRequest.Builder setAdasGnssBypass(boolean);
- method @NonNull @RequiresPermission(android.Manifest.permission.UPDATE_APP_OPS_STATS) public android.location.LocationRequest.Builder setHiddenFromAppOps(boolean);
- method @NonNull @RequiresPermission(android.Manifest.permission.LOCATION_BYPASS) public android.location.LocationRequest.Builder setLocationSettingsIgnored(boolean);
- method @NonNull @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public android.location.LocationRequest.Builder setLowPower(boolean);
- method @NonNull @RequiresPermission(android.Manifest.permission.UPDATE_DEVICE_STATS) public android.location.LocationRequest.Builder setWorkSource(@Nullable android.os.WorkSource);
- }
-
- public final class SatellitePvt implements android.os.Parcelable {
- method public int describeContents();
- method @Nullable public android.location.SatellitePvt.ClockInfo getClockInfo();
- method public int getEphemerisSource();
- method @FloatRange public double getIonoDelayMeters();
- method @IntRange(from=0, to=1023) public int getIssueOfDataClock();
- method @IntRange(from=0, to=1023) public int getIssueOfDataEphemeris();
- method @Nullable public android.location.SatellitePvt.PositionEcef getPositionEcef();
- method @IntRange(from=0) public long getTimeOfClockSeconds();
- method @IntRange(from=0) public long getTimeOfEphemerisSeconds();
- method @FloatRange public double getTropoDelayMeters();
- method @Nullable public android.location.SatellitePvt.VelocityEcef getVelocityEcef();
- method public boolean hasIono();
- method public boolean hasIssueOfDataClock();
- method public boolean hasIssueOfDataEphemeris();
- method public boolean hasPositionVelocityClockInfo();
- method public boolean hasTimeOfClockSeconds();
- method public boolean hasTimeOfEphemerisSeconds();
- method public boolean hasTropo();
- method public void writeToParcel(@NonNull android.os.Parcel, int);
- field @NonNull public static final android.os.Parcelable.Creator<android.location.SatellitePvt> CREATOR;
- field public static final int EPHEMERIS_SOURCE_DEMODULATED = 0; // 0x0
- field public static final int EPHEMERIS_SOURCE_OTHER = 3; // 0x3
- field public static final int EPHEMERIS_SOURCE_SERVER_LONG_TERM = 2; // 0x2
- field public static final int EPHEMERIS_SOURCE_SERVER_NORMAL = 1; // 0x1
- }
-
- public static final class SatellitePvt.Builder {
- ctor public SatellitePvt.Builder();
- method @NonNull public android.location.SatellitePvt build();
- method @NonNull public android.location.SatellitePvt.Builder setClockInfo(@NonNull android.location.SatellitePvt.ClockInfo);
- method @NonNull public android.location.SatellitePvt.Builder setEphemerisSource(int);
- method @NonNull public android.location.SatellitePvt.Builder setIonoDelayMeters(@FloatRange(from=0.0f, to=100.0f) double);
- method @NonNull public android.location.SatellitePvt.Builder setIssueOfDataClock(@IntRange(from=0, to=1023) int);
- method @NonNull public android.location.SatellitePvt.Builder setIssueOfDataEphemeris(@IntRange(from=0, to=1023) int);
- method @NonNull public android.location.SatellitePvt.Builder setPositionEcef(@NonNull android.location.SatellitePvt.PositionEcef);
- method @NonNull public android.location.SatellitePvt.Builder setTimeOfClockSeconds(@IntRange(from=0) long);
- method @NonNull public android.location.SatellitePvt.Builder setTimeOfEphemerisSeconds(@IntRange(from=0) long);
- method @NonNull public android.location.SatellitePvt.Builder setTropoDelayMeters(@FloatRange(from=0.0f, to=100.0f) double);
- method @NonNull public android.location.SatellitePvt.Builder setVelocityEcef(@NonNull android.location.SatellitePvt.VelocityEcef);
- }
-
- public static final class SatellitePvt.ClockInfo implements android.os.Parcelable {
- ctor public SatellitePvt.ClockInfo(double, double, double);
- method public int describeContents();
- method @FloatRange public double getClockDriftMetersPerSecond();
- method @FloatRange public double getHardwareCodeBiasMeters();
- method @FloatRange public double getTimeCorrectionMeters();
- method public void writeToParcel(@NonNull android.os.Parcel, int);
- field @NonNull public static final android.os.Parcelable.Creator<android.location.SatellitePvt.ClockInfo> CREATOR;
- }
-
- public static final class SatellitePvt.PositionEcef implements android.os.Parcelable {
- ctor public SatellitePvt.PositionEcef(double, double, double, double);
- method public int describeContents();
- method @FloatRange(from=0.0f, fromInclusive=false) public double getUreMeters();
- method @FloatRange public double getXMeters();
- method @FloatRange public double getYMeters();
- method @FloatRange public double getZMeters();
- method public void writeToParcel(@NonNull android.os.Parcel, int);
- field @NonNull public static final android.os.Parcelable.Creator<android.location.SatellitePvt.PositionEcef> CREATOR;
- }
-
- public static final class SatellitePvt.VelocityEcef implements android.os.Parcelable {
- ctor public SatellitePvt.VelocityEcef(double, double, double, double);
- method public int describeContents();
- method @FloatRange(from=0.0f, fromInclusive=false) public double getUreRateMetersPerSecond();
- method @FloatRange public double getXMetersPerSecond();
- method @FloatRange public double getYMetersPerSecond();
- method @FloatRange public double getZMetersPerSecond();
- method public void writeToParcel(@NonNull android.os.Parcel, int);
- field @NonNull public static final android.os.Parcelable.Creator<android.location.SatellitePvt.VelocityEcef> CREATOR;
- }
-
-}
-
-package android.location.provider {
-
- public abstract class LocationProviderBase {
- ctor public LocationProviderBase(@NonNull android.content.Context, @NonNull String, @NonNull android.location.provider.ProviderProperties);
- method @Nullable public final android.os.IBinder getBinder();
- method @NonNull public android.location.provider.ProviderProperties getProperties();
- method public boolean isAllowed();
- method public abstract void onFlush(@NonNull android.location.provider.LocationProviderBase.OnFlushCompleteCallback);
- method public abstract void onSendExtraCommand(@NonNull String, @Nullable android.os.Bundle);
- method public abstract void onSetRequest(@NonNull android.location.provider.ProviderRequest);
- method public void reportLocation(@NonNull android.location.Location);
- method public void reportLocations(@NonNull java.util.List<android.location.Location>);
- method public void setAllowed(boolean);
- method public void setProperties(@NonNull android.location.provider.ProviderProperties);
- field public static final String ACTION_FUSED_PROVIDER = "com.android.location.service.FusedLocationProvider";
- field public static final String ACTION_GNSS_PROVIDER = "android.location.provider.action.GNSS_PROVIDER";
- field public static final String ACTION_NETWORK_PROVIDER = "com.android.location.service.v3.NetworkLocationProvider";
- }
-
- public static interface LocationProviderBase.OnFlushCompleteCallback {
- method public void onFlushComplete();
- }
-
- public final class ProviderRequest implements android.os.Parcelable {
- method public int describeContents();
- method @IntRange(from=0) public long getIntervalMillis();
- method @IntRange(from=0) public long getMaxUpdateDelayMillis();
- method public int getQuality();
- method @NonNull public android.os.WorkSource getWorkSource();
- method public boolean isActive();
- method public boolean isLocationSettingsIgnored();
- method public boolean isLowPower();
- method public void writeToParcel(@NonNull android.os.Parcel, int);
- field @NonNull public static final android.os.Parcelable.Creator<android.location.provider.ProviderRequest> CREATOR;
- field @NonNull public static final android.location.provider.ProviderRequest EMPTY_REQUEST;
- field public static final long INTERVAL_DISABLED = 9223372036854775807L; // 0x7fffffffffffffffL
- }
-
- public static final class ProviderRequest.Builder {
- ctor public ProviderRequest.Builder();
- method @NonNull public android.location.provider.ProviderRequest build();
- method @NonNull public android.location.provider.ProviderRequest.Builder setIntervalMillis(@IntRange(from=0) long);
- method @NonNull public android.location.provider.ProviderRequest.Builder setLocationSettingsIgnored(boolean);
- method @NonNull public android.location.provider.ProviderRequest.Builder setLowPower(boolean);
- method @NonNull public android.location.provider.ProviderRequest.Builder setMaxUpdateDelayMillis(@IntRange(from=0) long);
- method @NonNull public android.location.provider.ProviderRequest.Builder setQuality(int);
- method @NonNull public android.location.provider.ProviderRequest.Builder setWorkSource(@NonNull android.os.WorkSource);
- }
-
- public static interface ProviderRequest.ChangedListener {
- method public void onProviderRequestChanged(@NonNull String, @NonNull android.location.provider.ProviderRequest);
- }
-
}
package android.media {
diff --git a/core/api/system-lint-baseline.txt b/core/api/system-lint-baseline.txt
index 6c233270bad5..e7c0a912383f 100644
--- a/core/api/system-lint-baseline.txt
+++ b/core/api/system-lint-baseline.txt
@@ -135,16 +135,6 @@ SamShouldBeLast: android.content.pm.ResolveInfo#dump(android.util.Printer, Strin
SAM-compatible parameters (such as parameter 1, "pw", in android.content.pm.ResolveInfo.dump) should be last to improve Kotlin interoperability; see https://kotlinlang.org/docs/reference/java-interop.html#sam-conversions
SamShouldBeLast: android.location.Location#dump(android.util.Printer, String):
SAM-compatible parameters (such as parameter 1, "pw", in android.location.Location.dump) should be last to improve Kotlin interoperability; see https://kotlinlang.org/docs/reference/java-interop.html#sam-conversions
-SamShouldBeLast: android.location.LocationManager#addNmeaListener(android.location.OnNmeaMessageListener, android.os.Handler):
- SAM-compatible parameters (such as parameter 1, "listener", in android.location.LocationManager.addNmeaListener) should be last to improve Kotlin interoperability; see https://kotlinlang.org/docs/reference/java-interop.html#sam-conversions
-SamShouldBeLast: android.location.LocationManager#requestLocationUpdates(String, long, float, android.location.LocationListener, android.os.Looper):
- SAM-compatible parameters (such as parameter 4, "listener", in android.location.LocationManager.requestLocationUpdates) should be last to improve Kotlin interoperability; see https://kotlinlang.org/docs/reference/java-interop.html#sam-conversions
-SamShouldBeLast: android.location.LocationManager#requestLocationUpdates(long, float, android.location.Criteria, android.location.LocationListener, android.os.Looper):
- SAM-compatible parameters (such as parameter 4, "listener", in android.location.LocationManager.requestLocationUpdates) should be last to improve Kotlin interoperability; see https://kotlinlang.org/docs/reference/java-interop.html#sam-conversions
-SamShouldBeLast: android.location.LocationManager#requestSingleUpdate(String, android.location.LocationListener, android.os.Looper):
- SAM-compatible parameters (such as parameter 2, "listener", in android.location.LocationManager.requestSingleUpdate) should be last to improve Kotlin interoperability; see https://kotlinlang.org/docs/reference/java-interop.html#sam-conversions
-SamShouldBeLast: android.location.LocationManager#requestSingleUpdate(android.location.Criteria, android.location.LocationListener, android.os.Looper):
- SAM-compatible parameters (such as parameter 2, "listener", in android.location.LocationManager.requestSingleUpdate) should be last to improve Kotlin interoperability; see https://kotlinlang.org/docs/reference/java-interop.html#sam-conversions
SamShouldBeLast: android.media.AudioFocusRequest.Builder#setOnAudioFocusChangeListener(android.media.AudioManager.OnAudioFocusChangeListener, android.os.Handler):
SAM-compatible parameters (such as parameter 1, "listener", in android.media.AudioFocusRequest.Builder.setOnAudioFocusChangeListener) should be last to improve Kotlin interoperability; see https://kotlinlang.org/docs/reference/java-interop.html#sam-conversions
SamShouldBeLast: android.media.AudioManager#requestAudioFocus(android.media.AudioManager.OnAudioFocusChangeListener, int, int):
diff --git a/core/api/system-removed.txt b/core/api/system-removed.txt
index 1c10356c6b03..aa17df3471d7 100644
--- a/core/api/system-removed.txt
+++ b/core/api/system-removed.txt
@@ -114,20 +114,6 @@ package android.hardware.hdmi {
}
-package android.location {
-
- public class LocationManager {
- method @Deprecated public boolean addGpsMeasurementListener(android.location.GpsMeasurementsEvent.Listener);
- method @Deprecated public boolean addGpsNavigationMessageListener(android.location.GpsNavigationMessageEvent.Listener);
- method @Deprecated @RequiresPermission(android.Manifest.permission.READ_DEVICE_CONFIG) public boolean isProviderPackage(@Nullable String, @NonNull String);
- method @Deprecated public void removeGpsMeasurementListener(android.location.GpsMeasurementsEvent.Listener);
- method @Deprecated public void removeGpsNavigationMessageListener(android.location.GpsNavigationMessageEvent.Listener);
- method @Deprecated @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public void setLocationControllerExtraPackage(String);
- method @Deprecated @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public void setLocationControllerExtraPackageEnabled(boolean);
- }
-
-}
-
package android.media.tv {
public final class TvInputManager {
diff --git a/core/api/test-current.txt b/core/api/test-current.txt
index 29b52132be75..642813f36a58 100644
--- a/core/api/test-current.txt
+++ b/core/api/test-current.txt
@@ -499,14 +499,14 @@ package android.app {
method public int describeContents();
method public int getActivityType();
method @Nullable public android.graphics.Rect getAppBounds();
- method public android.graphics.Rect getBounds();
+ method @NonNull public android.graphics.Rect getBounds();
method @NonNull public android.graphics.Rect getMaxBounds();
method public int getRotation();
method public int getWindowingMode();
method public static boolean isFloating(int);
method public void setActivityType(int);
method public void setAppBounds(@Nullable android.graphics.Rect);
- method public void setBounds(android.graphics.Rect);
+ method public void setBounds(@Nullable android.graphics.Rect);
method public void setMaxBounds(@Nullable android.graphics.Rect);
method public void setRotation(int);
method public void setTo(android.app.WindowConfiguration);
@@ -1748,109 +1748,6 @@ package android.inputmethodservice {
}
-package android.location {
-
- public final class GnssClock implements android.os.Parcelable {
- ctor public GnssClock();
- method public void reset();
- method public void resetBiasNanos();
- method public void resetBiasUncertaintyNanos();
- method public void resetDriftNanosPerSecond();
- method public void resetDriftUncertaintyNanosPerSecond();
- method public void resetElapsedRealtimeNanos();
- method public void resetElapsedRealtimeUncertaintyNanos();
- method public void resetFullBiasNanos();
- method public void resetLeapSecond();
- method public void resetReferenceCarrierFrequencyHzForIsb();
- method public void resetReferenceCodeTypeForIsb();
- method public void resetReferenceConstellationTypeForIsb();
- method public void resetTimeUncertaintyNanos();
- method public void set(android.location.GnssClock);
- method public void setBiasNanos(double);
- method public void setBiasUncertaintyNanos(@FloatRange(from=0.0f) double);
- method public void setDriftNanosPerSecond(double);
- method public void setDriftUncertaintyNanosPerSecond(@FloatRange(from=0.0f) double);
- method public void setElapsedRealtimeNanos(long);
- method public void setElapsedRealtimeUncertaintyNanos(@FloatRange(from=0.0f) double);
- method public void setFullBiasNanos(long);
- method public void setHardwareClockDiscontinuityCount(int);
- method public void setLeapSecond(int);
- method public void setReferenceCarrierFrequencyHzForIsb(@FloatRange(from=0.0) double);
- method public void setReferenceCodeTypeForIsb(@NonNull String);
- method public void setReferenceConstellationTypeForIsb(int);
- method public void setTimeNanos(long);
- method public void setTimeUncertaintyNanos(@FloatRange(from=0.0f) double);
- }
-
- public final class GnssMeasurement implements android.os.Parcelable {
- ctor public GnssMeasurement();
- method public void reset();
- method public void resetAutomaticGainControlLevel();
- method public void resetBasebandCn0DbHz();
- method @Deprecated public void resetCarrierCycles();
- method public void resetCarrierFrequencyHz();
- method @Deprecated public void resetCarrierPhase();
- method @Deprecated public void resetCarrierPhaseUncertainty();
- method public void resetCodeType();
- method public void resetCorrelationVectors();
- method public void resetFullInterSignalBiasNanos();
- method public void resetFullInterSignalBiasUncertaintyNanos();
- method public void resetSatelliteInterSignalBiasNanos();
- method public void resetSatelliteInterSignalBiasUncertaintyNanos();
- method public void resetSatellitePvt();
- method public void resetSnrInDb();
- method public void set(android.location.GnssMeasurement);
- method public void setAccumulatedDeltaRangeMeters(double);
- method public void setAccumulatedDeltaRangeState(int);
- method public void setAccumulatedDeltaRangeUncertaintyMeters(double);
- method @Deprecated public void setAutomaticGainControlLevelInDb(double);
- method public void setBasebandCn0DbHz(double);
- method @Deprecated public void setCarrierCycles(long);
- method public void setCarrierFrequencyHz(float);
- method @Deprecated public void setCarrierPhase(double);
- method @Deprecated public void setCarrierPhaseUncertainty(double);
- method public void setCn0DbHz(double);
- method public void setCodeType(@NonNull String);
- method public void setConstellationType(int);
- method public void setCorrelationVectors(@Nullable java.util.Collection<android.location.CorrelationVector>);
- method public void setFullInterSignalBiasNanos(double);
- method public void setFullInterSignalBiasUncertaintyNanos(@FloatRange(from=0.0) double);
- method public void setMultipathIndicator(int);
- method public void setPseudorangeRateMetersPerSecond(double);
- method public void setPseudorangeRateUncertaintyMetersPerSecond(double);
- method public void setReceivedSvTimeNanos(long);
- method public void setReceivedSvTimeUncertaintyNanos(long);
- method public void setSatelliteInterSignalBiasNanos(double);
- method public void setSatelliteInterSignalBiasUncertaintyNanos(@FloatRange(from=0.0) double);
- method public void setSatellitePvt(@Nullable android.location.SatellitePvt);
- method public void setSnrInDb(double);
- method public void setState(int);
- method public void setSvid(int);
- method public void setTimeOffsetNanos(double);
- field public static final int ADR_STATE_ALL = 31; // 0x1f
- }
-
- public final class GnssNavigationMessage implements android.os.Parcelable {
- ctor public GnssNavigationMessage();
- method public void reset();
- method public void set(android.location.GnssNavigationMessage);
- method public void setData(byte[]);
- method public void setMessageId(@IntRange(from=0xffffffff, to=120) int);
- method public void setStatus(int);
- method public void setSubmessageId(@IntRange(from=1) int);
- method public void setSvid(@IntRange(from=1, to=200) int);
- method public void setType(int);
- }
-
- public class LocationManager {
- method @NonNull public String[] getBackgroundThrottlingWhitelist();
- method @NonNull public android.os.PackageTagsList getIgnoreSettingsAllowlist();
- method @Deprecated @NonNull public String[] getIgnoreSettingsWhitelist();
- method @Deprecated @Nullable @RequiresPermission(android.Manifest.permission.READ_DEVICE_CONFIG) public java.util.List<java.lang.String> getProviderPackages(@NonNull String);
- }
-
-}
-
package android.media {
public final class AudioAttributes implements android.os.Parcelable {
diff --git a/core/api/test-lint-baseline.txt b/core/api/test-lint-baseline.txt
index 4a972806b314..1aaedaba3f79 100644
--- a/core/api/test-lint-baseline.txt
+++ b/core/api/test-lint-baseline.txt
@@ -87,50 +87,6 @@ GenericException: android.service.autofill.ImageTransformation#apply(android.ser
Methods must not throw generic exceptions (`java.lang.Exception`)
-GetterSetterNames: android.location.GnssClock#setBiasNanos(double):
- Symmetric method for `hasBiasNanos` must be named `setHasBiasNanos`; was `setBiasNanos`
-GetterSetterNames: android.location.GnssClock#setBiasUncertaintyNanos(double):
- Symmetric method for `hasBiasUncertaintyNanos` must be named `setHasBiasUncertaintyNanos`; was `setBiasUncertaintyNanos`
-GetterSetterNames: android.location.GnssClock#setDriftNanosPerSecond(double):
- Symmetric method for `hasDriftNanosPerSecond` must be named `setHasDriftNanosPerSecond`; was `setDriftNanosPerSecond`
-GetterSetterNames: android.location.GnssClock#setDriftUncertaintyNanosPerSecond(double):
- Symmetric method for `hasDriftUncertaintyNanosPerSecond` must be named `setHasDriftUncertaintyNanosPerSecond`; was `setDriftUncertaintyNanosPerSecond`
-GetterSetterNames: android.location.GnssClock#setElapsedRealtimeNanos(long):
- Symmetric method for `hasElapsedRealtimeNanos` must be named `setHasElapsedRealtimeNanos`; was `setElapsedRealtimeNanos`
-GetterSetterNames: android.location.GnssClock#setElapsedRealtimeUncertaintyNanos(double):
- Symmetric method for `hasElapsedRealtimeUncertaintyNanos` must be named `setHasElapsedRealtimeUncertaintyNanos`; was `setElapsedRealtimeUncertaintyNanos`
-GetterSetterNames: android.location.GnssClock#setFullBiasNanos(long):
- Symmetric method for `hasFullBiasNanos` must be named `setHasFullBiasNanos`; was `setFullBiasNanos`
-GetterSetterNames: android.location.GnssClock#setLeapSecond(int):
- Symmetric method for `hasLeapSecond` must be named `setHasLeapSecond`; was `setLeapSecond`
-GetterSetterNames: android.location.GnssClock#setReferenceCarrierFrequencyHzForIsb(double):
- Symmetric method for `hasReferenceCarrierFrequencyHzForIsb` must be named `setHasReferenceCarrierFrequencyHzForIsb`; was `setReferenceCarrierFrequencyHzForIsb`
-GetterSetterNames: android.location.GnssClock#setReferenceCodeTypeForIsb(String):
- Symmetric method for `hasReferenceCodeTypeForIsb` must be named `setHasReferenceCodeTypeForIsb`; was `setReferenceCodeTypeForIsb`
-GetterSetterNames: android.location.GnssClock#setReferenceConstellationTypeForIsb(int):
- Symmetric method for `hasReferenceConstellationTypeForIsb` must be named `setHasReferenceConstellationTypeForIsb`; was `setReferenceConstellationTypeForIsb`
-GetterSetterNames: android.location.GnssClock#setTimeUncertaintyNanos(double):
- Symmetric method for `hasTimeUncertaintyNanos` must be named `setHasTimeUncertaintyNanos`; was `setTimeUncertaintyNanos`
-GetterSetterNames: android.location.GnssMeasurement#setBasebandCn0DbHz(double):
- Symmetric method for `hasBasebandCn0DbHz` must be named `setHasBasebandCn0DbHz`; was `setBasebandCn0DbHz`
-GetterSetterNames: android.location.GnssMeasurement#setCarrierFrequencyHz(float):
- Symmetric method for `hasCarrierFrequencyHz` must be named `setHasCarrierFrequencyHz`; was `setCarrierFrequencyHz`
-GetterSetterNames: android.location.GnssMeasurement#setCodeType(String):
- Symmetric method for `hasCodeType` must be named `setHasCodeType`; was `setCodeType`
-GetterSetterNames: android.location.GnssMeasurement#setCorrelationVectors(java.util.Collection<android.location.CorrelationVector>):
- Symmetric method for `hasCorrelationVectors` must be named `setHasCorrelationVectors`; was `setCorrelationVectors`
-GetterSetterNames: android.location.GnssMeasurement#setFullInterSignalBiasNanos(double):
- Symmetric method for `hasFullInterSignalBiasNanos` must be named `setHasFullInterSignalBiasNanos`; was `setFullInterSignalBiasNanos`
-GetterSetterNames: android.location.GnssMeasurement#setFullInterSignalBiasUncertaintyNanos(double):
- Symmetric method for `hasFullInterSignalBiasUncertaintyNanos` must be named `setHasFullInterSignalBiasUncertaintyNanos`; was `setFullInterSignalBiasUncertaintyNanos`
-GetterSetterNames: android.location.GnssMeasurement#setSatelliteInterSignalBiasNanos(double):
- Symmetric method for `hasSatelliteInterSignalBiasNanos` must be named `setHasSatelliteInterSignalBiasNanos`; was `setSatelliteInterSignalBiasNanos`
-GetterSetterNames: android.location.GnssMeasurement#setSatelliteInterSignalBiasUncertaintyNanos(double):
- Symmetric method for `hasSatelliteInterSignalBiasUncertaintyNanos` must be named `setHasSatelliteInterSignalBiasUncertaintyNanos`; was `setSatelliteInterSignalBiasUncertaintyNanos`
-GetterSetterNames: android.location.GnssMeasurement#setSatellitePvt(android.location.SatellitePvt):
- Symmetric method for `hasSatellitePvt` must be named `setHasSatellitePvt`; was `setSatellitePvt`
-GetterSetterNames: android.location.GnssMeasurement#setSnrInDb(double):
- Symmetric method for `hasSnrInDb` must be named `setHasSnrInDb`; was `setSnrInDb`
GetterSetterNames: android.net.NetworkPolicyManager#getRestrictBackground():
Symmetric method for `setRestrictBackground` must be named `isRestrictBackground`; was `getRestrictBackground`
@@ -343,14 +299,6 @@ MissingNullability: android.hardware.camera2.CameraManager#getCameraIdListNoLazy
Missing nullability on method `getCameraIdListNoLazy` return
MissingNullability: android.hardware.display.AmbientDisplayConfiguration#AmbientDisplayConfiguration(android.content.Context) parameter #0:
Missing nullability on parameter `context` in method `AmbientDisplayConfiguration`
-MissingNullability: android.location.GnssClock#set(android.location.GnssClock) parameter #0:
- Missing nullability on parameter `clock` in method `set`
-MissingNullability: android.location.GnssMeasurement#set(android.location.GnssMeasurement) parameter #0:
- Missing nullability on parameter `measurement` in method `set`
-MissingNullability: android.location.GnssNavigationMessage#set(android.location.GnssNavigationMessage) parameter #0:
- Missing nullability on parameter `navigationMessage` in method `set`
-MissingNullability: android.location.GnssNavigationMessage#setData(byte[]) parameter #0:
- Missing nullability on parameter `value` in method `setData`
MissingNullability: android.media.AudioAttributes#getSdkUsages():
Missing nullability on method `getSdkUsages` return
MissingNullability: android.media.AudioManager#getPublicStreamTypes():
diff --git a/core/java/android/app/WindowConfiguration.java b/core/java/android/app/WindowConfiguration.java
index bf238c399ad3..019a1a8cb2a6 100644
--- a/core/java/android/app/WindowConfiguration.java
+++ b/core/java/android/app/WindowConfiguration.java
@@ -267,12 +267,13 @@ public class WindowConfiguration implements Parcelable, Comparable<WindowConfigu
}
};
- // TODO(b/297672475): make this take @Nullable
/**
* Sets the bounds to the provided {@link Rect}.
+ * Passing {@code null} sets the bounds {@link Rect} to empty.
+ *
* @param rect the new bounds value.
*/
- public void setBounds(Rect rect) {
+ public void setBounds(@Nullable Rect rect) {
if (rect == null) {
mBounds.setEmpty();
return;
@@ -282,8 +283,10 @@ public class WindowConfiguration implements Parcelable, Comparable<WindowConfigu
}
/**
- * Set {@link #mAppBounds} to the input Rect.
- * @param rect The rect value to set {@link #mAppBounds} to.
+ * Sets the app bounds to the provided {@link Rect}.
+ * Passing {@code null} sets the bounds to {@code null}.
+ *
+ * @param rect the new app bounds value.
* @see #getAppBounds()
*/
public void setAppBounds(@Nullable Rect rect) {
@@ -297,7 +300,9 @@ public class WindowConfiguration implements Parcelable, Comparable<WindowConfigu
/**
* Sets the maximum bounds to the provided {@link Rect}.
- * @param rect the new bounds value.
+ * Passing {@code null} sets the bounds {@link Rect} to empty.
+ *
+ * @param rect the new max bounds value.
* @see #getMaxBounds()
*/
public void setMaxBounds(@Nullable Rect rect) {
@@ -364,8 +369,8 @@ public class WindowConfiguration implements Parcelable, Comparable<WindowConfigu
return mAppBounds;
}
- // TODO(b/297672475): make this return @NonNull
/** @see #setBounds(Rect) */
+ @NonNull
public Rect getBounds() {
return mBounds;
}
diff --git a/core/java/android/companion/virtual/IVirtualDevice.aidl b/core/java/android/companion/virtual/IVirtualDevice.aidl
index be699f4b9fa3..c58561d0bb2e 100644
--- a/core/java/android/companion/virtual/IVirtualDevice.aidl
+++ b/core/java/android/companion/virtual/IVirtualDevice.aidl
@@ -64,6 +64,16 @@ interface IVirtualDevice {
String getPersistentDeviceId();
/**
+ * Returns the IDs of all virtual displays of this device.
+ */
+ int[] getDisplayIds();
+
+ /**
+ * Returns the device policy for the given policy type.
+ */
+ int getDevicePolicy(int policyType);
+
+ /**
* Closes the virtual device and frees all associated resources.
*/
@EnforcePermission("CREATE_VIRTUAL_DEVICE")
diff --git a/core/java/android/companion/virtual/IVirtualDeviceListener.aidl b/core/java/android/companion/virtual/IVirtualDeviceListener.aidl
new file mode 100644
index 000000000000..c6dd227fe782
--- /dev/null
+++ b/core/java/android/companion/virtual/IVirtualDeviceListener.aidl
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.companion.virtual;
+
+/**
+ * Interface to listen for changes in the available virtual devices.
+ *
+ * @hide
+ */
+oneway interface IVirtualDeviceListener {
+
+ /**
+ * Called whenever a new virtual device has been added to the system.
+ */
+ void onVirtualDeviceCreated(int deviceId);
+
+ /**
+ * Called whenever a virtual device has been removed from the system.
+ */
+ void onVirtualDeviceClosed(int deviceId);
+}
diff --git a/core/java/android/companion/virtual/IVirtualDeviceManager.aidl b/core/java/android/companion/virtual/IVirtualDeviceManager.aidl
index ed8484fe7266..b665036c202f 100644
--- a/core/java/android/companion/virtual/IVirtualDeviceManager.aidl
+++ b/core/java/android/companion/virtual/IVirtualDeviceManager.aidl
@@ -18,6 +18,7 @@ package android.companion.virtual;
import android.companion.virtual.IVirtualDevice;
import android.companion.virtual.IVirtualDeviceActivityListener;
+import android.companion.virtual.IVirtualDeviceListener;
import android.companion.virtual.IVirtualDeviceSoundEffectListener;
import android.companion.virtual.VirtualDevice;
import android.companion.virtual.VirtualDeviceParams;
@@ -56,12 +57,27 @@ interface IVirtualDeviceManager {
*/
List<VirtualDevice> getVirtualDevices();
- /**
+ /**
+ * Returns the details of the virtual device with the given ID, if any.
+ */
+ VirtualDevice getVirtualDevice(int deviceId);
+
+ /**
+ * Registers a virtual device listener to receive notifications for virtual device events.
+ */
+ void registerVirtualDeviceListener(in IVirtualDeviceListener listener);
+
+ /**
+ * Unregisters a previously registered virtual device listener.
+ */
+ void unregisterVirtualDeviceListener(in IVirtualDeviceListener listener);
+
+ /**
* Returns the ID of the device which owns the display with the given ID.
*/
int getDeviceIdForDisplayId(int displayId);
- /**
+ /**
* Checks whether the passed {@code deviceId} is a valid virtual device ID or not.
* {@link VirtualDeviceManager#DEVICE_ID_DEFAULT} is not valid as it is the ID of the default
* device which is not a virtual device. {@code deviceId} must correspond to a virtual device
diff --git a/core/java/android/companion/virtual/VirtualDevice.java b/core/java/android/companion/virtual/VirtualDevice.java
index ceaf7e4f8317..4692f921beb2 100644
--- a/core/java/android/companion/virtual/VirtualDevice.java
+++ b/core/java/android/companion/virtual/VirtualDevice.java
@@ -16,13 +16,17 @@
package android.companion.virtual;
+import static android.companion.virtual.VirtualDeviceParams.DEVICE_POLICY_CUSTOM;
+import static android.companion.virtual.VirtualDeviceParams.POLICY_TYPE_SENSORS;
+
+import android.annotation.FlaggedApi;
import android.annotation.NonNull;
import android.annotation.Nullable;
+import android.companion.virtual.flags.Flags;
import android.content.Context;
import android.os.Parcel;
import android.os.Parcelable;
-
-import java.util.Objects;
+import android.os.RemoteException;
/**
* Details of a particular virtual device.
@@ -31,9 +35,12 @@ import java.util.Objects;
*
* <p class="note">Not to be confused with {@link VirtualDeviceManager.VirtualDevice}, which is used
* by the virtual device creator and allows them to manage the device.
+ *
+ * @see VirtualDeviceManager#registerVirtualDeviceListener
*/
public final class VirtualDevice implements Parcelable {
+ private final @NonNull IVirtualDevice mVirtualDevice;
private final int mId;
private final @Nullable String mPersistentId;
private final @Nullable String mName;
@@ -44,17 +51,20 @@ public final class VirtualDevice implements Parcelable {
*
* @hide
*/
- public VirtualDevice(int id, @Nullable String persistentId, @Nullable String name) {
+ public VirtualDevice(@NonNull IVirtualDevice virtualDevice, int id,
+ @Nullable String persistentId, @Nullable String name) {
if (id <= Context.DEVICE_ID_DEFAULT) {
throw new IllegalArgumentException("VirtualDevice ID must be greater than "
+ Context.DEVICE_ID_DEFAULT);
}
+ mVirtualDevice = virtualDevice;
mId = id;
mPersistentId = persistentId;
mName = name;
}
private VirtualDevice(@NonNull Parcel parcel) {
+ mVirtualDevice = IVirtualDevice.Stub.asInterface(parcel.readStrongBinder());
mId = parcel.readInt();
mPersistentId = parcel.readString8();
mName = parcel.readString8();
@@ -101,6 +111,40 @@ public final class VirtualDevice implements Parcelable {
return mName;
}
+ /**
+ * Returns the IDs of all virtual displays that belong to this device, if any.
+ *
+ * <p>The actual {@link android.view.Display} objects can be obtained by passing the returned
+ * IDs to {@link android.hardware.display.DisplayManager#getDisplay(int)}.</p>
+ */
+ @FlaggedApi(Flags.FLAG_VDM_PUBLIC_APIS)
+ public @NonNull int[] getDisplayIds() {
+ try {
+ return mVirtualDevice.getDisplayIds();
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
+ }
+
+ /**
+ * Returns whether this device may have custom sensors.
+ *
+ * <p>Returning {@code true} does not necessarily mean that this device has sensors, it only
+ * means that a {@link android.hardware.SensorManager} instance created from a {@link Context}
+ * associated with this device will return this device's sensors, if any.</p>
+ *
+ * @see Context#getDeviceId()
+ * @see Context#createDeviceContext(int)
+ */
+ @FlaggedApi(Flags.FLAG_VDM_PUBLIC_APIS)
+ public boolean hasCustomSensorSupport() {
+ try {
+ return mVirtualDevice.getDevicePolicy(POLICY_TYPE_SENSORS) == DEVICE_POLICY_CUSTOM;
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
+ }
+
@Override
public int describeContents() {
return 0;
@@ -108,31 +152,13 @@ public final class VirtualDevice implements Parcelable {
@Override
public void writeToParcel(@NonNull Parcel dest, int flags) {
+ dest.writeStrongBinder(mVirtualDevice.asBinder());
dest.writeInt(mId);
dest.writeString8(mPersistentId);
dest.writeString8(mName);
}
@Override
- public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
- if (!(o instanceof VirtualDevice)) {
- return false;
- }
- VirtualDevice that = (VirtualDevice) o;
- return mId == that.mId
- && Objects.equals(mPersistentId, that.mPersistentId)
- && Objects.equals(mName, that.mName);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(mId, mPersistentId, mName);
- }
-
- @Override
@NonNull
public String toString() {
return "VirtualDevice("
diff --git a/core/java/android/companion/virtual/VirtualDeviceManager.java b/core/java/android/companion/virtual/VirtualDeviceManager.java
index 923e68951509..29b0ff30f96f 100644
--- a/core/java/android/companion/virtual/VirtualDeviceManager.java
+++ b/core/java/android/companion/virtual/VirtualDeviceManager.java
@@ -55,11 +55,13 @@ import android.hardware.input.VirtualNavigationTouchpadConfig;
import android.hardware.input.VirtualTouchscreen;
import android.hardware.input.VirtualTouchscreenConfig;
import android.media.AudioManager;
+import android.os.Binder;
import android.os.Looper;
import android.os.RemoteException;
import android.util.Log;
import android.view.Surface;
+import com.android.internal.annotations.GuardedBy;
import com.android.internal.util.AnnotationValidations;
import java.lang.annotation.ElementType;
@@ -67,6 +69,7 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.util.ArrayList;
+import java.util.Iterator;
import java.util.List;
import java.util.Objects;
import java.util.concurrent.Executor;
@@ -147,6 +150,9 @@ public final class VirtualDeviceManager {
private final IVirtualDeviceManager mService;
private final Context mContext;
+ @GuardedBy("mVirtualDeviceListeners")
+ private final List<VirtualDeviceListenerDelegate> mVirtualDeviceListeners = new ArrayList<>();
+
/** @hide */
public VirtualDeviceManager(
@Nullable IVirtualDeviceManager service, @NonNull Context context) {
@@ -207,6 +213,88 @@ public final class VirtualDeviceManager {
}
/**
+ * Returns the details of the virtual device with the given ID, if any.
+ *
+ * <p>The returned object is a read-only representation of the virtual device that expose its
+ * properties.</p>
+ */
+ @FlaggedApi(Flags.FLAG_VDM_PUBLIC_APIS)
+ @Nullable
+ public android.companion.virtual.VirtualDevice getVirtualDevice(int deviceId) {
+ if (mService == null) {
+ Log.w(TAG, "Failed to retrieve virtual devices; no virtual device manager service.");
+ return null;
+ }
+ if (deviceId == Context.DEVICE_ID_INVALID || deviceId == Context.DEVICE_ID_DEFAULT) {
+ return null; // Don't even bother making a Binder call.
+ }
+ try {
+ return mService.getVirtualDevice(deviceId);
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
+ }
+
+ /**
+ * Registers a virtual device listener to receive notifications when virtual devices are created
+ * or closed.
+ *
+ * @param executor The executor where the listener is executed on.
+ * @param listener The listener to add.
+ * @see #unregisterVirtualDeviceListener
+ */
+ @FlaggedApi(Flags.FLAG_VDM_PUBLIC_APIS)
+ public void registerVirtualDeviceListener(
+ @NonNull @CallbackExecutor Executor executor,
+ @NonNull VirtualDeviceListener listener) {
+ if (mService == null) {
+ Log.w(TAG, "Failed to register listener; no virtual device manager service.");
+ return;
+ }
+ final VirtualDeviceListenerDelegate delegate =
+ new VirtualDeviceListenerDelegate(Objects.requireNonNull(executor),
+ Objects.requireNonNull(listener));
+ synchronized (mVirtualDeviceListeners) {
+ try {
+ mService.registerVirtualDeviceListener(delegate);
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
+ mVirtualDeviceListeners.add(delegate);
+ }
+ }
+
+ /**
+ * Unregisters a virtual device listener previously registered with
+ * {@link #registerVirtualDeviceListener}.
+ *
+ * @param listener The listener to unregister.
+ * @see #registerVirtualDeviceListener
+ */
+ @FlaggedApi(Flags.FLAG_VDM_PUBLIC_APIS)
+ public void unregisterVirtualDeviceListener(@NonNull VirtualDeviceListener listener) {
+ if (mService == null) {
+ Log.w(TAG, "Failed to unregister listener; no virtual device manager service.");
+ return;
+ }
+ Objects.requireNonNull(listener);
+ synchronized (mVirtualDeviceListeners) {
+ final Iterator<VirtualDeviceListenerDelegate> it = mVirtualDeviceListeners.iterator();
+ while (it.hasNext()) {
+ final VirtualDeviceListenerDelegate delegate = it.next();
+ if (delegate.mListener == listener) {
+ try {
+ mService.unregisterVirtualDeviceListener(delegate);
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
+ it.remove();
+ }
+ }
+ }
+ }
+
+ /**
* Returns the device policy for the given virtual device and policy type.
*
* <p>In case the virtual device identifier is not valid, or there's no explicitly specified
@@ -748,7 +836,7 @@ public final class VirtualDeviceManager {
*
* @param executor The executor where the listener is executed on.
* @param soundEffectListener The listener to add.
- * @see #removeActivityListener(ActivityListener)
+ * @see #removeSoundEffectListener(SoundEffectListener)
*/
public void addSoundEffectListener(@CallbackExecutor @NonNull Executor executor,
@NonNull SoundEffectListener soundEffectListener) {
@@ -877,4 +965,59 @@ public final class VirtualDeviceManager {
*/
void onPlaySoundEffect(@AudioManager.SystemSoundEffect int effectType);
}
+
+ /**
+ * Listener for changes in the available virtual devices.
+ */
+ @FlaggedApi(Flags.FLAG_VDM_PUBLIC_APIS)
+ public interface VirtualDeviceListener {
+ /**
+ * Called whenever a new virtual device has been added to the system.
+ * Use {@link VirtualDeviceManager#getVirtualDevice(int)} to get more information about
+ * the device.
+ *
+ * @param deviceId The id of the virtual device that was added.
+ */
+ default void onVirtualDeviceCreated(int deviceId) {}
+
+ /**
+ * Called whenever a virtual device has been removed from the system.
+ *
+ * @param deviceId The id of the virtual device that was removed.
+ */
+ default void onVirtualDeviceClosed(int deviceId) {}
+ }
+
+ /**
+ * A wrapper for {@link VirtualDeviceListener} that executes callbacks on the given executor.
+ */
+ private static class VirtualDeviceListenerDelegate extends IVirtualDeviceListener.Stub {
+ private final VirtualDeviceListener mListener;
+ private final Executor mExecutor;
+
+ private VirtualDeviceListenerDelegate(Executor executor, VirtualDeviceListener listener) {
+ mExecutor = executor;
+ mListener = listener;
+ }
+
+ @Override
+ public void onVirtualDeviceCreated(int deviceId) {
+ final long token = Binder.clearCallingIdentity();
+ try {
+ mExecutor.execute(() -> mListener.onVirtualDeviceCreated(deviceId));
+ } finally {
+ Binder.restoreCallingIdentity(token);
+ }
+ }
+
+ @Override
+ public void onVirtualDeviceClosed(int deviceId) {
+ final long token = Binder.clearCallingIdentity();
+ try {
+ mExecutor.execute(() -> mListener.onVirtualDeviceClosed(deviceId));
+ } finally {
+ Binder.restoreCallingIdentity(token);
+ }
+ }
+ }
}
diff --git a/core/java/android/companion/virtual/VirtualDeviceParams.java b/core/java/android/companion/virtual/VirtualDeviceParams.java
index 037e814a722d..51df25723ef6 100644
--- a/core/java/android/companion/virtual/VirtualDeviceParams.java
+++ b/core/java/android/companion/virtual/VirtualDeviceParams.java
@@ -202,14 +202,12 @@ public final class VirtualDeviceParams implements Parcelable {
private final int mLockState;
@NonNull private final ArraySet<UserHandle> mUsersWithMatchingAccounts;
- @NonNull private final ArraySet<ComponentName> mAllowedCrossTaskNavigations;
- @NonNull private final ArraySet<ComponentName> mBlockedCrossTaskNavigations;
@NavigationPolicy
private final int mDefaultNavigationPolicy;
- @NonNull private final ArraySet<ComponentName> mAllowedActivities;
- @NonNull private final ArraySet<ComponentName> mBlockedActivities;
+ @NonNull private final ArraySet<ComponentName> mCrossTaskNavigationExceptions;
@ActivityPolicy
private final int mDefaultActivityPolicy;
+ @NonNull private final ArraySet<ComponentName> mActivityPolicyExceptions;
@Nullable private final String mName;
// Mapping of @PolicyType to @DevicePolicy
@NonNull private final SparseIntArray mDevicePolicies;
@@ -221,12 +219,10 @@ public final class VirtualDeviceParams implements Parcelable {
private VirtualDeviceParams(
@LockState int lockState,
@NonNull Set<UserHandle> usersWithMatchingAccounts,
- @NonNull Set<ComponentName> allowedCrossTaskNavigations,
- @NonNull Set<ComponentName> blockedCrossTaskNavigations,
@NavigationPolicy int defaultNavigationPolicy,
- @NonNull Set<ComponentName> allowedActivities,
- @NonNull Set<ComponentName> blockedActivities,
+ @NonNull Set<ComponentName> crossTaskNavigationExceptions,
@ActivityPolicy int defaultActivityPolicy,
+ @NonNull Set<ComponentName> activityPolicyExceptions,
@Nullable String name,
@NonNull SparseIntArray devicePolicies,
@NonNull List<VirtualSensorConfig> virtualSensorConfigs,
@@ -236,14 +232,12 @@ public final class VirtualDeviceParams implements Parcelable {
mLockState = lockState;
mUsersWithMatchingAccounts =
new ArraySet<>(Objects.requireNonNull(usersWithMatchingAccounts));
- mAllowedCrossTaskNavigations =
- new ArraySet<>(Objects.requireNonNull(allowedCrossTaskNavigations));
- mBlockedCrossTaskNavigations =
- new ArraySet<>(Objects.requireNonNull(blockedCrossTaskNavigations));
mDefaultNavigationPolicy = defaultNavigationPolicy;
- mAllowedActivities = new ArraySet<>(Objects.requireNonNull(allowedActivities));
- mBlockedActivities = new ArraySet<>(Objects.requireNonNull(blockedActivities));
+ mCrossTaskNavigationExceptions =
+ new ArraySet<>(Objects.requireNonNull(crossTaskNavigationExceptions));
mDefaultActivityPolicy = defaultActivityPolicy;
+ mActivityPolicyExceptions =
+ new ArraySet<>(Objects.requireNonNull(activityPolicyExceptions));
mName = name;
mDevicePolicies = Objects.requireNonNull(devicePolicies);
mVirtualSensorConfigs = Objects.requireNonNull(virtualSensorConfigs);
@@ -256,12 +250,10 @@ public final class VirtualDeviceParams implements Parcelable {
private VirtualDeviceParams(Parcel parcel) {
mLockState = parcel.readInt();
mUsersWithMatchingAccounts = (ArraySet<UserHandle>) parcel.readArraySet(null);
- mAllowedCrossTaskNavigations = (ArraySet<ComponentName>) parcel.readArraySet(null);
- mBlockedCrossTaskNavigations = (ArraySet<ComponentName>) parcel.readArraySet(null);
mDefaultNavigationPolicy = parcel.readInt();
- mAllowedActivities = (ArraySet<ComponentName>) parcel.readArraySet(null);
- mBlockedActivities = (ArraySet<ComponentName>) parcel.readArraySet(null);
+ mCrossTaskNavigationExceptions = (ArraySet<ComponentName>) parcel.readArraySet(null);
mDefaultActivityPolicy = parcel.readInt();
+ mActivityPolicyExceptions = (ArraySet<ComponentName>) parcel.readArraySet(null);
mName = parcel.readString8();
mDevicePolicies = parcel.readSparseIntArray();
mVirtualSensorConfigs = new ArrayList<>();
@@ -301,7 +293,9 @@ public final class VirtualDeviceParams implements Parcelable {
*/
@NonNull
public Set<ComponentName> getAllowedCrossTaskNavigations() {
- return Collections.unmodifiableSet(mAllowedCrossTaskNavigations);
+ return mDefaultNavigationPolicy == NAVIGATION_POLICY_DEFAULT_ALLOWED
+ ? Collections.emptySet()
+ : Collections.unmodifiableSet(mCrossTaskNavigationExceptions);
}
/**
@@ -314,7 +308,9 @@ public final class VirtualDeviceParams implements Parcelable {
*/
@NonNull
public Set<ComponentName> getBlockedCrossTaskNavigations() {
- return Collections.unmodifiableSet(mBlockedCrossTaskNavigations);
+ return mDefaultNavigationPolicy == NAVIGATION_POLICY_DEFAULT_BLOCKED
+ ? Collections.emptySet()
+ : Collections.unmodifiableSet(mCrossTaskNavigationExceptions);
}
/**
@@ -338,7 +334,9 @@ public final class VirtualDeviceParams implements Parcelable {
*/
@NonNull
public Set<ComponentName> getAllowedActivities() {
- return Collections.unmodifiableSet(mAllowedActivities);
+ return mDefaultActivityPolicy == ACTIVITY_POLICY_DEFAULT_ALLOWED
+ ? Collections.emptySet()
+ : Collections.unmodifiableSet(mActivityPolicyExceptions);
}
/**
@@ -349,7 +347,9 @@ public final class VirtualDeviceParams implements Parcelable {
*/
@NonNull
public Set<ComponentName> getBlockedActivities() {
- return Collections.unmodifiableSet(mBlockedActivities);
+ return mDefaultActivityPolicy == ACTIVITY_POLICY_DEFAULT_BLOCKED
+ ? Collections.emptySet()
+ : Collections.unmodifiableSet(mActivityPolicyExceptions);
}
/**
@@ -439,12 +439,10 @@ public final class VirtualDeviceParams implements Parcelable {
public void writeToParcel(@NonNull Parcel dest, int flags) {
dest.writeInt(mLockState);
dest.writeArraySet(mUsersWithMatchingAccounts);
- dest.writeArraySet(mAllowedCrossTaskNavigations);
- dest.writeArraySet(mBlockedCrossTaskNavigations);
dest.writeInt(mDefaultNavigationPolicy);
- dest.writeArraySet(mAllowedActivities);
- dest.writeArraySet(mBlockedActivities);
+ dest.writeArraySet(mCrossTaskNavigationExceptions);
dest.writeInt(mDefaultActivityPolicy);
+ dest.writeArraySet(mActivityPolicyExceptions);
dest.writeString8(mName);
dest.writeSparseIntArray(mDevicePolicies);
dest.writeTypedList(mVirtualSensorConfigs);
@@ -477,11 +475,10 @@ public final class VirtualDeviceParams implements Parcelable {
}
return mLockState == that.mLockState
&& mUsersWithMatchingAccounts.equals(that.mUsersWithMatchingAccounts)
- && Objects.equals(mAllowedCrossTaskNavigations, that.mAllowedCrossTaskNavigations)
- && Objects.equals(mBlockedCrossTaskNavigations, that.mBlockedCrossTaskNavigations)
+ && Objects.equals(
+ mCrossTaskNavigationExceptions, that.mCrossTaskNavigationExceptions)
&& mDefaultNavigationPolicy == that.mDefaultNavigationPolicy
- && Objects.equals(mAllowedActivities, that.mAllowedActivities)
- && Objects.equals(mBlockedActivities, that.mBlockedActivities)
+ && Objects.equals(mActivityPolicyExceptions, that.mActivityPolicyExceptions)
&& mDefaultActivityPolicy == that.mDefaultActivityPolicy
&& Objects.equals(mName, that.mName)
&& mAudioPlaybackSessionId == that.mAudioPlaybackSessionId
@@ -491,10 +488,9 @@ public final class VirtualDeviceParams implements Parcelable {
@Override
public int hashCode() {
int hashCode = Objects.hash(
- mLockState, mUsersWithMatchingAccounts, mAllowedCrossTaskNavigations,
- mBlockedCrossTaskNavigations, mDefaultNavigationPolicy, mAllowedActivities,
- mBlockedActivities, mDefaultActivityPolicy, mName, mDevicePolicies,
- mAudioPlaybackSessionId, mAudioRecordingSessionId);
+ mLockState, mUsersWithMatchingAccounts, mCrossTaskNavigationExceptions,
+ mDefaultNavigationPolicy, mActivityPolicyExceptions, mDefaultActivityPolicy, mName,
+ mDevicePolicies, mAudioPlaybackSessionId, mAudioRecordingSessionId);
for (int i = 0; i < mDevicePolicies.size(); i++) {
hashCode = 31 * hashCode + mDevicePolicies.keyAt(i);
hashCode = 31 * hashCode + mDevicePolicies.valueAt(i);
@@ -508,12 +504,10 @@ public final class VirtualDeviceParams implements Parcelable {
return "VirtualDeviceParams("
+ " mLockState=" + mLockState
+ " mUsersWithMatchingAccounts=" + mUsersWithMatchingAccounts
- + " mAllowedCrossTaskNavigations=" + mAllowedCrossTaskNavigations
- + " mBlockedCrossTaskNavigations=" + mBlockedCrossTaskNavigations
+ " mDefaultNavigationPolicy=" + mDefaultNavigationPolicy
- + " mAllowedActivities=" + mAllowedActivities
- + " mBlockedActivities=" + mBlockedActivities
+ + " mCrossTaskNavigationExceptions=" + mCrossTaskNavigationExceptions
+ " mDefaultActivityPolicy=" + mDefaultActivityPolicy
+ + " mActivityPolicyExceptions=" + mActivityPolicyExceptions
+ " mName=" + mName
+ " mDevicePolicies=" + mDevicePolicies
+ " mAudioPlaybackSessionId=" + mAudioPlaybackSessionId
@@ -529,13 +523,11 @@ public final class VirtualDeviceParams implements Parcelable {
pw.println(prefix + "mName=" + mName);
pw.println(prefix + "mLockState=" + mLockState);
pw.println(prefix + "mUsersWithMatchingAccounts=" + mUsersWithMatchingAccounts);
- pw.println(prefix + "mAllowedCrossTaskNavigations=" + mAllowedCrossTaskNavigations);
- pw.println(prefix + "mBlockedCrossTaskNavigations=" + mBlockedCrossTaskNavigations);
- pw.println(prefix + "mAllowedActivities=" + mAllowedActivities);
- pw.println(prefix + "mBlockedActivities=" + mBlockedActivities);
- pw.println(prefix + "mDevicePolicies=" + mDevicePolicies);
pw.println(prefix + "mDefaultNavigationPolicy=" + mDefaultNavigationPolicy);
+ pw.println(prefix + "mCrossTaskNavigationExceptions=" + mCrossTaskNavigationExceptions);
pw.println(prefix + "mDefaultActivityPolicy=" + mDefaultActivityPolicy);
+ pw.println(prefix + "mActivityPolicyExceptions=" + mActivityPolicyExceptions);
+ pw.println(prefix + "mDevicePolicies=" + mDevicePolicies);
pw.println(prefix + "mVirtualSensorConfigs=" + mVirtualSensorConfigs);
pw.println(prefix + "mAudioPlaybackSessionId=" + mAudioPlaybackSessionId);
pw.println(prefix + "mAudioRecordingSessionId=" + mAudioRecordingSessionId);
@@ -560,13 +552,11 @@ public final class VirtualDeviceParams implements Parcelable {
private @LockState int mLockState = LOCK_STATE_DEFAULT;
@NonNull private Set<UserHandle> mUsersWithMatchingAccounts = Collections.emptySet();
- @NonNull private Set<ComponentName> mAllowedCrossTaskNavigations = Collections.emptySet();
- @NonNull private Set<ComponentName> mBlockedCrossTaskNavigations = Collections.emptySet();
+ @NonNull private Set<ComponentName> mCrossTaskNavigationExceptions = Collections.emptySet();
@NavigationPolicy
private int mDefaultNavigationPolicy = NAVIGATION_POLICY_DEFAULT_ALLOWED;
private boolean mDefaultNavigationPolicyConfigured = false;
- @NonNull private Set<ComponentName> mBlockedActivities = Collections.emptySet();
- @NonNull private Set<ComponentName> mAllowedActivities = Collections.emptySet();
+ @NonNull private Set<ComponentName> mActivityPolicyExceptions = Collections.emptySet();
@ActivityPolicy
private int mDefaultActivityPolicy = ACTIVITY_POLICY_DEFAULT_ALLOWED;
private boolean mDefaultActivityPolicyConfigured = false;
@@ -705,12 +695,12 @@ public final class VirtualDeviceParams implements Parcelable {
if (mDefaultNavigationPolicyConfigured
&& mDefaultNavigationPolicy != NAVIGATION_POLICY_DEFAULT_BLOCKED) {
throw new IllegalArgumentException(
- "Allowed cross task navigation and blocked task navigation cannot "
+ "Allowed cross task navigations and blocked cross task navigations cannot "
+ " both be set.");
}
mDefaultNavigationPolicy = NAVIGATION_POLICY_DEFAULT_BLOCKED;
mDefaultNavigationPolicyConfigured = true;
- mAllowedCrossTaskNavigations = Objects.requireNonNull(allowedCrossTaskNavigations);
+ mCrossTaskNavigationExceptions = Objects.requireNonNull(allowedCrossTaskNavigations);
return this;
}
@@ -741,7 +731,7 @@ public final class VirtualDeviceParams implements Parcelable {
}
mDefaultNavigationPolicy = NAVIGATION_POLICY_DEFAULT_ALLOWED;
mDefaultNavigationPolicyConfigured = true;
- mBlockedCrossTaskNavigations = Objects.requireNonNull(blockedCrossTaskNavigations);
+ mCrossTaskNavigationExceptions = Objects.requireNonNull(blockedCrossTaskNavigations);
return this;
}
@@ -767,7 +757,7 @@ public final class VirtualDeviceParams implements Parcelable {
}
mDefaultActivityPolicy = ACTIVITY_POLICY_DEFAULT_BLOCKED;
mDefaultActivityPolicyConfigured = true;
- mAllowedActivities = Objects.requireNonNull(allowedActivities);
+ mActivityPolicyExceptions = Objects.requireNonNull(allowedActivities);
return this;
}
@@ -793,7 +783,7 @@ public final class VirtualDeviceParams implements Parcelable {
}
mDefaultActivityPolicy = ACTIVITY_POLICY_DEFAULT_ALLOWED;
mDefaultActivityPolicyConfigured = true;
- mBlockedActivities = Objects.requireNonNull(blockedActivities);
+ mActivityPolicyExceptions = Objects.requireNonNull(blockedActivities);
return this;
}
@@ -988,12 +978,10 @@ public final class VirtualDeviceParams implements Parcelable {
return new VirtualDeviceParams(
mLockState,
mUsersWithMatchingAccounts,
- mAllowedCrossTaskNavigations,
- mBlockedCrossTaskNavigations,
mDefaultNavigationPolicy,
- mAllowedActivities,
- mBlockedActivities,
+ mCrossTaskNavigationExceptions,
mDefaultActivityPolicy,
+ mActivityPolicyExceptions,
mName,
mDevicePolicies,
mVirtualSensorConfigs,
diff --git a/core/java/android/companion/virtual/flags.aconfig b/core/java/android/companion/virtual/flags.aconfig
index 057b8565a8bb..9ab3be6863d0 100644
--- a/core/java/android/companion/virtual/flags.aconfig
+++ b/core/java/android/companion/virtual/flags.aconfig
@@ -13,3 +13,10 @@ flag {
description: "Enable dynamic policy API"
bug: "298401780"
}
+
+flag {
+ name: "vdm_public_apis"
+ namespace: "virtual_devices"
+ description: "Enable public VDM API for device capabilities"
+ bug: "297253526"
+}
diff --git a/core/java/android/content/pm/ArchivedPackageParcel.aidl b/core/java/android/content/pm/ArchivedPackageParcel.aidl
index b34b708aa2c5..6aeee895301a 100644
--- a/core/java/android/content/pm/ArchivedPackageParcel.aidl
+++ b/core/java/android/content/pm/ArchivedPackageParcel.aidl
@@ -29,7 +29,6 @@ parcelable ArchivedPackageParcel {
int versionCode;
int versionCodeMajor;
int targetSdkVersion;
- boolean clearUserDataAllowed;
boolean backupAllowed;
boolean defaultToDeviceProtectedStorage;
boolean requestLegacyExternalStorage;
diff --git a/core/java/android/content/pm/parsing/ApkLite.java b/core/java/android/content/pm/parsing/ApkLite.java
index 71cfd1b1e1cb..8e7592a1eb73 100644
--- a/core/java/android/content/pm/parsing/ApkLite.java
+++ b/core/java/android/content/pm/parsing/ApkLite.java
@@ -140,11 +140,6 @@ public class ApkLite {
private final boolean mIsSdkLibrary;
/**
- * Indicates whether this application's data will be cleared on a failed restore.
- */
- private final boolean mClearUserDataAllowed;
-
- /**
* Set to <code>false</code> if the application does not wish to permit any OS-driven
* backups of its data; <code>true</code> otherwise.
*/
@@ -219,7 +214,6 @@ public class ApkLite {
mRollbackDataPolicy = rollbackDataPolicy;
mHasDeviceAdminReceiver = hasDeviceAdminReceiver;
mIsSdkLibrary = isSdkLibrary;
- mClearUserDataAllowed = clearUserDataAllowed;
mBackupAllowed = backupAllowed;
mDefaultToDeviceProtectedStorage = defaultToDeviceProtectedStorage;
mRequestLegacyExternalStorage = requestLegacyExternalStorage;
@@ -261,7 +255,6 @@ public class ApkLite {
mRollbackDataPolicy = 0;
mHasDeviceAdminReceiver = false;
mIsSdkLibrary = false;
- mClearUserDataAllowed = archivedPackage.clearUserDataAllowed;
mBackupAllowed = archivedPackage.backupAllowed;
mDefaultToDeviceProtectedStorage = archivedPackage.defaultToDeviceProtectedStorage;
mRequestLegacyExternalStorage = archivedPackage.requestLegacyExternalStorage;
@@ -576,14 +569,6 @@ public class ApkLite {
}
/**
- * Indicates whether this application's data will be cleared on a failed restore.
- */
- @DataClass.Generated.Member
- public boolean isClearUserDataAllowed() {
- return mClearUserDataAllowed;
- }
-
- /**
* Set to <code>false</code> if the application does not wish to permit any OS-driven
* backups of its data; <code>true</code> otherwise.
*/
@@ -627,10 +612,10 @@ public class ApkLite {
}
@DataClass.Generated(
- time = 1693422809896L,
+ time = 1693513509013L,
codegenVersion = "1.0.23",
sourceFile = "frameworks/base/core/java/android/content/pm/parsing/ApkLite.java",
- inputSignatures = "private final @android.annotation.NonNull java.lang.String mPackageName\nprivate final @android.annotation.NonNull java.lang.String mPath\nprivate final @android.annotation.Nullable java.lang.String mSplitName\nprivate final @android.annotation.Nullable java.lang.String mUsesSplitName\nprivate final @android.annotation.Nullable java.lang.String mConfigForSplit\nprivate final @android.annotation.Nullable java.util.Set<java.lang.String> mRequiredSplitTypes\nprivate final @android.annotation.Nullable java.util.Set<java.lang.String> mSplitTypes\nprivate final int mVersionCodeMajor\nprivate final int mVersionCode\nprivate final int mRevisionCode\nprivate final int mInstallLocation\nprivate final int mMinSdkVersion\nprivate final int mTargetSdkVersion\nprivate final @android.annotation.NonNull android.content.pm.VerifierInfo[] mVerifiers\nprivate final @android.annotation.NonNull android.content.pm.SigningDetails mSigningDetails\nprivate final boolean mFeatureSplit\nprivate final boolean mIsolatedSplits\nprivate final boolean mSplitRequired\nprivate final boolean mCoreApp\nprivate final boolean mDebuggable\nprivate final boolean mProfileableByShell\nprivate final boolean mMultiArch\nprivate final boolean mUse32bitAbi\nprivate final boolean mExtractNativeLibs\nprivate final boolean mUseEmbeddedDex\nprivate final @android.annotation.Nullable java.lang.String mTargetPackageName\nprivate final boolean mOverlayIsStatic\nprivate final int mOverlayPriority\nprivate final @android.annotation.Nullable java.lang.String mRequiredSystemPropertyName\nprivate final @android.annotation.Nullable java.lang.String mRequiredSystemPropertyValue\nprivate final int mRollbackDataPolicy\nprivate final boolean mHasDeviceAdminReceiver\nprivate final boolean mIsSdkLibrary\nprivate final boolean mClearUserDataAllowed\nprivate final boolean mBackupAllowed\nprivate final boolean mDefaultToDeviceProtectedStorage\nprivate final boolean mRequestLegacyExternalStorage\nprivate final boolean mUserDataFragile\nprivate final boolean mClearUserDataOnFailedRestoreAllowed\npublic long getLongVersionCode()\nprivate boolean hasAnyRequiredSplitTypes()\nclass ApkLite extends java.lang.Object implements []\n@com.android.internal.util.DataClass(genConstructor=false, genConstDefs=false)")
+ inputSignatures = "private final @android.annotation.NonNull java.lang.String mPackageName\nprivate final @android.annotation.NonNull java.lang.String mPath\nprivate final @android.annotation.Nullable java.lang.String mSplitName\nprivate final @android.annotation.Nullable java.lang.String mUsesSplitName\nprivate final @android.annotation.Nullable java.lang.String mConfigForSplit\nprivate final @android.annotation.Nullable java.util.Set<java.lang.String> mRequiredSplitTypes\nprivate final @android.annotation.Nullable java.util.Set<java.lang.String> mSplitTypes\nprivate final int mVersionCodeMajor\nprivate final int mVersionCode\nprivate final int mRevisionCode\nprivate final int mInstallLocation\nprivate final int mMinSdkVersion\nprivate final int mTargetSdkVersion\nprivate final @android.annotation.NonNull android.content.pm.VerifierInfo[] mVerifiers\nprivate final @android.annotation.NonNull android.content.pm.SigningDetails mSigningDetails\nprivate final boolean mFeatureSplit\nprivate final boolean mIsolatedSplits\nprivate final boolean mSplitRequired\nprivate final boolean mCoreApp\nprivate final boolean mDebuggable\nprivate final boolean mProfileableByShell\nprivate final boolean mMultiArch\nprivate final boolean mUse32bitAbi\nprivate final boolean mExtractNativeLibs\nprivate final boolean mUseEmbeddedDex\nprivate final @android.annotation.Nullable java.lang.String mTargetPackageName\nprivate final boolean mOverlayIsStatic\nprivate final int mOverlayPriority\nprivate final @android.annotation.Nullable java.lang.String mRequiredSystemPropertyName\nprivate final @android.annotation.Nullable java.lang.String mRequiredSystemPropertyValue\nprivate final int mRollbackDataPolicy\nprivate final boolean mHasDeviceAdminReceiver\nprivate final boolean mIsSdkLibrary\nprivate final boolean mBackupAllowed\nprivate final boolean mDefaultToDeviceProtectedStorage\nprivate final boolean mRequestLegacyExternalStorage\nprivate final boolean mUserDataFragile\nprivate final boolean mClearUserDataOnFailedRestoreAllowed\npublic long getLongVersionCode()\nprivate boolean hasAnyRequiredSplitTypes()\nclass ApkLite extends java.lang.Object implements []\n@com.android.internal.util.DataClass(genConstructor=false, genConstDefs=false)")
@Deprecated
private void __metadata() {}
diff --git a/core/java/android/content/pm/parsing/PackageLite.java b/core/java/android/content/pm/parsing/PackageLite.java
index 4638af752d33..ccef9def609e 100644
--- a/core/java/android/content/pm/parsing/PackageLite.java
+++ b/core/java/android/content/pm/parsing/PackageLite.java
@@ -113,10 +113,6 @@ public class PackageLite {
*/
private final boolean mIsSdkLibrary;
/**
- * Indicates whether this application's data will be cleared on a failed restore.
- */
- private final boolean mClearUserDataAllowed;
- /**
* Set to <code>false</code> if the application does not wish to permit any OS-driven
* backups of its data; <code>true</code> otherwise.
*/
@@ -175,7 +171,6 @@ public class PackageLite {
mSplitApkPaths = splitApkPaths;
mSplitRevisionCodes = splitRevisionCodes;
mTargetSdk = targetSdk;
- mClearUserDataAllowed = baseApk.isClearUserDataAllowed();
mBackupAllowed = baseApk.isBackupAllowed();
mDefaultToDeviceProtectedStorage = baseApk.isDefaultToDeviceProtectedStorage();
mRequestLegacyExternalStorage = baseApk.isRequestLegacyExternalStorage();
@@ -460,14 +455,6 @@ public class PackageLite {
}
/**
- * Indicates whether this application's data will be cleared on a failed restore.
- */
- @DataClass.Generated.Member
- public boolean isClearUserDataAllowed() {
- return mClearUserDataAllowed;
- }
-
- /**
* Set to <code>false</code> if the application does not wish to permit any OS-driven
* backups of its data; <code>true</code> otherwise.
*/
@@ -511,10 +498,10 @@ public class PackageLite {
}
@DataClass.Generated(
- time = 1693423910860L,
+ time = 1693513525097L,
codegenVersion = "1.0.23",
sourceFile = "frameworks/base/core/java/android/content/pm/parsing/PackageLite.java",
- inputSignatures = "private final @android.annotation.NonNull java.lang.String mPackageName\nprivate final @android.annotation.NonNull java.lang.String mPath\nprivate final @android.annotation.NonNull java.lang.String mBaseApkPath\nprivate final @android.annotation.Nullable java.lang.String[] mSplitApkPaths\nprivate final @android.annotation.Nullable java.lang.String[] mSplitNames\nprivate final @android.annotation.Nullable java.lang.String[] mUsesSplitNames\nprivate final @android.annotation.Nullable java.lang.String[] mConfigForSplit\nprivate final @android.annotation.Nullable java.util.Set<java.lang.String> mBaseRequiredSplitTypes\nprivate final @android.annotation.Nullable java.util.Set<java.lang.String>[] mRequiredSplitTypes\nprivate final @android.annotation.Nullable java.util.Set<java.lang.String>[] mSplitTypes\nprivate final int mVersionCodeMajor\nprivate final int mVersionCode\nprivate final int mTargetSdk\nprivate final int mBaseRevisionCode\nprivate final @android.annotation.Nullable int[] mSplitRevisionCodes\nprivate final int mInstallLocation\nprivate final @android.annotation.NonNull android.content.pm.VerifierInfo[] mVerifiers\nprivate final @android.annotation.NonNull android.content.pm.SigningDetails mSigningDetails\nprivate final @android.annotation.Nullable boolean[] mIsFeatureSplits\nprivate final boolean mIsolatedSplits\nprivate final boolean mSplitRequired\nprivate final boolean mCoreApp\nprivate final boolean mDebuggable\nprivate final boolean mMultiArch\nprivate final boolean mUse32bitAbi\nprivate final boolean mExtractNativeLibs\nprivate final boolean mProfileableByShell\nprivate final boolean mUseEmbeddedDex\nprivate final boolean mIsSdkLibrary\nprivate final boolean mClearUserDataAllowed\nprivate final boolean mBackupAllowed\nprivate final boolean mDefaultToDeviceProtectedStorage\nprivate final boolean mRequestLegacyExternalStorage\nprivate final boolean mUserDataFragile\nprivate final boolean mClearUserDataOnFailedRestoreAllowed\npublic java.util.List<java.lang.String> getAllApkPaths()\npublic long getLongVersionCode()\nprivate boolean hasAnyRequiredSplitTypes()\nclass PackageLite extends java.lang.Object implements []\n@com.android.internal.util.DataClass(genConstructor=false, genConstDefs=false)")
+ inputSignatures = "private final @android.annotation.NonNull java.lang.String mPackageName\nprivate final @android.annotation.NonNull java.lang.String mPath\nprivate final @android.annotation.NonNull java.lang.String mBaseApkPath\nprivate final @android.annotation.Nullable java.lang.String[] mSplitApkPaths\nprivate final @android.annotation.Nullable java.lang.String[] mSplitNames\nprivate final @android.annotation.Nullable java.lang.String[] mUsesSplitNames\nprivate final @android.annotation.Nullable java.lang.String[] mConfigForSplit\nprivate final @android.annotation.Nullable java.util.Set<java.lang.String> mBaseRequiredSplitTypes\nprivate final @android.annotation.Nullable java.util.Set<java.lang.String>[] mRequiredSplitTypes\nprivate final @android.annotation.Nullable java.util.Set<java.lang.String>[] mSplitTypes\nprivate final int mVersionCodeMajor\nprivate final int mVersionCode\nprivate final int mTargetSdk\nprivate final int mBaseRevisionCode\nprivate final @android.annotation.Nullable int[] mSplitRevisionCodes\nprivate final int mInstallLocation\nprivate final @android.annotation.NonNull android.content.pm.VerifierInfo[] mVerifiers\nprivate final @android.annotation.NonNull android.content.pm.SigningDetails mSigningDetails\nprivate final @android.annotation.Nullable boolean[] mIsFeatureSplits\nprivate final boolean mIsolatedSplits\nprivate final boolean mSplitRequired\nprivate final boolean mCoreApp\nprivate final boolean mDebuggable\nprivate final boolean mMultiArch\nprivate final boolean mUse32bitAbi\nprivate final boolean mExtractNativeLibs\nprivate final boolean mProfileableByShell\nprivate final boolean mUseEmbeddedDex\nprivate final boolean mIsSdkLibrary\nprivate final boolean mBackupAllowed\nprivate final boolean mDefaultToDeviceProtectedStorage\nprivate final boolean mRequestLegacyExternalStorage\nprivate final boolean mUserDataFragile\nprivate final boolean mClearUserDataOnFailedRestoreAllowed\npublic java.util.List<java.lang.String> getAllApkPaths()\npublic long getLongVersionCode()\nprivate boolean hasAnyRequiredSplitTypes()\nclass PackageLite extends java.lang.Object implements []\n@com.android.internal.util.DataClass(genConstructor=false, genConstDefs=false)")
@Deprecated
private void __metadata() {}
diff --git a/core/java/android/hardware/SystemSensorManager.java b/core/java/android/hardware/SystemSensorManager.java
index 0f6f6019c0f7..dfd380233662 100644
--- a/core/java/android/hardware/SystemSensorManager.java
+++ b/core/java/android/hardware/SystemSensorManager.java
@@ -129,6 +129,7 @@ public class SystemSensorManager extends SensorManager {
mDynamicSensorCallbacks = new HashMap<>();
private BroadcastReceiver mDynamicSensorBroadcastReceiver;
private BroadcastReceiver mRuntimeSensorBroadcastReceiver;
+ private VirtualDeviceManager.VirtualDeviceListener mVirtualDeviceListener;
// Looper associated with the context in which this instance was created.
private final Looper mMainLooper;
@@ -518,7 +519,11 @@ public class SystemSensorManager extends SensorManager {
}
private List<Sensor> createRuntimeSensorListLocked(int deviceId) {
- setupRuntimeSensorBroadcastReceiver();
+ if (android.companion.virtual.flags.Flags.vdmPublicApis()) {
+ setupVirtualDeviceListener();
+ } else {
+ setupRuntimeSensorBroadcastReceiver();
+ }
List<Sensor> list = new ArrayList<>();
nativeGetRuntimeSensors(mNativeInstance, deviceId, list);
mFullRuntimeSensorListByDevice.put(deviceId, list);
@@ -558,6 +563,34 @@ public class SystemSensorManager extends SensorManager {
}
}
+ private void setupVirtualDeviceListener() {
+ if (mVirtualDeviceListener != null) {
+ return;
+ }
+ if (mVdm == null) {
+ mVdm = mContext.getSystemService(VirtualDeviceManager.class);
+ if (mVdm == null) {
+ return;
+ }
+ }
+ mVirtualDeviceListener = new VirtualDeviceManager.VirtualDeviceListener() {
+ @Override
+ public void onVirtualDeviceClosed(int deviceId) {
+ synchronized (mFullRuntimeSensorListByDevice) {
+ List<Sensor> removedSensors =
+ mFullRuntimeSensorListByDevice.removeReturnOld(deviceId);
+ if (removedSensors != null) {
+ for (Sensor s : removedSensors) {
+ cleanupSensorConnection(s);
+ }
+ }
+ mRuntimeSensorListByDeviceByType.remove(deviceId);
+ }
+ }
+ };
+ mVdm.registerVirtualDeviceListener(mContext.getMainExecutor(), mVirtualDeviceListener);
+ }
+
private void setupDynamicSensorBroadcastReceiver() {
if (mDynamicSensorBroadcastReceiver == null) {
mDynamicSensorBroadcastReceiver = new BroadcastReceiver() {
@@ -581,12 +614,6 @@ public class SystemSensorManager extends SensorManager {
}
}
- private void teardownDynamicSensorBroadcastReceiver() {
- mDynamicSensorCallbacks.clear();
- mContext.unregisterReceiver(mDynamicSensorBroadcastReceiver);
- mDynamicSensorBroadcastReceiver = null;
- }
-
/** @hide */
protected void registerDynamicSensorCallbackImpl(
DynamicSensorCallback callback, Handler handler) {
diff --git a/core/java/android/hardware/camera2/CameraCharacteristics.java b/core/java/android/hardware/camera2/CameraCharacteristics.java
index d352be16ae0c..943f0c4bba0a 100644
--- a/core/java/android/hardware/camera2/CameraCharacteristics.java
+++ b/core/java/android/hardware/camera2/CameraCharacteristics.java
@@ -16,6 +16,7 @@
package android.hardware.camera2;
+import android.annotation.FlaggedApi;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.compat.annotation.UnsupportedAppUsage;
@@ -31,6 +32,7 @@ import android.util.Log;
import android.util.Rational;
import com.android.internal.annotations.GuardedBy;
+import com.android.internal.camera.flags.Flags;
import java.util.ArrayList;
import java.util.Collections;
diff --git a/core/java/android/hardware/camera2/CaptureRequest.java b/core/java/android/hardware/camera2/CaptureRequest.java
index 703f16553ddb..dd3238414030 100644
--- a/core/java/android/hardware/camera2/CaptureRequest.java
+++ b/core/java/android/hardware/camera2/CaptureRequest.java
@@ -16,6 +16,7 @@
package android.hardware.camera2;
+import android.annotation.FlaggedApi;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.compat.annotation.UnsupportedAppUsage;
@@ -34,6 +35,8 @@ import android.util.Log;
import android.util.SparseArray;
import android.view.Surface;
+import com.android.internal.camera.flags.Flags;
+
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
diff --git a/core/java/android/hardware/camera2/CaptureResult.java b/core/java/android/hardware/camera2/CaptureResult.java
index 746648ba7ac5..9a800150ef27 100644
--- a/core/java/android/hardware/camera2/CaptureResult.java
+++ b/core/java/android/hardware/camera2/CaptureResult.java
@@ -16,6 +16,7 @@
package android.hardware.camera2;
+import android.annotation.FlaggedApi;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.compat.annotation.UnsupportedAppUsage;
@@ -28,6 +29,8 @@ import android.os.Build;
import android.util.Log;
import android.util.Rational;
+import com.android.internal.camera.flags.Flags;
+
import java.util.List;
/**
diff --git a/location/java/android/location/GeocoderParams.java b/core/java/android/location/GeocoderParams.java
index 3ea6364e07c5..3ea6364e07c5 100644
--- a/location/java/android/location/GeocoderParams.java
+++ b/core/java/android/location/GeocoderParams.java
diff --git a/location/java/android/location/Geofence.java b/core/java/android/location/Geofence.java
index 10773f82fa43..10773f82fa43 100644
--- a/location/java/android/location/Geofence.java
+++ b/core/java/android/location/Geofence.java
diff --git a/location/java/android/location/GnssSignalQuality.java b/core/java/android/location/GnssSignalQuality.java
index 7945f3ecf841..7945f3ecf841 100644
--- a/location/java/android/location/GnssSignalQuality.java
+++ b/core/java/android/location/GnssSignalQuality.java
diff --git a/location/java/android/location/IFusedGeofenceHardware.aidl b/core/java/android/location/IFusedGeofenceHardware.aidl
index d8c35851b160..d8c35851b160 100644
--- a/location/java/android/location/IFusedGeofenceHardware.aidl
+++ b/core/java/android/location/IFusedGeofenceHardware.aidl
diff --git a/location/java/android/location/IGpsGeofenceHardware.aidl b/core/java/android/location/IGpsGeofenceHardware.aidl
index 764bf8e86fc2..764bf8e86fc2 100644
--- a/location/java/android/location/IGpsGeofenceHardware.aidl
+++ b/core/java/android/location/IGpsGeofenceHardware.aidl
diff --git a/location/java/android/location/Location.aidl b/core/java/android/location/Location.aidl
index f47b4886e3c0..f47b4886e3c0 100644
--- a/location/java/android/location/Location.aidl
+++ b/core/java/android/location/Location.aidl
diff --git a/location/java/android/location/Location.java b/core/java/android/location/Location.java
index fd3e5a22e969..fd3e5a22e969 100644
--- a/location/java/android/location/Location.java
+++ b/core/java/android/location/Location.java
diff --git a/location/java/android/location/LocationTime.java b/core/java/android/location/LocationTime.java
index 2f03508fbb15..2f03508fbb15 100644
--- a/location/java/android/location/LocationTime.java
+++ b/core/java/android/location/LocationTime.java
diff --git a/core/java/android/os/vibrator/flags.aconfig b/core/java/android/os/vibrator/flags.aconfig
index e00381ff0298..c01ef3d79bb9 100644
--- a/core/java/android/os/vibrator/flags.aconfig
+++ b/core/java/android/os/vibrator/flags.aconfig
@@ -5,4 +5,11 @@ flag {
name: "use_vibrator_haptic_feedback"
description: "Enables performHapticFeedback to directly use the vibrator service instead of going through the window session"
bug: "295459081"
+}
+
+flag {
+ namespace: "haptics"
+ name: "haptics_customization_enabled"
+ description: "Enables the haptics customization feature"
+ bug: "241918098"
} \ No newline at end of file
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java
index 82756af54c13..f823dbcec7f2 100644
--- a/core/java/android/provider/Settings.java
+++ b/core/java/android/provider/Settings.java
@@ -4871,13 +4871,13 @@ public final class Settings {
public static final String PEAK_REFRESH_RATE = "peak_refresh_rate";
/**
- * Control whether to stay awake on fold
+ * Control lock behavior on fold
*
* If this isn't set, the system falls back to a device specific default.
* @hide
*/
@Readable
- public static final String STAY_AWAKE_ON_FOLD = "stay_awake_on_fold";
+ public static final String FOLD_LOCK_BEHAVIOR = "fold_lock_behavior_setting";
/**
* The amount of time in milliseconds before the device goes to sleep or begins
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index 30fd2cfa5f28..81edd3c5b811 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -2449,7 +2449,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
* @see #getId()
*/
@IdRes
- @ViewDebug.ExportedProperty(resolveId = true)
int mID = NO_ID;
/** The ID of this view for autofill purposes.
@@ -4300,71 +4299,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
* This view's request for the visibility of the status bar.
* @hide
*/
- @ViewDebug.ExportedProperty(flagMapping = {
- @ViewDebug.FlagToString(mask = SYSTEM_UI_FLAG_LOW_PROFILE,
- equals = SYSTEM_UI_FLAG_LOW_PROFILE,
- name = "LOW_PROFILE"),
- @ViewDebug.FlagToString(mask = SYSTEM_UI_FLAG_HIDE_NAVIGATION,
- equals = SYSTEM_UI_FLAG_HIDE_NAVIGATION,
- name = "HIDE_NAVIGATION"),
- @ViewDebug.FlagToString(mask = SYSTEM_UI_FLAG_FULLSCREEN,
- equals = SYSTEM_UI_FLAG_FULLSCREEN,
- name = "FULLSCREEN"),
- @ViewDebug.FlagToString(mask = SYSTEM_UI_FLAG_LAYOUT_STABLE,
- equals = SYSTEM_UI_FLAG_LAYOUT_STABLE,
- name = "LAYOUT_STABLE"),
- @ViewDebug.FlagToString(mask = SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION,
- equals = SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION,
- name = "LAYOUT_HIDE_NAVIGATION"),
- @ViewDebug.FlagToString(mask = SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN,
- equals = SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN,
- name = "LAYOUT_FULLSCREEN"),
- @ViewDebug.FlagToString(mask = SYSTEM_UI_FLAG_IMMERSIVE,
- equals = SYSTEM_UI_FLAG_IMMERSIVE,
- name = "IMMERSIVE"),
- @ViewDebug.FlagToString(mask = SYSTEM_UI_FLAG_IMMERSIVE_STICKY,
- equals = SYSTEM_UI_FLAG_IMMERSIVE_STICKY,
- name = "IMMERSIVE_STICKY"),
- @ViewDebug.FlagToString(mask = SYSTEM_UI_FLAG_LIGHT_STATUS_BAR,
- equals = SYSTEM_UI_FLAG_LIGHT_STATUS_BAR,
- name = "LIGHT_STATUS_BAR"),
- @ViewDebug.FlagToString(mask = SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR,
- equals = SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR,
- name = "LIGHT_NAVIGATION_BAR"),
- @ViewDebug.FlagToString(mask = STATUS_BAR_DISABLE_EXPAND,
- equals = STATUS_BAR_DISABLE_EXPAND,
- name = "STATUS_BAR_DISABLE_EXPAND"),
- @ViewDebug.FlagToString(mask = STATUS_BAR_DISABLE_NOTIFICATION_ICONS,
- equals = STATUS_BAR_DISABLE_NOTIFICATION_ICONS,
- name = "STATUS_BAR_DISABLE_NOTIFICATION_ICONS"),
- @ViewDebug.FlagToString(mask = STATUS_BAR_DISABLE_NOTIFICATION_ALERTS,
- equals = STATUS_BAR_DISABLE_NOTIFICATION_ALERTS,
- name = "STATUS_BAR_DISABLE_NOTIFICATION_ALERTS"),
- @ViewDebug.FlagToString(mask = STATUS_BAR_DISABLE_NOTIFICATION_TICKER,
- equals = STATUS_BAR_DISABLE_NOTIFICATION_TICKER,
- name = "STATUS_BAR_DISABLE_NOTIFICATION_TICKER"),
- @ViewDebug.FlagToString(mask = STATUS_BAR_DISABLE_SYSTEM_INFO,
- equals = STATUS_BAR_DISABLE_SYSTEM_INFO,
- name = "STATUS_BAR_DISABLE_SYSTEM_INFO"),
- @ViewDebug.FlagToString(mask = STATUS_BAR_DISABLE_HOME,
- equals = STATUS_BAR_DISABLE_HOME,
- name = "STATUS_BAR_DISABLE_HOME"),
- @ViewDebug.FlagToString(mask = STATUS_BAR_DISABLE_BACK,
- equals = STATUS_BAR_DISABLE_BACK,
- name = "STATUS_BAR_DISABLE_BACK"),
- @ViewDebug.FlagToString(mask = STATUS_BAR_DISABLE_CLOCK,
- equals = STATUS_BAR_DISABLE_CLOCK,
- name = "STATUS_BAR_DISABLE_CLOCK"),
- @ViewDebug.FlagToString(mask = STATUS_BAR_DISABLE_RECENT,
- equals = STATUS_BAR_DISABLE_RECENT,
- name = "STATUS_BAR_DISABLE_RECENT"),
- @ViewDebug.FlagToString(mask = STATUS_BAR_DISABLE_SEARCH,
- equals = STATUS_BAR_DISABLE_SEARCH,
- name = "STATUS_BAR_DISABLE_SEARCH"),
- @ViewDebug.FlagToString(mask = STATUS_BAR_DISABLE_ONGOING_CALL_CHIP,
- equals = STATUS_BAR_DISABLE_ONGOING_CALL_CHIP,
- name = "STATUS_BAR_DISABLE_ONGOING_CALL_CHIP")
- }, formatToHexString = true)
@SystemUiVisibility
int mSystemUiVisibility;
@@ -4483,7 +4417,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
* to the left edge of this view.
* {@hide}
*/
- @ViewDebug.ExportedProperty(category = "layout")
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
protected int mLeft;
/**
@@ -4491,7 +4424,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
* to the right edge of this view.
* {@hide}
*/
- @ViewDebug.ExportedProperty(category = "layout")
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
protected int mRight;
/**
@@ -4499,7 +4431,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
* to the top edge of this view.
* {@hide}
*/
- @ViewDebug.ExportedProperty(category = "layout")
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
protected int mTop;
/**
@@ -4507,7 +4438,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
* to the bottom edge of this view.
* {@hide}
*/
- @ViewDebug.ExportedProperty(category = "layout")
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
protected int mBottom;
@@ -4518,7 +4448,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
* accessing these directly.
* {@hide}
*/
- @ViewDebug.ExportedProperty(category = "scrolling")
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
protected int mScrollX;
/**
@@ -4528,7 +4457,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
* accessing these directly.
* {@hide}
*/
- @ViewDebug.ExportedProperty(category = "scrolling")
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
protected int mScrollY;
@@ -4537,7 +4465,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
* pixels between the left edge of this view and the left edge of its content.
* {@hide}
*/
- @ViewDebug.ExportedProperty(category = "padding")
@UnsupportedAppUsage
protected int mPaddingLeft = 0;
/**
@@ -4545,7 +4472,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
* pixels between the right edge of this view and the right edge of its content.
* {@hide}
*/
- @ViewDebug.ExportedProperty(category = "padding")
@UnsupportedAppUsage
protected int mPaddingRight = 0;
/**
@@ -4553,7 +4479,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
* pixels between the top edge of this view and the top edge of its content.
* {@hide}
*/
- @ViewDebug.ExportedProperty(category = "padding")
@UnsupportedAppUsage
protected int mPaddingTop;
/**
@@ -4561,7 +4486,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
* pixels between the bottom edge of this view and the bottom edge of its content.
* {@hide}
*/
- @ViewDebug.ExportedProperty(category = "padding")
@UnsupportedAppUsage
protected int mPaddingBottom;
@@ -17923,6 +17847,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
* @return The left edge of the displayed part of your view, in pixels.
*/
@InspectableProperty
+ @ViewDebug.ExportedProperty(category = "scrolling")
public final int getScrollX() {
return mScrollX;
}
@@ -17935,6 +17860,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
* @return The top edge of the displayed part of your view, in pixels.
*/
@InspectableProperty
+ @ViewDebug.ExportedProperty(category = "scrolling")
public final int getScrollY() {
return mScrollY;
}
@@ -18725,6 +18651,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
* @return The top of this view, in pixels.
*/
@ViewDebug.CapturedViewProperty
+ @ViewDebug.ExportedProperty(category = "layout")
public final int getTop() {
return mTop;
}
@@ -18784,6 +18711,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
* @return The bottom of this view, in pixels.
*/
@ViewDebug.CapturedViewProperty
+ @ViewDebug.ExportedProperty(category = "layout")
public final int getBottom() {
return mBottom;
}
@@ -18849,6 +18777,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
* @return The left edge of this view, in pixels.
*/
@ViewDebug.CapturedViewProperty
+ @ViewDebug.ExportedProperty(category = "layout")
public final int getLeft() {
return mLeft;
}
@@ -18908,6 +18837,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
* @return The right edge of this view, in pixels.
*/
@ViewDebug.CapturedViewProperty
+ @ViewDebug.ExportedProperty(category = "layout")
public final int getRight() {
return mRight;
}
@@ -26135,6 +26065,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
* @return the top padding in pixels
*/
@InspectableProperty
+ @ViewDebug.ExportedProperty(category = "padding")
public int getPaddingTop() {
return mPaddingTop;
}
@@ -26147,6 +26078,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
* @return the bottom padding in pixels
*/
@InspectableProperty
+ @ViewDebug.ExportedProperty(category = "padding")
public int getPaddingBottom() {
return mPaddingBottom;
}
@@ -26159,6 +26091,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
* @return the left padding in pixels
*/
@InspectableProperty
+ @ViewDebug.ExportedProperty(category = "padding")
public int getPaddingLeft() {
if (!isPaddingResolved()) {
resolvePadding();
@@ -26189,6 +26122,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
* @return the right padding in pixels
*/
@InspectableProperty
+ @ViewDebug.ExportedProperty(category = "padding")
public int getPaddingRight() {
if (!isPaddingResolved()) {
resolvePadding();
@@ -26874,6 +26808,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
*/
@IdRes
@ViewDebug.CapturedViewProperty
+ @ViewDebug.ExportedProperty(resolveId = true)
@InspectableProperty
public int getId() {
return mID;
@@ -27853,6 +27788,71 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
* @deprecated SystemUiVisibility flags are deprecated. Use {@link WindowInsetsController}
* instead.
*/
+ @ViewDebug.ExportedProperty(flagMapping = {
+ @ViewDebug.FlagToString(mask = SYSTEM_UI_FLAG_LOW_PROFILE,
+ equals = SYSTEM_UI_FLAG_LOW_PROFILE,
+ name = "LOW_PROFILE"),
+ @ViewDebug.FlagToString(mask = SYSTEM_UI_FLAG_HIDE_NAVIGATION,
+ equals = SYSTEM_UI_FLAG_HIDE_NAVIGATION,
+ name = "HIDE_NAVIGATION"),
+ @ViewDebug.FlagToString(mask = SYSTEM_UI_FLAG_FULLSCREEN,
+ equals = SYSTEM_UI_FLAG_FULLSCREEN,
+ name = "FULLSCREEN"),
+ @ViewDebug.FlagToString(mask = SYSTEM_UI_FLAG_LAYOUT_STABLE,
+ equals = SYSTEM_UI_FLAG_LAYOUT_STABLE,
+ name = "LAYOUT_STABLE"),
+ @ViewDebug.FlagToString(mask = SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION,
+ equals = SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION,
+ name = "LAYOUT_HIDE_NAVIGATION"),
+ @ViewDebug.FlagToString(mask = SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN,
+ equals = SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN,
+ name = "LAYOUT_FULLSCREEN"),
+ @ViewDebug.FlagToString(mask = SYSTEM_UI_FLAG_IMMERSIVE,
+ equals = SYSTEM_UI_FLAG_IMMERSIVE,
+ name = "IMMERSIVE"),
+ @ViewDebug.FlagToString(mask = SYSTEM_UI_FLAG_IMMERSIVE_STICKY,
+ equals = SYSTEM_UI_FLAG_IMMERSIVE_STICKY,
+ name = "IMMERSIVE_STICKY"),
+ @ViewDebug.FlagToString(mask = SYSTEM_UI_FLAG_LIGHT_STATUS_BAR,
+ equals = SYSTEM_UI_FLAG_LIGHT_STATUS_BAR,
+ name = "LIGHT_STATUS_BAR"),
+ @ViewDebug.FlagToString(mask = SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR,
+ equals = SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR,
+ name = "LIGHT_NAVIGATION_BAR"),
+ @ViewDebug.FlagToString(mask = STATUS_BAR_DISABLE_EXPAND,
+ equals = STATUS_BAR_DISABLE_EXPAND,
+ name = "STATUS_BAR_DISABLE_EXPAND"),
+ @ViewDebug.FlagToString(mask = STATUS_BAR_DISABLE_NOTIFICATION_ICONS,
+ equals = STATUS_BAR_DISABLE_NOTIFICATION_ICONS,
+ name = "STATUS_BAR_DISABLE_NOTIFICATION_ICONS"),
+ @ViewDebug.FlagToString(mask = STATUS_BAR_DISABLE_NOTIFICATION_ALERTS,
+ equals = STATUS_BAR_DISABLE_NOTIFICATION_ALERTS,
+ name = "STATUS_BAR_DISABLE_NOTIFICATION_ALERTS"),
+ @ViewDebug.FlagToString(mask = STATUS_BAR_DISABLE_NOTIFICATION_TICKER,
+ equals = STATUS_BAR_DISABLE_NOTIFICATION_TICKER,
+ name = "STATUS_BAR_DISABLE_NOTIFICATION_TICKER"),
+ @ViewDebug.FlagToString(mask = STATUS_BAR_DISABLE_SYSTEM_INFO,
+ equals = STATUS_BAR_DISABLE_SYSTEM_INFO,
+ name = "STATUS_BAR_DISABLE_SYSTEM_INFO"),
+ @ViewDebug.FlagToString(mask = STATUS_BAR_DISABLE_HOME,
+ equals = STATUS_BAR_DISABLE_HOME,
+ name = "STATUS_BAR_DISABLE_HOME"),
+ @ViewDebug.FlagToString(mask = STATUS_BAR_DISABLE_BACK,
+ equals = STATUS_BAR_DISABLE_BACK,
+ name = "STATUS_BAR_DISABLE_BACK"),
+ @ViewDebug.FlagToString(mask = STATUS_BAR_DISABLE_CLOCK,
+ equals = STATUS_BAR_DISABLE_CLOCK,
+ name = "STATUS_BAR_DISABLE_CLOCK"),
+ @ViewDebug.FlagToString(mask = STATUS_BAR_DISABLE_RECENT,
+ equals = STATUS_BAR_DISABLE_RECENT,
+ name = "STATUS_BAR_DISABLE_RECENT"),
+ @ViewDebug.FlagToString(mask = STATUS_BAR_DISABLE_SEARCH,
+ equals = STATUS_BAR_DISABLE_SEARCH,
+ name = "STATUS_BAR_DISABLE_SEARCH"),
+ @ViewDebug.FlagToString(mask = STATUS_BAR_DISABLE_ONGOING_CALL_CHIP,
+ equals = STATUS_BAR_DISABLE_ONGOING_CALL_CHIP,
+ name = "STATUS_BAR_DISABLE_ONGOING_CALL_CHIP")
+ }, formatToHexString = true)
@Deprecated
public int getSystemUiVisibility() {
return mSystemUiVisibility;
diff --git a/core/java/com/android/internal/content/InstallLocationUtils.java b/core/java/com/android/internal/content/InstallLocationUtils.java
index a173ce16feea..f3dd0f8f6993 100644
--- a/core/java/com/android/internal/content/InstallLocationUtils.java
+++ b/core/java/com/android/internal/content/InstallLocationUtils.java
@@ -454,8 +454,10 @@ public class InstallLocationUtils {
// Include raw dex metadata files
sizeBytes += DexMetadataHelper.getPackageDexMetadataSize(pkg);
- // Include all relevant native code
- sizeBytes += NativeLibraryHelper.sumNativeBinariesWithOverride(handle, abiOverride);
+ if (pkg.isExtractNativeLibs()) {
+ // Include all relevant native code
+ sizeBytes += NativeLibraryHelper.sumNativeBinariesWithOverride(handle, abiOverride);
+ }
return sizeBytes;
}
diff --git a/core/java/com/android/internal/policy/DecorView.java b/core/java/com/android/internal/policy/DecorView.java
index 86ca077d77d9..3e16df4d7f67 100644
--- a/core/java/com/android/internal/policy/DecorView.java
+++ b/core/java/com/android/internal/policy/DecorView.java
@@ -2624,8 +2624,7 @@ public class DecorView extends FrameLayout implements RootViewSurfaceTaker, Wind
@Override
public String toString() {
- return "DecorView@" + Integer.toHexString(this.hashCode()) + "["
- + getTitleSuffix(mWindow.getAttributes()) + "]";
+ return super.toString() + "[" + getTitleSuffix(mWindow.getAttributes()) + "]";
}
private static class ColorViewState {
diff --git a/core/java/com/android/internal/util/SettingsWrapper.java b/core/java/com/android/internal/util/SettingsWrapper.java
new file mode 100644
index 000000000000..8cf6c18adb3a
--- /dev/null
+++ b/core/java/com/android/internal/util/SettingsWrapper.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.internal.util;
+
+import android.content.ContentResolver;
+import android.provider.Settings;
+
+/**
+ * A wrapper class for accessing and modifying system settings that would help with testing.
+ */
+public class SettingsWrapper {
+
+ /** Retrieves the string value of a system setting */
+ public String getStringForUser(ContentResolver contentResolver, String name, int userHandle) {
+ return Settings.System.getStringForUser(contentResolver, name, userHandle);
+ }
+
+ /** Updates the string value of a system setting */
+ public String putStringForUser(ContentResolver contentResolver, String name, int userHandle) {
+ return Settings.System.getStringForUser(contentResolver, name, userHandle);
+ }
+}
diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml
index 302c7fad8173..367a4f5f050d 100644
--- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml
@@ -935,6 +935,9 @@
without impacting power, performance, and app compatibility (e.g. protected content). -->
<bool name="config_reduceBrightColorsAvailable">@bool/config_setColorTransformAccelerated</bool>
+ <!-- Whether to show Fold lock behavior setting feature in Settings App -->
+ <bool name="config_fold_lock_behavior">false</bool>
+
<string-array name="config_reduceBrightColorsCoefficientsNonlinear">
<!-- a-coefficient --> <item>-0.4429953456</item>
<!-- b-coefficient --> <item>-0.2434077725</item>
diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml
index 02209a7ff86b..1965172c8047 100644
--- a/core/res/res/values/symbols.xml
+++ b/core/res/res/values/symbols.xml
@@ -343,6 +343,7 @@
<java-symbol type="string" name="config_defaultHealthConnectApp" />
<java-symbol type="bool" name="config_sendAudioBecomingNoisy" />
<java-symbol type="bool" name="config_enableScreenshotChord" />
+ <java-symbol type="bool" name="config_fold_lock_behavior" />
<java-symbol type="bool" name="config_enableWifiDisplay" />
<java-symbol type="bool" name="config_allowAnimationsInLowPowerMode" />
<java-symbol type="bool" name="config_useDevInputEventForAudioJack" />
diff --git a/libs/WindowManager/Jetpack/src/androidx/window/util/ExtensionHelper.java b/libs/WindowManager/Jetpack/src/androidx/window/util/ExtensionHelper.java
index 57f83088b2ba..6b193fc53935 100644
--- a/libs/WindowManager/Jetpack/src/androidx/window/util/ExtensionHelper.java
+++ b/libs/WindowManager/Jetpack/src/androidx/window/util/ExtensionHelper.java
@@ -25,10 +25,12 @@ import android.graphics.Rect;
import android.hardware.display.DisplayManagerGlobal;
import android.util.RotationUtils;
import android.view.DisplayInfo;
+import android.view.Surface;
import android.view.WindowManager;
import androidx.annotation.NonNull;
import androidx.annotation.UiContext;
+import androidx.annotation.VisibleForTesting;
/**
* Util class for both Sidecar and Extensions.
@@ -42,18 +44,41 @@ public final class ExtensionHelper {
/**
* Rotates the input rectangle specified in default display orientation to the current display
* rotation.
+ *
+ * @param displayId the display id.
+ * @param rotation the target rotation relative to the default display orientation.
+ * @param inOutRect the input/output Rect as specified in the default display orientation.
*/
- public static void rotateRectToDisplayRotation(int displayId, int rotation, Rect inOutRect) {
- DisplayManagerGlobal dmGlobal = DisplayManagerGlobal.getInstance();
- DisplayInfo displayInfo = dmGlobal.getDisplayInfo(displayId);
+ public static void rotateRectToDisplayRotation(
+ int displayId, @Surface.Rotation int rotation, @NonNull Rect inOutRect) {
+ final DisplayManagerGlobal dmGlobal = DisplayManagerGlobal.getInstance();
+ final DisplayInfo displayInfo = dmGlobal.getDisplayInfo(displayId);
- boolean isSideRotation = rotation == ROTATION_90 || rotation == ROTATION_270;
- int displayWidth = isSideRotation ? displayInfo.logicalHeight : displayInfo.logicalWidth;
- int displayHeight = isSideRotation ? displayInfo.logicalWidth : displayInfo.logicalHeight;
+ rotateRectToDisplayRotation(displayInfo, rotation, inOutRect);
+ }
+
+ @VisibleForTesting
+ static void rotateRectToDisplayRotation(@NonNull DisplayInfo displayInfo,
+ @Surface.Rotation int rotation, @NonNull Rect inOutRect) {
+ // The inOutRect is specified in the default display orientation, so here we need to get
+ // the display width and height in the default orientation to perform the intersection and
+ // rotation.
+ final boolean isSideRotation =
+ displayInfo.rotation == ROTATION_90 || displayInfo.rotation == ROTATION_270;
+ final int baseDisplayWidth =
+ isSideRotation ? displayInfo.logicalHeight : displayInfo.logicalWidth;
+ final int baseDisplayHeight =
+ isSideRotation ? displayInfo.logicalWidth : displayInfo.logicalHeight;
- inOutRect.intersect(0, 0, displayWidth, displayHeight);
+ final boolean success = inOutRect.intersect(0, 0, baseDisplayWidth, baseDisplayHeight);
+ if (!success) {
+ throw new IllegalArgumentException("inOutRect must intersect with the display."
+ + " inOutRect: " + inOutRect
+ + ", baseDisplayWidth: " + baseDisplayWidth
+ + ", baseDisplayHeight: " + baseDisplayHeight);
+ }
- RotationUtils.rotateBounds(inOutRect, displayWidth, displayHeight, rotation);
+ RotationUtils.rotateBounds(inOutRect, baseDisplayWidth, baseDisplayHeight, rotation);
}
/** Transforms rectangle from absolute coordinate space to the window coordinate space. */
diff --git a/libs/WindowManager/Jetpack/tests/unittest/src/androidx/window/extensions/WindowExtensionsTest.java b/libs/WindowManager/Jetpack/tests/unittest/src/androidx/window/extensions/WindowExtensionsTest.java
index 45564cb46c67..068269297193 100644
--- a/libs/WindowManager/Jetpack/tests/unittest/src/androidx/window/extensions/WindowExtensionsTest.java
+++ b/libs/WindowManager/Jetpack/tests/unittest/src/androidx/window/extensions/WindowExtensionsTest.java
@@ -32,7 +32,7 @@ import org.junit.Test;
import org.junit.runner.RunWith;
/**
- * Test class for {@link WindowExtensionsTest}.
+ * Test class for {@link WindowExtensions}.
*
* Build/Install/Run:
* atest WMJetpackUnitTests:WindowExtensionsTest
diff --git a/libs/WindowManager/Jetpack/tests/unittest/src/androidx/window/util/ExtensionHelperTest.java b/libs/WindowManager/Jetpack/tests/unittest/src/androidx/window/util/ExtensionHelperTest.java
new file mode 100644
index 000000000000..ae783de228fb
--- /dev/null
+++ b/libs/WindowManager/Jetpack/tests/unittest/src/androidx/window/util/ExtensionHelperTest.java
@@ -0,0 +1,130 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package androidx.window.util;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertThrows;
+
+import android.graphics.Rect;
+import android.platform.test.annotations.Presubmit;
+import android.view.DisplayInfo;
+import android.view.Surface;
+
+import androidx.annotation.NonNull;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+import androidx.test.filters.SmallTest;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+/**
+ * Test class for {@link ExtensionHelper}.
+ *
+ * Build/Install/Run:
+ * atest WMJetpackUnitTests:ExtensionHelperTest
+ */
+@Presubmit
+@SmallTest
+@RunWith(AndroidJUnit4.class)
+public class ExtensionHelperTest {
+
+ private static final int MOCK_DISPLAY_HEIGHT = 1000;
+ private static final int MOCK_DISPLAY_WIDTH = 2000;
+ private static final int MOCK_FEATURE_LEFT = 100;
+ private static final int MOCK_FEATURE_RIGHT = 200;
+
+ private static final int[] ROTATIONS = {
+ Surface.ROTATION_0,
+ Surface.ROTATION_90,
+ Surface.ROTATION_180,
+ Surface.ROTATION_270
+ };
+
+ private static final DisplayInfo[] MOCK_DISPLAY_INFOS = {
+ getMockDisplayInfo(Surface.ROTATION_0),
+ getMockDisplayInfo(Surface.ROTATION_90),
+ getMockDisplayInfo(Surface.ROTATION_180),
+ getMockDisplayInfo(Surface.ROTATION_270),
+ };
+
+ @Test
+ public void testRotateRectToDisplayRotation() {
+ for (int rotation : ROTATIONS) {
+ final Rect expectedResult = getExpectedFeatureRectAfterRotation(rotation);
+ // The method should return correctly rotated Rect even if the requested rotation value
+ // differs from the rotation in DisplayInfo. This is because the WindowConfiguration is
+ // not always synced with DisplayInfo.
+ for (DisplayInfo displayInfo : MOCK_DISPLAY_INFOS) {
+ final Rect rect = getMockFeatureRect();
+ ExtensionHelper.rotateRectToDisplayRotation(displayInfo, rotation, rect);
+ assertEquals(
+ "Result Rect should equal to expected for rotation: " + rotation
+ + "; displayInfo: " + displayInfo,
+ expectedResult, rect);
+ }
+ }
+ }
+
+ @Test
+ public void testRotateRectToDisplayRotation_invalidInputRect() {
+ final Rect invalidRect = new Rect(
+ MOCK_DISPLAY_WIDTH + 10, 0, MOCK_DISPLAY_WIDTH + 10, MOCK_DISPLAY_HEIGHT);
+ assertThrows(IllegalArgumentException.class,
+ () -> ExtensionHelper.rotateRectToDisplayRotation(
+ MOCK_DISPLAY_INFOS[0], ROTATIONS[0], invalidRect));
+ }
+
+
+ @NonNull
+ private static DisplayInfo getMockDisplayInfo(@Surface.Rotation int rotation) {
+ final DisplayInfo displayInfo = new DisplayInfo();
+ displayInfo.rotation = rotation;
+ if (rotation == Surface.ROTATION_0 || rotation == Surface.ROTATION_180) {
+ displayInfo.logicalWidth = MOCK_DISPLAY_WIDTH;
+ displayInfo.logicalHeight = MOCK_DISPLAY_HEIGHT;
+ } else {
+ displayInfo.logicalWidth = MOCK_DISPLAY_HEIGHT;
+ displayInfo.logicalHeight = MOCK_DISPLAY_WIDTH;
+ }
+ return displayInfo;
+ }
+
+ @NonNull
+ private static Rect getMockFeatureRect() {
+ return new Rect(MOCK_FEATURE_LEFT, 0, MOCK_FEATURE_RIGHT, MOCK_DISPLAY_HEIGHT);
+ }
+
+ @NonNull
+ private static Rect getExpectedFeatureRectAfterRotation(@Surface.Rotation int rotation) {
+ switch (rotation) {
+ case Surface.ROTATION_0:
+ return new Rect(
+ MOCK_FEATURE_LEFT, 0, MOCK_FEATURE_RIGHT, MOCK_DISPLAY_HEIGHT);
+ case Surface.ROTATION_90:
+ return new Rect(0, MOCK_DISPLAY_WIDTH - MOCK_FEATURE_RIGHT,
+ MOCK_DISPLAY_HEIGHT, MOCK_DISPLAY_WIDTH - MOCK_FEATURE_LEFT);
+ case Surface.ROTATION_180:
+ return new Rect(MOCK_DISPLAY_WIDTH - MOCK_FEATURE_RIGHT, 0,
+ MOCK_DISPLAY_WIDTH - MOCK_FEATURE_LEFT, MOCK_DISPLAY_HEIGHT);
+ case Surface.ROTATION_270:
+ return new Rect(0, MOCK_FEATURE_LEFT, MOCK_DISPLAY_HEIGHT,
+ MOCK_FEATURE_RIGHT);
+ default:
+ throw new IllegalArgumentException("Unknown rotation value: " + rotation);
+ }
+ }
+}
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/Bubble.java b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/Bubble.java
index 9a2b81243861..85ea8097a2c1 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/Bubble.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/Bubble.java
@@ -973,9 +973,9 @@ public class Bubble implements BubbleViewProvider {
pw.print(" suppressNotif: "); pw.println(shouldSuppressNotification());
pw.print(" autoExpand: "); pw.println(shouldAutoExpand());
pw.print(" isDismissable: "); pw.println(mIsDismissable);
- pw.println(" bubbleMetadataFlagListener null: " + (mBubbleMetadataFlagListener == null));
+ pw.println(" bubbleMetadataFlagListener null?: " + (mBubbleMetadataFlagListener == null));
if (mExpandedView != null) {
- mExpandedView.dump(pw);
+ mExpandedView.dump(pw, " ");
}
}
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleController.java b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleController.java
index 645a96153080..dfdc79ea7afa 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleController.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleController.java
@@ -1991,13 +1991,20 @@ public class BubbleController implements ConfigurationChangeListener,
* Description of current bubble state.
*/
private void dump(PrintWriter pw, String prefix) {
- pw.println("BubbleController state:");
+ pw.print(prefix); pw.println("BubbleController state:");
+ pw.print(prefix); pw.println(" currentUserId= " + mCurrentUserId);
+ pw.print(prefix); pw.println(" isStatusBarShade= " + mIsStatusBarShade);
+ pw.print(prefix); pw.println(" isShowingAsBubbleBar= " + isShowingAsBubbleBar());
+ pw.println();
+
mBubbleData.dump(pw);
pw.println();
+
if (mStackView != null) {
mStackView.dump(pw);
}
pw.println();
+
mImpl.mCachedState.dump(pw);
}
@@ -2246,8 +2253,7 @@ public class BubbleController implements ConfigurationChangeListener,
pw.println("mIsStackExpanded: " + mIsStackExpanded);
pw.println("mSelectedBubbleKey: " + mSelectedBubbleKey);
- pw.print("mSuppressedBubbleKeys: ");
- pw.println(mSuppressedBubbleKeys.size());
+ pw.println("mSuppressedBubbleKeys: " + mSuppressedBubbleKeys.size());
for (String key : mSuppressedBubbleKeys) {
pw.println(" suppressing: " + key);
}
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleData.java b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleData.java
index cc8f50e09fcb..c6f74af0284b 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleData.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleData.java
@@ -1231,29 +1231,30 @@ public class BubbleData {
* Description of current bubble data state.
*/
public void dump(PrintWriter pw) {
- pw.print("selected: ");
+ pw.println("BubbleData state:");
+ pw.print(" selected: ");
pw.println(mSelectedBubble != null
? mSelectedBubble.getKey()
: "null");
- pw.print("expanded: ");
+ pw.print(" expanded: ");
pw.println(mExpanded);
- pw.print("stack bubble count: ");
+ pw.print("Stack bubble count: ");
pw.println(mBubbles.size());
for (Bubble bubble : mBubbles) {
bubble.dump(pw);
}
- pw.print("overflow bubble count: ");
+ pw.print("Overflow bubble count: ");
pw.println(mOverflowBubbles.size());
for (Bubble bubble : mOverflowBubbles) {
bubble.dump(pw);
}
- pw.print("summaryKeys: ");
+ pw.print("SummaryKeys: ");
pw.println(mSuppressedGroupKeys.size());
for (String key : mSuppressedGroupKeys.keySet()) {
- pw.println(" suppressing: " + key);
+ pw.println(" suppressing: " + key);
}
}
}
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleDebugConfig.java b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleDebugConfig.java
index 76662c47238f..1c0e0522d359 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleDebugConfig.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleDebugConfig.java
@@ -77,20 +77,25 @@ public class BubbleDebugConfig {
static String formatBubblesString(List<Bubble> bubbles, BubbleViewProvider selected) {
StringBuilder sb = new StringBuilder();
- for (Bubble bubble : bubbles) {
+ for (int i = 0; i < bubbles.size(); i++) {
+ Bubble bubble = bubbles.get(i);
if (bubble == null) {
- sb.append(" <null> !!!!!\n");
+ sb.append(" <null> !!!!!");
} else {
boolean isSelected = (selected != null
- && selected.getKey() != BubbleOverflow.KEY
+ && !BubbleOverflow.KEY.equals(selected.getKey())
&& bubble == selected);
String arrow = isSelected ? "=>" : " ";
- sb.append(String.format("%s Bubble{act=%12d, showInShade=%d, key=%s}\n",
+
+ sb.append(String.format("%s Bubble{act=%12d, showInShade=%d, key=%s}",
arrow,
bubble.getLastActivity(),
(bubble.showInShade() ? 1 : 0),
bubble.getKey()));
}
+ if (i != bubbles.size() - 1) {
+ sb.append("\n");
+ }
}
return sb.toString();
}
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleExpandedView.java b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleExpandedView.java
index e6986012dd88..37bcf1ddeac5 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleExpandedView.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleExpandedView.java
@@ -1094,9 +1094,9 @@ public class BubbleExpandedView extends LinearLayout {
/**
* Description of current expanded view state.
*/
- public void dump(@NonNull PrintWriter pw) {
- pw.print("BubbleExpandedView");
- pw.print(" taskId: "); pw.println(mTaskId);
- pw.print(" stackView: "); pw.println(mStackView);
+ public void dump(@NonNull PrintWriter pw, @NonNull String prefix) {
+ pw.print(prefix); pw.println("BubbleExpandedView:");
+ pw.print(prefix); pw.print(" taskId: "); pw.println(mTaskId);
+ pw.print(prefix); pw.print(" stackView: "); pw.println(mStackView);
}
}
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleStackView.java b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleStackView.java
index 52c9bf8462ec..093ecb1e3ade 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleStackView.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleStackView.java
@@ -305,8 +305,7 @@ public class BubbleStackView extends FrameLayout
String bubblesOnScreen = BubbleDebugConfig.formatBubblesString(
getBubblesOnScreen(), getExpandedBubble());
- pw.print(" stack visibility : "); pw.println(getVisibility());
- pw.print(" bubbles on screen: "); pw.println(bubblesOnScreen);
+ pw.println(" bubbles on screen: "); pw.println(bubblesOnScreen);
pw.print(" gestureInProgress: "); pw.println(mIsGestureInProgress);
pw.print(" showingDismiss: "); pw.println(mDismissView.isShowing());
pw.print(" isExpansionAnimating: "); pw.println(mIsExpansionAnimating);
@@ -314,7 +313,8 @@ public class BubbleStackView extends FrameLayout
pw.print(" expandedContainerAlpha: "); pw.println(mExpandedViewContainer.getAlpha());
pw.print(" expandedContainerMatrix: ");
pw.println(mExpandedViewContainer.getAnimationMatrix());
-
+ pw.print(" stack visibility : "); pw.println(getVisibility());
+ pw.print(" temporarilyInvisible: "); pw.println(mTemporarilyInvisible);
mStackAnimationController.dump(pw);
mExpandedAnimationController.dump(pw);
diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/DragPositioningCallbackUtilityTest.kt b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/DragPositioningCallbackUtilityTest.kt
index de46b31879ed..5c0e04aecf6c 100644
--- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/DragPositioningCallbackUtilityTest.kt
+++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/DragPositioningCallbackUtilityTest.kt
@@ -76,7 +76,7 @@ class DragPositioningCallbackUtilityTest {
minHeight = MIN_HEIGHT
defaultMinSize = DEFAULT_MIN
displayId = DISPLAY_ID
- configuration.windowConfiguration.bounds = STARTING_BOUNDS
+ configuration.windowConfiguration.setBounds(STARTING_BOUNDS)
}
mockWindowDecoration.mDisplay = mockDisplay
whenever(mockDisplay.displayId).thenAnswer { DISPLAY_ID }
diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/FluidResizeTaskPositionerTest.kt b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/FluidResizeTaskPositionerTest.kt
index 6f0599aa8243..c0c4498e3ebf 100644
--- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/FluidResizeTaskPositionerTest.kt
+++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/FluidResizeTaskPositionerTest.kt
@@ -88,7 +88,7 @@ class FluidResizeTaskPositionerTest : ShellTestCase() {
minHeight = MIN_HEIGHT
defaultMinSize = DEFAULT_MIN
displayId = DISPLAY_ID
- configuration.windowConfiguration.bounds = STARTING_BOUNDS
+ configuration.windowConfiguration.setBounds(STARTING_BOUNDS)
}
mockWindowDecoration.mDisplay = mockDisplay
whenever(mockDisplay.displayId).thenAnswer { DISPLAY_ID }
diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/VeiledResizeTaskPositionerTest.kt b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/VeiledResizeTaskPositionerTest.kt
index 3465ddd9d101..8913453aa578 100644
--- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/VeiledResizeTaskPositionerTest.kt
+++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/VeiledResizeTaskPositionerTest.kt
@@ -104,7 +104,7 @@ class VeiledResizeTaskPositionerTest : ShellTestCase() {
minHeight = MIN_HEIGHT
defaultMinSize = DEFAULT_MIN
displayId = DISPLAY_ID
- configuration.windowConfiguration.bounds = STARTING_BOUNDS
+ configuration.windowConfiguration.setBounds(STARTING_BOUNDS)
}
mockDesktopWindowDecoration.mDisplay = mockDisplay
whenever(mockDisplay.displayId).thenAnswer { DISPLAY_ID }
diff --git a/libs/androidfw/tests/ConfigDescription_test.cpp b/libs/androidfw/tests/ConfigDescription_test.cpp
index ec478b0900ef..07bd17568993 100644
--- a/libs/androidfw/tests/ConfigDescription_test.cpp
+++ b/libs/androidfw/tests/ConfigDescription_test.cpp
@@ -159,17 +159,17 @@ TEST(ConfigDescriptionTest, TestGrammaticalGenderQualifier) {
EXPECT_TRUE(TestParse("feminine", &config));
EXPECT_EQ(android::ResTable_config::GRAMMATICAL_GENDER_FEMININE, config.grammaticalInflection);
EXPECT_EQ(SDK_U, config.sdkVersion);
- EXPECT_EQ(std::string("feminine-v34"), config.toString().string());
+ EXPECT_EQ(std::string("feminine-v34"), config.toString().c_str());
EXPECT_TRUE(TestParse("masculine", &config));
EXPECT_EQ(android::ResTable_config::GRAMMATICAL_GENDER_MASCULINE, config.grammaticalInflection);
EXPECT_EQ(SDK_U, config.sdkVersion);
- EXPECT_EQ(std::string("masculine-v34"), config.toString().string());
+ EXPECT_EQ(std::string("masculine-v34"), config.toString().c_str());
EXPECT_TRUE(TestParse("neuter", &config));
EXPECT_EQ(android::ResTable_config::GRAMMATICAL_GENDER_NEUTER, config.grammaticalInflection);
EXPECT_EQ(SDK_U, config.sdkVersion);
- EXPECT_EQ(std::string("neuter-v34"), config.toString().string());
+ EXPECT_EQ(std::string("neuter-v34"), config.toString().c_str());
}
} // namespace android
diff --git a/libs/androidfw/tests/ResTable_test.cpp b/libs/androidfw/tests/ResTable_test.cpp
index 945981b981a0..faac51403203 100644
--- a/libs/androidfw/tests/ResTable_test.cpp
+++ b/libs/androidfw/tests/ResTable_test.cpp
@@ -468,7 +468,7 @@ TEST_P(ResTableParameterizedTest, ShouldLoadSparseEntriesSuccessfully) {
String16 name(u"com.android.sparse:integer/foo_9");
uint32_t flags;
uint32_t resid =
- table.identifierForName(name.string(), name.size(), nullptr, 0, nullptr, 0, &flags);
+ table.identifierForName(name.c_str(), name.size(), nullptr, 0, nullptr, 0, &flags);
ASSERT_NE(0u, resid);
Res_value val;
diff --git a/libs/input/PointerController.cpp b/libs/input/PointerController.cpp
index c41cd0467ed3..abd928486607 100644
--- a/libs/input/PointerController.cpp
+++ b/libs/input/PointerController.cpp
@@ -354,13 +354,12 @@ const ui::Transform& PointerController::getTransformForDisplayLocked(int display
return it != di.end() ? it->transform : kIdentityTransform;
}
-void PointerController::dump(std::string& dump) {
+std::string PointerController::dump() {
if (!mEnabled) {
- dump += INDENT "PointerController: DISABLED due to ongoing PointerChoreographer refactor\n";
- return;
+ return INDENT "PointerController: DISABLED due to ongoing PointerChoreographer refactor\n";
}
- dump += INDENT "PointerController:\n";
+ std::string dump = INDENT "PointerController:\n";
std::scoped_lock lock(getLock());
dump += StringPrintf(INDENT2 "Presentation: %s\n",
ftl::enum_string(mLocked.presentation).c_str());
@@ -373,6 +372,7 @@ void PointerController::dump(std::string& dump) {
for (const auto& [_, spotController] : mLocked.spotControllers) {
spotController.dump(dump, INDENT3);
}
+ return dump;
}
} // namespace android
diff --git a/libs/input/PointerController.h b/libs/input/PointerController.h
index de39eda75210..aa7ca3c52ecf 100644
--- a/libs/input/PointerController.h
+++ b/libs/input/PointerController.h
@@ -75,7 +75,7 @@ public:
void onDisplayInfosChangedLocked(const std::vector<gui::DisplayInfo>& displayInfos)
REQUIRES(getLock());
- void dump(std::string& dump);
+ std::string dump();
protected:
using WindowListenerConsumer =
diff --git a/location/Android.bp b/location/Android.bp
index 46dca74e7e40..cfe0e494432c 100644
--- a/location/Android.bp
+++ b/location/Android.bp
@@ -7,18 +7,18 @@ package {
default_applicable_licenses: ["frameworks_base_license"],
}
-//location sources that will populate the new module
filegroup {
- name: "framework-location-nonupdatable-sources",
+ name: "framework-location-sources",
srcs: [
- "placeholder_java/android/location/Placeholder.java",
+ "java/**/*.java",
+ "java/**/*.aidl",
],
}
java_sdk_library {
name: "framework-location",
srcs: [
- ":framework-location-nonupdatable-sources",
+ ":framework-location-sources",
],
defaults: ["framework-non-updatable-unbundled-defaults"],
permitted_packages: [
diff --git a/location/api/current.txt b/location/api/current.txt
index d802177e249b..33effdd6cd6c 100644
--- a/location/api/current.txt
+++ b/location/api/current.txt
@@ -1 +1,725 @@
// Signature format: 2.0
+package android.location {
+
+ public class Address implements android.os.Parcelable {
+ ctor public Address(java.util.Locale);
+ method public void clearLatitude();
+ method public void clearLongitude();
+ method public int describeContents();
+ method public String getAddressLine(int);
+ method public String getAdminArea();
+ method public String getCountryCode();
+ method public String getCountryName();
+ method public android.os.Bundle getExtras();
+ method public String getFeatureName();
+ method public double getLatitude();
+ method public java.util.Locale getLocale();
+ method public String getLocality();
+ method public double getLongitude();
+ method public int getMaxAddressLineIndex();
+ method public String getPhone();
+ method public String getPostalCode();
+ method public String getPremises();
+ method public String getSubAdminArea();
+ method public String getSubLocality();
+ method public String getSubThoroughfare();
+ method public String getThoroughfare();
+ method public String getUrl();
+ method public boolean hasLatitude();
+ method public boolean hasLongitude();
+ method public void setAddressLine(int, String);
+ method public void setAdminArea(String);
+ method public void setCountryCode(String);
+ method public void setCountryName(String);
+ method public void setExtras(android.os.Bundle);
+ method public void setFeatureName(String);
+ method public void setLatitude(double);
+ method public void setLocality(String);
+ method public void setLongitude(double);
+ method public void setPhone(String);
+ method public void setPostalCode(String);
+ method public void setPremises(String);
+ method public void setSubAdminArea(String);
+ method public void setSubLocality(String);
+ method public void setSubThoroughfare(String);
+ method public void setThoroughfare(String);
+ method public void setUrl(String);
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.location.Address> CREATOR;
+ }
+
+ @Deprecated public class Criteria implements android.os.Parcelable {
+ ctor @Deprecated public Criteria();
+ ctor @Deprecated public Criteria(android.location.Criteria);
+ method @Deprecated public int describeContents();
+ method @Deprecated public int getAccuracy();
+ method @Deprecated public int getBearingAccuracy();
+ method @Deprecated public int getHorizontalAccuracy();
+ method @Deprecated public int getPowerRequirement();
+ method @Deprecated public int getSpeedAccuracy();
+ method @Deprecated public int getVerticalAccuracy();
+ method @Deprecated public boolean isAltitudeRequired();
+ method @Deprecated public boolean isBearingRequired();
+ method @Deprecated public boolean isCostAllowed();
+ method @Deprecated public boolean isSpeedRequired();
+ method @Deprecated public void setAccuracy(int);
+ method @Deprecated public void setAltitudeRequired(boolean);
+ method @Deprecated public void setBearingAccuracy(int);
+ method @Deprecated public void setBearingRequired(boolean);
+ method @Deprecated public void setCostAllowed(boolean);
+ method @Deprecated public void setHorizontalAccuracy(int);
+ method @Deprecated public void setPowerRequirement(int);
+ method @Deprecated public void setSpeedAccuracy(int);
+ method @Deprecated public void setSpeedRequired(boolean);
+ method @Deprecated public void setVerticalAccuracy(int);
+ method @Deprecated public void writeToParcel(android.os.Parcel, int);
+ field @Deprecated public static final int ACCURACY_COARSE = 2; // 0x2
+ field @Deprecated public static final int ACCURACY_FINE = 1; // 0x1
+ field @Deprecated public static final int ACCURACY_HIGH = 3; // 0x3
+ field @Deprecated public static final int ACCURACY_LOW = 1; // 0x1
+ field @Deprecated public static final int ACCURACY_MEDIUM = 2; // 0x2
+ field @Deprecated @NonNull public static final android.os.Parcelable.Creator<android.location.Criteria> CREATOR;
+ field @Deprecated public static final int NO_REQUIREMENT = 0; // 0x0
+ field @Deprecated public static final int POWER_HIGH = 3; // 0x3
+ field @Deprecated public static final int POWER_LOW = 1; // 0x1
+ field @Deprecated public static final int POWER_MEDIUM = 2; // 0x2
+ }
+
+ public final class Geocoder {
+ ctor public Geocoder(@NonNull android.content.Context);
+ ctor public Geocoder(@NonNull android.content.Context, @NonNull java.util.Locale);
+ method @Deprecated @Nullable public java.util.List<android.location.Address> getFromLocation(@FloatRange(from=-90.0, to=90.0) double, @FloatRange(from=-180.0, to=180.0) double, @IntRange int) throws java.io.IOException;
+ method public void getFromLocation(@FloatRange(from=-90.0, to=90.0) double, @FloatRange(from=-180.0, to=180.0) double, @IntRange int, @NonNull android.location.Geocoder.GeocodeListener);
+ method @Deprecated @Nullable public java.util.List<android.location.Address> getFromLocationName(@NonNull String, @IntRange int) throws java.io.IOException;
+ method public void getFromLocationName(@NonNull String, @IntRange int, @NonNull android.location.Geocoder.GeocodeListener);
+ method @Deprecated @Nullable public java.util.List<android.location.Address> getFromLocationName(@NonNull String, @IntRange int, @FloatRange(from=-90.0, to=90.0) double, @FloatRange(from=-180.0, to=180.0) double, @FloatRange(from=-90.0, to=90.0) double, @FloatRange(from=-180.0, to=180.0) double) throws java.io.IOException;
+ method public void getFromLocationName(@NonNull String, @IntRange int, @FloatRange(from=-90.0, to=90.0) double, @FloatRange(from=-180.0, to=180.0) double, @FloatRange(from=-90.0, to=90.0) double, @FloatRange(from=-180.0, to=180.0) double, @NonNull android.location.Geocoder.GeocodeListener);
+ method public static boolean isPresent();
+ }
+
+ public static interface Geocoder.GeocodeListener {
+ method public default void onError(@Nullable String);
+ method public void onGeocode(@NonNull java.util.List<android.location.Address>);
+ }
+
+ public final class GnssAntennaInfo implements android.os.Parcelable {
+ method public int describeContents();
+ method @FloatRange(from=0.0f) public double getCarrierFrequencyMHz();
+ method @NonNull public android.location.GnssAntennaInfo.PhaseCenterOffset getPhaseCenterOffset();
+ method @Nullable public android.location.GnssAntennaInfo.SphericalCorrections getPhaseCenterVariationCorrections();
+ method @Nullable public android.location.GnssAntennaInfo.SphericalCorrections getSignalGainCorrections();
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.location.GnssAntennaInfo> CREATOR;
+ }
+
+ public static class GnssAntennaInfo.Builder {
+ ctor @Deprecated public GnssAntennaInfo.Builder();
+ ctor public GnssAntennaInfo.Builder(double, @NonNull android.location.GnssAntennaInfo.PhaseCenterOffset);
+ ctor public GnssAntennaInfo.Builder(@NonNull android.location.GnssAntennaInfo);
+ method @NonNull public android.location.GnssAntennaInfo build();
+ method @NonNull public android.location.GnssAntennaInfo.Builder setCarrierFrequencyMHz(@FloatRange(from=0.0f) double);
+ method @NonNull public android.location.GnssAntennaInfo.Builder setPhaseCenterOffset(@NonNull android.location.GnssAntennaInfo.PhaseCenterOffset);
+ method @NonNull public android.location.GnssAntennaInfo.Builder setPhaseCenterVariationCorrections(@Nullable android.location.GnssAntennaInfo.SphericalCorrections);
+ method @NonNull public android.location.GnssAntennaInfo.Builder setSignalGainCorrections(@Nullable android.location.GnssAntennaInfo.SphericalCorrections);
+ }
+
+ public static interface GnssAntennaInfo.Listener {
+ method public void onGnssAntennaInfoReceived(@NonNull java.util.List<android.location.GnssAntennaInfo>);
+ }
+
+ public static final class GnssAntennaInfo.PhaseCenterOffset implements android.os.Parcelable {
+ ctor public GnssAntennaInfo.PhaseCenterOffset(double, double, double, double, double, double);
+ method public int describeContents();
+ method @FloatRange public double getXOffsetMm();
+ method @FloatRange public double getXOffsetUncertaintyMm();
+ method @FloatRange public double getYOffsetMm();
+ method @FloatRange public double getYOffsetUncertaintyMm();
+ method @FloatRange public double getZOffsetMm();
+ method @FloatRange public double getZOffsetUncertaintyMm();
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.location.GnssAntennaInfo.PhaseCenterOffset> CREATOR;
+ }
+
+ public static final class GnssAntennaInfo.SphericalCorrections implements android.os.Parcelable {
+ ctor public GnssAntennaInfo.SphericalCorrections(@NonNull double[][], @NonNull double[][]);
+ method public int describeContents();
+ method @NonNull public double[][] getCorrectionUncertaintiesArray();
+ method @NonNull public double[][] getCorrectionsArray();
+ method @FloatRange(from=0.0f, to=180.0f) public double getDeltaPhi();
+ method @FloatRange(from=0.0f, to=360.0f) public double getDeltaTheta();
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.location.GnssAntennaInfo.SphericalCorrections> CREATOR;
+ }
+
+ public final class GnssAutomaticGainControl implements android.os.Parcelable {
+ method public int describeContents();
+ method @IntRange(from=0) public long getCarrierFrequencyHz();
+ method public int getConstellationType();
+ method @FloatRange(from=0xffffd8f0, to=10000) public double getLevelDb();
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.location.GnssAutomaticGainControl> CREATOR;
+ }
+
+ public static final class GnssAutomaticGainControl.Builder {
+ ctor public GnssAutomaticGainControl.Builder();
+ ctor public GnssAutomaticGainControl.Builder(@NonNull android.location.GnssAutomaticGainControl);
+ method @NonNull public android.location.GnssAutomaticGainControl build();
+ method @NonNull public android.location.GnssAutomaticGainControl.Builder setCarrierFrequencyHz(@IntRange(from=0) long);
+ method @NonNull public android.location.GnssAutomaticGainControl.Builder setConstellationType(int);
+ method @NonNull public android.location.GnssAutomaticGainControl.Builder setLevelDb(@FloatRange(from=0xffffd8f0, to=10000) double);
+ }
+
+ public final class GnssCapabilities implements android.os.Parcelable {
+ method public int describeContents();
+ method @NonNull public java.util.List<android.location.GnssSignalType> getGnssSignalTypes();
+ method public int hasAccumulatedDeltaRange();
+ method public boolean hasAntennaInfo();
+ method public boolean hasGeofencing();
+ method @Deprecated public boolean hasGnssAntennaInfo();
+ method public boolean hasLowPowerMode();
+ method public boolean hasMeasurementCorrections();
+ method public boolean hasMeasurementCorrectionsExcessPathLength();
+ method public boolean hasMeasurementCorrectionsForDriving();
+ method public boolean hasMeasurementCorrectionsLosSats();
+ method public boolean hasMeasurementCorrectionsReflectingPlane();
+ method public boolean hasMeasurementCorrelationVectors();
+ method public boolean hasMeasurements();
+ method public boolean hasMsa();
+ method public boolean hasMsb();
+ method public boolean hasNavigationMessages();
+ method public boolean hasOnDemandTime();
+ method public boolean hasPowerMultibandAcquisition();
+ method public boolean hasPowerMultibandTracking();
+ method public boolean hasPowerOtherModes();
+ method public boolean hasPowerSinglebandAcquisition();
+ method public boolean hasPowerSinglebandTracking();
+ method public boolean hasPowerTotal();
+ method public boolean hasSatelliteBlocklist();
+ method public boolean hasSatellitePvt();
+ method public boolean hasScheduling();
+ method public boolean hasSingleShotFix();
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field public static final int CAPABILITY_SUPPORTED = 1; // 0x1
+ field public static final int CAPABILITY_UNKNOWN = 0; // 0x0
+ field public static final int CAPABILITY_UNSUPPORTED = 2; // 0x2
+ field @NonNull public static final android.os.Parcelable.Creator<android.location.GnssCapabilities> CREATOR;
+ }
+
+ public static final class GnssCapabilities.Builder {
+ ctor public GnssCapabilities.Builder();
+ ctor public GnssCapabilities.Builder(@NonNull android.location.GnssCapabilities);
+ method @NonNull public android.location.GnssCapabilities build();
+ method @NonNull public android.location.GnssCapabilities.Builder setGnssSignalTypes(@NonNull java.util.List<android.location.GnssSignalType>);
+ method @NonNull public android.location.GnssCapabilities.Builder setHasAccumulatedDeltaRange(int);
+ method @NonNull public android.location.GnssCapabilities.Builder setHasAntennaInfo(boolean);
+ method @NonNull public android.location.GnssCapabilities.Builder setHasGeofencing(boolean);
+ method @NonNull public android.location.GnssCapabilities.Builder setHasLowPowerMode(boolean);
+ method @NonNull public android.location.GnssCapabilities.Builder setHasMeasurementCorrections(boolean);
+ method @NonNull public android.location.GnssCapabilities.Builder setHasMeasurementCorrectionsExcessPathLength(boolean);
+ method @NonNull public android.location.GnssCapabilities.Builder setHasMeasurementCorrectionsForDriving(boolean);
+ method @NonNull public android.location.GnssCapabilities.Builder setHasMeasurementCorrectionsLosSats(boolean);
+ method @NonNull public android.location.GnssCapabilities.Builder setHasMeasurementCorrectionsReflectingPlane(boolean);
+ method @NonNull public android.location.GnssCapabilities.Builder setHasMeasurementCorrelationVectors(boolean);
+ method @NonNull public android.location.GnssCapabilities.Builder setHasMeasurements(boolean);
+ method @NonNull public android.location.GnssCapabilities.Builder setHasMsa(boolean);
+ method @NonNull public android.location.GnssCapabilities.Builder setHasMsb(boolean);
+ method @NonNull public android.location.GnssCapabilities.Builder setHasNavigationMessages(boolean);
+ method @NonNull public android.location.GnssCapabilities.Builder setHasOnDemandTime(boolean);
+ method @NonNull public android.location.GnssCapabilities.Builder setHasPowerMultibandAcquisition(boolean);
+ method @NonNull public android.location.GnssCapabilities.Builder setHasPowerMultibandTracking(boolean);
+ method @NonNull public android.location.GnssCapabilities.Builder setHasPowerOtherModes(boolean);
+ method @NonNull public android.location.GnssCapabilities.Builder setHasPowerSinglebandAcquisition(boolean);
+ method @NonNull public android.location.GnssCapabilities.Builder setHasPowerSinglebandTracking(boolean);
+ method @NonNull public android.location.GnssCapabilities.Builder setHasPowerTotal(boolean);
+ method @NonNull public android.location.GnssCapabilities.Builder setHasSatelliteBlocklist(boolean);
+ method @NonNull public android.location.GnssCapabilities.Builder setHasSatellitePvt(boolean);
+ method @NonNull public android.location.GnssCapabilities.Builder setHasScheduling(boolean);
+ method @NonNull public android.location.GnssCapabilities.Builder setHasSingleShotFix(boolean);
+ }
+
+ public final class GnssClock implements android.os.Parcelable {
+ method public int describeContents();
+ method public double getBiasNanos();
+ method @FloatRange(from=0.0f) public double getBiasUncertaintyNanos();
+ method public double getDriftNanosPerSecond();
+ method @FloatRange(from=0.0f) public double getDriftUncertaintyNanosPerSecond();
+ method public long getElapsedRealtimeNanos();
+ method @FloatRange(from=0.0f) public double getElapsedRealtimeUncertaintyNanos();
+ method public long getFullBiasNanos();
+ method public int getHardwareClockDiscontinuityCount();
+ method public int getLeapSecond();
+ method @FloatRange(from=0.0) public double getReferenceCarrierFrequencyHzForIsb();
+ method @NonNull public String getReferenceCodeTypeForIsb();
+ method public int getReferenceConstellationTypeForIsb();
+ method public long getTimeNanos();
+ method @FloatRange(from=0.0f) public double getTimeUncertaintyNanos();
+ method public boolean hasBiasNanos();
+ method public boolean hasBiasUncertaintyNanos();
+ method public boolean hasDriftNanosPerSecond();
+ method public boolean hasDriftUncertaintyNanosPerSecond();
+ method public boolean hasElapsedRealtimeNanos();
+ method public boolean hasElapsedRealtimeUncertaintyNanos();
+ method public boolean hasFullBiasNanos();
+ method public boolean hasLeapSecond();
+ method public boolean hasReferenceCarrierFrequencyHzForIsb();
+ method public boolean hasReferenceCodeTypeForIsb();
+ method public boolean hasReferenceConstellationTypeForIsb();
+ method public boolean hasTimeUncertaintyNanos();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.location.GnssClock> CREATOR;
+ }
+
+ public final class GnssMeasurement implements android.os.Parcelable {
+ method public int describeContents();
+ method public double getAccumulatedDeltaRangeMeters();
+ method public int getAccumulatedDeltaRangeState();
+ method public double getAccumulatedDeltaRangeUncertaintyMeters();
+ method @Deprecated public double getAutomaticGainControlLevelDb();
+ method @FloatRange(from=0, to=63) public double getBasebandCn0DbHz();
+ method @Deprecated public long getCarrierCycles();
+ method public float getCarrierFrequencyHz();
+ method @Deprecated public double getCarrierPhase();
+ method @Deprecated public double getCarrierPhaseUncertainty();
+ method @FloatRange(from=0, to=63) public double getCn0DbHz();
+ method @NonNull public String getCodeType();
+ method public int getConstellationType();
+ method public double getFullInterSignalBiasNanos();
+ method @FloatRange(from=0.0) public double getFullInterSignalBiasUncertaintyNanos();
+ method public int getMultipathIndicator();
+ method public double getPseudorangeRateMetersPerSecond();
+ method public double getPseudorangeRateUncertaintyMetersPerSecond();
+ method public long getReceivedSvTimeNanos();
+ method public long getReceivedSvTimeUncertaintyNanos();
+ method public double getSatelliteInterSignalBiasNanos();
+ method @FloatRange(from=0.0) public double getSatelliteInterSignalBiasUncertaintyNanos();
+ method public double getSnrInDb();
+ method public int getState();
+ method public int getSvid();
+ method public double getTimeOffsetNanos();
+ method @Deprecated public boolean hasAutomaticGainControlLevelDb();
+ method public boolean hasBasebandCn0DbHz();
+ method @Deprecated public boolean hasCarrierCycles();
+ method public boolean hasCarrierFrequencyHz();
+ method @Deprecated public boolean hasCarrierPhase();
+ method @Deprecated public boolean hasCarrierPhaseUncertainty();
+ method public boolean hasCodeType();
+ method public boolean hasFullInterSignalBiasNanos();
+ method public boolean hasFullInterSignalBiasUncertaintyNanos();
+ method public boolean hasSatelliteInterSignalBiasNanos();
+ method public boolean hasSatelliteInterSignalBiasUncertaintyNanos();
+ method public boolean hasSnrInDb();
+ method public void writeToParcel(android.os.Parcel, int);
+ field public static final int ADR_STATE_CYCLE_SLIP = 4; // 0x4
+ field public static final int ADR_STATE_HALF_CYCLE_REPORTED = 16; // 0x10
+ field public static final int ADR_STATE_HALF_CYCLE_RESOLVED = 8; // 0x8
+ field public static final int ADR_STATE_RESET = 2; // 0x2
+ field public static final int ADR_STATE_UNKNOWN = 0; // 0x0
+ field public static final int ADR_STATE_VALID = 1; // 0x1
+ field @NonNull public static final android.os.Parcelable.Creator<android.location.GnssMeasurement> CREATOR;
+ field public static final int MULTIPATH_INDICATOR_DETECTED = 1; // 0x1
+ field public static final int MULTIPATH_INDICATOR_NOT_DETECTED = 2; // 0x2
+ field public static final int MULTIPATH_INDICATOR_UNKNOWN = 0; // 0x0
+ field public static final int STATE_2ND_CODE_LOCK = 65536; // 0x10000
+ field public static final int STATE_BDS_D2_BIT_SYNC = 256; // 0x100
+ field public static final int STATE_BDS_D2_SUBFRAME_SYNC = 512; // 0x200
+ field public static final int STATE_BIT_SYNC = 2; // 0x2
+ field public static final int STATE_CODE_LOCK = 1; // 0x1
+ field public static final int STATE_GAL_E1BC_CODE_LOCK = 1024; // 0x400
+ field public static final int STATE_GAL_E1B_PAGE_SYNC = 4096; // 0x1000
+ field public static final int STATE_GAL_E1C_2ND_CODE_LOCK = 2048; // 0x800
+ field public static final int STATE_GLO_STRING_SYNC = 64; // 0x40
+ field public static final int STATE_GLO_TOD_DECODED = 128; // 0x80
+ field public static final int STATE_GLO_TOD_KNOWN = 32768; // 0x8000
+ field public static final int STATE_MSEC_AMBIGUOUS = 16; // 0x10
+ field public static final int STATE_SBAS_SYNC = 8192; // 0x2000
+ field public static final int STATE_SUBFRAME_SYNC = 4; // 0x4
+ field public static final int STATE_SYMBOL_SYNC = 32; // 0x20
+ field public static final int STATE_TOW_DECODED = 8; // 0x8
+ field public static final int STATE_TOW_KNOWN = 16384; // 0x4000
+ field public static final int STATE_UNKNOWN = 0; // 0x0
+ }
+
+ public final class GnssMeasurementRequest implements android.os.Parcelable {
+ method public int describeContents();
+ method @IntRange(from=0) public int getIntervalMillis();
+ method public boolean isFullTracking();
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.location.GnssMeasurementRequest> CREATOR;
+ field public static final int PASSIVE_INTERVAL = 2147483647; // 0x7fffffff
+ }
+
+ public static final class GnssMeasurementRequest.Builder {
+ ctor public GnssMeasurementRequest.Builder();
+ ctor public GnssMeasurementRequest.Builder(@NonNull android.location.GnssMeasurementRequest);
+ method @NonNull public android.location.GnssMeasurementRequest build();
+ method @NonNull public android.location.GnssMeasurementRequest.Builder setFullTracking(boolean);
+ method @NonNull public android.location.GnssMeasurementRequest.Builder setIntervalMillis(@IntRange(from=0) int);
+ }
+
+ public final class GnssMeasurementsEvent implements android.os.Parcelable {
+ method public int describeContents();
+ method @NonNull public android.location.GnssClock getClock();
+ method @NonNull public java.util.Collection<android.location.GnssAutomaticGainControl> getGnssAutomaticGainControls();
+ method @NonNull public java.util.Collection<android.location.GnssMeasurement> getMeasurements();
+ method public boolean hasIsFullTracking();
+ method public boolean isFullTracking();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.location.GnssMeasurementsEvent> CREATOR;
+ }
+
+ public static final class GnssMeasurementsEvent.Builder {
+ ctor public GnssMeasurementsEvent.Builder();
+ ctor public GnssMeasurementsEvent.Builder(@NonNull android.location.GnssMeasurementsEvent);
+ method @NonNull public android.location.GnssMeasurementsEvent build();
+ method @NonNull public android.location.GnssMeasurementsEvent.Builder clearIsFullTracking();
+ method @NonNull public android.location.GnssMeasurementsEvent.Builder setClock(@NonNull android.location.GnssClock);
+ method @NonNull public android.location.GnssMeasurementsEvent.Builder setGnssAutomaticGainControls(@NonNull java.util.Collection<android.location.GnssAutomaticGainControl>);
+ method @NonNull public android.location.GnssMeasurementsEvent.Builder setIsFullTracking(boolean);
+ method @NonNull public android.location.GnssMeasurementsEvent.Builder setMeasurements(@NonNull java.util.Collection<android.location.GnssMeasurement>);
+ }
+
+ public abstract static class GnssMeasurementsEvent.Callback {
+ ctor public GnssMeasurementsEvent.Callback();
+ method public void onGnssMeasurementsReceived(android.location.GnssMeasurementsEvent);
+ method @Deprecated public void onStatusChanged(int);
+ field @Deprecated public static final int STATUS_LOCATION_DISABLED = 2; // 0x2
+ field @Deprecated public static final int STATUS_NOT_ALLOWED = 3; // 0x3
+ field @Deprecated public static final int STATUS_NOT_SUPPORTED = 0; // 0x0
+ field @Deprecated public static final int STATUS_READY = 1; // 0x1
+ }
+
+ public final class GnssNavigationMessage implements android.os.Parcelable {
+ method public int describeContents();
+ method @NonNull public byte[] getData();
+ method @IntRange(from=0xffffffff, to=120) public int getMessageId();
+ method public int getStatus();
+ method @IntRange(from=1) public int getSubmessageId();
+ method @IntRange(from=1, to=200) public int getSvid();
+ method public int getType();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.location.GnssNavigationMessage> CREATOR;
+ field public static final int STATUS_PARITY_PASSED = 1; // 0x1
+ field public static final int STATUS_PARITY_REBUILT = 2; // 0x2
+ field public static final int STATUS_UNKNOWN = 0; // 0x0
+ field public static final int TYPE_BDS_CNAV1 = 1283; // 0x503
+ field public static final int TYPE_BDS_CNAV2 = 1284; // 0x504
+ field public static final int TYPE_BDS_D1 = 1281; // 0x501
+ field public static final int TYPE_BDS_D2 = 1282; // 0x502
+ field public static final int TYPE_GAL_F = 1538; // 0x602
+ field public static final int TYPE_GAL_I = 1537; // 0x601
+ field public static final int TYPE_GLO_L1CA = 769; // 0x301
+ field public static final int TYPE_GPS_CNAV2 = 260; // 0x104
+ field public static final int TYPE_GPS_L1CA = 257; // 0x101
+ field public static final int TYPE_GPS_L2CNAV = 258; // 0x102
+ field public static final int TYPE_GPS_L5CNAV = 259; // 0x103
+ field public static final int TYPE_IRN_L5CA = 1793; // 0x701
+ field public static final int TYPE_QZS_L1CA = 1025; // 0x401
+ field public static final int TYPE_SBS = 513; // 0x201
+ field public static final int TYPE_UNKNOWN = 0; // 0x0
+ }
+
+ public abstract static class GnssNavigationMessage.Callback {
+ ctor public GnssNavigationMessage.Callback();
+ method public void onGnssNavigationMessageReceived(android.location.GnssNavigationMessage);
+ method @Deprecated public void onStatusChanged(int);
+ field @Deprecated public static final int STATUS_LOCATION_DISABLED = 2; // 0x2
+ field @Deprecated public static final int STATUS_NOT_SUPPORTED = 0; // 0x0
+ field @Deprecated public static final int STATUS_READY = 1; // 0x1
+ }
+
+ public final class GnssSignalType implements android.os.Parcelable {
+ method @NonNull public static android.location.GnssSignalType create(int, @FloatRange(from=0.0f, fromInclusive=false) double, @NonNull String);
+ method public int describeContents();
+ method @FloatRange(from=0.0f, fromInclusive=false) public double getCarrierFrequencyHz();
+ method @NonNull public String getCodeType();
+ method public int getConstellationType();
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.location.GnssSignalType> CREATOR;
+ }
+
+ public final class GnssStatus implements android.os.Parcelable {
+ method public int describeContents();
+ method @FloatRange(from=0, to=360) public float getAzimuthDegrees(@IntRange(from=0) int);
+ method @FloatRange(from=0, to=63) public float getBasebandCn0DbHz(@IntRange(from=0) int);
+ method @FloatRange(from=0) public float getCarrierFrequencyHz(@IntRange(from=0) int);
+ method @FloatRange(from=0, to=63) public float getCn0DbHz(@IntRange(from=0) int);
+ method public int getConstellationType(@IntRange(from=0) int);
+ method @FloatRange(from=0xffffffa6, to=90) public float getElevationDegrees(@IntRange(from=0) int);
+ method @IntRange(from=0) public int getSatelliteCount();
+ method @IntRange(from=1, to=206) public int getSvid(@IntRange(from=0) int);
+ method public boolean hasAlmanacData(@IntRange(from=0) int);
+ method public boolean hasBasebandCn0DbHz(@IntRange(from=0) int);
+ method public boolean hasCarrierFrequencyHz(@IntRange(from=0) int);
+ method public boolean hasEphemerisData(@IntRange(from=0) int);
+ method public boolean usedInFix(@IntRange(from=0) int);
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field public static final int CONSTELLATION_BEIDOU = 5; // 0x5
+ field public static final int CONSTELLATION_GALILEO = 6; // 0x6
+ field public static final int CONSTELLATION_GLONASS = 3; // 0x3
+ field public static final int CONSTELLATION_GPS = 1; // 0x1
+ field public static final int CONSTELLATION_IRNSS = 7; // 0x7
+ field public static final int CONSTELLATION_QZSS = 4; // 0x4
+ field public static final int CONSTELLATION_SBAS = 2; // 0x2
+ field public static final int CONSTELLATION_UNKNOWN = 0; // 0x0
+ field @NonNull public static final android.os.Parcelable.Creator<android.location.GnssStatus> CREATOR;
+ }
+
+ public static final class GnssStatus.Builder {
+ ctor public GnssStatus.Builder();
+ method @NonNull public android.location.GnssStatus.Builder addSatellite(int, @IntRange(from=1, to=200) int, @FloatRange(from=0, to=63) float, @FloatRange(from=0xffffffa6, to=90) float, @FloatRange(from=0, to=360) float, boolean, boolean, boolean, boolean, @FloatRange(from=0) float, boolean, @FloatRange(from=0, to=63) float);
+ method @NonNull public android.location.GnssStatus build();
+ method @NonNull public android.location.GnssStatus.Builder clearSatellites();
+ }
+
+ public abstract static class GnssStatus.Callback {
+ ctor public GnssStatus.Callback();
+ method public void onFirstFix(int);
+ method public void onSatelliteStatusChanged(@NonNull android.location.GnssStatus);
+ method public void onStarted();
+ method public void onStopped();
+ }
+
+ @Deprecated public final class GpsSatellite {
+ method @Deprecated public float getAzimuth();
+ method @Deprecated public float getElevation();
+ method @Deprecated public int getPrn();
+ method @Deprecated public float getSnr();
+ method @Deprecated public boolean hasAlmanac();
+ method @Deprecated public boolean hasEphemeris();
+ method @Deprecated public boolean usedInFix();
+ }
+
+ @Deprecated public final class GpsStatus {
+ method @Deprecated @NonNull public static android.location.GpsStatus create(@NonNull android.location.GnssStatus, int);
+ method @Deprecated public int getMaxSatellites();
+ method @Deprecated public Iterable<android.location.GpsSatellite> getSatellites();
+ method @Deprecated public int getTimeToFirstFix();
+ field @Deprecated public static final int GPS_EVENT_FIRST_FIX = 3; // 0x3
+ field @Deprecated public static final int GPS_EVENT_SATELLITE_STATUS = 4; // 0x4
+ field @Deprecated public static final int GPS_EVENT_STARTED = 1; // 0x1
+ field @Deprecated public static final int GPS_EVENT_STOPPED = 2; // 0x2
+ }
+
+ @Deprecated public static interface GpsStatus.Listener {
+ method @Deprecated public void onGpsStatusChanged(int);
+ }
+
+ @Deprecated public static interface GpsStatus.NmeaListener {
+ method @Deprecated public void onNmeaReceived(long, String);
+ }
+
+ public interface LocationListener {
+ method public default void onFlushComplete(int);
+ method public void onLocationChanged(@NonNull android.location.Location);
+ method public default void onLocationChanged(@NonNull java.util.List<android.location.Location>);
+ method public default void onProviderDisabled(@NonNull String);
+ method public default void onProviderEnabled(@NonNull String);
+ method @Deprecated public default void onStatusChanged(String, int, android.os.Bundle);
+ }
+
+ public class LocationManager {
+ method @Deprecated @RequiresPermission(android.Manifest.permission.ACCESS_FINE_LOCATION) public boolean addGpsStatusListener(android.location.GpsStatus.Listener);
+ method @Deprecated @RequiresPermission(android.Manifest.permission.ACCESS_FINE_LOCATION) public boolean addNmeaListener(@NonNull android.location.GpsStatus.NmeaListener);
+ method @Deprecated @RequiresPermission(android.Manifest.permission.ACCESS_FINE_LOCATION) public boolean addNmeaListener(@NonNull android.location.OnNmeaMessageListener);
+ method @RequiresPermission(android.Manifest.permission.ACCESS_FINE_LOCATION) public boolean addNmeaListener(@NonNull android.location.OnNmeaMessageListener, @Nullable android.os.Handler);
+ method @RequiresPermission(android.Manifest.permission.ACCESS_FINE_LOCATION) public boolean addNmeaListener(@NonNull java.util.concurrent.Executor, @NonNull android.location.OnNmeaMessageListener);
+ method @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void addProximityAlert(double, double, float, long, @NonNull android.app.PendingIntent);
+ method public void addTestProvider(@NonNull String, boolean, boolean, boolean, boolean, boolean, boolean, boolean, int, int);
+ method public void addTestProvider(@NonNull String, @NonNull android.location.provider.ProviderProperties);
+ method public void addTestProvider(@NonNull String, @NonNull android.location.provider.ProviderProperties, @NonNull java.util.Set<java.lang.String>);
+ method @Deprecated public void clearTestProviderEnabled(@NonNull String);
+ method @Deprecated public void clearTestProviderLocation(@NonNull String);
+ method @Deprecated public void clearTestProviderStatus(@NonNull String);
+ method @NonNull public java.util.List<java.lang.String> getAllProviders();
+ method @Deprecated @Nullable public String getBestProvider(@NonNull android.location.Criteria, boolean);
+ method @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void getCurrentLocation(@NonNull String, @Nullable android.os.CancellationSignal, @NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer<android.location.Location>);
+ method @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void getCurrentLocation(@NonNull String, @NonNull android.location.LocationRequest, @Nullable android.os.CancellationSignal, @NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer<android.location.Location>);
+ method @Nullable public java.util.List<android.location.GnssAntennaInfo> getGnssAntennaInfos();
+ method @NonNull public android.location.GnssCapabilities getGnssCapabilities();
+ method @Nullable public String getGnssHardwareModelName();
+ method public int getGnssYearOfHardware();
+ method @Deprecated @Nullable @RequiresPermission(android.Manifest.permission.ACCESS_FINE_LOCATION) public android.location.GpsStatus getGpsStatus(@Nullable android.location.GpsStatus);
+ method @Nullable @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public android.location.Location getLastKnownLocation(@NonNull String);
+ method @Deprecated @Nullable public android.location.LocationProvider getProvider(@NonNull String);
+ method @Nullable public android.location.provider.ProviderProperties getProviderProperties(@NonNull String);
+ method @NonNull public java.util.List<java.lang.String> getProviders(boolean);
+ method @Deprecated @NonNull public java.util.List<java.lang.String> getProviders(@NonNull android.location.Criteria, boolean);
+ method public boolean hasProvider(@NonNull String);
+ method public boolean isLocationEnabled();
+ method public boolean isProviderEnabled(@NonNull String);
+ method public boolean registerAntennaInfoListener(@NonNull java.util.concurrent.Executor, @NonNull android.location.GnssAntennaInfo.Listener);
+ method @Deprecated @RequiresPermission(android.Manifest.permission.ACCESS_FINE_LOCATION) public boolean registerGnssMeasurementsCallback(@NonNull android.location.GnssMeasurementsEvent.Callback);
+ method @RequiresPermission(android.Manifest.permission.ACCESS_FINE_LOCATION) public boolean registerGnssMeasurementsCallback(@NonNull android.location.GnssMeasurementsEvent.Callback, @Nullable android.os.Handler);
+ method @RequiresPermission(android.Manifest.permission.ACCESS_FINE_LOCATION) public boolean registerGnssMeasurementsCallback(@NonNull java.util.concurrent.Executor, @NonNull android.location.GnssMeasurementsEvent.Callback);
+ method @RequiresPermission(android.Manifest.permission.ACCESS_FINE_LOCATION) public boolean registerGnssMeasurementsCallback(@NonNull android.location.GnssMeasurementRequest, @NonNull java.util.concurrent.Executor, @NonNull android.location.GnssMeasurementsEvent.Callback);
+ method @Deprecated public boolean registerGnssNavigationMessageCallback(@NonNull android.location.GnssNavigationMessage.Callback);
+ method @RequiresPermission(android.Manifest.permission.ACCESS_FINE_LOCATION) public boolean registerGnssNavigationMessageCallback(@NonNull android.location.GnssNavigationMessage.Callback, @Nullable android.os.Handler);
+ method @RequiresPermission(android.Manifest.permission.ACCESS_FINE_LOCATION) public boolean registerGnssNavigationMessageCallback(@NonNull java.util.concurrent.Executor, @NonNull android.location.GnssNavigationMessage.Callback);
+ method @Deprecated @RequiresPermission(android.Manifest.permission.ACCESS_FINE_LOCATION) public boolean registerGnssStatusCallback(@NonNull android.location.GnssStatus.Callback);
+ method @RequiresPermission(android.Manifest.permission.ACCESS_FINE_LOCATION) public boolean registerGnssStatusCallback(@NonNull android.location.GnssStatus.Callback, @Nullable android.os.Handler);
+ method @RequiresPermission(android.Manifest.permission.ACCESS_FINE_LOCATION) public boolean registerGnssStatusCallback(@NonNull java.util.concurrent.Executor, @NonNull android.location.GnssStatus.Callback);
+ method @Deprecated public void removeGpsStatusListener(android.location.GpsStatus.Listener);
+ method @Deprecated public void removeNmeaListener(@NonNull android.location.GpsStatus.NmeaListener);
+ method public void removeNmeaListener(@NonNull android.location.OnNmeaMessageListener);
+ method @RequiresPermission(anyOf={"android.permission.ACCESS_COARSE_LOCATION", "android.permission.ACCESS_FINE_LOCATION"}, apis="..22") public void removeProximityAlert(@NonNull android.app.PendingIntent);
+ method public void removeTestProvider(@NonNull String);
+ method @RequiresPermission(anyOf={"android.permission.ACCESS_COARSE_LOCATION", "android.permission.ACCESS_FINE_LOCATION"}, apis="..22") public void removeUpdates(@NonNull android.location.LocationListener);
+ method public void removeUpdates(@NonNull android.app.PendingIntent);
+ method public void requestFlush(@NonNull String, @NonNull android.location.LocationListener, int);
+ method public void requestFlush(@NonNull String, @NonNull android.app.PendingIntent, int);
+ method @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void requestLocationUpdates(@NonNull String, long, float, @NonNull android.location.LocationListener);
+ method @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void requestLocationUpdates(@NonNull String, long, float, @NonNull android.location.LocationListener, @Nullable android.os.Looper);
+ method @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void requestLocationUpdates(@NonNull String, long, float, @NonNull java.util.concurrent.Executor, @NonNull android.location.LocationListener);
+ method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void requestLocationUpdates(long, float, @NonNull android.location.Criteria, @NonNull android.location.LocationListener, @Nullable android.os.Looper);
+ method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void requestLocationUpdates(long, float, @NonNull android.location.Criteria, @NonNull java.util.concurrent.Executor, @NonNull android.location.LocationListener);
+ method @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void requestLocationUpdates(@NonNull String, long, float, @NonNull android.app.PendingIntent);
+ method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void requestLocationUpdates(long, float, @NonNull android.location.Criteria, @NonNull android.app.PendingIntent);
+ method @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void requestLocationUpdates(@NonNull String, @NonNull android.location.LocationRequest, @NonNull java.util.concurrent.Executor, @NonNull android.location.LocationListener);
+ method @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void requestLocationUpdates(@NonNull String, @NonNull android.location.LocationRequest, @NonNull android.app.PendingIntent);
+ method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void requestSingleUpdate(@NonNull String, @NonNull android.location.LocationListener, @Nullable android.os.Looper);
+ method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void requestSingleUpdate(@NonNull android.location.Criteria, @NonNull android.location.LocationListener, @Nullable android.os.Looper);
+ method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void requestSingleUpdate(@NonNull String, @NonNull android.app.PendingIntent);
+ method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void requestSingleUpdate(@NonNull android.location.Criteria, @NonNull android.app.PendingIntent);
+ method public boolean sendExtraCommand(@NonNull String, @NonNull String, @Nullable android.os.Bundle);
+ method public void setTestProviderEnabled(@NonNull String, boolean);
+ method public void setTestProviderLocation(@NonNull String, @NonNull android.location.Location);
+ method @Deprecated public void setTestProviderStatus(@NonNull String, int, @Nullable android.os.Bundle, long);
+ method public void unregisterAntennaInfoListener(@NonNull android.location.GnssAntennaInfo.Listener);
+ method public void unregisterGnssMeasurementsCallback(@NonNull android.location.GnssMeasurementsEvent.Callback);
+ method public void unregisterGnssNavigationMessageCallback(@NonNull android.location.GnssNavigationMessage.Callback);
+ method public void unregisterGnssStatusCallback(@NonNull android.location.GnssStatus.Callback);
+ field public static final String ACTION_GNSS_CAPABILITIES_CHANGED = "android.location.action.GNSS_CAPABILITIES_CHANGED";
+ field public static final String EXTRA_GNSS_CAPABILITIES = "android.location.extra.GNSS_CAPABILITIES";
+ field public static final String EXTRA_LOCATION_ENABLED = "android.location.extra.LOCATION_ENABLED";
+ field public static final String EXTRA_PROVIDER_ENABLED = "android.location.extra.PROVIDER_ENABLED";
+ field public static final String EXTRA_PROVIDER_NAME = "android.location.extra.PROVIDER_NAME";
+ field public static final String FUSED_PROVIDER = "fused";
+ field public static final String GPS_PROVIDER = "gps";
+ field public static final String KEY_FLUSH_COMPLETE = "flushComplete";
+ field public static final String KEY_LOCATIONS = "locations";
+ field public static final String KEY_LOCATION_CHANGED = "location";
+ field public static final String KEY_PROVIDER_ENABLED = "providerEnabled";
+ field public static final String KEY_PROXIMITY_ENTERING = "entering";
+ field @Deprecated public static final String KEY_STATUS_CHANGED = "status";
+ field public static final String MODE_CHANGED_ACTION = "android.location.MODE_CHANGED";
+ field public static final String NETWORK_PROVIDER = "network";
+ field public static final String PASSIVE_PROVIDER = "passive";
+ field public static final String PROVIDERS_CHANGED_ACTION = "android.location.PROVIDERS_CHANGED";
+ }
+
+ @Deprecated public class LocationProvider {
+ method @Deprecated public int getAccuracy();
+ method @Deprecated public String getName();
+ method @Deprecated public int getPowerRequirement();
+ method @Deprecated public boolean hasMonetaryCost();
+ method @Deprecated public boolean meetsCriteria(android.location.Criteria);
+ method @Deprecated public boolean requiresCell();
+ method @Deprecated public boolean requiresNetwork();
+ method @Deprecated public boolean requiresSatellite();
+ method @Deprecated public boolean supportsAltitude();
+ method @Deprecated public boolean supportsBearing();
+ method @Deprecated public boolean supportsSpeed();
+ field @Deprecated public static final int AVAILABLE = 2; // 0x2
+ field @Deprecated public static final int OUT_OF_SERVICE = 0; // 0x0
+ field @Deprecated public static final int TEMPORARILY_UNAVAILABLE = 1; // 0x1
+ }
+
+ public final class LocationRequest implements android.os.Parcelable {
+ method public int describeContents();
+ method @IntRange(from=1) public long getDurationMillis();
+ method @IntRange(from=0) public long getIntervalMillis();
+ method @IntRange(from=0) public long getMaxUpdateDelayMillis();
+ method @IntRange(from=1, to=java.lang.Integer.MAX_VALUE) public int getMaxUpdates();
+ method @FloatRange(from=0, to=java.lang.Float.MAX_VALUE) public float getMinUpdateDistanceMeters();
+ method @IntRange(from=0) public long getMinUpdateIntervalMillis();
+ method public int getQuality();
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.location.LocationRequest> CREATOR;
+ field public static final long PASSIVE_INTERVAL = 9223372036854775807L; // 0x7fffffffffffffffL
+ field public static final int QUALITY_BALANCED_POWER_ACCURACY = 102; // 0x66
+ field public static final int QUALITY_HIGH_ACCURACY = 100; // 0x64
+ field public static final int QUALITY_LOW_POWER = 104; // 0x68
+ }
+
+ public static final class LocationRequest.Builder {
+ ctor public LocationRequest.Builder(long);
+ ctor public LocationRequest.Builder(@NonNull android.location.LocationRequest);
+ method @NonNull public android.location.LocationRequest build();
+ method @NonNull public android.location.LocationRequest.Builder clearMinUpdateIntervalMillis();
+ method @NonNull public android.location.LocationRequest.Builder setDurationMillis(@IntRange(from=1) long);
+ method @NonNull public android.location.LocationRequest.Builder setIntervalMillis(@IntRange(from=0) long);
+ method @NonNull public android.location.LocationRequest.Builder setMaxUpdateDelayMillis(@IntRange(from=0) long);
+ method @NonNull public android.location.LocationRequest.Builder setMaxUpdates(@IntRange(from=1, to=java.lang.Integer.MAX_VALUE) int);
+ method @NonNull public android.location.LocationRequest.Builder setMinUpdateDistanceMeters(@FloatRange(from=0, to=java.lang.Float.MAX_VALUE) float);
+ method @NonNull public android.location.LocationRequest.Builder setMinUpdateIntervalMillis(@IntRange(from=0) long);
+ method @NonNull public android.location.LocationRequest.Builder setQuality(int);
+ }
+
+ public interface OnNmeaMessageListener {
+ method public void onNmeaMessage(String, long);
+ }
+
+ public abstract class SettingInjectorService extends android.app.Service {
+ ctor public SettingInjectorService(String);
+ method public final android.os.IBinder onBind(android.content.Intent);
+ method protected abstract boolean onGetEnabled();
+ method protected abstract String onGetSummary();
+ method public final void onStart(android.content.Intent, int);
+ method public final int onStartCommand(android.content.Intent, int, int);
+ method public static final void refreshSettings(@NonNull android.content.Context);
+ field public static final String ACTION_INJECTED_SETTING_CHANGED = "android.location.InjectedSettingChanged";
+ field public static final String ACTION_SERVICE_INTENT = "android.location.SettingInjectorService";
+ field public static final String ATTRIBUTES_NAME = "injected-location-setting";
+ field public static final String META_DATA_NAME = "android.location.SettingInjectorService";
+ }
+
+}
+
+package android.location.altitude {
+
+ public final class AltitudeConverter {
+ ctor public AltitudeConverter();
+ method @WorkerThread public void addMslAltitudeToLocation(@NonNull android.content.Context, @NonNull android.location.Location) throws java.io.IOException;
+ }
+
+}
+
+package android.location.provider {
+
+ public final class ProviderProperties implements android.os.Parcelable {
+ method public int describeContents();
+ method public int getAccuracy();
+ method public int getPowerUsage();
+ method public boolean hasAltitudeSupport();
+ method public boolean hasBearingSupport();
+ method public boolean hasCellRequirement();
+ method public boolean hasMonetaryCost();
+ method public boolean hasNetworkRequirement();
+ method public boolean hasSatelliteRequirement();
+ method public boolean hasSpeedSupport();
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field public static final int ACCURACY_COARSE = 2; // 0x2
+ field public static final int ACCURACY_FINE = 1; // 0x1
+ field @NonNull public static final android.os.Parcelable.Creator<android.location.provider.ProviderProperties> CREATOR;
+ field public static final int POWER_USAGE_HIGH = 3; // 0x3
+ field public static final int POWER_USAGE_LOW = 1; // 0x1
+ field public static final int POWER_USAGE_MEDIUM = 2; // 0x2
+ }
+
+ public static final class ProviderProperties.Builder {
+ ctor public ProviderProperties.Builder();
+ ctor public ProviderProperties.Builder(@NonNull android.location.provider.ProviderProperties);
+ method @NonNull public android.location.provider.ProviderProperties build();
+ method @NonNull public android.location.provider.ProviderProperties.Builder setAccuracy(int);
+ method @NonNull public android.location.provider.ProviderProperties.Builder setHasAltitudeSupport(boolean);
+ method @NonNull public android.location.provider.ProviderProperties.Builder setHasBearingSupport(boolean);
+ method @NonNull public android.location.provider.ProviderProperties.Builder setHasCellRequirement(boolean);
+ method @NonNull public android.location.provider.ProviderProperties.Builder setHasMonetaryCost(boolean);
+ method @NonNull public android.location.provider.ProviderProperties.Builder setHasNetworkRequirement(boolean);
+ method @NonNull public android.location.provider.ProviderProperties.Builder setHasSatelliteRequirement(boolean);
+ method @NonNull public android.location.provider.ProviderProperties.Builder setHasSpeedSupport(boolean);
+ method @NonNull public android.location.provider.ProviderProperties.Builder setPowerUsage(int);
+ }
+
+}
+
diff --git a/location/api/module-lib-current.txt b/location/api/module-lib-current.txt
index d802177e249b..8c14b864005d 100644
--- a/location/api/module-lib-current.txt
+++ b/location/api/module-lib-current.txt
@@ -1 +1,11 @@
// Signature format: 2.0
+package android.location {
+
+ public class LocationManager {
+ method @RequiresPermission(allOf={android.Manifest.permission.LOCATION_HARDWARE, android.Manifest.permission.ACCESS_FINE_LOCATION}) public boolean injectLocation(@NonNull android.location.Location);
+ method @RequiresPermission(android.Manifest.permission.CONTROL_AUTOMOTIVE_GNSS) public boolean isAutomotiveGnssSuspended();
+ method @RequiresPermission(android.Manifest.permission.CONTROL_AUTOMOTIVE_GNSS) public void setAutomotiveGnssSuspended(boolean);
+ }
+
+}
+
diff --git a/location/api/module-lib-lint-baseline.txt b/location/api/module-lib-lint-baseline.txt
new file mode 100644
index 000000000000..7cd6a86853a4
--- /dev/null
+++ b/location/api/module-lib-lint-baseline.txt
@@ -0,0 +1,13 @@
+// Baseline format: 1.0
+SamShouldBeLast: android.location.LocationManager#addNmeaListener(android.location.OnNmeaMessageListener, android.os.Handler):
+ SAM-compatible parameters (such as parameter 1, "listener", in android.location.LocationManager.addNmeaListener) should be last to improve Kotlin interoperability; see https://kotlinlang.org/docs/reference/java-interop.html#sam-conversions
+SamShouldBeLast: android.location.LocationManager#requestLocationUpdates(String, long, float, android.location.LocationListener, android.os.Looper):
+ SAM-compatible parameters (such as parameter 4, "listener", in android.location.LocationManager.requestLocationUpdates) should be last to improve Kotlin interoperability; see https://kotlinlang.org/docs/reference/java-interop.html#sam-conversions
+SamShouldBeLast: android.location.LocationManager#requestLocationUpdates(android.location.LocationRequest, android.location.LocationListener, android.os.Looper):
+ SAM-compatible parameters (such as parameter 2, "listener", in android.location.LocationManager.requestLocationUpdates) should be last to improve Kotlin interoperability; see https://kotlinlang.org/docs/reference/java-interop.html#sam-conversions
+SamShouldBeLast: android.location.LocationManager#requestLocationUpdates(long, float, android.location.Criteria, android.location.LocationListener, android.os.Looper):
+ SAM-compatible parameters (such as parameter 4, "listener", in android.location.LocationManager.requestLocationUpdates) should be last to improve Kotlin interoperability; see https://kotlinlang.org/docs/reference/java-interop.html#sam-conversions
+SamShouldBeLast: android.location.LocationManager#requestSingleUpdate(String, android.location.LocationListener, android.os.Looper):
+ SAM-compatible parameters (such as parameter 2, "listener", in android.location.LocationManager.requestSingleUpdate) should be last to improve Kotlin interoperability; see https://kotlinlang.org/docs/reference/java-interop.html#sam-conversions
+SamShouldBeLast: android.location.LocationManager#requestSingleUpdate(android.location.Criteria, android.location.LocationListener, android.os.Looper):
+ SAM-compatible parameters (such as parameter 2, "listener", in android.location.LocationManager.requestSingleUpdate) should be last to improve Kotlin interoperability; see https://kotlinlang.org/docs/reference/java-interop.html#sam-conversions
diff --git a/location/api/system-current.txt b/location/api/system-current.txt
index d802177e249b..a1d6ab5798e1 100644
--- a/location/api/system-current.txt
+++ b/location/api/system-current.txt
@@ -1 +1,646 @@
// Signature format: 2.0
+package android.location {
+
+ public abstract class BatchedLocationCallback {
+ ctor public BatchedLocationCallback();
+ method public void onLocationBatch(java.util.List<android.location.Location>);
+ }
+
+ public final class CorrelationVector implements android.os.Parcelable {
+ method public int describeContents();
+ method @FloatRange(from=0.0f) public double getFrequencyOffsetMetersPerSecond();
+ method @NonNull public int[] getMagnitude();
+ method @FloatRange(from=0.0f) public double getSamplingStartMeters();
+ method @FloatRange(from=0.0f, fromInclusive=false) public double getSamplingWidthMeters();
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.location.CorrelationVector> CREATOR;
+ }
+
+ public static final class CorrelationVector.Builder {
+ ctor public CorrelationVector.Builder();
+ method @NonNull public android.location.CorrelationVector build();
+ method @NonNull public android.location.CorrelationVector.Builder setFrequencyOffsetMetersPerSecond(@FloatRange(from=0.0f) double);
+ method @NonNull public android.location.CorrelationVector.Builder setMagnitude(@NonNull int[]);
+ method @NonNull public android.location.CorrelationVector.Builder setSamplingStartMeters(@FloatRange(from=0.0f) double);
+ method @NonNull public android.location.CorrelationVector.Builder setSamplingWidthMeters(@FloatRange(from=0.0f, fromInclusive=false) double);
+ }
+
+ public final class Country implements android.os.Parcelable {
+ ctor public Country(@NonNull String, int);
+ method public int describeContents();
+ method @NonNull public String getCountryCode();
+ method public int getSource();
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field public static final int COUNTRY_SOURCE_LOCALE = 3; // 0x3
+ field public static final int COUNTRY_SOURCE_LOCATION = 1; // 0x1
+ field public static final int COUNTRY_SOURCE_NETWORK = 0; // 0x0
+ field public static final int COUNTRY_SOURCE_SIM = 2; // 0x2
+ field @NonNull public static final android.os.Parcelable.Creator<android.location.Country> CREATOR;
+ }
+
+ public class CountryDetector {
+ method public void registerCountryDetectorCallback(@NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer<android.location.Country>);
+ method public void unregisterCountryDetectorCallback(@NonNull java.util.function.Consumer<android.location.Country>);
+ }
+
+ public final class GnssCapabilities implements android.os.Parcelable {
+ method @Deprecated public boolean hasMeasurementCorrectionsReflectingPane();
+ method @Deprecated public boolean hasNavMessages();
+ method @Deprecated public boolean hasSatelliteBlacklist();
+ }
+
+ public final class GnssExcessPathInfo implements android.os.Parcelable {
+ method public int describeContents();
+ method @FloatRange(from=0.0f) public float getAttenuationDb();
+ method @FloatRange(from=0.0f) public float getExcessPathLengthMeters();
+ method @FloatRange(from=0.0f) public float getExcessPathLengthUncertaintyMeters();
+ method @NonNull public android.location.GnssReflectingPlane getReflectingPlane();
+ method public boolean hasAttenuation();
+ method public boolean hasExcessPathLength();
+ method public boolean hasExcessPathLengthUncertainty();
+ method public boolean hasReflectingPlane();
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.location.GnssExcessPathInfo> CREATOR;
+ }
+
+ public static final class GnssExcessPathInfo.Builder {
+ ctor public GnssExcessPathInfo.Builder();
+ method @NonNull public android.location.GnssExcessPathInfo build();
+ method @NonNull public android.location.GnssExcessPathInfo.Builder clearAttenuationDb();
+ method @NonNull public android.location.GnssExcessPathInfo.Builder clearExcessPathLengthMeters();
+ method @NonNull public android.location.GnssExcessPathInfo.Builder clearExcessPathLengthUncertaintyMeters();
+ method @NonNull public android.location.GnssExcessPathInfo.Builder setAttenuationDb(@FloatRange(from=0.0f) float);
+ method @NonNull public android.location.GnssExcessPathInfo.Builder setExcessPathLengthMeters(@FloatRange(from=0.0f) float);
+ method @NonNull public android.location.GnssExcessPathInfo.Builder setExcessPathLengthUncertaintyMeters(@FloatRange(from=0.0f) float);
+ method @NonNull public android.location.GnssExcessPathInfo.Builder setReflectingPlane(@Nullable android.location.GnssReflectingPlane);
+ }
+
+ public final class GnssMeasurement implements android.os.Parcelable {
+ method @Nullable public java.util.Collection<android.location.CorrelationVector> getCorrelationVectors();
+ method @Nullable public android.location.SatellitePvt getSatellitePvt();
+ method public boolean hasCorrelationVectors();
+ method public boolean hasSatellitePvt();
+ }
+
+ public final class GnssMeasurementCorrections implements android.os.Parcelable {
+ method public int describeContents();
+ method @FloatRange(from=-1000.0F, to=10000.0f) public double getAltitudeMeters();
+ method @FloatRange(from=0.0f, to=360.0f) public float getEnvironmentBearingDegrees();
+ method @FloatRange(from=0.0f, to=180.0f) public float getEnvironmentBearingUncertaintyDegrees();
+ method @FloatRange(from=0.0f) public double getHorizontalPositionUncertaintyMeters();
+ method @FloatRange(from=-90.0F, to=90.0f) public double getLatitudeDegrees();
+ method @FloatRange(from=-180.0F, to=180.0f) public double getLongitudeDegrees();
+ method @NonNull public java.util.List<android.location.GnssSingleSatCorrection> getSingleSatelliteCorrectionList();
+ method @IntRange(from=0) public long getToaGpsNanosecondsOfWeek();
+ method @FloatRange(from=0.0f) public double getVerticalPositionUncertaintyMeters();
+ method public boolean hasEnvironmentBearing();
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field public static final android.os.Parcelable.Creator<android.location.GnssMeasurementCorrections> CREATOR;
+ }
+
+ public static final class GnssMeasurementCorrections.Builder {
+ ctor public GnssMeasurementCorrections.Builder();
+ method @NonNull public android.location.GnssMeasurementCorrections build();
+ method @NonNull public android.location.GnssMeasurementCorrections.Builder setAltitudeMeters(@FloatRange(from=-1000.0F, to=10000.0f) double);
+ method @NonNull public android.location.GnssMeasurementCorrections.Builder setEnvironmentBearingDegrees(@FloatRange(from=0.0f, to=360.0f) float);
+ method @NonNull public android.location.GnssMeasurementCorrections.Builder setEnvironmentBearingUncertaintyDegrees(@FloatRange(from=0.0f, to=180.0f) float);
+ method @NonNull public android.location.GnssMeasurementCorrections.Builder setHorizontalPositionUncertaintyMeters(@FloatRange(from=0.0f) double);
+ method @NonNull public android.location.GnssMeasurementCorrections.Builder setLatitudeDegrees(@FloatRange(from=-90.0F, to=90.0f) double);
+ method @NonNull public android.location.GnssMeasurementCorrections.Builder setLongitudeDegrees(@FloatRange(from=-180.0F, to=180.0f) double);
+ method @NonNull public android.location.GnssMeasurementCorrections.Builder setSingleSatelliteCorrectionList(@NonNull java.util.List<android.location.GnssSingleSatCorrection>);
+ method @NonNull public android.location.GnssMeasurementCorrections.Builder setToaGpsNanosecondsOfWeek(@IntRange(from=0) long);
+ method @NonNull public android.location.GnssMeasurementCorrections.Builder setVerticalPositionUncertaintyMeters(@FloatRange(from=0.0f) double);
+ }
+
+ public final class GnssMeasurementRequest implements android.os.Parcelable {
+ method @NonNull public android.os.WorkSource getWorkSource();
+ method public boolean isCorrelationVectorOutputsEnabled();
+ }
+
+ public static final class GnssMeasurementRequest.Builder {
+ method @NonNull public android.location.GnssMeasurementRequest.Builder setCorrelationVectorOutputsEnabled(boolean);
+ method @NonNull @RequiresPermission(android.Manifest.permission.UPDATE_DEVICE_STATS) public android.location.GnssMeasurementRequest.Builder setWorkSource(@Nullable android.os.WorkSource);
+ }
+
+ public final class GnssReflectingPlane implements android.os.Parcelable {
+ method public int describeContents();
+ method @FloatRange(from=-1000.0F, to=10000.0f) public double getAltitudeMeters();
+ method @FloatRange(from=0.0f, to=360.0f) public double getAzimuthDegrees();
+ method @FloatRange(from=-90.0F, to=90.0f) public double getLatitudeDegrees();
+ method @FloatRange(from=-180.0F, to=180.0f) public double getLongitudeDegrees();
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field public static final android.os.Parcelable.Creator<android.location.GnssReflectingPlane> CREATOR;
+ }
+
+ public static final class GnssReflectingPlane.Builder {
+ ctor public GnssReflectingPlane.Builder();
+ method @NonNull public android.location.GnssReflectingPlane build();
+ method @NonNull public android.location.GnssReflectingPlane.Builder setAltitudeMeters(@FloatRange(from=-1000.0F, to=10000.0f) double);
+ method @NonNull public android.location.GnssReflectingPlane.Builder setAzimuthDegrees(@FloatRange(from=0.0f, to=360.0f) double);
+ method @NonNull public android.location.GnssReflectingPlane.Builder setLatitudeDegrees(@FloatRange(from=-90.0F, to=90.0f) double);
+ method @NonNull public android.location.GnssReflectingPlane.Builder setLongitudeDegrees(@FloatRange(from=-180.0F, to=180.0f) double);
+ }
+
+ public final class GnssRequest implements android.os.Parcelable {
+ method public int describeContents();
+ method public boolean isFullTracking();
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.location.GnssRequest> CREATOR;
+ }
+
+ public static final class GnssRequest.Builder {
+ ctor public GnssRequest.Builder();
+ ctor public GnssRequest.Builder(@NonNull android.location.GnssRequest);
+ method @NonNull public android.location.GnssRequest build();
+ method @NonNull public android.location.GnssRequest.Builder setFullTracking(boolean);
+ }
+
+ public final class GnssSingleSatCorrection implements android.os.Parcelable {
+ method public int describeContents();
+ method @FloatRange(from=0.0f, fromInclusive=false) public float getCarrierFrequencyHz();
+ method @FloatRange(from=0.0f) public float getCombinedAttenuationDb();
+ method public int getConstellationType();
+ method @FloatRange(from=0.0f) public float getExcessPathLengthMeters();
+ method @FloatRange(from=0.0f) public float getExcessPathLengthUncertaintyMeters();
+ method @NonNull public java.util.List<android.location.GnssExcessPathInfo> getGnssExcessPathInfoList();
+ method @FloatRange(from=0.0f, to=1.0f) public float getProbabilityLineOfSight();
+ method @Deprecated @Nullable public android.location.GnssReflectingPlane getReflectingPlane();
+ method @IntRange(from=0) public int getSatelliteId();
+ method public boolean hasCombinedAttenuation();
+ method public boolean hasExcessPathLength();
+ method public boolean hasExcessPathLengthUncertainty();
+ method @Deprecated public boolean hasReflectingPlane();
+ method public boolean hasValidSatelliteLineOfSight();
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field public static final android.os.Parcelable.Creator<android.location.GnssSingleSatCorrection> CREATOR;
+ }
+
+ public static final class GnssSingleSatCorrection.Builder {
+ ctor public GnssSingleSatCorrection.Builder();
+ method @NonNull public android.location.GnssSingleSatCorrection build();
+ method @NonNull public android.location.GnssSingleSatCorrection.Builder clearCombinedAttenuationDb();
+ method @NonNull public android.location.GnssSingleSatCorrection.Builder clearExcessPathLengthMeters();
+ method @NonNull public android.location.GnssSingleSatCorrection.Builder clearExcessPathLengthUncertaintyMeters();
+ method @NonNull public android.location.GnssSingleSatCorrection.Builder clearProbabilityLineOfSight();
+ method @NonNull public android.location.GnssSingleSatCorrection.Builder setCarrierFrequencyHz(@FloatRange(from=0.0f, fromInclusive=false) float);
+ method @NonNull public android.location.GnssSingleSatCorrection.Builder setCombinedAttenuationDb(@FloatRange(from=0.0f) float);
+ method @NonNull public android.location.GnssSingleSatCorrection.Builder setConstellationType(int);
+ method @NonNull public android.location.GnssSingleSatCorrection.Builder setExcessPathLengthMeters(@FloatRange(from=0.0f) float);
+ method @NonNull public android.location.GnssSingleSatCorrection.Builder setExcessPathLengthUncertaintyMeters(@FloatRange(from=0.0f) float);
+ method @NonNull public android.location.GnssSingleSatCorrection.Builder setGnssExcessPathInfoList(@NonNull java.util.List<android.location.GnssExcessPathInfo>);
+ method @NonNull public android.location.GnssSingleSatCorrection.Builder setProbabilityLineOfSight(@FloatRange(from=0.0f, to=1.0f) float);
+ method @Deprecated @NonNull public android.location.GnssSingleSatCorrection.Builder setReflectingPlane(@Nullable android.location.GnssReflectingPlane);
+ method @NonNull public android.location.GnssSingleSatCorrection.Builder setSatelliteId(@IntRange(from=0) int);
+ }
+
+ @Deprecated public class GpsClock implements android.os.Parcelable {
+ method @Deprecated public int describeContents();
+ method @Deprecated public double getBiasInNs();
+ method @Deprecated public double getBiasUncertaintyInNs();
+ method @Deprecated public double getDriftInNsPerSec();
+ method @Deprecated public double getDriftUncertaintyInNsPerSec();
+ method @Deprecated public long getFullBiasInNs();
+ method @Deprecated public short getLeapSecond();
+ method @Deprecated public long getTimeInNs();
+ method @Deprecated public double getTimeUncertaintyInNs();
+ method @Deprecated public byte getType();
+ method @Deprecated public boolean hasBiasInNs();
+ method @Deprecated public boolean hasBiasUncertaintyInNs();
+ method @Deprecated public boolean hasDriftInNsPerSec();
+ method @Deprecated public boolean hasDriftUncertaintyInNsPerSec();
+ method @Deprecated public boolean hasFullBiasInNs();
+ method @Deprecated public boolean hasLeapSecond();
+ method @Deprecated public boolean hasTimeUncertaintyInNs();
+ method @Deprecated public void reset();
+ method @Deprecated public void resetBiasInNs();
+ method @Deprecated public void resetBiasUncertaintyInNs();
+ method @Deprecated public void resetDriftInNsPerSec();
+ method @Deprecated public void resetDriftUncertaintyInNsPerSec();
+ method @Deprecated public void resetFullBiasInNs();
+ method @Deprecated public void resetLeapSecond();
+ method @Deprecated public void resetTimeUncertaintyInNs();
+ method @Deprecated public void set(android.location.GpsClock);
+ method @Deprecated public void setBiasInNs(double);
+ method @Deprecated public void setBiasUncertaintyInNs(double);
+ method @Deprecated public void setDriftInNsPerSec(double);
+ method @Deprecated public void setDriftUncertaintyInNsPerSec(double);
+ method @Deprecated public void setFullBiasInNs(long);
+ method @Deprecated public void setLeapSecond(short);
+ method @Deprecated public void setTimeInNs(long);
+ method @Deprecated public void setTimeUncertaintyInNs(double);
+ method @Deprecated public void setType(byte);
+ method @Deprecated public void writeToParcel(android.os.Parcel, int);
+ field @Deprecated @NonNull public static final android.os.Parcelable.Creator<android.location.GpsClock> CREATOR;
+ field @Deprecated public static final byte TYPE_GPS_TIME = 2; // 0x2
+ field @Deprecated public static final byte TYPE_LOCAL_HW_TIME = 1; // 0x1
+ field @Deprecated public static final byte TYPE_UNKNOWN = 0; // 0x0
+ }
+
+ @Deprecated public class GpsMeasurement implements android.os.Parcelable {
+ method @Deprecated public int describeContents();
+ method @Deprecated public double getAccumulatedDeltaRangeInMeters();
+ method @Deprecated public short getAccumulatedDeltaRangeState();
+ method @Deprecated public double getAccumulatedDeltaRangeUncertaintyInMeters();
+ method @Deprecated public double getAzimuthInDeg();
+ method @Deprecated public double getAzimuthUncertaintyInDeg();
+ method @Deprecated public int getBitNumber();
+ method @Deprecated public long getCarrierCycles();
+ method @Deprecated public float getCarrierFrequencyInHz();
+ method @Deprecated public double getCarrierPhase();
+ method @Deprecated public double getCarrierPhaseUncertainty();
+ method @Deprecated public double getCn0InDbHz();
+ method @Deprecated public double getCodePhaseInChips();
+ method @Deprecated public double getCodePhaseUncertaintyInChips();
+ method @Deprecated public double getDopplerShiftInHz();
+ method @Deprecated public double getDopplerShiftUncertaintyInHz();
+ method @Deprecated public double getElevationInDeg();
+ method @Deprecated public double getElevationUncertaintyInDeg();
+ method @Deprecated public byte getLossOfLock();
+ method @Deprecated public byte getMultipathIndicator();
+ method @Deprecated public byte getPrn();
+ method @Deprecated public double getPseudorangeInMeters();
+ method @Deprecated public double getPseudorangeRateInMetersPerSec();
+ method @Deprecated public double getPseudorangeRateUncertaintyInMetersPerSec();
+ method @Deprecated public double getPseudorangeUncertaintyInMeters();
+ method @Deprecated public long getReceivedGpsTowInNs();
+ method @Deprecated public long getReceivedGpsTowUncertaintyInNs();
+ method @Deprecated public double getSnrInDb();
+ method @Deprecated public short getState();
+ method @Deprecated public short getTimeFromLastBitInMs();
+ method @Deprecated public double getTimeOffsetInNs();
+ method @Deprecated public boolean hasAzimuthInDeg();
+ method @Deprecated public boolean hasAzimuthUncertaintyInDeg();
+ method @Deprecated public boolean hasBitNumber();
+ method @Deprecated public boolean hasCarrierCycles();
+ method @Deprecated public boolean hasCarrierFrequencyInHz();
+ method @Deprecated public boolean hasCarrierPhase();
+ method @Deprecated public boolean hasCarrierPhaseUncertainty();
+ method @Deprecated public boolean hasCodePhaseInChips();
+ method @Deprecated public boolean hasCodePhaseUncertaintyInChips();
+ method @Deprecated public boolean hasDopplerShiftInHz();
+ method @Deprecated public boolean hasDopplerShiftUncertaintyInHz();
+ method @Deprecated public boolean hasElevationInDeg();
+ method @Deprecated public boolean hasElevationUncertaintyInDeg();
+ method @Deprecated public boolean hasPseudorangeInMeters();
+ method @Deprecated public boolean hasPseudorangeUncertaintyInMeters();
+ method @Deprecated public boolean hasSnrInDb();
+ method @Deprecated public boolean hasTimeFromLastBitInMs();
+ method @Deprecated public boolean isPseudorangeRateCorrected();
+ method @Deprecated public boolean isUsedInFix();
+ method @Deprecated public void reset();
+ method @Deprecated public void resetAzimuthInDeg();
+ method @Deprecated public void resetAzimuthUncertaintyInDeg();
+ method @Deprecated public void resetBitNumber();
+ method @Deprecated public void resetCarrierCycles();
+ method @Deprecated public void resetCarrierFrequencyInHz();
+ method @Deprecated public void resetCarrierPhase();
+ method @Deprecated public void resetCarrierPhaseUncertainty();
+ method @Deprecated public void resetCodePhaseInChips();
+ method @Deprecated public void resetCodePhaseUncertaintyInChips();
+ method @Deprecated public void resetDopplerShiftInHz();
+ method @Deprecated public void resetDopplerShiftUncertaintyInHz();
+ method @Deprecated public void resetElevationInDeg();
+ method @Deprecated public void resetElevationUncertaintyInDeg();
+ method @Deprecated public void resetPseudorangeInMeters();
+ method @Deprecated public void resetPseudorangeUncertaintyInMeters();
+ method @Deprecated public void resetSnrInDb();
+ method @Deprecated public void resetTimeFromLastBitInMs();
+ method @Deprecated public void set(android.location.GpsMeasurement);
+ method @Deprecated public void setAccumulatedDeltaRangeInMeters(double);
+ method @Deprecated public void setAccumulatedDeltaRangeState(short);
+ method @Deprecated public void setAccumulatedDeltaRangeUncertaintyInMeters(double);
+ method @Deprecated public void setAzimuthInDeg(double);
+ method @Deprecated public void setAzimuthUncertaintyInDeg(double);
+ method @Deprecated public void setBitNumber(int);
+ method @Deprecated public void setCarrierCycles(long);
+ method @Deprecated public void setCarrierFrequencyInHz(float);
+ method @Deprecated public void setCarrierPhase(double);
+ method @Deprecated public void setCarrierPhaseUncertainty(double);
+ method @Deprecated public void setCn0InDbHz(double);
+ method @Deprecated public void setCodePhaseInChips(double);
+ method @Deprecated public void setCodePhaseUncertaintyInChips(double);
+ method @Deprecated public void setDopplerShiftInHz(double);
+ method @Deprecated public void setDopplerShiftUncertaintyInHz(double);
+ method @Deprecated public void setElevationInDeg(double);
+ method @Deprecated public void setElevationUncertaintyInDeg(double);
+ method @Deprecated public void setLossOfLock(byte);
+ method @Deprecated public void setMultipathIndicator(byte);
+ method @Deprecated public void setPrn(byte);
+ method @Deprecated public void setPseudorangeInMeters(double);
+ method @Deprecated public void setPseudorangeRateInMetersPerSec(double);
+ method @Deprecated public void setPseudorangeRateUncertaintyInMetersPerSec(double);
+ method @Deprecated public void setPseudorangeUncertaintyInMeters(double);
+ method @Deprecated public void setReceivedGpsTowInNs(long);
+ method @Deprecated public void setReceivedGpsTowUncertaintyInNs(long);
+ method @Deprecated public void setSnrInDb(double);
+ method @Deprecated public void setState(short);
+ method @Deprecated public void setTimeFromLastBitInMs(short);
+ method @Deprecated public void setTimeOffsetInNs(double);
+ method @Deprecated public void setUsedInFix(boolean);
+ method @Deprecated public void writeToParcel(android.os.Parcel, int);
+ field @Deprecated public static final short ADR_STATE_CYCLE_SLIP = 4; // 0x4
+ field @Deprecated public static final short ADR_STATE_RESET = 2; // 0x2
+ field @Deprecated public static final short ADR_STATE_UNKNOWN = 0; // 0x0
+ field @Deprecated public static final short ADR_STATE_VALID = 1; // 0x1
+ field @Deprecated @NonNull public static final android.os.Parcelable.Creator<android.location.GpsMeasurement> CREATOR;
+ field @Deprecated public static final byte LOSS_OF_LOCK_CYCLE_SLIP = 2; // 0x2
+ field @Deprecated public static final byte LOSS_OF_LOCK_OK = 1; // 0x1
+ field @Deprecated public static final byte LOSS_OF_LOCK_UNKNOWN = 0; // 0x0
+ field @Deprecated public static final byte MULTIPATH_INDICATOR_DETECTED = 1; // 0x1
+ field @Deprecated public static final byte MULTIPATH_INDICATOR_NOT_USED = 2; // 0x2
+ field @Deprecated public static final byte MULTIPATH_INDICATOR_UNKNOWN = 0; // 0x0
+ field @Deprecated public static final short STATE_BIT_SYNC = 2; // 0x2
+ field @Deprecated public static final short STATE_CODE_LOCK = 1; // 0x1
+ field @Deprecated public static final short STATE_MSEC_AMBIGUOUS = 16; // 0x10
+ field @Deprecated public static final short STATE_SUBFRAME_SYNC = 4; // 0x4
+ field @Deprecated public static final short STATE_TOW_DECODED = 8; // 0x8
+ field @Deprecated public static final short STATE_UNKNOWN = 0; // 0x0
+ }
+
+ @Deprecated public class GpsMeasurementsEvent implements android.os.Parcelable {
+ ctor @Deprecated public GpsMeasurementsEvent(android.location.GpsClock, android.location.GpsMeasurement[]);
+ method @Deprecated public int describeContents();
+ method @Deprecated @NonNull public android.location.GpsClock getClock();
+ method @Deprecated @NonNull public java.util.Collection<android.location.GpsMeasurement> getMeasurements();
+ method @Deprecated public void writeToParcel(android.os.Parcel, int);
+ field @Deprecated @NonNull public static final android.os.Parcelable.Creator<android.location.GpsMeasurementsEvent> CREATOR;
+ field @Deprecated public static final int STATUS_GPS_LOCATION_DISABLED = 2; // 0x2
+ field @Deprecated public static final int STATUS_NOT_SUPPORTED = 0; // 0x0
+ field @Deprecated public static final int STATUS_READY = 1; // 0x1
+ }
+
+ @Deprecated public static interface GpsMeasurementsEvent.Listener {
+ method @Deprecated public void onGpsMeasurementsReceived(android.location.GpsMeasurementsEvent);
+ method @Deprecated public void onStatusChanged(int);
+ }
+
+ @Deprecated public class GpsNavigationMessage implements android.os.Parcelable {
+ method @Deprecated public int describeContents();
+ method @Deprecated @NonNull public byte[] getData();
+ method @Deprecated public short getMessageId();
+ method @Deprecated public byte getPrn();
+ method @Deprecated public short getStatus();
+ method @Deprecated public short getSubmessageId();
+ method @Deprecated public byte getType();
+ method @Deprecated public void reset();
+ method @Deprecated public void set(android.location.GpsNavigationMessage);
+ method @Deprecated public void setData(byte[]);
+ method @Deprecated public void setMessageId(short);
+ method @Deprecated public void setPrn(byte);
+ method @Deprecated public void setStatus(short);
+ method @Deprecated public void setSubmessageId(short);
+ method @Deprecated public void setType(byte);
+ method @Deprecated public void writeToParcel(android.os.Parcel, int);
+ field @Deprecated @NonNull public static final android.os.Parcelable.Creator<android.location.GpsNavigationMessage> CREATOR;
+ field @Deprecated public static final short STATUS_PARITY_PASSED = 1; // 0x1
+ field @Deprecated public static final short STATUS_PARITY_REBUILT = 2; // 0x2
+ field @Deprecated public static final short STATUS_UNKNOWN = 0; // 0x0
+ field @Deprecated public static final byte TYPE_CNAV2 = 4; // 0x4
+ field @Deprecated public static final byte TYPE_L1CA = 1; // 0x1
+ field @Deprecated public static final byte TYPE_L2CNAV = 2; // 0x2
+ field @Deprecated public static final byte TYPE_L5CNAV = 3; // 0x3
+ field @Deprecated public static final byte TYPE_UNKNOWN = 0; // 0x0
+ }
+
+ @Deprecated public class GpsNavigationMessageEvent implements android.os.Parcelable {
+ ctor @Deprecated public GpsNavigationMessageEvent(android.location.GpsNavigationMessage);
+ method @Deprecated public int describeContents();
+ method @Deprecated @NonNull public android.location.GpsNavigationMessage getNavigationMessage();
+ method @Deprecated public void writeToParcel(android.os.Parcel, int);
+ field @Deprecated @NonNull public static final android.os.Parcelable.Creator<android.location.GpsNavigationMessageEvent> CREATOR;
+ field @Deprecated public static int STATUS_GPS_LOCATION_DISABLED;
+ field @Deprecated public static int STATUS_NOT_SUPPORTED;
+ field @Deprecated public static int STATUS_READY;
+ }
+
+ @Deprecated public static interface GpsNavigationMessageEvent.Listener {
+ method @Deprecated public void onGpsNavigationMessageReceived(android.location.GpsNavigationMessageEvent);
+ method @Deprecated public void onStatusChanged(int);
+ }
+
+ public final class LastLocationRequest implements android.os.Parcelable {
+ method public int describeContents();
+ method public boolean isAdasGnssBypass();
+ method public boolean isHiddenFromAppOps();
+ method public boolean isLocationSettingsIgnored();
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.location.LastLocationRequest> CREATOR;
+ }
+
+ public static final class LastLocationRequest.Builder {
+ ctor public LastLocationRequest.Builder();
+ ctor public LastLocationRequest.Builder(@NonNull android.location.LastLocationRequest);
+ method @NonNull public android.location.LastLocationRequest build();
+ method @NonNull @RequiresPermission(android.Manifest.permission.LOCATION_BYPASS) public android.location.LastLocationRequest.Builder setAdasGnssBypass(boolean);
+ method @NonNull @RequiresPermission(android.Manifest.permission.UPDATE_APP_OPS_STATS) public android.location.LastLocationRequest.Builder setHiddenFromAppOps(boolean);
+ method @NonNull @RequiresPermission(android.Manifest.permission.LOCATION_BYPASS) public android.location.LastLocationRequest.Builder setLocationSettingsIgnored(boolean);
+ }
+
+ public class LocationManager {
+ method @RequiresPermission(allOf={android.Manifest.permission.LOCATION_HARDWARE, android.Manifest.permission.INTERACT_ACROSS_USERS}) public void addProviderRequestChangedListener(@NonNull java.util.concurrent.Executor, @NonNull android.location.provider.ProviderRequest.ChangedListener);
+ method @Deprecated @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public void flushGnssBatch();
+ method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void getCurrentLocation(@NonNull android.location.LocationRequest, @Nullable android.os.CancellationSignal, @NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer<android.location.Location>);
+ method @Nullable public String getExtraLocationControllerPackage();
+ method @Deprecated public int getGnssBatchSize();
+ method @Nullable @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public android.location.Location getLastKnownLocation(@NonNull String, @NonNull android.location.LastLocationRequest);
+ method @RequiresPermission(android.Manifest.permission.ACCESS_FINE_LOCATION) public void injectGnssMeasurementCorrections(@NonNull android.location.GnssMeasurementCorrections);
+ method public boolean isAdasGnssLocationEnabled();
+ method public boolean isExtraLocationControllerPackageEnabled();
+ method public boolean isLocationEnabledForUser(@NonNull android.os.UserHandle);
+ method public boolean isProviderEnabledForUser(@NonNull String, @NonNull android.os.UserHandle);
+ method @Deprecated @RequiresPermission(android.Manifest.permission.READ_DEVICE_CONFIG) public boolean isProviderPackage(@NonNull String);
+ method @RequiresPermission(android.Manifest.permission.READ_DEVICE_CONFIG) public boolean isProviderPackage(@Nullable String, @NonNull String, @Nullable String);
+ method @Deprecated @RequiresPermission(allOf={android.Manifest.permission.LOCATION_HARDWARE, android.Manifest.permission.UPDATE_APP_OPS_STATS}) public boolean registerGnssBatchedLocationCallback(long, boolean, @NonNull android.location.BatchedLocationCallback, @Nullable android.os.Handler);
+ method @Deprecated @RequiresPermission(android.Manifest.permission.ACCESS_FINE_LOCATION) public boolean registerGnssMeasurementsCallback(@NonNull android.location.GnssRequest, @NonNull java.util.concurrent.Executor, @NonNull android.location.GnssMeasurementsEvent.Callback);
+ method @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public void removeProviderRequestChangedListener(@NonNull android.location.provider.ProviderRequest.ChangedListener);
+ method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void requestLocationUpdates(@Nullable android.location.LocationRequest, @NonNull android.location.LocationListener, @Nullable android.os.Looper);
+ method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void requestLocationUpdates(@Nullable android.location.LocationRequest, @NonNull java.util.concurrent.Executor, @NonNull android.location.LocationListener);
+ method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void requestLocationUpdates(@Nullable android.location.LocationRequest, @NonNull android.app.PendingIntent);
+ method @RequiresPermission(android.Manifest.permission.LOCATION_BYPASS) public void setAdasGnssLocationEnabled(boolean);
+ method @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public void setExtraLocationControllerPackage(@Nullable String);
+ method @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public void setExtraLocationControllerPackageEnabled(boolean);
+ method @RequiresPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) public void setLocationEnabledForUser(boolean, @NonNull android.os.UserHandle);
+ method @Deprecated @RequiresPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) public boolean setProviderEnabledForUser(@NonNull String, boolean, @NonNull android.os.UserHandle);
+ method @Deprecated @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public boolean unregisterGnssBatchedLocationCallback(@NonNull android.location.BatchedLocationCallback);
+ field public static final String ACTION_ADAS_GNSS_ENABLED_CHANGED = "android.location.action.ADAS_GNSS_ENABLED_CHANGED";
+ field public static final String EXTRA_ADAS_GNSS_ENABLED = "android.location.extra.ADAS_GNSS_ENABLED";
+ field @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public static final String GPS_HARDWARE_PROVIDER = "gps_hardware";
+ }
+
+ public final class LocationRequest implements android.os.Parcelable {
+ method @Deprecated @NonNull public static android.location.LocationRequest create();
+ method @Deprecated @NonNull public static android.location.LocationRequest createFromDeprecatedCriteria(@NonNull android.location.Criteria, long, float, boolean);
+ method @Deprecated @NonNull public static android.location.LocationRequest createFromDeprecatedProvider(@NonNull String, long, float, boolean);
+ method @Deprecated public long getExpireAt();
+ method @Deprecated public long getExpireIn();
+ method @Deprecated public long getFastestInterval();
+ method @Deprecated public boolean getHideFromAppOps();
+ method @Deprecated public long getInterval();
+ method @Deprecated public int getNumUpdates();
+ method @Deprecated @NonNull public String getProvider();
+ method @Deprecated public float getSmallestDisplacement();
+ method @NonNull public android.os.WorkSource getWorkSource();
+ method public boolean isAdasGnssBypass();
+ method public boolean isHiddenFromAppOps();
+ method public boolean isLocationSettingsIgnored();
+ method public boolean isLowPower();
+ method @Deprecated public boolean isLowPowerMode();
+ method @Deprecated @NonNull public android.location.LocationRequest setExpireAt(long);
+ method @Deprecated @NonNull public android.location.LocationRequest setExpireIn(long);
+ method @Deprecated @NonNull public android.location.LocationRequest setFastestInterval(long);
+ method @Deprecated public void setHideFromAppOps(boolean);
+ method @Deprecated @NonNull public android.location.LocationRequest setInterval(long);
+ method @Deprecated @NonNull @RequiresPermission(android.Manifest.permission.LOCATION_BYPASS) public android.location.LocationRequest setLocationSettingsIgnored(boolean);
+ method @Deprecated @NonNull public android.location.LocationRequest setLowPowerMode(boolean);
+ method @Deprecated @NonNull public android.location.LocationRequest setNumUpdates(int);
+ method @Deprecated @NonNull public android.location.LocationRequest setProvider(@NonNull String);
+ method @Deprecated @NonNull public android.location.LocationRequest setQuality(int);
+ method @Deprecated @NonNull public android.location.LocationRequest setSmallestDisplacement(float);
+ method @Deprecated public void setWorkSource(@Nullable android.os.WorkSource);
+ field @Deprecated public static final int ACCURACY_BLOCK = 102; // 0x66
+ field @Deprecated public static final int ACCURACY_CITY = 104; // 0x68
+ field @Deprecated public static final int ACCURACY_FINE = 100; // 0x64
+ field @Deprecated public static final int POWER_HIGH = 203; // 0xcb
+ field @Deprecated public static final int POWER_LOW = 201; // 0xc9
+ field @Deprecated public static final int POWER_NONE = 200; // 0xc8
+ }
+
+ public static final class LocationRequest.Builder {
+ method @NonNull @RequiresPermission(android.Manifest.permission.LOCATION_BYPASS) public android.location.LocationRequest.Builder setAdasGnssBypass(boolean);
+ method @NonNull @RequiresPermission(android.Manifest.permission.UPDATE_APP_OPS_STATS) public android.location.LocationRequest.Builder setHiddenFromAppOps(boolean);
+ method @NonNull @RequiresPermission(android.Manifest.permission.LOCATION_BYPASS) public android.location.LocationRequest.Builder setLocationSettingsIgnored(boolean);
+ method @NonNull @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public android.location.LocationRequest.Builder setLowPower(boolean);
+ method @NonNull @RequiresPermission(android.Manifest.permission.UPDATE_DEVICE_STATS) public android.location.LocationRequest.Builder setWorkSource(@Nullable android.os.WorkSource);
+ }
+
+ public final class SatellitePvt implements android.os.Parcelable {
+ method public int describeContents();
+ method @Nullable public android.location.SatellitePvt.ClockInfo getClockInfo();
+ method public int getEphemerisSource();
+ method @FloatRange public double getIonoDelayMeters();
+ method @IntRange(from=0, to=1023) public int getIssueOfDataClock();
+ method @IntRange(from=0, to=1023) public int getIssueOfDataEphemeris();
+ method @Nullable public android.location.SatellitePvt.PositionEcef getPositionEcef();
+ method @IntRange(from=0) public long getTimeOfClockSeconds();
+ method @IntRange(from=0) public long getTimeOfEphemerisSeconds();
+ method @FloatRange public double getTropoDelayMeters();
+ method @Nullable public android.location.SatellitePvt.VelocityEcef getVelocityEcef();
+ method public boolean hasIono();
+ method public boolean hasIssueOfDataClock();
+ method public boolean hasIssueOfDataEphemeris();
+ method public boolean hasPositionVelocityClockInfo();
+ method public boolean hasTimeOfClockSeconds();
+ method public boolean hasTimeOfEphemerisSeconds();
+ method public boolean hasTropo();
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.location.SatellitePvt> CREATOR;
+ field public static final int EPHEMERIS_SOURCE_DEMODULATED = 0; // 0x0
+ field public static final int EPHEMERIS_SOURCE_OTHER = 3; // 0x3
+ field public static final int EPHEMERIS_SOURCE_SERVER_LONG_TERM = 2; // 0x2
+ field public static final int EPHEMERIS_SOURCE_SERVER_NORMAL = 1; // 0x1
+ }
+
+ public static final class SatellitePvt.Builder {
+ ctor public SatellitePvt.Builder();
+ method @NonNull public android.location.SatellitePvt build();
+ method @NonNull public android.location.SatellitePvt.Builder setClockInfo(@NonNull android.location.SatellitePvt.ClockInfo);
+ method @NonNull public android.location.SatellitePvt.Builder setEphemerisSource(int);
+ method @NonNull public android.location.SatellitePvt.Builder setIonoDelayMeters(@FloatRange(from=0.0f, to=100.0f) double);
+ method @NonNull public android.location.SatellitePvt.Builder setIssueOfDataClock(@IntRange(from=0, to=1023) int);
+ method @NonNull public android.location.SatellitePvt.Builder setIssueOfDataEphemeris(@IntRange(from=0, to=1023) int);
+ method @NonNull public android.location.SatellitePvt.Builder setPositionEcef(@NonNull android.location.SatellitePvt.PositionEcef);
+ method @NonNull public android.location.SatellitePvt.Builder setTimeOfClockSeconds(@IntRange(from=0) long);
+ method @NonNull public android.location.SatellitePvt.Builder setTimeOfEphemerisSeconds(@IntRange(from=0) long);
+ method @NonNull public android.location.SatellitePvt.Builder setTropoDelayMeters(@FloatRange(from=0.0f, to=100.0f) double);
+ method @NonNull public android.location.SatellitePvt.Builder setVelocityEcef(@NonNull android.location.SatellitePvt.VelocityEcef);
+ }
+
+ public static final class SatellitePvt.ClockInfo implements android.os.Parcelable {
+ ctor public SatellitePvt.ClockInfo(double, double, double);
+ method public int describeContents();
+ method @FloatRange public double getClockDriftMetersPerSecond();
+ method @FloatRange public double getHardwareCodeBiasMeters();
+ method @FloatRange public double getTimeCorrectionMeters();
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.location.SatellitePvt.ClockInfo> CREATOR;
+ }
+
+ public static final class SatellitePvt.PositionEcef implements android.os.Parcelable {
+ ctor public SatellitePvt.PositionEcef(double, double, double, double);
+ method public int describeContents();
+ method @FloatRange(from=0.0f, fromInclusive=false) public double getUreMeters();
+ method @FloatRange public double getXMeters();
+ method @FloatRange public double getYMeters();
+ method @FloatRange public double getZMeters();
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.location.SatellitePvt.PositionEcef> CREATOR;
+ }
+
+ public static final class SatellitePvt.VelocityEcef implements android.os.Parcelable {
+ ctor public SatellitePvt.VelocityEcef(double, double, double, double);
+ method public int describeContents();
+ method @FloatRange(from=0.0f, fromInclusive=false) public double getUreRateMetersPerSecond();
+ method @FloatRange public double getXMetersPerSecond();
+ method @FloatRange public double getYMetersPerSecond();
+ method @FloatRange public double getZMetersPerSecond();
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.location.SatellitePvt.VelocityEcef> CREATOR;
+ }
+
+}
+
+package android.location.provider {
+
+ public abstract class LocationProviderBase {
+ ctor public LocationProviderBase(@NonNull android.content.Context, @NonNull String, @NonNull android.location.provider.ProviderProperties);
+ method @Nullable public final android.os.IBinder getBinder();
+ method @NonNull public android.location.provider.ProviderProperties getProperties();
+ method public boolean isAllowed();
+ method public abstract void onFlush(@NonNull android.location.provider.LocationProviderBase.OnFlushCompleteCallback);
+ method public abstract void onSendExtraCommand(@NonNull String, @Nullable android.os.Bundle);
+ method public abstract void onSetRequest(@NonNull android.location.provider.ProviderRequest);
+ method public void reportLocation(@NonNull android.location.Location);
+ method public void reportLocations(@NonNull java.util.List<android.location.Location>);
+ method public void setAllowed(boolean);
+ method public void setProperties(@NonNull android.location.provider.ProviderProperties);
+ field public static final String ACTION_FUSED_PROVIDER = "com.android.location.service.FusedLocationProvider";
+ field public static final String ACTION_GNSS_PROVIDER = "android.location.provider.action.GNSS_PROVIDER";
+ field public static final String ACTION_NETWORK_PROVIDER = "com.android.location.service.v3.NetworkLocationProvider";
+ }
+
+ public static interface LocationProviderBase.OnFlushCompleteCallback {
+ method public void onFlushComplete();
+ }
+
+ public final class ProviderRequest implements android.os.Parcelable {
+ method public int describeContents();
+ method @IntRange(from=0) public long getIntervalMillis();
+ method @IntRange(from=0) public long getMaxUpdateDelayMillis();
+ method public int getQuality();
+ method @NonNull public android.os.WorkSource getWorkSource();
+ method public boolean isActive();
+ method public boolean isLocationSettingsIgnored();
+ method public boolean isLowPower();
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.location.provider.ProviderRequest> CREATOR;
+ field @NonNull public static final android.location.provider.ProviderRequest EMPTY_REQUEST;
+ field public static final long INTERVAL_DISABLED = 9223372036854775807L; // 0x7fffffffffffffffL
+ }
+
+ public static final class ProviderRequest.Builder {
+ ctor public ProviderRequest.Builder();
+ method @NonNull public android.location.provider.ProviderRequest build();
+ method @NonNull public android.location.provider.ProviderRequest.Builder setIntervalMillis(@IntRange(from=0) long);
+ method @NonNull public android.location.provider.ProviderRequest.Builder setLocationSettingsIgnored(boolean);
+ method @NonNull public android.location.provider.ProviderRequest.Builder setLowPower(boolean);
+ method @NonNull public android.location.provider.ProviderRequest.Builder setMaxUpdateDelayMillis(@IntRange(from=0) long);
+ method @NonNull public android.location.provider.ProviderRequest.Builder setQuality(int);
+ method @NonNull public android.location.provider.ProviderRequest.Builder setWorkSource(@NonNull android.os.WorkSource);
+ }
+
+ public static interface ProviderRequest.ChangedListener {
+ method public void onProviderRequestChanged(@NonNull String, @NonNull android.location.provider.ProviderRequest);
+ }
+
+}
+
diff --git a/location/api/system-lint-baseline.txt b/location/api/system-lint-baseline.txt
new file mode 100644
index 000000000000..a5e5752d7cf5
--- /dev/null
+++ b/location/api/system-lint-baseline.txt
@@ -0,0 +1,11 @@
+// Baseline format: 1.0
+SamShouldBeLast: android.location.LocationManager#addNmeaListener(android.location.OnNmeaMessageListener, android.os.Handler):
+ SAM-compatible parameters (such as parameter 1, "listener", in android.location.LocationManager.addNmeaListener) should be last to improve Kotlin interoperability; see https://kotlinlang.org/docs/reference/java-interop.html#sam-conversions
+SamShouldBeLast: android.location.LocationManager#requestLocationUpdates(String, long, float, android.location.LocationListener, android.os.Looper):
+ SAM-compatible parameters (such as parameter 4, "listener", in android.location.LocationManager.requestLocationUpdates) should be last to improve Kotlin interoperability; see https://kotlinlang.org/docs/reference/java-interop.html#sam-conversions
+SamShouldBeLast: android.location.LocationManager#requestLocationUpdates(long, float, android.location.Criteria, android.location.LocationListener, android.os.Looper):
+ SAM-compatible parameters (such as parameter 4, "listener", in android.location.LocationManager.requestLocationUpdates) should be last to improve Kotlin interoperability; see https://kotlinlang.org/docs/reference/java-interop.html#sam-conversions
+SamShouldBeLast: android.location.LocationManager#requestSingleUpdate(String, android.location.LocationListener, android.os.Looper):
+ SAM-compatible parameters (such as parameter 2, "listener", in android.location.LocationManager.requestSingleUpdate) should be last to improve Kotlin interoperability; see https://kotlinlang.org/docs/reference/java-interop.html#sam-conversions
+SamShouldBeLast: android.location.LocationManager#requestSingleUpdate(android.location.Criteria, android.location.LocationListener, android.os.Looper):
+ SAM-compatible parameters (such as parameter 2, "listener", in android.location.LocationManager.requestSingleUpdate) should be last to improve Kotlin interoperability; see https://kotlinlang.org/docs/reference/java-interop.html#sam-conversions
diff --git a/location/api/system-removed.txt b/location/api/system-removed.txt
index d802177e249b..2755a9ff33c8 100644
--- a/location/api/system-removed.txt
+++ b/location/api/system-removed.txt
@@ -1 +1,15 @@
// Signature format: 2.0
+package android.location {
+
+ public class LocationManager {
+ method @Deprecated public boolean addGpsMeasurementListener(android.location.GpsMeasurementsEvent.Listener);
+ method @Deprecated public boolean addGpsNavigationMessageListener(android.location.GpsNavigationMessageEvent.Listener);
+ method @Deprecated @RequiresPermission(android.Manifest.permission.READ_DEVICE_CONFIG) public boolean isProviderPackage(@Nullable String, @NonNull String);
+ method @Deprecated public void removeGpsMeasurementListener(android.location.GpsMeasurementsEvent.Listener);
+ method @Deprecated public void removeGpsNavigationMessageListener(android.location.GpsNavigationMessageEvent.Listener);
+ method @Deprecated @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public void setLocationControllerExtraPackage(String);
+ method @Deprecated @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public void setLocationControllerExtraPackageEnabled(boolean);
+ }
+
+}
+
diff --git a/location/api/test-current.txt b/location/api/test-current.txt
index d802177e249b..bdcb00a93b95 100644
--- a/location/api/test-current.txt
+++ b/location/api/test-current.txt
@@ -1 +1,104 @@
// Signature format: 2.0
+package android.location {
+
+ public final class GnssClock implements android.os.Parcelable {
+ ctor public GnssClock();
+ method public void reset();
+ method public void resetBiasNanos();
+ method public void resetBiasUncertaintyNanos();
+ method public void resetDriftNanosPerSecond();
+ method public void resetDriftUncertaintyNanosPerSecond();
+ method public void resetElapsedRealtimeNanos();
+ method public void resetElapsedRealtimeUncertaintyNanos();
+ method public void resetFullBiasNanos();
+ method public void resetLeapSecond();
+ method public void resetReferenceCarrierFrequencyHzForIsb();
+ method public void resetReferenceCodeTypeForIsb();
+ method public void resetReferenceConstellationTypeForIsb();
+ method public void resetTimeUncertaintyNanos();
+ method public void set(android.location.GnssClock);
+ method public void setBiasNanos(double);
+ method public void setBiasUncertaintyNanos(@FloatRange(from=0.0f) double);
+ method public void setDriftNanosPerSecond(double);
+ method public void setDriftUncertaintyNanosPerSecond(@FloatRange(from=0.0f) double);
+ method public void setElapsedRealtimeNanos(long);
+ method public void setElapsedRealtimeUncertaintyNanos(@FloatRange(from=0.0f) double);
+ method public void setFullBiasNanos(long);
+ method public void setHardwareClockDiscontinuityCount(int);
+ method public void setLeapSecond(int);
+ method public void setReferenceCarrierFrequencyHzForIsb(@FloatRange(from=0.0) double);
+ method public void setReferenceCodeTypeForIsb(@NonNull String);
+ method public void setReferenceConstellationTypeForIsb(int);
+ method public void setTimeNanos(long);
+ method public void setTimeUncertaintyNanos(@FloatRange(from=0.0f) double);
+ }
+
+ public final class GnssMeasurement implements android.os.Parcelable {
+ ctor public GnssMeasurement();
+ method public void reset();
+ method public void resetAutomaticGainControlLevel();
+ method public void resetBasebandCn0DbHz();
+ method @Deprecated public void resetCarrierCycles();
+ method public void resetCarrierFrequencyHz();
+ method @Deprecated public void resetCarrierPhase();
+ method @Deprecated public void resetCarrierPhaseUncertainty();
+ method public void resetCodeType();
+ method public void resetCorrelationVectors();
+ method public void resetFullInterSignalBiasNanos();
+ method public void resetFullInterSignalBiasUncertaintyNanos();
+ method public void resetSatelliteInterSignalBiasNanos();
+ method public void resetSatelliteInterSignalBiasUncertaintyNanos();
+ method public void resetSatellitePvt();
+ method public void resetSnrInDb();
+ method public void set(android.location.GnssMeasurement);
+ method public void setAccumulatedDeltaRangeMeters(double);
+ method public void setAccumulatedDeltaRangeState(int);
+ method public void setAccumulatedDeltaRangeUncertaintyMeters(double);
+ method @Deprecated public void setAutomaticGainControlLevelInDb(double);
+ method public void setBasebandCn0DbHz(double);
+ method @Deprecated public void setCarrierCycles(long);
+ method public void setCarrierFrequencyHz(float);
+ method @Deprecated public void setCarrierPhase(double);
+ method @Deprecated public void setCarrierPhaseUncertainty(double);
+ method public void setCn0DbHz(double);
+ method public void setCodeType(@NonNull String);
+ method public void setConstellationType(int);
+ method public void setCorrelationVectors(@Nullable java.util.Collection<android.location.CorrelationVector>);
+ method public void setFullInterSignalBiasNanos(double);
+ method public void setFullInterSignalBiasUncertaintyNanos(@FloatRange(from=0.0) double);
+ method public void setMultipathIndicator(int);
+ method public void setPseudorangeRateMetersPerSecond(double);
+ method public void setPseudorangeRateUncertaintyMetersPerSecond(double);
+ method public void setReceivedSvTimeNanos(long);
+ method public void setReceivedSvTimeUncertaintyNanos(long);
+ method public void setSatelliteInterSignalBiasNanos(double);
+ method public void setSatelliteInterSignalBiasUncertaintyNanos(@FloatRange(from=0.0) double);
+ method public void setSatellitePvt(@Nullable android.location.SatellitePvt);
+ method public void setSnrInDb(double);
+ method public void setState(int);
+ method public void setSvid(int);
+ method public void setTimeOffsetNanos(double);
+ field public static final int ADR_STATE_ALL = 31; // 0x1f
+ }
+
+ public final class GnssNavigationMessage implements android.os.Parcelable {
+ ctor public GnssNavigationMessage();
+ method public void reset();
+ method public void set(android.location.GnssNavigationMessage);
+ method public void setData(byte[]);
+ method public void setMessageId(@IntRange(from=0xffffffff, to=120) int);
+ method public void setStatus(int);
+ method public void setSubmessageId(@IntRange(from=1) int);
+ method public void setSvid(@IntRange(from=1, to=200) int);
+ method public void setType(int);
+ }
+
+ public class LocationManager {
+ method @NonNull public String[] getBackgroundThrottlingWhitelist();
+ method @NonNull public android.os.PackageTagsList getIgnoreSettingsAllowlist();
+ method @Deprecated @NonNull public String[] getIgnoreSettingsWhitelist();
+ method @Deprecated @Nullable @RequiresPermission(android.Manifest.permission.READ_DEVICE_CONFIG) public java.util.List<java.lang.String> getProviderPackages(@NonNull String);
+ }
+
+}
+
diff --git a/location/api/test-lint-baseline.txt b/location/api/test-lint-baseline.txt
new file mode 100644
index 000000000000..189588e4bafb
--- /dev/null
+++ b/location/api/test-lint-baseline.txt
@@ -0,0 +1,54 @@
+// Baseline format: 1.0
+GetterSetterNames: android.location.GnssClock#setBiasNanos(double):
+ Symmetric method for `hasBiasNanos` must be named `setHasBiasNanos`; was `setBiasNanos`
+GetterSetterNames: android.location.GnssClock#setBiasUncertaintyNanos(double):
+ Symmetric method for `hasBiasUncertaintyNanos` must be named `setHasBiasUncertaintyNanos`; was `setBiasUncertaintyNanos`
+GetterSetterNames: android.location.GnssClock#setDriftNanosPerSecond(double):
+ Symmetric method for `hasDriftNanosPerSecond` must be named `setHasDriftNanosPerSecond`; was `setDriftNanosPerSecond`
+GetterSetterNames: android.location.GnssClock#setDriftUncertaintyNanosPerSecond(double):
+ Symmetric method for `hasDriftUncertaintyNanosPerSecond` must be named `setHasDriftUncertaintyNanosPerSecond`; was `setDriftUncertaintyNanosPerSecond`
+GetterSetterNames: android.location.GnssClock#setElapsedRealtimeNanos(long):
+ Symmetric method for `hasElapsedRealtimeNanos` must be named `setHasElapsedRealtimeNanos`; was `setElapsedRealtimeNanos`
+GetterSetterNames: android.location.GnssClock#setElapsedRealtimeUncertaintyNanos(double):
+ Symmetric method for `hasElapsedRealtimeUncertaintyNanos` must be named `setHasElapsedRealtimeUncertaintyNanos`; was `setElapsedRealtimeUncertaintyNanos`
+GetterSetterNames: android.location.GnssClock#setFullBiasNanos(long):
+ Symmetric method for `hasFullBiasNanos` must be named `setHasFullBiasNanos`; was `setFullBiasNanos`
+GetterSetterNames: android.location.GnssClock#setLeapSecond(int):
+ Symmetric method for `hasLeapSecond` must be named `setHasLeapSecond`; was `setLeapSecond`
+GetterSetterNames: android.location.GnssClock#setReferenceCarrierFrequencyHzForIsb(double):
+ Symmetric method for `hasReferenceCarrierFrequencyHzForIsb` must be named `setHasReferenceCarrierFrequencyHzForIsb`; was `setReferenceCarrierFrequencyHzForIsb`
+GetterSetterNames: android.location.GnssClock#setReferenceCodeTypeForIsb(String):
+ Symmetric method for `hasReferenceCodeTypeForIsb` must be named `setHasReferenceCodeTypeForIsb`; was `setReferenceCodeTypeForIsb`
+GetterSetterNames: android.location.GnssClock#setReferenceConstellationTypeForIsb(int):
+ Symmetric method for `hasReferenceConstellationTypeForIsb` must be named `setHasReferenceConstellationTypeForIsb`; was `setReferenceConstellationTypeForIsb`
+GetterSetterNames: android.location.GnssClock#setTimeUncertaintyNanos(double):
+ Symmetric method for `hasTimeUncertaintyNanos` must be named `setHasTimeUncertaintyNanos`; was `setTimeUncertaintyNanos`
+GetterSetterNames: android.location.GnssMeasurement#setBasebandCn0DbHz(double):
+ Symmetric method for `hasBasebandCn0DbHz` must be named `setHasBasebandCn0DbHz`; was `setBasebandCn0DbHz`
+GetterSetterNames: android.location.GnssMeasurement#setCarrierFrequencyHz(float):
+ Symmetric method for `hasCarrierFrequencyHz` must be named `setHasCarrierFrequencyHz`; was `setCarrierFrequencyHz`
+GetterSetterNames: android.location.GnssMeasurement#setCodeType(String):
+ Symmetric method for `hasCodeType` must be named `setHasCodeType`; was `setCodeType`
+GetterSetterNames: android.location.GnssMeasurement#setCorrelationVectors(java.util.Collection<android.location.CorrelationVector>):
+ Symmetric method for `hasCorrelationVectors` must be named `setHasCorrelationVectors`; was `setCorrelationVectors`
+GetterSetterNames: android.location.GnssMeasurement#setFullInterSignalBiasNanos(double):
+ Symmetric method for `hasFullInterSignalBiasNanos` must be named `setHasFullInterSignalBiasNanos`; was `setFullInterSignalBiasNanos`
+GetterSetterNames: android.location.GnssMeasurement#setFullInterSignalBiasUncertaintyNanos(double):
+ Symmetric method for `hasFullInterSignalBiasUncertaintyNanos` must be named `setHasFullInterSignalBiasUncertaintyNanos`; was `setFullInterSignalBiasUncertaintyNanos`
+GetterSetterNames: android.location.GnssMeasurement#setSatelliteInterSignalBiasNanos(double):
+ Symmetric method for `hasSatelliteInterSignalBiasNanos` must be named `setHasSatelliteInterSignalBiasNanos`; was `setSatelliteInterSignalBiasNanos`
+GetterSetterNames: android.location.GnssMeasurement#setSatelliteInterSignalBiasUncertaintyNanos(double):
+ Symmetric method for `hasSatelliteInterSignalBiasUncertaintyNanos` must be named `setHasSatelliteInterSignalBiasUncertaintyNanos`; was `setSatelliteInterSignalBiasUncertaintyNanos`
+GetterSetterNames: android.location.GnssMeasurement#setSatellitePvt(android.location.SatellitePvt):
+ Symmetric method for `hasSatellitePvt` must be named `setHasSatellitePvt`; was `setSatellitePvt`
+GetterSetterNames: android.location.GnssMeasurement#setSnrInDb(double):
+ Symmetric method for `hasSnrInDb` must be named `setHasSnrInDb`; was `setSnrInDb`
+
+MissingNullability: android.location.GnssClock#set(android.location.GnssClock) parameter #0:
+ Missing nullability on parameter `clock` in method `set`
+MissingNullability: android.location.GnssMeasurement#set(android.location.GnssMeasurement) parameter #0:
+ Missing nullability on parameter `measurement` in method `set`
+MissingNullability: android.location.GnssNavigationMessage#set(android.location.GnssNavigationMessage) parameter #0:
+ Missing nullability on parameter `navigationMessage` in method `set`
+MissingNullability: android.location.GnssNavigationMessage#setData(byte[]) parameter #0:
+ Missing nullability on parameter `value` in method `setData`
diff --git a/location/java/Android.bp b/location/java/Android.bp
deleted file mode 100644
index 543f2b1ab4a8..000000000000
--- a/location/java/Android.bp
+++ /dev/null
@@ -1,17 +0,0 @@
-package {
- // See: http://go/android-license-faq
- // A large-scale-change added 'default_applicable_licenses' to import
- // all of the 'license_kinds' from "frameworks_base_license"
- // to get the below license kinds:
- // SPDX-license-identifier-Apache-2.0
- default_applicable_licenses: ["frameworks_base_license"],
-}
-
-filegroup {
- name: "framework-location-sources",
- srcs: [
- "**/*.java",
- "**/*.aidl",
- ],
- visibility: ["//frameworks/base"],
-}
diff --git a/media/java/android/media/AudioManager.java b/media/java/android/media/AudioManager.java
index e2f407294458..842542f4f43b 100644
--- a/media/java/android/media/AudioManager.java
+++ b/media/java/android/media/AudioManager.java
@@ -4945,7 +4945,9 @@ public class AudioManager {
synchronized (this) {
while (!mQuit) {
final long timeToWait = timeOutTime - java.lang.System.currentTimeMillis();
- if (timeToWait < 0) { break; }
+ if (timeToWait <= 0) {
+ break;
+ }
this.wait(timeToWait);
}
}
diff --git a/media/java/android/media/flags.aconfig b/media/java/android/media/flags.aconfig
deleted file mode 100644
index 8567a3b166ab..000000000000
--- a/media/java/android/media/flags.aconfig
+++ /dev/null
@@ -1,8 +0,0 @@
-package: "android.media"
-
-flag {
- name: "haptics_customization_enabled"
- namespace: "media"
- description: "Enables the haptics customization feature"
- bug: "241918098"
-}
diff --git a/packages/SettingsProvider/src/android/provider/settings/backup/SystemSettings.java b/packages/SettingsProvider/src/android/provider/settings/backup/SystemSettings.java
index 6b0a9060d782..248c60cb4fe9 100644
--- a/packages/SettingsProvider/src/android/provider/settings/backup/SystemSettings.java
+++ b/packages/SettingsProvider/src/android/provider/settings/backup/SystemSettings.java
@@ -61,7 +61,7 @@ public class SystemSettings {
Settings.System.TTY_MODE,
Settings.System.MASTER_MONO,
Settings.System.MASTER_BALANCE,
- Settings.System.STAY_AWAKE_ON_FOLD,
+ Settings.System.FOLD_LOCK_BEHAVIOR,
Settings.System.SOUND_EFFECTS_ENABLED,
Settings.System.HAPTIC_FEEDBACK_ENABLED,
Settings.System.POWER_SOUNDS_ENABLED, // moved to global
diff --git a/packages/SettingsProvider/src/android/provider/settings/validators/SystemSettingsValidators.java b/packages/SettingsProvider/src/android/provider/settings/validators/SystemSettingsValidators.java
index 20740dcedf95..17ce7c7cc435 100644
--- a/packages/SettingsProvider/src/android/provider/settings/validators/SystemSettingsValidators.java
+++ b/packages/SettingsProvider/src/android/provider/settings/validators/SystemSettingsValidators.java
@@ -134,6 +134,7 @@ public class SystemSettingsValidators {
VALIDATORS.put(System.HAPTIC_FEEDBACK_ENABLED, BOOLEAN_VALIDATOR);
VALIDATORS.put(System.RINGTONE, URI_VALIDATOR);
VALIDATORS.put(System.NOTIFICATION_SOUND, URI_VALIDATOR);
+ VALIDATORS.put(System.FOLD_LOCK_BEHAVIOR, ANY_STRING_VALIDATOR);
VALIDATORS.put(System.ALARM_ALERT, URI_VALIDATOR);
VALIDATORS.put(System.TEXT_AUTO_REPLACE, BOOLEAN_VALIDATOR);
VALIDATORS.put(System.TEXT_AUTO_CAPS, BOOLEAN_VALIDATOR);
@@ -219,7 +220,6 @@ public class SystemSettingsValidators {
VALIDATORS.put(System.WIFI_STATIC_DNS1, LENIENT_IP_ADDRESS_VALIDATOR);
VALIDATORS.put(System.WIFI_STATIC_DNS2, LENIENT_IP_ADDRESS_VALIDATOR);
VALIDATORS.put(System.SHOW_BATTERY_PERCENT, BOOLEAN_VALIDATOR);
- VALIDATORS.put(System.STAY_AWAKE_ON_FOLD, BOOLEAN_VALIDATOR);
VALIDATORS.put(System.NOTIFICATION_LIGHT_PULSE, BOOLEAN_VALIDATOR);
VALIDATORS.put(System.WEAR_ACCESSIBILITY_GESTURE_ENABLED, BOOLEAN_VALIDATOR);
VALIDATORS.put(System.WEAR_ACCESSIBILITY_GESTURE_ENABLED_DURING_OOBE, BOOLEAN_VALIDATOR);
diff --git a/packages/SystemUI/Android.bp b/packages/SystemUI/Android.bp
index 089ddbeda53b..bba79bbcab5b 100644
--- a/packages/SystemUI/Android.bp
+++ b/packages/SystemUI/Android.bp
@@ -552,10 +552,12 @@ systemui_optimized_java_defaults {
optimize: true,
shrink: true,
shrink_resources: true,
+ ignore_warnings: false,
proguard_compatibility: false,
},
conditions_default: {
optimize: {
+ ignore_warnings: false,
proguard_compatibility: false,
},
},
diff --git a/packages/SystemUI/compose/features/src/com/android/systemui/qs/footer/ui/compose/FooterActions.kt b/packages/SystemUI/compose/features/src/com/android/systemui/qs/footer/ui/compose/FooterActions.kt
index 13acde206247..482220013e32 100644
--- a/packages/SystemUI/compose/features/src/com/android/systemui/qs/footer/ui/compose/FooterActions.kt
+++ b/packages/SystemUI/compose/features/src/com/android/systemui/qs/footer/ui/compose/FooterActions.kt
@@ -137,6 +137,7 @@ fun FooterActions(
)
}
+ val horizontalPadding = dimensionResource(R.dimen.qs_content_horizontal_padding)
Row(
modifier
.fillMaxWidth()
@@ -150,6 +151,8 @@ fun FooterActions(
.padding(
top = dimensionResource(R.dimen.qs_footer_actions_top_padding),
bottom = dimensionResource(R.dimen.qs_footer_actions_bottom_padding),
+ start = horizontalPadding,
+ end = horizontalPadding,
)
.layout { measurable, constraints ->
// All buttons have a 4dp padding to increase their touch size. To be consistent
diff --git a/packages/SystemUI/res-keyguard/layout-land/keyguard_pin_view.xml b/packages/SystemUI/res-keyguard/layout-land/keyguard_pin_view.xml
deleted file mode 100644
index cd7ab986844c..000000000000
--- a/packages/SystemUI/res-keyguard/layout-land/keyguard_pin_view.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?><!--
-**
-** Copyright 2023, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License")
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-** http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
--->
-
-<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="match_parent"
- android:layout_height="match_parent">
-
- <include layout="@layout/keyguard_pin_view_landscape" />
-
-</FrameLayout>
diff --git a/packages/SystemUI/res-keyguard/layout-sw600dp-land/keyguard_pin_view.xml b/packages/SystemUI/res-keyguard/layout-sw600dp-land/keyguard_pin_view.xml
deleted file mode 100644
index 80cc8c06680a..000000000000
--- a/packages/SystemUI/res-keyguard/layout-sw600dp-land/keyguard_pin_view.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?><!--
-**
-** Copyright 2023, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License")
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-** http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
--->
-
-<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="match_parent"
- android:layout_height="match_parent">
-
- <include layout="@layout/keyguard_pin_view_portrait" />
-
-</FrameLayout>
diff --git a/packages/SystemUI/res-keyguard/layout/keyguard_pin_view.xml b/packages/SystemUI/res-keyguard/layout/keyguard_pin_view.xml
index 29e14c57a047..f3cd9e49b49c 100644
--- a/packages/SystemUI/res-keyguard/layout/keyguard_pin_view.xml
+++ b/packages/SystemUI/res-keyguard/layout/keyguard_pin_view.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
**
-** Copyright 2012, The Android Open Source Project
+** Copyright 2023, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License")
** you may not use this file except in compliance with the License.
@@ -16,10 +16,203 @@
** limitations under the License.
*/
-->
-<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+
+<com.android.keyguard.KeyguardPINView xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:androidprv="http://schemas.android.com/apk/res-auto"
+ android:id="@+id/keyguard_pin_view"
android:layout_width="match_parent"
- android:layout_height="match_parent">
+ android:layout_height="match_parent"
+ android:layout_gravity="center_horizontal|bottom"
+ android:clipChildren="false"
+ android:clipToPadding="false"
+ android:orientation="vertical"
+ androidprv:layout_maxWidth="@dimen/keyguard_security_width">
+
+ <include layout="@layout/keyguard_bouncer_message_area"/>
+
+ <com.android.systemui.bouncer.ui.BouncerMessageView
+ android:id="@+id/bouncer_message_view"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical" />
+
+ <androidx.constraintlayout.widget.ConstraintLayout
+ android:id="@+id/pin_container"
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:layout_marginBottom="8dp"
+ android:clipChildren="false"
+ android:clipToPadding="false"
+ android:layout_weight="1"
+ android:layoutDirection="ltr"
+ android:orientation="vertical">
+
+ <!-- Set this to be just above key1. It would be better to introduce a barrier above
+ key1/key2/key3, then place this View above that. Sadly, that doesn't work (the Barrier
+ drops to the bottom of the page, and key1/2/3 all shoot up to the top-left). In any
+ case, the Flow should ensure that key1/2/3 all have the same top, so this should be
+ fine. -->
+ <com.android.keyguard.AlphaOptimizedRelativeLayout
+ android:id="@+id/row0"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:paddingBottom="@dimen/num_pad_entry_row_margin_bottom"
+ androidprv:layout_constraintTop_toTopOf="parent"
+ androidprv:layout_constraintEnd_toEndOf="parent"
+ androidprv:layout_constraintStart_toStartOf="parent"
+ androidprv:layout_constraintBottom_toTopOf="@id/key1"
+ androidprv:layout_constraintVertical_bias="0.5">
+
+ <com.android.keyguard.PasswordTextView
+ android:id="@+id/pinEntry"
+ style="@style/Widget.TextView.Password"
+ android:layout_width="@dimen/keyguard_security_width"
+ android:layout_height="@dimen/keyguard_password_height"
+ android:layout_centerHorizontal="true"
+ android:layout_marginRight="72dp"
+ android:contentDescription="@string/keyguard_accessibility_pin_area"
+ androidprv:scaledTextSize="@integer/scaled_password_text_size" />
+ </com.android.keyguard.AlphaOptimizedRelativeLayout>
+
+ <!-- Guideline used to place the top row of keys relative to the screen height. This will be
+ updated in KeyguardPINView to reduce the height of the PIN pad. -->
+ <androidx.constraintlayout.widget.Guideline
+ android:id="@+id/pin_pad_top_guideline"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ androidprv:layout_constraintGuide_percent="0"
+ android:orientation="horizontal" />
+
+ <com.android.keyguard.KeyguardPinFlowView
+ android:id="@+id/flow1"
+ android:layout_width="0dp"
+ android:layout_height="0dp"
+ android:orientation="horizontal"
+ android:clipChildren="false"
+ android:clipToPadding="false"
+
+ androidprv:constraint_referenced_ids="key1,key2,key3,key4,key5,key6,key7,key8,key9,delete_button,key0,key_enter"
+
+ androidprv:flow_horizontalGap="@dimen/num_pad_key_margin_end"
+
+ androidprv:flow_horizontalStyle="packed"
+ androidprv:flow_maxElementsWrap="3"
+
+ androidprv:flow_verticalBias="1.0"
+ androidprv:flow_verticalGap="@dimen/num_pad_entry_row_margin_bottom"
+ androidprv:flow_verticalStyle="packed"
+
+ androidprv:flow_wrapMode="aligned"
+ androidprv:layout_constraintBottom_toBottomOf="parent"
+ androidprv:layout_constraintEnd_toEndOf="parent"
+ androidprv:layout_constraintStart_toStartOf="parent"
+ androidprv:layout_constraintTop_toBottomOf="@id/pin_pad_top_guideline" />
+
+ <com.android.keyguard.NumPadKey
+ android:id="@+id/key1"
+ android:layout_width="0dp"
+ android:layout_height="0dp"
+ android:accessibilityTraversalBefore="@id/key2"
+ androidprv:digit="1"
+ androidprv:textView="@+id/pinEntry" />
+
+ <com.android.keyguard.NumPadKey
+ android:id="@+id/key2"
+ android:layout_width="0dp"
+ android:layout_height="0dp"
+ android:accessibilityTraversalBefore="@id/key3"
+ androidprv:digit="2"
+ androidprv:textView="@+id/pinEntry" />
+
+ <com.android.keyguard.NumPadKey
+ android:id="@+id/key3"
+ android:layout_width="0dp"
+ android:layout_height="0dp"
+ android:accessibilityTraversalBefore="@id/key4"
+ androidprv:digit="3"
+ androidprv:textView="@+id/pinEntry" />
+
+ <com.android.keyguard.NumPadKey
+ android:id="@+id/key4"
+ android:layout_width="0dp"
+ android:layout_height="0dp"
+ android:accessibilityTraversalBefore="@id/key5"
+ androidprv:digit="4"
+ androidprv:textView="@+id/pinEntry" />
+
+ <com.android.keyguard.NumPadKey
+ android:id="@+id/key5"
+ android:layout_width="0dp"
+ android:layout_height="0dp"
+ android:accessibilityTraversalBefore="@id/key6"
+ androidprv:digit="5"
+ androidprv:textView="@+id/pinEntry" />
+
+ <com.android.keyguard.NumPadKey
+ android:id="@+id/key6"
+ android:layout_width="0dp"
+ android:layout_height="0dp"
+ android:accessibilityTraversalBefore="@id/key7"
+ androidprv:digit="6"
+ androidprv:textView="@+id/pinEntry" />
+
+ <com.android.keyguard.NumPadKey
+ android:id="@+id/key7"
+ android:layout_width="0dp"
+ android:layout_height="0dp"
+ android:accessibilityTraversalBefore="@id/key8"
+ androidprv:digit="7"
+ androidprv:textView="@+id/pinEntry" />
+
+
+ <com.android.keyguard.NumPadKey
+ android:id="@+id/key8"
+ android:layout_width="0dp"
+ android:layout_height="0dp"
+ android:accessibilityTraversalBefore="@id/key9"
+ androidprv:digit="8"
+ androidprv:textView="@+id/pinEntry" />
+
+ <com.android.keyguard.NumPadKey
+ android:id="@+id/key9"
+ android:layout_width="0dp"
+ android:layout_height="0dp"
+ android:accessibilityTraversalBefore="@id/delete_button"
+ androidprv:digit="9"
+ androidprv:textView="@+id/pinEntry" />
+
+ <com.android.keyguard.NumPadButton
+ android:id="@+id/delete_button"
+ style="@style/NumPadKey.Delete"
+ android:layout_width="0dp"
+ android:layout_height="0dp"
+ android:accessibilityTraversalBefore="@id/key0"
+ android:contentDescription="@string/keyboardview_keycode_delete" />
+
+ <com.android.keyguard.NumPadKey
+ android:id="@+id/key0"
+ android:layout_width="0dp"
+ android:layout_height="0dp"
+ android:accessibilityTraversalBefore="@id/key_enter"
+ androidprv:digit="0"
+ androidprv:textView="@+id/pinEntry" />
+
+ <com.android.keyguard.NumPadButton
+ android:id="@+id/key_enter"
+ style="@style/NumPadKey.Enter"
+ android:layout_width="0dp"
+ android:layout_height="0dp"
+ android:contentDescription="@string/keyboardview_keycode_enter" />
+ </androidx.constraintlayout.widget.ConstraintLayout>
- <include layout="@layout/keyguard_pin_view_portrait" />
+ <include layout="@layout/keyguard_eca"
+ android:id="@+id/keyguard_selector_fade_container"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical"
+ android:layout_gravity="bottom|center_horizontal"
+ android:layout_marginTop="@dimen/keyguard_eca_top_margin"
+ android:layout_marginBottom="@dimen/keyguard_eca_bottom_margin"
+ android:gravity="center_horizontal"/>
-</FrameLayout>
+</com.android.keyguard.KeyguardPINView>
diff --git a/packages/SystemUI/res-keyguard/layout/keyguard_pin_view_landscape.xml b/packages/SystemUI/res-keyguard/layout/keyguard_pin_view_landscape.xml
deleted file mode 100644
index e00742d80017..000000000000
--- a/packages/SystemUI/res-keyguard/layout/keyguard_pin_view_landscape.xml
+++ /dev/null
@@ -1,231 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?><!--
-**
-** Copyright 2023, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License")
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-** http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
--->
-
-<com.android.keyguard.KeyguardPINView xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:androidprv="http://schemas.android.com/apk/res-auto"
- xmlns:tools="http://schemas.android.com/tools"
- android:id="@+id/keyguard_pin_view"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:layout_gravity="center_horizontal|bottom"
- android:clipChildren="false"
- android:clipToPadding="false"
- android:orientation="horizontal">
-
- <androidx.constraintlayout.widget.ConstraintLayout
- android:layout_width="0dp"
- android:layout_height="match_parent"
- android:layout_weight="2"
- android:clipChildren="false"
- android:clipToPadding="false"
- android:layoutDirection="ltr"
- android:orientation="vertical">
-
- <include layout="@layout/keyguard_bouncer_message_area" />
-
- <com.android.systemui.bouncer.ui.BouncerMessageView
- android:id="@+id/bouncer_message_view"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:orientation="vertical"
- androidprv:layout_constraintBottom_toTopOf="@+id/row0"
- androidprv:layout_constraintTop_toTopOf="parent"
- androidprv:layout_constraintVertical_chainStyle="packed" />
-
- <!-- Set this to be just above key1. It would be better to introduce a barrier above
- key1/key2/key3, then place this View above that. Sadly, that doesn't work (the Barrier
- drops to the bottom of the page, and key1/2/3 all shoot up to the top-left). In any
- case, the Flow should ensure that key1/2/3 all have the same top, so this should be
- fine. -->
- <com.android.keyguard.AlphaOptimizedRelativeLayout
- android:id="@+id/row0"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:paddingBottom="@dimen/num_pad_entry_row_margin_bottom"
- androidprv:layout_constraintBottom_toTopOf="@+id/keyguard_selector_fade_container"
- androidprv:layout_constraintTop_toBottomOf="@+id/bouncer_message_view"
- tools:layout_editor_absoluteX="-16dp">
-
- <com.android.keyguard.PasswordTextView
- android:id="@+id/pinEntry"
- style="@style/Widget.TextView.Password"
- android:layout_width="@dimen/keyguard_security_width"
- android:layout_height="@dimen/keyguard_password_height"
- android:layout_centerHorizontal="true"
- android:layout_marginRight="72dp"
- android:contentDescription="@string/keyguard_accessibility_pin_area"
- androidprv:scaledTextSize="@integer/scaled_password_text_size" />
- </com.android.keyguard.AlphaOptimizedRelativeLayout>
-
- <include
- android:id="@+id/keyguard_selector_fade_container"
- layout="@layout/keyguard_eca"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_gravity="bottom|center_horizontal"
- android:layout_marginBottom="@dimen/keyguard_eca_bottom_margin"
- android:layout_marginTop="@dimen/keyguard_eca_top_margin"
- android:gravity="center_horizontal"
- android:orientation="vertical"
- androidprv:layout_constraintBottom_toBottomOf="parent" />
-
- </androidx.constraintlayout.widget.ConstraintLayout>
-
- <androidx.constraintlayout.widget.ConstraintLayout
- android:id="@+id/pin_container"
- android:layout_width="0dp"
- android:layout_height="match_parent"
- android:layout_weight="3"
- android:clipChildren="false"
- android:clipToPadding="false"
- android:layoutDirection="ltr"
- android:orientation="vertical">
-
- <!-- Guideline used to place the top row of keys relative to the screen height. This will be
- updated in KeyguardPINView to reduce the height of the PIN pad. -->
- <androidx.constraintlayout.widget.Guideline
- android:id="@+id/pin_pad_top_guideline"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:orientation="horizontal"
- androidprv:layout_constraintGuide_percent="0" />
-
- <com.android.keyguard.KeyguardPinFlowView
- android:id="@+id/flow1"
- android:layout_width="0dp"
- android:layout_height="0dp"
- android:clipChildren="false"
- android:clipToPadding="false"
- android:orientation="horizontal"
-
- androidprv:constraint_referenced_ids="key1,key2,key3,key4,key5,key6,key7,key8,key9,delete_button,key0,key_enter"
-
- androidprv:flow_horizontalGap="@dimen/num_pad_key_margin_end"
-
- androidprv:flow_horizontalStyle="packed"
- androidprv:flow_maxElementsWrap="3"
-
- androidprv:flow_verticalBias="0.5"
- androidprv:flow_verticalGap="@dimen/num_pad_entry_row_margin_bottom"
- androidprv:flow_verticalStyle="packed"
-
- androidprv:flow_wrapMode="aligned"
- androidprv:layout_constraintBottom_toBottomOf="parent"
- androidprv:layout_constraintEnd_toEndOf="parent"
- androidprv:layout_constraintStart_toStartOf="parent"
- androidprv:layout_constraintTop_toBottomOf="@id/pin_pad_top_guideline" />
-
- <com.android.keyguard.NumPadButton
- android:id="@+id/delete_button"
- style="@style/NumPadKey.Delete"
- android:layout_width="0dp"
- android:layout_height="0dp"
- android:accessibilityTraversalBefore="@id/key0"
- android:contentDescription="@string/keyboardview_keycode_delete" />
-
- <com.android.keyguard.NumPadButton
- android:id="@+id/key_enter"
- style="@style/NumPadKey.Enter"
- android:layout_width="0dp"
- android:layout_height="0dp"
- android:contentDescription="@string/keyboardview_keycode_enter" />
-
- <com.android.keyguard.NumPadKey
- android:id="@+id/key1"
- android:layout_width="0dp"
- android:layout_height="0dp"
- android:accessibilityTraversalBefore="@id/key2"
- androidprv:digit="1"
- androidprv:textView="@+id/pinEntry" />
-
- <com.android.keyguard.NumPadKey
- android:id="@+id/key2"
- android:layout_width="0dp"
- android:layout_height="0dp"
- android:accessibilityTraversalBefore="@id/key3"
- androidprv:digit="2"
- androidprv:textView="@+id/pinEntry" />
-
- <com.android.keyguard.NumPadKey
- android:id="@+id/key3"
- android:layout_width="0dp"
- android:layout_height="0dp"
- android:accessibilityTraversalBefore="@id/key4"
- androidprv:digit="3"
- androidprv:textView="@+id/pinEntry" />
-
- <com.android.keyguard.NumPadKey
- android:id="@+id/key4"
- android:layout_width="0dp"
- android:layout_height="0dp"
- android:accessibilityTraversalBefore="@id/key5"
- androidprv:digit="4"
- androidprv:textView="@+id/pinEntry" />
-
- <com.android.keyguard.NumPadKey
- android:id="@+id/key5"
- android:layout_width="0dp"
- android:layout_height="0dp"
- android:accessibilityTraversalBefore="@id/key6"
- androidprv:digit="5"
- androidprv:textView="@+id/pinEntry" />
-
-
- <com.android.keyguard.NumPadKey
- android:id="@+id/key6"
- android:layout_width="0dp"
- android:layout_height="0dp"
- android:accessibilityTraversalBefore="@id/key7"
- androidprv:digit="6"
- androidprv:textView="@+id/pinEntry" />
-
- <com.android.keyguard.NumPadKey
- android:id="@+id/key7"
- android:layout_width="0dp"
- android:layout_height="0dp"
- android:accessibilityTraversalBefore="@id/key8"
- androidprv:digit="7"
- androidprv:textView="@+id/pinEntry" />
-
- <com.android.keyguard.NumPadKey
- android:id="@+id/key8"
- android:layout_width="0dp"
- android:layout_height="0dp"
- android:accessibilityTraversalBefore="@id/key9"
- androidprv:digit="8"
- androidprv:textView="@+id/pinEntry" />
-
- <com.android.keyguard.NumPadKey
- android:id="@+id/key9"
- android:layout_width="0dp"
- android:layout_height="0dp"
- android:accessibilityTraversalBefore="@id/delete_button"
- androidprv:digit="9"
- androidprv:textView="@+id/pinEntry" />
-
- <com.android.keyguard.NumPadKey
- android:id="@+id/key0"
- android:layout_width="0dp"
- android:layout_height="0dp"
- android:accessibilityTraversalBefore="@id/key_enter"
- androidprv:digit="0"
- androidprv:textView="@+id/pinEntry" />
-
- </androidx.constraintlayout.widget.ConstraintLayout>
-
-</com.android.keyguard.KeyguardPINView>
diff --git a/packages/SystemUI/res-keyguard/layout/keyguard_pin_view_portrait.xml b/packages/SystemUI/res-keyguard/layout/keyguard_pin_view_portrait.xml
deleted file mode 100644
index f3cd9e49b49c..000000000000
--- a/packages/SystemUI/res-keyguard/layout/keyguard_pin_view_portrait.xml
+++ /dev/null
@@ -1,218 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-**
-** Copyright 2023, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License")
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-** http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
--->
-
-<com.android.keyguard.KeyguardPINView xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:androidprv="http://schemas.android.com/apk/res-auto"
- android:id="@+id/keyguard_pin_view"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:layout_gravity="center_horizontal|bottom"
- android:clipChildren="false"
- android:clipToPadding="false"
- android:orientation="vertical"
- androidprv:layout_maxWidth="@dimen/keyguard_security_width">
-
- <include layout="@layout/keyguard_bouncer_message_area"/>
-
- <com.android.systemui.bouncer.ui.BouncerMessageView
- android:id="@+id/bouncer_message_view"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:orientation="vertical" />
-
- <androidx.constraintlayout.widget.ConstraintLayout
- android:id="@+id/pin_container"
- android:layout_width="match_parent"
- android:layout_height="0dp"
- android:layout_marginBottom="8dp"
- android:clipChildren="false"
- android:clipToPadding="false"
- android:layout_weight="1"
- android:layoutDirection="ltr"
- android:orientation="vertical">
-
- <!-- Set this to be just above key1. It would be better to introduce a barrier above
- key1/key2/key3, then place this View above that. Sadly, that doesn't work (the Barrier
- drops to the bottom of the page, and key1/2/3 all shoot up to the top-left). In any
- case, the Flow should ensure that key1/2/3 all have the same top, so this should be
- fine. -->
- <com.android.keyguard.AlphaOptimizedRelativeLayout
- android:id="@+id/row0"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:paddingBottom="@dimen/num_pad_entry_row_margin_bottom"
- androidprv:layout_constraintTop_toTopOf="parent"
- androidprv:layout_constraintEnd_toEndOf="parent"
- androidprv:layout_constraintStart_toStartOf="parent"
- androidprv:layout_constraintBottom_toTopOf="@id/key1"
- androidprv:layout_constraintVertical_bias="0.5">
-
- <com.android.keyguard.PasswordTextView
- android:id="@+id/pinEntry"
- style="@style/Widget.TextView.Password"
- android:layout_width="@dimen/keyguard_security_width"
- android:layout_height="@dimen/keyguard_password_height"
- android:layout_centerHorizontal="true"
- android:layout_marginRight="72dp"
- android:contentDescription="@string/keyguard_accessibility_pin_area"
- androidprv:scaledTextSize="@integer/scaled_password_text_size" />
- </com.android.keyguard.AlphaOptimizedRelativeLayout>
-
- <!-- Guideline used to place the top row of keys relative to the screen height. This will be
- updated in KeyguardPINView to reduce the height of the PIN pad. -->
- <androidx.constraintlayout.widget.Guideline
- android:id="@+id/pin_pad_top_guideline"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- androidprv:layout_constraintGuide_percent="0"
- android:orientation="horizontal" />
-
- <com.android.keyguard.KeyguardPinFlowView
- android:id="@+id/flow1"
- android:layout_width="0dp"
- android:layout_height="0dp"
- android:orientation="horizontal"
- android:clipChildren="false"
- android:clipToPadding="false"
-
- androidprv:constraint_referenced_ids="key1,key2,key3,key4,key5,key6,key7,key8,key9,delete_button,key0,key_enter"
-
- androidprv:flow_horizontalGap="@dimen/num_pad_key_margin_end"
-
- androidprv:flow_horizontalStyle="packed"
- androidprv:flow_maxElementsWrap="3"
-
- androidprv:flow_verticalBias="1.0"
- androidprv:flow_verticalGap="@dimen/num_pad_entry_row_margin_bottom"
- androidprv:flow_verticalStyle="packed"
-
- androidprv:flow_wrapMode="aligned"
- androidprv:layout_constraintBottom_toBottomOf="parent"
- androidprv:layout_constraintEnd_toEndOf="parent"
- androidprv:layout_constraintStart_toStartOf="parent"
- androidprv:layout_constraintTop_toBottomOf="@id/pin_pad_top_guideline" />
-
- <com.android.keyguard.NumPadKey
- android:id="@+id/key1"
- android:layout_width="0dp"
- android:layout_height="0dp"
- android:accessibilityTraversalBefore="@id/key2"
- androidprv:digit="1"
- androidprv:textView="@+id/pinEntry" />
-
- <com.android.keyguard.NumPadKey
- android:id="@+id/key2"
- android:layout_width="0dp"
- android:layout_height="0dp"
- android:accessibilityTraversalBefore="@id/key3"
- androidprv:digit="2"
- androidprv:textView="@+id/pinEntry" />
-
- <com.android.keyguard.NumPadKey
- android:id="@+id/key3"
- android:layout_width="0dp"
- android:layout_height="0dp"
- android:accessibilityTraversalBefore="@id/key4"
- androidprv:digit="3"
- androidprv:textView="@+id/pinEntry" />
-
- <com.android.keyguard.NumPadKey
- android:id="@+id/key4"
- android:layout_width="0dp"
- android:layout_height="0dp"
- android:accessibilityTraversalBefore="@id/key5"
- androidprv:digit="4"
- androidprv:textView="@+id/pinEntry" />
-
- <com.android.keyguard.NumPadKey
- android:id="@+id/key5"
- android:layout_width="0dp"
- android:layout_height="0dp"
- android:accessibilityTraversalBefore="@id/key6"
- androidprv:digit="5"
- androidprv:textView="@+id/pinEntry" />
-
- <com.android.keyguard.NumPadKey
- android:id="@+id/key6"
- android:layout_width="0dp"
- android:layout_height="0dp"
- android:accessibilityTraversalBefore="@id/key7"
- androidprv:digit="6"
- androidprv:textView="@+id/pinEntry" />
-
- <com.android.keyguard.NumPadKey
- android:id="@+id/key7"
- android:layout_width="0dp"
- android:layout_height="0dp"
- android:accessibilityTraversalBefore="@id/key8"
- androidprv:digit="7"
- androidprv:textView="@+id/pinEntry" />
-
-
- <com.android.keyguard.NumPadKey
- android:id="@+id/key8"
- android:layout_width="0dp"
- android:layout_height="0dp"
- android:accessibilityTraversalBefore="@id/key9"
- androidprv:digit="8"
- androidprv:textView="@+id/pinEntry" />
-
- <com.android.keyguard.NumPadKey
- android:id="@+id/key9"
- android:layout_width="0dp"
- android:layout_height="0dp"
- android:accessibilityTraversalBefore="@id/delete_button"
- androidprv:digit="9"
- androidprv:textView="@+id/pinEntry" />
-
- <com.android.keyguard.NumPadButton
- android:id="@+id/delete_button"
- style="@style/NumPadKey.Delete"
- android:layout_width="0dp"
- android:layout_height="0dp"
- android:accessibilityTraversalBefore="@id/key0"
- android:contentDescription="@string/keyboardview_keycode_delete" />
-
- <com.android.keyguard.NumPadKey
- android:id="@+id/key0"
- android:layout_width="0dp"
- android:layout_height="0dp"
- android:accessibilityTraversalBefore="@id/key_enter"
- androidprv:digit="0"
- androidprv:textView="@+id/pinEntry" />
-
- <com.android.keyguard.NumPadButton
- android:id="@+id/key_enter"
- style="@style/NumPadKey.Enter"
- android:layout_width="0dp"
- android:layout_height="0dp"
- android:contentDescription="@string/keyboardview_keycode_enter" />
- </androidx.constraintlayout.widget.ConstraintLayout>
-
- <include layout="@layout/keyguard_eca"
- android:id="@+id/keyguard_selector_fade_container"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:orientation="vertical"
- android:layout_gravity="bottom|center_horizontal"
- android:layout_marginTop="@dimen/keyguard_eca_top_margin"
- android:layout_marginBottom="@dimen/keyguard_eca_bottom_margin"
- android:gravity="center_horizontal"/>
-
-</com.android.keyguard.KeyguardPINView>
diff --git a/packages/SystemUI/res/values-sw600dp/bools.xml b/packages/SystemUI/res/values-sw600dp/bools.xml
index 05e38bdb8389..d7ddf00f91c2 100644
--- a/packages/SystemUI/res/values-sw600dp/bools.xml
+++ b/packages/SystemUI/res/values-sw600dp/bools.xml
@@ -18,4 +18,12 @@
<resources>
<!-- Whether to show the user switcher in quick settings when only a single user is present. -->
<bool name="qs_show_user_switcher_for_single_user">true</bool>
+
+ <!-- Do update bouncer constraints (port or land) on rotation.
+ Needed for bouncer refactor to use motion layout, because constraints should only be
+ changed on small screens. Only used when flag "lockscreen.enable_landscape" (b/293252410)
+ is enabled
+
+ False here so bouncers constraints are not updated when rotating on large screens -->
+ <bool name="update_bouncer_constraints">false</bool>
</resources>
diff --git a/packages/SystemUI/res/values/bools.xml b/packages/SystemUI/res/values/bools.xml
index 405a59fe1cc7..91d3a88dcc89 100644
--- a/packages/SystemUI/res/values/bools.xml
+++ b/packages/SystemUI/res/values/bools.xml
@@ -51,4 +51,12 @@
This configuration will only apply when config_remoteInsetsControllerControlsSystemBars.
is set to true. -->
<bool name="config_remoteInsetsControllerSystemBarsCanBeShownByUserAction">false</bool>
+
+ <!-- Do update bouncer constraints (port or land) on rotation.
+ Needed for bouncer refactor to use motion layout, because constraints should only be
+ changed on small screens. Only used when flag "lockscreen.enable_landscape" (b/293252410)
+ is enabled
+
+ True here so bouncers constraints are updated when rotating on small screens -->
+ <bool name="update_bouncer_constraints">true</bool>
</resources>
diff --git a/packages/SystemUI/res/values/config.xml b/packages/SystemUI/res/values/config.xml
index 016936aae956..c13480672102 100644
--- a/packages/SystemUI/res/values/config.xml
+++ b/packages/SystemUI/res/values/config.xml
@@ -934,4 +934,12 @@
<!-- Flag controlling whether visual query attention detection has been enabled. -->
<bool name="config_enableVisualQueryAttentionDetection">false</bool>
+
+ <!--
+ Whether the scene container framework is enabled.
+
+ The scene container framework is a newer (2023) way to organize the various "scenes" between the
+ bouncer, lockscreen, shade, and quick settings.
+ -->
+ <bool name="config_sceneContainerFrameworkEnabled">true</bool>
</resources>
diff --git a/packages/SystemUI/res/values/ids.xml b/packages/SystemUI/res/values/ids.xml
index 579358fe709b..d8c808054fff 100644
--- a/packages/SystemUI/res/values/ids.xml
+++ b/packages/SystemUI/res/values/ids.xml
@@ -233,4 +233,7 @@
removed later.
-->
<item type="id" name="tag_smartspace_view" />
+
+ <!-- Tag set on the Compose implementation of the QS footer actions. -->
+ <item type="id" name="tag_compose_qs_footer_actions" />
</resources>
diff --git a/packages/SystemUI/res/xml/media_session_expanded.xml b/packages/SystemUI/res/xml/media_session_expanded.xml
index 0cdc0f9505bc..8bf7560d6ddb 100644
--- a/packages/SystemUI/res/xml/media_session_expanded.xml
+++ b/packages/SystemUI/res/xml/media_session_expanded.xml
@@ -54,10 +54,12 @@
android:layout_marginStart="@dimen/qs_media_padding"
android:layout_marginEnd="@dimen/qs_media_padding"
app:layout_constraintEnd_toStartOf="@id/actionPlayPause"
+ app:layout_constraintTop_toBottomOf="@id/media_seamless"
app:layout_constrainedWidth="true"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintBottom_toTopOf="@id/header_artist"
- app:layout_constraintHorizontal_bias="0" />
+ app:layout_constraintHorizontal_bias="0"
+ app:layout_constraintVertical_bias="1" />
<Constraint
android:id="@+id/media_explicit_indicator"
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardInputView.java b/packages/SystemUI/src/com/android/keyguard/KeyguardInputView.java
index c9d906911dbc..a72d8137663b 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardInputView.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardInputView.java
@@ -64,6 +64,11 @@ public abstract class KeyguardInputView extends LinearLayout {
return false;
}
+ /** Change motion layout constraint set based on orientation */
+ protected void updateConstraints(int orientation) {
+ //Unless overridden, never update constrains (keeping default portrait constraints)
+ }
+
protected AnimatorListenerAdapter getAnimationListener(int cuj) {
return new AnimatorListenerAdapter() {
private boolean mIsCancel;
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainerController.java b/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainerController.java
index 4d906c474970..a2d8c50fdca7 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainerController.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainerController.java
@@ -371,11 +371,9 @@ public class KeyguardSecurityContainerController extends ViewController<Keyguard
@Override
public void onOrientationChanged(int orientation) {
- if (mFeatureFlags.isEnabled(LOCKSCREEN_ENABLE_LANDSCAPE)) {
- // TODO(b/295603468)
- // Fix reinflation of views when flag is enabled.
- KeyguardSecurityContainerController.this
- .onDensityOrFontScaleOrOrientationChanged();
+ if (mFeatureFlags.isEnabled(LOCKSCREEN_ENABLE_LANDSCAPE)
+ && getResources().getBoolean(R.bool.update_bouncer_constraints)) {
+ mSecurityViewFlipperController.updateConstraints(orientation);
}
}
};
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityViewFlipper.java b/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityViewFlipper.java
index 4d2391ad5596..891eb149427b 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityViewFlipper.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityViewFlipper.java
@@ -83,6 +83,14 @@ public class KeyguardSecurityViewFlipper extends ViewFlipper {
return "";
}
+ /** Updates the keyguard view's constraints based on orientation */
+ public void updateConstraints(int orientation) {
+ KeyguardInputView securityView = getSecurityView();
+ if (securityView != null) {
+ securityView.updateConstraints(orientation);
+ }
+ }
+
@Override
protected boolean checkLayoutParams(ViewGroup.LayoutParams p) {
return p instanceof LayoutParams;
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityViewFlipperController.java b/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityViewFlipperController.java
index bc5b1ba9a294..74f0beb71eb2 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityViewFlipperController.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityViewFlipperController.java
@@ -16,6 +16,8 @@
package com.android.keyguard;
+import static com.android.systemui.flags.Flags.LOCKSCREEN_ENABLE_LANDSCAPE;
+
import android.util.Log;
import android.view.LayoutInflater;
@@ -116,30 +118,38 @@ public class KeyguardSecurityViewFlipperController
public void asynchronouslyInflateView(SecurityMode securityMode,
KeyguardSecurityCallback keyguardSecurityCallback,
@Nullable OnViewInflatedCallback onViewInflatedListener) {
- int layoutId = getLayoutIdFor(securityMode);
- int viewID = getKeyguardInputViewId(securityMode);
- if (layoutId != 0 && viewID != 0) {
+ int layoutId = mFeatureFlags.isEnabled(LOCKSCREEN_ENABLE_LANDSCAPE)
+ ? getLayoutIdFor(securityMode) : getLegacyLayoutIdFor(securityMode);
+ if (layoutId != 0) {
if (DEBUG) {
- Log.v(TAG, "inflating on bg thread id = "
- + layoutId + " . viewID = " + viewID);
+ Log.v(TAG, "inflating on bg thread id = " + layoutId + " .");
}
mAsyncLayoutInflater.inflate(layoutId, mView,
(view, resId, parent) -> {
mView.addView(view);
KeyguardInputViewController<KeyguardInputView> childController =
mKeyguardSecurityViewControllerFactory.create(
- (KeyguardInputView) view.findViewById(viewID),
+ (KeyguardInputView) view,
securityMode, keyguardSecurityCallback);
childController.init();
mChildren.add(childController);
if (onViewInflatedListener != null) {
onViewInflatedListener.onViewInflated(childController);
+
+ // Portrait constrains are default
+ if (mFeatureFlags.isEnabled(LOCKSCREEN_ENABLE_LANDSCAPE)
+ &&
+ getResources().getBoolean(R.bool.update_bouncer_constraints)) {
+ // updateConstraints based on orientation (only on small screens)
+ updateConstraints(getResources().getConfiguration().orientation);
+ }
}
});
}
}
private int getLayoutIdFor(SecurityMode securityMode) {
+ // TODO (b/297863911, b/297864907) - implement motion layout for other bouncers
switch (securityMode) {
case Pattern: return R.layout.keyguard_pattern_view;
case PIN: return R.layout.keyguard_pin_view;
@@ -151,19 +161,23 @@ public class KeyguardSecurityViewFlipperController
}
}
- private int getKeyguardInputViewId(SecurityMode securityMode) {
- //Keyguard Input View is not the root view of the layout, use these IDs for lookup.
+ private int getLegacyLayoutIdFor(SecurityMode securityMode) {
switch (securityMode) {
- case Pattern: return R.id.keyguard_pattern_view;
- case PIN: return R.id.keyguard_pin_view;
- case Password: return R.id.keyguard_password_view;
- case SimPin: return R.id.keyguard_sim_pin_view;
- case SimPuk: return R.id.keyguard_sim_puk_view;
+ case Pattern: return R.layout.keyguard_pattern_view;
+ case PIN: return R.layout.keyguard_pin_view;
+ case Password: return R.layout.keyguard_password_view;
+ case SimPin: return R.layout.keyguard_sim_pin_view;
+ case SimPuk: return R.layout.keyguard_sim_puk_view;
default:
return 0;
}
}
+ /** Updates the keyguard view's constraints based on orientation */
+ public void updateConstraints(int orientation) {
+ mView.updateConstraints(orientation);
+ }
+
/** Makes the supplied child visible if it is contained win this view, */
public void show(KeyguardInputViewController<KeyguardInputView> childController) {
int index = childController.getIndexIn(mView);
diff --git a/packages/SystemUI/src/com/android/systemui/controls/ui/ThumbnailBehavior.kt b/packages/SystemUI/src/com/android/systemui/controls/ui/ThumbnailBehavior.kt
index 0b57e792f9f7..d011dd421f7f 100644
--- a/packages/SystemUI/src/com/android/systemui/controls/ui/ThumbnailBehavior.kt
+++ b/packages/SystemUI/src/com/android/systemui/controls/ui/ThumbnailBehavior.kt
@@ -22,6 +22,7 @@ import android.graphics.drawable.ClipDrawable
import android.graphics.drawable.LayerDrawable
import android.view.View
import android.service.controls.Control
+import android.service.controls.templates.TemperatureControlTemplate
import android.service.controls.templates.ThumbnailTemplate
import android.util.TypedValue
@@ -68,7 +69,9 @@ class ThumbnailBehavior(currentUserId: Int) : Behavior {
override fun bind(cws: ControlWithState, colorOffset: Int) {
this.control = cws.control!!
cvh.setStatusText(control.getStatusText())
- template = control.getControlTemplate() as ThumbnailTemplate
+ template = control.controlTemplate as? ThumbnailTemplate
+ ?: (control.controlTemplate as TemperatureControlTemplate).template
+ as ThumbnailTemplate
val ld = cvh.layout.getBackground() as LayerDrawable
val clipLayer = ld.findDrawableByLayerId(R.id.clip_layer) as ClipDrawable
diff --git a/packages/SystemUI/src/com/android/systemui/dagger/SystemUIModule.java b/packages/SystemUI/src/com/android/systemui/dagger/SystemUIModule.java
index 08d11c2fc4ef..7ee0ff4568be 100644
--- a/packages/SystemUI/src/com/android/systemui/dagger/SystemUIModule.java
+++ b/packages/SystemUI/src/com/android/systemui/dagger/SystemUIModule.java
@@ -124,7 +124,6 @@ import com.android.systemui.user.UserModule;
import com.android.systemui.util.concurrency.SysUIConcurrencyModule;
import com.android.systemui.util.dagger.UtilModule;
import com.android.systemui.util.kotlin.CoroutinesModule;
-import com.android.systemui.util.leak.GarbageMonitorModule;
import com.android.systemui.util.sensors.SensorModule;
import com.android.systemui.util.settings.SettingsUtilModule;
import com.android.systemui.util.time.SystemClock;
@@ -177,7 +176,6 @@ import javax.inject.Named;
FlagsModule.class,
SystemPropertiesFlagsModule.class,
FooterActionsModule.class,
- GarbageMonitorModule.class,
KeyboardModule.class,
LetterboxModule.class,
KeyguardBlueprintModule.class,
diff --git a/packages/SystemUI/src/com/android/systemui/flags/Flags.kt b/packages/SystemUI/src/com/android/systemui/flags/Flags.kt
index a6453ed6b4dc..59e30a1e0109 100644
--- a/packages/SystemUI/src/com/android/systemui/flags/Flags.kt
+++ b/packages/SystemUI/src/com/android/systemui/flags/Flags.kt
@@ -215,7 +215,7 @@ object Flags {
/** Inflate and bind views upon emitting a blueprint value . */
// TODO(b/297365780): Tracking Bug
@JvmField
- val LAZY_INFLATE_KEYGUARD = unreleasedFlag("lazy_inflate_keyguard", teamfood = true)
+ val LAZY_INFLATE_KEYGUARD = releasedFlag("lazy_inflate_keyguard")
/** Enables UI updates for AI wallpapers in the wallpaper picker. */
// TODO(b/267722622): Tracking Bug
@@ -655,7 +655,10 @@ object Flags {
),
level = DeprecationLevel.WARNING,
)
- @JvmField val SCENE_CONTAINER = unreleasedFlag("scene_container")
+ @JvmField val SCENE_CONTAINER = resourceBooleanFlag(
+ R.bool.config_sceneContainerFrameworkEnabled,
+ "scene_container",
+ )
// 1900
@JvmField val NOTE_TASKS = releasedFlag("keycode_flag")
@@ -720,7 +723,7 @@ object Flags {
@JvmField val KEYBOARD_BACKLIGHT_INDICATOR = releasedFlag("keyboard_backlight_indicator")
// TODO(b/277192623): Tracking Bug
- @JvmField val KEYBOARD_EDUCATION = unreleasedFlag("keyboard_education", teamfood = false)
+ @JvmField val KEYBOARD_EDUCATION = unreleasedFlag("keyboard_education", teamfood = true)
// TODO(b/277201412): Tracking Bug
@JvmField
@@ -786,11 +789,11 @@ object Flags {
/** Enable the Compose implementation of the PeopleSpaceActivity. */
@JvmField
- val COMPOSE_PEOPLE_SPACE = releasedFlag("compose_people_space")
+ val COMPOSE_PEOPLE_SPACE = unreleasedFlag("compose_people_space", teamfood = true)
/** Enable the Compose implementation of the Quick Settings footer actions. */
@JvmField
- val COMPOSE_QS_FOOTER_ACTIONS = unreleasedFlag("compose_qs_footer_actions")
+ val COMPOSE_QS_FOOTER_ACTIONS = unreleasedFlag("compose_qs_footer_actions", teamfood = true)
/** Enable the share wifi button in Quick Settings internet dialog. */
@JvmField
diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSContainerImpl.java b/packages/SystemUI/src/com/android/systemui/qs/QSContainerImpl.java
index d2eac45754bd..37e750b86c21 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/QSContainerImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/QSContainerImpl.java
@@ -235,11 +235,15 @@ public class QSContainerImpl extends FrameLayout implements Dumpable {
quickStatusBarHeaderController.setContentMargins(mContentHorizontalPadding,
mContentHorizontalPadding);
} else {
- view.setPaddingRelative(
- mContentHorizontalPadding,
- view.getPaddingTop(),
- mContentHorizontalPadding,
- view.getPaddingBottom());
+ // Set the horizontal paddings unless the view is the Compose implementation of the
+ // footer actions.
+ if (view.getTag(R.id.tag_compose_qs_footer_actions) == null) {
+ view.setPaddingRelative(
+ mContentHorizontalPadding,
+ view.getPaddingTop(),
+ mContentHorizontalPadding,
+ view.getPaddingBottom());
+ }
}
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSFragment.java b/packages/SystemUI/src/com/android/systemui/qs/QSFragment.java
index d801faa44b40..596d024958b0 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/QSFragment.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/QSFragment.java
@@ -303,6 +303,17 @@ public class QSFragment extends LifecycleFragment implements QS, CommandQueue.Ca
// to all views except for qs_footer_actions, so we set it to the Compose view.
composeView.setId(R.id.qs_footer_actions);
+ // Set this tag so that QSContainerImpl does not add horizontal paddings to this Compose
+ // implementation of the footer actions. They will be set in Compose instead so that the
+ // background fills the full screen width.
+ composeView.setTag(R.id.tag_compose_qs_footer_actions, true);
+
+ // Set the same elevation as the View implementation, otherwise the footer actions will be
+ // drawn below the scroll view with QS grid and clicks won't get through on small devices
+ // where there isn't enough vertical space to show all the tiles and the footer actions.
+ composeView.setElevation(
+ composeView.getContext().getResources().getDimension(R.dimen.qs_panel_elevation));
+
// Replace the View by the Compose provided one.
ViewGroup parent = (ViewGroup) footerActionsView.getParent();
ViewGroup.LayoutParams layoutParams = footerActionsView.getLayoutParams();
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java
index 0277a36c91ad..b797c6339a34 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java
@@ -606,8 +606,8 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {
private final ActivityLaunchAnimator mActivityLaunchAnimator;
private final NotificationLaunchAnimatorControllerProvider mNotificationAnimationProvider;
- private final NotificationPresenter mPresenter;
- private final NotificationActivityStarter mNotificationActivityStarter;
+ private final Lazy<NotificationPresenter> mPresenterLazy;
+ private final Lazy<NotificationActivityStarter> mNotificationActivityStarterLazy;
private final Lazy<NotificationShadeDepthController> mNotificationShadeDepthControllerLazy;
private final Optional<Bubbles> mBubblesOptional;
private final Lazy<NoteTaskController> mNoteTaskControllerLazy;
@@ -681,8 +681,9 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {
Lazy<NotificationShadeWindowViewController> notificationShadeWindowViewControllerLazy,
NotificationShelfController notificationShelfController,
NotificationStackScrollLayoutController notificationStackScrollLayoutController,
- NotificationPresenter notificationPresenter,
- NotificationActivityStarter notificationActivityStarter,
+ // Lazys due to b/298099682.
+ Lazy<NotificationPresenter> notificationPresenterLazy,
+ Lazy<NotificationActivityStarter> notificationActivityStarterLazy,
NotificationLaunchAnimatorControllerProvider notifLaunchAnimatorControllerProvider,
NotificationExpansionRepository notificationExpansionRepository,
DozeParameters dozeParameters,
@@ -791,8 +792,8 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {
mStackScrollerController = notificationStackScrollLayoutController;
mStackScroller = mStackScrollerController.getView();
mNotifListContainer = mStackScrollerController.getNotificationListContainer();
- mPresenter = notificationPresenter;
- mNotificationActivityStarter = notificationActivityStarter;
+ mPresenterLazy = notificationPresenterLazy;
+ mNotificationActivityStarterLazy = notificationActivityStarterLazy;
mNotificationAnimationProvider = notifLaunchAnimatorControllerProvider;
mNotificationExpansionRepository = notificationExpansionRepository;
mDozeServiceHost = dozeServiceHost;
@@ -1509,15 +1510,16 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {
mActivityLaunchAnimator.setCallback(mActivityLaunchAnimatorCallback);
mActivityLaunchAnimator.addListener(mActivityLaunchAnimatorListener);
mRemoteInputManager.addControllerCallback(mNotificationShadeWindowController);
- mStackScrollerController.setNotificationActivityStarter(mNotificationActivityStarter);
- mGutsManager.setNotificationActivityStarter(mNotificationActivityStarter);
- mShadeController.setNotificationPresenter(mPresenter);
+ mStackScrollerController.setNotificationActivityStarter(
+ mNotificationActivityStarterLazy.get());
+ mGutsManager.setNotificationActivityStarter(mNotificationActivityStarterLazy.get());
+ mShadeController.setNotificationPresenter(mPresenterLazy.get());
mNotificationsController.initialize(
- mPresenter,
+ mPresenterLazy.get(),
mNotifListContainer,
mStackScrollerController.getNotifStackController(),
- mNotificationActivityStarter);
- mWindowRootViewVisibilityInteractor.setUp(mPresenter, mNotificationsController);
+ mNotificationActivityStarterLazy.get());
+ mWindowRootViewVisibilityInteractor.setUp(mPresenterLazy.get(), mNotificationsController);
}
/**
@@ -1710,7 +1712,7 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {
private void onExpandedInvisible() {
setInteracting(StatusBarManager.WINDOW_STATUS_BAR, false);
- if (!mNotificationActivityStarter.isCollapsingToShowActivityOverLockscreen()) {
+ if (!mNotificationActivityStarterLazy.get().isCollapsingToShowActivityOverLockscreen()) {
showBouncerOrLockScreenIfKeyguard();
} else if (DEBUG) {
Log.d(TAG, "Not showing bouncer due to activity showing over lockscreen");
@@ -2036,7 +2038,7 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {
String action = intent.getAction();
if (ACTION_FAKE_ARTWORK.equals(action)) {
if (DEBUG_MEDIA_FAKE_ARTWORK) {
- mPresenter.updateMediaMetaData(true, true);
+ mPresenterLazy.get().updateMediaMetaData(true, true);
}
}
}
@@ -2218,7 +2220,7 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {
releaseGestureWakeLock();
runLaunchTransitionEndRunnable();
mKeyguardStateController.setLaunchTransitionFadingAway(false);
- mPresenter.updateMediaMetaData(true /* metaDataChanged */, true);
+ mPresenterLazy.get().updateMediaMetaData(true /* metaDataChanged */, true);
}
/**
@@ -2242,7 +2244,7 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {
beforeFading.run();
}
updateScrimController();
- mPresenter.updateMediaMetaData(false, true);
+ mPresenterLazy.get().updateMediaMetaData(false, true);
mShadeSurface.resetAlpha();
mShadeSurface.fadeOut(
FADE_KEYGUARD_START_DELAY, FADE_KEYGUARD_DURATION,
@@ -3343,7 +3345,8 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {
updateDozingState();
checkBarModes();
updateScrimController();
- mPresenter.updateMediaMetaData(false, mState != StatusBarState.KEYGUARD);
+ mPresenterLazy.get()
+ .updateMediaMetaData(false, mState != StatusBarState.KEYGUARD);
Trace.endSection();
}
diff --git a/packages/SystemUI/tests/src/com/android/keyguard/KeyguardSecurityContainerControllerTest.kt b/packages/SystemUI/tests/src/com/android/keyguard/KeyguardSecurityContainerControllerTest.kt
index 02b9bf06fc2a..5da919b22afe 100644
--- a/packages/SystemUI/tests/src/com/android/keyguard/KeyguardSecurityContainerControllerTest.kt
+++ b/packages/SystemUI/tests/src/com/android/keyguard/KeyguardSecurityContainerControllerTest.kt
@@ -622,51 +622,6 @@ class KeyguardSecurityContainerControllerTest : SysuiTestCase() {
configurationListenerArgumentCaptor.value.onUiModeChanged()
verify(view).reloadColors()
}
- @Test
- fun onOrientationChanged_landscapeKeyguardFlagDisabled_blockReinflate() {
- featureFlags.set(Flags.LOCKSCREEN_ENABLE_LANDSCAPE, false)
-
- // Run onOrientationChanged
- val configurationListenerArgumentCaptor =
- ArgumentCaptor.forClass(ConfigurationController.ConfigurationListener::class.java)
- underTest.onViewAttached()
- verify(configurationController).addCallback(configurationListenerArgumentCaptor.capture())
- clearInvocations(viewFlipperController)
- configurationListenerArgumentCaptor.value.onOrientationChanged(
- Configuration.ORIENTATION_LANDSCAPE
- )
- // Verify view is reinflated when flag is on
- verify(viewFlipperController, never()).clearViews()
- verify(viewFlipperController, never())
- .asynchronouslyInflateView(
- eq(SecurityMode.PIN),
- any(),
- onViewInflatedCallbackArgumentCaptor.capture()
- )
- }
-
- @Test
- fun onOrientationChanged_landscapeKeyguardFlagEnabled_doesReinflate() {
- featureFlags.set(Flags.LOCKSCREEN_ENABLE_LANDSCAPE, true)
-
- // Run onOrientationChanged
- val configurationListenerArgumentCaptor =
- ArgumentCaptor.forClass(ConfigurationController.ConfigurationListener::class.java)
- underTest.onViewAttached()
- verify(configurationController).addCallback(configurationListenerArgumentCaptor.capture())
- clearInvocations(viewFlipperController)
- configurationListenerArgumentCaptor.value.onOrientationChanged(
- Configuration.ORIENTATION_LANDSCAPE
- )
- // Verify view is reinflated when flag is on
- verify(viewFlipperController).clearViews()
- verify(viewFlipperController)
- .asynchronouslyInflateView(
- eq(SecurityMode.PIN),
- any(),
- onViewInflatedCallbackArgumentCaptor.capture()
- )
- }
@Test
fun hasDismissActions() {
diff --git a/packages/SystemUI/tests/src/com/android/keyguard/KeyguardSecurityViewFlipperControllerTest.java b/packages/SystemUI/tests/src/com/android/keyguard/KeyguardSecurityViewFlipperControllerTest.java
index 68c2f59722ad..19bc8186eee5 100644
--- a/packages/SystemUI/tests/src/com/android/keyguard/KeyguardSecurityViewFlipperControllerTest.java
+++ b/packages/SystemUI/tests/src/com/android/keyguard/KeyguardSecurityViewFlipperControllerTest.java
@@ -140,11 +140,6 @@ public class KeyguardSecurityViewFlipperControllerTest extends SysuiTestCase {
@Test
public void asynchronouslyInflateView_setNeedsInput() {
- when(mKeyguardSecurityViewControllerFactory.create(
- any(), any(SecurityMode.class),
- any(KeyguardSecurityCallback.class)))
- .thenReturn(mKeyguardInputViewController);
-
ArgumentCaptor<AsyncLayoutInflater.OnInflateFinishedListener> argumentCaptor =
ArgumentCaptor.forClass(AsyncLayoutInflater.OnInflateFinishedListener.class);
mKeyguardSecurityViewFlipperController.asynchronouslyInflateView(SecurityMode.PIN,
diff --git a/packages/SystemUI/tests/src/com/android/systemui/controls/ui/TemperatureControlBehaviorTest.kt b/packages/SystemUI/tests/src/com/android/systemui/controls/ui/TemperatureControlBehaviorTest.kt
new file mode 100644
index 000000000000..588e34d3111d
--- /dev/null
+++ b/packages/SystemUI/tests/src/com/android/systemui/controls/ui/TemperatureControlBehaviorTest.kt
@@ -0,0 +1,98 @@
+package com.android.systemui.controls.ui
+
+import android.app.PendingIntent
+import android.content.ComponentName
+import android.content.Intent
+import android.graphics.drawable.Icon
+import android.service.controls.Control
+import android.service.controls.DeviceTypes
+import android.service.controls.templates.TemperatureControlTemplate
+import android.service.controls.templates.ThumbnailTemplate
+import android.view.LayoutInflater
+import android.view.ViewGroup
+import androidx.test.filters.SmallTest
+import com.android.systemui.R
+import com.android.systemui.SysuiTestCase
+import com.android.systemui.controls.ControlsMetricsLogger
+import com.android.systemui.controls.controller.ControlInfo
+import com.android.systemui.controls.controller.ControlsController
+import com.android.systemui.util.concurrency.FakeExecutor
+import com.android.systemui.util.time.FakeSystemClock
+import org.junit.Before
+import org.junit.Test
+import org.mockito.Mock
+import org.mockito.MockitoAnnotations
+
+@SmallTest
+class TemperatureControlBehaviorTest : SysuiTestCase() {
+
+ @Mock lateinit var controlsMetricsLogger: ControlsMetricsLogger
+ @Mock lateinit var controlActionCoordinator: ControlActionCoordinator
+ @Mock lateinit var controlsController: ControlsController
+
+ private val fakeSystemClock = FakeSystemClock()
+ private val underTest = TemperatureControlBehavior()
+
+ private lateinit var viewHolder: ControlViewHolder
+
+ @Before
+ fun setup() {
+ MockitoAnnotations.initMocks(this)
+
+ viewHolder =
+ ControlViewHolder(
+ LayoutInflater.from(mContext).inflate(R.layout.controls_base_item, null, false)
+ as ViewGroup,
+ controlsController,
+ FakeExecutor(fakeSystemClock),
+ FakeExecutor(fakeSystemClock),
+ controlActionCoordinator,
+ controlsMetricsLogger,
+ 0,
+ 0,
+ )
+ }
+
+ @Test
+ fun testBehaviourSupportsThumbnailSubBehaviour() {
+ val controlWithState =
+ ControlWithState(
+ ComponentName("test.pkg", "TestClass"),
+ ControlInfo(
+ "test_id",
+ "test title",
+ "test subtitle",
+ DeviceTypes.TYPE_AC_UNIT,
+ ),
+ Control.StatefulBuilder(
+ "",
+ PendingIntent.getActivity(
+ context,
+ 0,
+ Intent(),
+ PendingIntent.FLAG_IMMUTABLE,
+ ),
+ )
+ .setControlTemplate(
+ TemperatureControlTemplate(
+ "test id",
+ ThumbnailTemplate(
+ "test id",
+ false,
+ Icon.createWithContentUri(""),
+ "test description",
+ ),
+ 0,
+ 0,
+ 0
+ )
+ )
+ .setStatus(Control.STATUS_OK)
+ .build()
+ )
+ viewHolder.bindData(controlWithState, false)
+ underTest.initialize(viewHolder)
+
+ underTest.bind(controlWithState, 0) // no crash
+ }
+}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/screenshot/ScreenshotPolicyImplTest.kt b/packages/SystemUI/tests/src/com/android/systemui/screenshot/ScreenshotPolicyImplTest.kt
index ee61f5736263..587da2d5d677 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/screenshot/ScreenshotPolicyImplTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/screenshot/ScreenshotPolicyImplTest.kt
@@ -140,7 +140,7 @@ class ScreenshotPolicyImplTest : SysuiTestCase() {
private val pipTask = RootTaskInfo().apply {
configuration.windowConfiguration.apply {
windowingMode = WINDOWING_MODE_PINNED
- bounds = Rect(628, 1885, 1038, 2295)
+ setBounds(Rect(628, 1885, 1038, 2295))
activityType = ACTIVITY_TYPE_STANDARD
}
displayId = DISPLAY_ID
@@ -164,7 +164,7 @@ class ScreenshotPolicyImplTest : SysuiTestCase() {
private val fullScreenWorkProfileTask = RootTaskInfo().apply {
configuration.windowConfiguration.apply {
windowingMode = WINDOWING_MODE_FULLSCREEN
- bounds = Rect(0, 0, 1080, 2400)
+ setBounds(Rect(0, 0, 1080, 2400))
activityType = ACTIVITY_TYPE_STANDARD
}
displayId = DISPLAY_ID
@@ -188,7 +188,7 @@ class ScreenshotPolicyImplTest : SysuiTestCase() {
private val launcherTask = RootTaskInfo().apply {
configuration.windowConfiguration.apply {
windowingMode = WINDOWING_MODE_FULLSCREEN
- bounds = Rect(0, 0, 1080, 2400)
+ setBounds(Rect(0, 0, 1080, 2400))
activityType = ACTIVITY_TYPE_HOME
}
displayId = DISPLAY_ID
@@ -212,7 +212,7 @@ class ScreenshotPolicyImplTest : SysuiTestCase() {
private val emptyTask = RootTaskInfo().apply {
configuration.windowConfiguration.apply {
windowingMode = WINDOWING_MODE_FULLSCREEN
- bounds = Rect(0, 0, 1080, 2400)
+ setBounds(Rect(0, 0, 1080, 2400))
activityType = ACTIVITY_TYPE_UNDEFINED
}
displayId = DISPLAY_ID
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/CentralSurfacesImplTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/CentralSurfacesImplTest.java
index 4e3690f1d124..137566bf1a2a 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/CentralSurfacesImplTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/CentralSurfacesImplTest.java
@@ -136,6 +136,7 @@ import com.android.systemui.statusbar.LockscreenShadeTransitionController;
import com.android.systemui.statusbar.NotificationListener;
import com.android.systemui.statusbar.NotificationLockscreenUserManager;
import com.android.systemui.statusbar.NotificationMediaManager;
+import com.android.systemui.statusbar.NotificationPresenter;
import com.android.systemui.statusbar.NotificationRemoteInputManager;
import com.android.systemui.statusbar.NotificationShadeDepthController;
import com.android.systemui.statusbar.NotificationShadeWindowController;
@@ -491,8 +492,8 @@ public class CentralSurfacesImplTest extends SysuiTestCase {
mNotificationShadeWindowViewControllerLazy,
mNotificationShelfController,
mStackScrollerController,
- mNotificationPresenter,
- mNotificationActivityStarter,
+ (Lazy<NotificationPresenter>) () -> mNotificationPresenter,
+ (Lazy<NotificationActivityStarter>) () -> mNotificationActivityStarter,
mNotifLaunchAnimControllerProvider,
new NotificationExpansionRepository(),
mDozeParameters,
diff --git a/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java b/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java
index cbf4cced0e9b..93ba362070d3 100644
--- a/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java
+++ b/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java
@@ -63,6 +63,7 @@ import android.app.PendingIntent;
import android.app.RemoteAction;
import android.app.admin.DevicePolicyManager;
import android.appwidget.AppWidgetManagerInternal;
+import android.companion.virtual.VirtualDeviceManager;
import android.content.ActivityNotFoundException;
import android.content.BroadcastReceiver;
import android.content.ComponentName;
@@ -928,18 +929,32 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub
mContext.registerReceiverAsUser(receiver, UserHandle.ALL, filter, null, mMainHandler,
Context.RECEIVER_EXPORTED);
- final BroadcastReceiver virtualDeviceReceiver = new BroadcastReceiver() {
- @Override
- public void onReceive(Context context, Intent intent) {
- final int deviceId = intent.getIntExtra(
- EXTRA_VIRTUAL_DEVICE_ID, DEVICE_ID_DEFAULT);
- mProxyManager.clearConnections(deviceId);
+ if (android.companion.virtual.flags.Flags.vdmPublicApis()) {
+ VirtualDeviceManager vdm = mContext.getSystemService(VirtualDeviceManager.class);
+ if (vdm != null) {
+ vdm.registerVirtualDeviceListener(mContext.getMainExecutor(),
+ new VirtualDeviceManager.VirtualDeviceListener() {
+ @Override
+ public void onVirtualDeviceClosed(int deviceId) {
+ mProxyManager.clearConnections(deviceId);
+ }
+ });
}
- };
+ } else {
+ final BroadcastReceiver virtualDeviceReceiver = new BroadcastReceiver() {
+ @Override
+ public void onReceive(Context context, Intent intent) {
+ final int deviceId = intent.getIntExtra(
+ EXTRA_VIRTUAL_DEVICE_ID, DEVICE_ID_DEFAULT);
+ mProxyManager.clearConnections(deviceId);
+ }
+ };
- final IntentFilter virtualDeviceFilter = new IntentFilter(ACTION_VIRTUAL_DEVICE_REMOVED);
- mContext.registerReceiver(virtualDeviceReceiver, virtualDeviceFilter,
- Context.RECEIVER_NOT_EXPORTED);
+ final IntentFilter virtualDeviceFilter = new IntentFilter(
+ ACTION_VIRTUAL_DEVICE_REMOVED);
+ mContext.registerReceiver(virtualDeviceReceiver, virtualDeviceFilter,
+ Context.RECEIVER_NOT_EXPORTED);
+ }
}
/**
diff --git a/services/autofill/java/com/android/server/autofill/AutofillManagerService.java b/services/autofill/java/com/android/server/autofill/AutofillManagerService.java
index ec4203e3390c..cad8fcf39b32 100644
--- a/services/autofill/java/com/android/server/autofill/AutofillManagerService.java
+++ b/services/autofill/java/com/android/server/autofill/AutofillManagerService.java
@@ -594,8 +594,6 @@ public final class AutofillManagerService
// Called by Shell command.
int getMaxPartitions() {
- enforceCallingPermissionForManagement();
-
synchronized (mLock) {
return sPartitionMaxCount;
}
@@ -628,8 +626,6 @@ public final class AutofillManagerService
// Called by Shell command.
int getMaxVisibleDatasets() {
- enforceCallingPermissionForManagement();
-
synchronized (sLock) {
return sVisibleDatasetsMaxCount;
}
diff --git a/services/companion/java/com/android/server/companion/virtual/GenericWindowPolicyController.java b/services/companion/java/com/android/server/companion/virtual/GenericWindowPolicyController.java
index 9e7b897119a1..b07a0bb57678 100644
--- a/services/companion/java/com/android/server/companion/virtual/GenericWindowPolicyController.java
+++ b/services/companion/java/com/android/server/companion/virtual/GenericWindowPolicyController.java
@@ -27,8 +27,6 @@ import android.annotation.UserIdInt;
import android.app.WindowConfiguration;
import android.app.compat.CompatChanges;
import android.companion.virtual.VirtualDeviceManager.ActivityListener;
-import android.companion.virtual.VirtualDeviceParams;
-import android.companion.virtual.VirtualDeviceParams.ActivityPolicy;
import android.compat.annotation.ChangeId;
import android.compat.annotation.EnabledSince;
import android.content.ComponentName;
@@ -108,18 +106,14 @@ public class GenericWindowPolicyController extends DisplayWindowPolicyController
public static final long ALLOW_SECURE_ACTIVITY_DISPLAY_ON_REMOTE_DEVICE = 201712607L;
@NonNull
private final ArraySet<UserHandle> mAllowedUsers;
- @Nullable
- private final ArraySet<ComponentName> mAllowedCrossTaskNavigations;
- @Nullable
- private final ArraySet<ComponentName> mBlockedCrossTaskNavigations;
- @Nullable
- private final ArraySet<ComponentName> mAllowedActivities;
- @Nullable
- private final ArraySet<ComponentName> mBlockedActivities;
+ private final boolean mActivityLaunchAllowedByDefault;
+ @NonNull
+ private final ArraySet<ComponentName> mActivityPolicyExceptions;
+ private final boolean mCrossTaskNavigationAllowedByDefault;
+ @NonNull
+ private final ArraySet<ComponentName> mCrossTaskNavigationExceptions;
private final Object mGenericWindowPolicyControllerLock = new Object();
- @ActivityPolicy
- private final int mDefaultActivityPolicy;
- private final ActivityBlockedCallback mActivityBlockedCallback;
+ @Nullable private final ActivityBlockedCallback mActivityBlockedCallback;
private int mDisplayId = Display.INVALID_DISPLAY;
@NonNull
@@ -134,7 +128,7 @@ public class GenericWindowPolicyController extends DisplayWindowPolicyController
private final ArraySet<RunningAppsChangedListener> mRunningAppsChangedListeners =
new ArraySet<>();
@Nullable private final SecureWindowCallback mSecureWindowCallback;
- @Nullable private final Set<String> mDisplayCategories;
+ @NonNull private final Set<String> mDisplayCategories;
@GuardedBy("mGenericWindowPolicyControllerLock")
private boolean mShowTasksInHostDeviceRecents;
@@ -146,18 +140,14 @@ public class GenericWindowPolicyController extends DisplayWindowPolicyController
* @param windowFlags The window flags that this controller is interested in.
* @param systemWindowFlags The system window flags that this controller is interested in.
* @param allowedUsers The set of users that are allowed to stream in this display.
- * @param allowedCrossTaskNavigations The set of components explicitly allowed to navigate
- * across tasks on this device.
- * @param blockedCrossTaskNavigations The set of components explicitly blocked from
- * navigating across tasks on this device.
- * @param allowedActivities The set of activities explicitly allowed to stream on this device.
- * Used only if the {@code activityPolicy} is
- * {@link VirtualDeviceParams#ACTIVITY_POLICY_DEFAULT_BLOCKED}.
- * @param blockedActivities The set of activities explicitly blocked from streaming on this
- * device. Used only if the {@code activityPolicy} is
- * {@link VirtualDeviceParams#ACTIVITY_POLICY_DEFAULT_ALLOWED}
- * @param defaultActivityPolicy Whether activities are default allowed to be displayed or
- * blocked.
+ * @param activityLaunchAllowedByDefault Whether activities are default allowed to be launched
+ * or blocked.
+ * @param activityPolicyExceptions The set of activities explicitly exempt from the default
+ * activity policy.
+ * @param crossTaskNavigationAllowedByDefault Whether cross task navigations are allowed by
+ * default or not.
+ * @param crossTaskNavigationExceptions The set of components explicitly exempt from the default
+ * navigation policy.
* @param activityListener Activity listener to listen for activity changes.
* @param activityBlockedCallback Callback that is called when an activity is blocked from
* launching.
@@ -169,25 +159,23 @@ public class GenericWindowPolicyController extends DisplayWindowPolicyController
*/
public GenericWindowPolicyController(int windowFlags, int systemWindowFlags,
@NonNull ArraySet<UserHandle> allowedUsers,
- @NonNull Set<ComponentName> allowedCrossTaskNavigations,
- @NonNull Set<ComponentName> blockedCrossTaskNavigations,
- @NonNull Set<ComponentName> allowedActivities,
- @NonNull Set<ComponentName> blockedActivities,
- @ActivityPolicy int defaultActivityPolicy,
- @NonNull ActivityListener activityListener,
- @NonNull PipBlockedCallback pipBlockedCallback,
- @NonNull ActivityBlockedCallback activityBlockedCallback,
- @NonNull SecureWindowCallback secureWindowCallback,
- @NonNull IntentListenerCallback intentListenerCallback,
+ boolean activityLaunchAllowedByDefault,
+ @NonNull Set<ComponentName> activityPolicyExceptions,
+ boolean crossTaskNavigationAllowedByDefault,
+ @NonNull Set<ComponentName> crossTaskNavigationExceptions,
+ @Nullable ActivityListener activityListener,
+ @Nullable PipBlockedCallback pipBlockedCallback,
+ @Nullable ActivityBlockedCallback activityBlockedCallback,
+ @Nullable SecureWindowCallback secureWindowCallback,
+ @Nullable IntentListenerCallback intentListenerCallback,
@NonNull Set<String> displayCategories,
boolean showTasksInHostDeviceRecents) {
super();
mAllowedUsers = allowedUsers;
- mAllowedCrossTaskNavigations = new ArraySet<>(allowedCrossTaskNavigations);
- mBlockedCrossTaskNavigations = new ArraySet<>(blockedCrossTaskNavigations);
- mAllowedActivities = new ArraySet<>(allowedActivities);
- mBlockedActivities = new ArraySet<>(blockedActivities);
- mDefaultActivityPolicy = defaultActivityPolicy;
+ mActivityLaunchAllowedByDefault = activityLaunchAllowedByDefault;
+ mActivityPolicyExceptions = new ArraySet<>(activityPolicyExceptions);
+ mCrossTaskNavigationAllowedByDefault = crossTaskNavigationAllowedByDefault;
+ mCrossTaskNavigationExceptions = new ArraySet<>(crossTaskNavigationExceptions);
mActivityBlockedCallback = activityBlockedCallback;
setInterestedWindowFlags(windowFlags, systemWindowFlags);
mActivityListener = activityListener;
@@ -233,7 +221,9 @@ public class GenericWindowPolicyController extends DisplayWindowPolicyController
@Nullable Intent intent, @WindowConfiguration.WindowingMode int windowingMode,
int launchingFromDisplayId, boolean isNewTask) {
if (!canContainActivity(activityInfo, windowingMode, launchingFromDisplayId, isNewTask)) {
- mActivityBlockedCallback.onActivityBlocked(mDisplayId, activityInfo);
+ if (mActivityBlockedCallback != null) {
+ mActivityBlockedCallback.onActivityBlocked(mDisplayId, activityInfo);
+ }
return false;
}
if (mIntentListenerCallback != null && intent != null
@@ -275,22 +265,17 @@ public class GenericWindowPolicyController extends DisplayWindowPolicyController
+ mDisplayCategories);
return false;
}
- if ((mDefaultActivityPolicy == VirtualDeviceParams.ACTIVITY_POLICY_DEFAULT_ALLOWED
- && mBlockedActivities.contains(activityComponent))
- || (mDefaultActivityPolicy == VirtualDeviceParams.ACTIVITY_POLICY_DEFAULT_BLOCKED
- && !mAllowedActivities.contains(activityComponent))) {
+ if (!isAllowedByPolicy(mActivityLaunchAllowedByDefault, mActivityPolicyExceptions,
+ activityComponent)) {
Slog.d(TAG, "Virtual device launch disallowed by policy: " + activityComponent);
return false;
}
- if (isNewTask && launchingFromDisplayId != DEFAULT_DISPLAY) {
- if ((!mBlockedCrossTaskNavigations.isEmpty()
- && mBlockedCrossTaskNavigations.contains(activityComponent))
- || ((!mAllowedCrossTaskNavigations.isEmpty()
- && !mAllowedCrossTaskNavigations.contains(activityComponent)))) {
- Slog.d(TAG, "Virtual device cross task navigation disallowed by policy: "
- + activityComponent);
- return false;
- }
+ if (isNewTask && launchingFromDisplayId != DEFAULT_DISPLAY
+ && !isAllowedByPolicy(mCrossTaskNavigationAllowedByDefault,
+ mCrossTaskNavigationExceptions, activityComponent)) {
+ Slog.d(TAG, "Virtual device cross task navigation disallowed by policy: "
+ + activityComponent);
+ return false;
}
return true;
@@ -302,7 +287,7 @@ public class GenericWindowPolicyController extends DisplayWindowPolicyController
int systemWindowFlags) {
// The callback is fired only when windowFlags are changed. To let VirtualDevice owner
// aware that the virtual display has a secure window on top.
- if ((windowFlags & FLAG_SECURE) != 0) {
+ if ((windowFlags & FLAG_SECURE) != 0 && mSecureWindowCallback != null) {
// Post callback on the main thread, so it doesn't block activity launching.
mHandler.post(() -> mSecureWindowCallback.onSecureWindowShown(mDisplayId,
activityInfo.applicationInfo.uid));
@@ -314,7 +299,9 @@ public class GenericWindowPolicyController extends DisplayWindowPolicyController
// TODO(b/201712607): Add checks for the apps that use SurfaceView#setSecure.
if ((windowFlags & FLAG_SECURE) != 0
|| (systemWindowFlags & SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS) != 0) {
- mActivityBlockedCallback.onActivityBlocked(mDisplayId, activityInfo);
+ if (mActivityBlockedCallback != null) {
+ mActivityBlockedCallback.onActivityBlocked(mDisplayId, activityInfo);
+ }
return false;
}
}
@@ -367,9 +354,9 @@ public class GenericWindowPolicyController extends DisplayWindowPolicyController
if (super.isEnteringPipAllowed(uid)) {
return true;
}
- mHandler.post(() -> {
- mPipBlockedCallback.onEnteringPipBlocked(uid);
- });
+ if (mPipBlockedCallback != null) {
+ mHandler.post(() -> mPipBlockedCallback.onEnteringPipBlocked(uid));
+ }
return false;
}
@@ -389,7 +376,13 @@ public class GenericWindowPolicyController extends DisplayWindowPolicyController
}
return activityInfo.requiredDisplayCategory != null
&& mDisplayCategories.contains(activityInfo.requiredDisplayCategory);
+ }
+ private boolean isAllowedByPolicy(boolean allowedByDefault, ArraySet<ComponentName> exceptions,
+ ComponentName component) {
+ // Either allowed and the exceptions do not contain the component,
+ // or disallowed and the exceptions contain the component.
+ return allowedByDefault != exceptions.contains(component);
}
@VisibleForTesting
diff --git a/services/companion/java/com/android/server/companion/virtual/VirtualDeviceImpl.java b/services/companion/java/com/android/server/companion/virtual/VirtualDeviceImpl.java
index 56afeb112068..8f765e4b79d6 100644
--- a/services/companion/java/com/android/server/companion/virtual/VirtualDeviceImpl.java
+++ b/services/companion/java/com/android/server/companion/virtual/VirtualDeviceImpl.java
@@ -19,7 +19,9 @@ package com.android.server.companion.virtual;
import static android.app.admin.DevicePolicyManager.NEARBY_STREAMING_ENABLED;
import static android.app.admin.DevicePolicyManager.NEARBY_STREAMING_NOT_CONTROLLED_BY_POLICY;
import static android.app.admin.DevicePolicyManager.NEARBY_STREAMING_SAME_MANAGED_ACCOUNT_ONLY;
+import static android.companion.virtual.VirtualDeviceParams.ACTIVITY_POLICY_DEFAULT_ALLOWED;
import static android.companion.virtual.VirtualDeviceParams.DEVICE_POLICY_DEFAULT;
+import static android.companion.virtual.VirtualDeviceParams.NAVIGATION_POLICY_DEFAULT_ALLOWED;
import static android.companion.virtual.VirtualDeviceParams.POLICY_TYPE_RECENTS;
import static android.view.WindowManager.LayoutParams.FLAG_SECURE;
import static android.view.WindowManager.LayoutParams.SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS;
@@ -39,6 +41,7 @@ import android.companion.virtual.IVirtualDevice;
import android.companion.virtual.IVirtualDeviceActivityListener;
import android.companion.virtual.IVirtualDeviceIntentInterceptor;
import android.companion.virtual.IVirtualDeviceSoundEffectListener;
+import android.companion.virtual.VirtualDevice;
import android.companion.virtual.VirtualDeviceManager;
import android.companion.virtual.VirtualDeviceManager.ActivityListener;
import android.companion.virtual.VirtualDeviceParams;
@@ -168,6 +171,9 @@ final class VirtualDeviceImpl extends IVirtualDevice.Stub
@Nullable
private LocaleList mLocaleList = null;
+ @NonNull
+ private final VirtualDevice mPublicVirtualDeviceObject;
+
private ActivityListener createListenerAdapter() {
return new ActivityListener() {
@@ -286,6 +292,9 @@ final class VirtualDeviceImpl extends IVirtualDevice.Stub
throw e.rethrowFromSystemServer();
}
mVirtualDeviceLog.logCreated(deviceId, mOwnerUid);
+
+ mPublicVirtualDeviceObject = new VirtualDevice(
+ this, getDeviceId(), getPersistentDeviceId(), mParams.getName());
}
@VisibleForTesting
@@ -315,9 +324,9 @@ final class VirtualDeviceImpl extends IVirtualDevice.Stub
return mAssociationInfo.getDisplayName();
}
- /** Returns the optional name of the device. */
- String getDeviceName() {
- return mParams.getName();
+ /** Returns the public representation of the device. */
+ VirtualDevice getPublicVirtualDeviceObject() {
+ return mPublicVirtualDeviceObject;
}
/** Returns the locale of the device. */
@@ -327,7 +336,7 @@ final class VirtualDeviceImpl extends IVirtualDevice.Stub
}
}
- /** Returns the policy specified for this policy type */
+ @Override // Binder call
public @VirtualDeviceParams.DevicePolicy int getDevicePolicy(
@VirtualDeviceParams.PolicyType int policyType) {
if (Flags.dynamicPolicy()) {
@@ -754,8 +763,10 @@ final class VirtualDeviceImpl extends IVirtualDevice.Stub
synchronized (mVirtualDeviceLock) {
mDefaultShowPointerIcon = showPointerIcon;
}
- getDisplayIds().forEach(
- displayId -> mInputController.setShowPointerIcon(showPointerIcon, displayId));
+ final int[] displayIds = getDisplayIds();
+ for (int i = 0; i < displayIds.length; ++i) {
+ mInputController.setShowPointerIcon(showPointerIcon, displayIds[i]);
+ }
} finally {
Binder.restoreCallingIdentity(ident);
}
@@ -831,22 +842,31 @@ final class VirtualDeviceImpl extends IVirtualDevice.Stub
private GenericWindowPolicyController createWindowPolicyController(
@NonNull Set<String> displayCategories) {
- final GenericWindowPolicyController gwpc =
- new GenericWindowPolicyController(FLAG_SECURE,
- SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS,
- getAllowedUserHandles(),
- mParams.getAllowedCrossTaskNavigations(),
- mParams.getBlockedCrossTaskNavigations(),
- mParams.getAllowedActivities(),
- mParams.getBlockedActivities(),
- mParams.getDefaultActivityPolicy(),
- createListenerAdapter(),
- this::onEnteringPipBlocked,
- this::onActivityBlocked,
- this::onSecureWindowShown,
- this::shouldInterceptIntent,
- displayCategories,
- mParams.getDevicePolicy(POLICY_TYPE_RECENTS) == DEVICE_POLICY_DEFAULT);
+ final boolean activityLaunchAllowedByDefault =
+ mParams.getDefaultActivityPolicy() == ACTIVITY_POLICY_DEFAULT_ALLOWED;
+ final boolean crossTaskNavigationAllowedByDefault =
+ mParams.getDefaultNavigationPolicy() == NAVIGATION_POLICY_DEFAULT_ALLOWED;
+ final boolean showTasksInHostDeviceRecents =
+ mParams.getDevicePolicy(POLICY_TYPE_RECENTS) == DEVICE_POLICY_DEFAULT;
+
+ final GenericWindowPolicyController gwpc = new GenericWindowPolicyController(
+ FLAG_SECURE,
+ SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS,
+ getAllowedUserHandles(),
+ activityLaunchAllowedByDefault,
+ /*activityPolicyExceptions=*/activityLaunchAllowedByDefault
+ ? mParams.getBlockedActivities() : mParams.getAllowedActivities(),
+ crossTaskNavigationAllowedByDefault,
+ /*crossTaskNavigationExceptions=*/crossTaskNavigationAllowedByDefault
+ ? mParams.getBlockedCrossTaskNavigations()
+ : mParams.getAllowedCrossTaskNavigations(),
+ createListenerAdapter(),
+ this::onEnteringPipBlocked,
+ this::onActivityBlocked,
+ this::onSecureWindowShown,
+ this::shouldInterceptIntent,
+ displayCategories,
+ showTasksInHostDeviceRecents);
gwpc.registerRunningAppsChangedListener(/* listener= */ this);
return gwpc;
}
@@ -1018,14 +1038,15 @@ final class VirtualDeviceImpl extends IVirtualDevice.Stub
return mOwnerUid;
}
- ArraySet<Integer> getDisplayIds() {
+ @Override // Binder call
+ public int[] getDisplayIds() {
synchronized (mVirtualDeviceLock) {
final int size = mVirtualDisplays.size();
- ArraySet<Integer> arraySet = new ArraySet<>(size);
+ int[] displayIds = new int[size];
for (int i = 0; i < size; i++) {
- arraySet.append(mVirtualDisplays.keyAt(i));
+ displayIds[i] = mVirtualDisplays.keyAt(i);
}
- return arraySet;
+ return displayIds;
}
}
diff --git a/services/companion/java/com/android/server/companion/virtual/VirtualDeviceManagerService.java b/services/companion/java/com/android/server/companion/virtual/VirtualDeviceManagerService.java
index 4da929816d2f..cfe56e910b8a 100644
--- a/services/companion/java/com/android/server/companion/virtual/VirtualDeviceManagerService.java
+++ b/services/companion/java/com/android/server/companion/virtual/VirtualDeviceManagerService.java
@@ -30,6 +30,7 @@ import android.companion.AssociationInfo;
import android.companion.CompanionDeviceManager;
import android.companion.virtual.IVirtualDevice;
import android.companion.virtual.IVirtualDeviceActivityListener;
+import android.companion.virtual.IVirtualDeviceListener;
import android.companion.virtual.IVirtualDeviceManager;
import android.companion.virtual.IVirtualDeviceSoundEffectListener;
import android.companion.virtual.VirtualDevice;
@@ -49,6 +50,7 @@ import android.os.LocaleList;
import android.os.Looper;
import android.os.Parcel;
import android.os.Process;
+import android.os.RemoteCallbackList;
import android.os.RemoteException;
import android.os.UserHandle;
import android.util.ArraySet;
@@ -70,6 +72,7 @@ import com.android.server.wm.ActivityTaskManagerInternal;
import java.io.FileDescriptor;
import java.io.PrintWriter;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Objects;
@@ -77,6 +80,7 @@ import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.function.Consumer;
+import java.util.stream.Collectors;
@SuppressLint("LongLogTag")
@@ -103,6 +107,9 @@ public class VirtualDeviceManagerService extends SystemService {
}
};
+ private final RemoteCallbackList<IVirtualDeviceListener> mVirtualDeviceListeners =
+ new RemoteCallbackList<>();
+
/**
* Mapping from device IDs to virtual devices.
*/
@@ -225,6 +232,17 @@ public class VirtualDeviceManagerService extends SystemService {
mVirtualDevices.remove(deviceId);
}
+ if (Flags.vdmPublicApis()) {
+ mVirtualDeviceListeners.broadcast(listener -> {
+ try {
+ listener.onVirtualDeviceClosed(deviceId);
+ } catch (RemoteException e) {
+ Slog.i(TAG, "Failed to invoke onVirtualDeviceClosed listener: "
+ + e.getMessage());
+ }
+ });
+ }
+
Intent i = new Intent(VirtualDeviceManager.ACTION_VIRTUAL_DEVICE_REMOVED);
i.putExtra(VirtualDeviceManager.EXTRA_VIRTUAL_DEVICE_ID, deviceId);
i.setFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY);
@@ -376,6 +394,17 @@ public class VirtualDeviceManagerService extends SystemService {
}
mVirtualDevices.put(deviceId, virtualDevice);
}
+
+ if (Flags.vdmPublicApis()) {
+ mVirtualDeviceListeners.broadcast(listener -> {
+ try {
+ listener.onVirtualDeviceCreated(deviceId);
+ } catch (RemoteException e) {
+ Slog.i(TAG, "Failed to invoke onVirtualDeviceCreated listener: "
+ + e.getMessage());
+ }
+ });
+ }
return virtualDevice;
}
@@ -415,14 +444,31 @@ public class VirtualDeviceManagerService extends SystemService {
synchronized (mVirtualDeviceManagerLock) {
for (int i = 0; i < mVirtualDevices.size(); i++) {
final VirtualDeviceImpl device = mVirtualDevices.valueAt(i);
- virtualDevices.add(
- new VirtualDevice(device.getDeviceId(), device.getPersistentDeviceId(),
- device.getDeviceName()));
+ virtualDevices.add(device.getPublicVirtualDeviceObject());
}
}
return virtualDevices;
}
+ @Override // Binder call
+ public VirtualDevice getVirtualDevice(int deviceId) {
+ VirtualDeviceImpl device;
+ synchronized (mVirtualDeviceManagerLock) {
+ device = mVirtualDevices.get(deviceId);
+ }
+ return device == null ? null : device.getPublicVirtualDeviceObject();
+ }
+
+ @Override // Binder call
+ public void registerVirtualDeviceListener(IVirtualDeviceListener listener) {
+ mVirtualDeviceListeners.register(listener);
+ }
+
+ @Override // Binder call
+ public void unregisterVirtualDeviceListener(IVirtualDeviceListener listener) {
+ mVirtualDeviceListeners.unregister(listener);
+ }
+
@Override // BinderCall
@VirtualDeviceParams.DevicePolicy
public int getDevicePolicy(int deviceId, @VirtualDeviceParams.PolicyType int policyType) {
@@ -705,7 +751,9 @@ public class VirtualDeviceManagerService extends SystemService {
synchronized (mVirtualDeviceManagerLock) {
virtualDevice = mVirtualDevices.get(deviceId);
}
- return virtualDevice == null ? new ArraySet<>() : virtualDevice.getDisplayIds();
+ return virtualDevice == null ? new ArraySet<>()
+ : Arrays.stream(virtualDevice.getDisplayIds()).boxed()
+ .collect(Collectors.toCollection(ArraySet::new));
}
@Override
diff --git a/services/core/java/com/android/server/clipboard/ClipboardService.java b/services/core/java/com/android/server/clipboard/ClipboardService.java
index 38c6a528e221..906c66d4fe8a 100644
--- a/services/core/java/com/android/server/clipboard/ClipboardService.java
+++ b/services/core/java/com/android/server/clipboard/ClipboardService.java
@@ -144,6 +144,7 @@ public class ClipboardService extends SystemService {
private final VirtualDeviceManagerInternal mVdmInternal;
private final VirtualDeviceManager mVdm;
private BroadcastReceiver mVirtualDeviceRemovedReceiver;
+ private VirtualDeviceManager.VirtualDeviceListener mVirtualDeviceListener;
private final IUserManager mUm;
private final PackageManager mPm;
private final AppOpsManager mAppOps;
@@ -216,12 +217,14 @@ public class ClipboardService extends SystemService {
@Override
public void onStart() {
publishBinderService(Context.CLIPBOARD_SERVICE, new ClipboardImpl());
- if (mVdmInternal != null) {
- registerVirtualDeviceRemovedListener();
+ if (!android.companion.virtual.flags.Flags.vdmPublicApis() && mVdmInternal != null) {
+ registerVirtualDeviceBroadcastReceiver();
+ } else if (android.companion.virtual.flags.Flags.vdmPublicApis() && mVdm != null) {
+ registerVirtualDeviceListener();
}
}
- private void registerVirtualDeviceRemovedListener() {
+ private void registerVirtualDeviceBroadcastReceiver() {
if (mVirtualDeviceRemovedReceiver != null) {
return;
}
@@ -245,6 +248,23 @@ public class ClipboardService extends SystemService {
Context.RECEIVER_NOT_EXPORTED);
}
+ private void registerVirtualDeviceListener() {
+ if (mVirtualDeviceListener != null) {
+ return;
+ }
+ mVirtualDeviceListener = new VirtualDeviceManager.VirtualDeviceListener() {
+ @Override
+ public void onVirtualDeviceClosed(int deviceId) {
+ synchronized (mLock) {
+ for (int i = mClipboards.numMaps() - 1; i >= 0; i--) {
+ mClipboards.delete(mClipboards.keyAt(i), deviceId);
+ }
+ }
+ }
+ };
+ mVdm.registerVirtualDeviceListener(getContext().getMainExecutor(), mVirtualDeviceListener);
+ }
+
@Override
public void onUserStopped(@NonNull TargetUser user) {
synchronized (mLock) {
diff --git a/services/core/java/com/android/server/display/BrightnessMappingStrategy.java b/services/core/java/com/android/server/display/BrightnessMappingStrategy.java
index df2a8301f543..99a5398aa7ee 100644
--- a/services/core/java/com/android/server/display/BrightnessMappingStrategy.java
+++ b/services/core/java/com/android/server/display/BrightnessMappingStrategy.java
@@ -25,6 +25,7 @@ import android.content.res.TypedArray;
import android.hardware.display.BrightnessConfiguration;
import android.hardware.display.BrightnessCorrection;
import android.os.PowerManager;
+import android.util.LongArray;
import android.util.MathUtils;
import android.util.Pair;
import android.util.Slog;
@@ -37,7 +38,11 @@ import com.android.server.display.utils.Plog;
import com.android.server.display.whitebalance.DisplayWhiteBalanceController;
import java.io.PrintWriter;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
import java.util.Arrays;
+import java.util.Date;
+import java.util.List;
import java.util.Locale;
import java.util.Objects;
@@ -840,6 +845,13 @@ public abstract class BrightnessMappingStrategy {
private final boolean mIsForIdleMode;
private final DisplayWhiteBalanceController mDisplayWhiteBalanceController;
+ // Previous short-term models and the times that they were computed stored for debugging
+ // purposes
+ private List<Spline> mPreviousBrightnessSplines = new ArrayList<>();
+ private LongArray mBrightnessSplineChangeTimes = new LongArray();
+ private static final int NO_OF_PREVIOUS_CONFIGS_TO_LOG = 5;
+ private static final SimpleDateFormat FORMAT = new SimpleDateFormat("MM-dd HH:mm:ss.SSS");
+
public PhysicalMappingStrategy(BrightnessConfiguration config, float[] nits,
float[] brightness, float maxGamma, boolean isForIdleMode,
DisplayWhiteBalanceController displayWhiteBalanceController) {
@@ -982,6 +994,13 @@ public abstract class BrightnessMappingStrategy {
mUserLux = lux;
mUserBrightness = brightness;
computeSpline();
+
+ if (mPreviousBrightnessSplines.size() == NO_OF_PREVIOUS_CONFIGS_TO_LOG) {
+ mPreviousBrightnessSplines.remove(0);
+ mBrightnessSplineChangeTimes.remove(0);
+ }
+ mPreviousBrightnessSplines.add(mBrightnessSpline);
+ mBrightnessSplineChangeTimes.add(System.currentTimeMillis());
}
@Override
@@ -1042,7 +1061,16 @@ public abstract class BrightnessMappingStrategy {
pw.println(" mDefaultConfig=" + mDefaultConfig);
pw.println(" mBrightnessRangeAdjustmentApplied=" + mBrightnessRangeAdjustmentApplied);
- dumpConfigDiff(pw, hbmTransition);
+ pw.println(" Previous short-term models (oldest to newest): ");
+ for (int i = 0; i < mPreviousBrightnessSplines.size(); i++) {
+ pw.println(" Computed at "
+ + FORMAT.format(new Date(mBrightnessSplineChangeTimes.get(i))) + ": ");
+ dumpConfigDiff(pw, hbmTransition, mPreviousBrightnessSplines.get(i),
+ /* shortTermModelOnly= */ true);
+ }
+
+ pw.println(" Difference between current config and default: ");
+ dumpConfigDiff(pw, hbmTransition, mBrightnessSpline, /* shortTermModelOnly= */ false);
}
@Override
@@ -1066,9 +1094,8 @@ public abstract class BrightnessMappingStrategy {
*
* @param pw The print-writer to write to.
*/
- private void dumpConfigDiff(PrintWriter pw, float hbmTransition) {
- pw.println(" Difference between current config and default: ");
-
+ private void dumpConfigDiff(PrintWriter pw, float hbmTransition, Spline brightnessSpline,
+ boolean shortTermModelOnly) {
Pair<float[], float[]> currentCurve = mConfig.getCurve();
Spline currSpline = Spline.createSpline(currentCurve.first, currentCurve.second);
@@ -1107,7 +1134,7 @@ public abstract class BrightnessMappingStrategy {
float defaultNits = defaultSpline.interpolate(lux);
float longTermNits = currSpline.interpolate(lux);
- float shortTermNits = mBrightnessSpline.interpolate(lux);
+ float shortTermNits = brightnessSpline.interpolate(lux);
float brightness = mAdjustedNitsToBrightnessSpline.interpolate(shortTermNits);
String luxPrefix = (lux == mUserLux ? "^" : "");
@@ -1142,8 +1169,10 @@ public abstract class BrightnessMappingStrategy {
// At 80 chars, start another row
if (sbLux.length() > 80 || (i == luxes.length - 1)) {
pw.println(sbLux);
- pw.println(sbNits);
- pw.println(sbLong);
+ if (!shortTermModelOnly) {
+ pw.println(sbNits);
+ pw.println(sbLong);
+ }
pw.println(sbShort);
pw.println(sbBrightness);
pw.println(sbPercent);
diff --git a/services/core/java/com/android/server/display/DisplayManagerService.java b/services/core/java/com/android/server/display/DisplayManagerService.java
index f3ad4b443ba3..90c7ce7d5bc8 100644
--- a/services/core/java/com/android/server/display/DisplayManagerService.java
+++ b/services/core/java/com/android/server/display/DisplayManagerService.java
@@ -146,6 +146,7 @@ import com.android.internal.util.ArrayUtils;
import com.android.internal.util.DumpUtils;
import com.android.internal.util.FrameworkStatsLog;
import com.android.internal.util.IndentingPrintWriter;
+import com.android.internal.util.SettingsWrapper;
import com.android.server.AnimationThread;
import com.android.server.DisplayThread;
import com.android.server.LocalServices;
@@ -159,7 +160,7 @@ import com.android.server.display.layout.Layout;
import com.android.server.display.mode.DisplayModeDirector;
import com.android.server.display.utils.SensorUtils;
import com.android.server.input.InputManagerInternal;
-import com.android.server.utils.FoldSettingWrapper;
+import com.android.server.utils.FoldSettingProvider;
import com.android.server.wm.SurfaceAnimationThread;
import com.android.server.wm.WindowManagerInternal;
@@ -549,9 +550,9 @@ public final class DisplayManagerService extends SystemService {
mHandler = new DisplayManagerHandler(DisplayThread.get().getLooper());
mUiHandler = UiThread.getHandler();
mDisplayDeviceRepo = new DisplayDeviceRepository(mSyncRoot, mPersistentDataStore);
- mLogicalDisplayMapper = new LogicalDisplayMapper(mContext, mDisplayDeviceRepo,
- new LogicalDisplayListener(), mSyncRoot, mHandler,
- new FoldSettingWrapper(mContext.getContentResolver()), mFlags);
+ mLogicalDisplayMapper = new LogicalDisplayMapper(mContext,
+ new FoldSettingProvider(mContext, new SettingsWrapper()), mDisplayDeviceRepo,
+ new LogicalDisplayListener(), mSyncRoot, mHandler, mFlags);
mDisplayModeDirector = new DisplayModeDirector(context, mHandler);
mBrightnessSynchronizer = new BrightnessSynchronizer(mContext);
Resources resources = mContext.getResources();
diff --git a/services/core/java/com/android/server/display/LogicalDisplayMapper.java b/services/core/java/com/android/server/display/LogicalDisplayMapper.java
index cbe0fc7e713b..b3b16ade0546 100644
--- a/services/core/java/com/android/server/display/LogicalDisplayMapper.java
+++ b/services/core/java/com/android/server/display/LogicalDisplayMapper.java
@@ -43,7 +43,7 @@ import com.android.internal.annotations.VisibleForTesting;
import com.android.server.display.feature.DisplayManagerFlags;
import com.android.server.display.layout.DisplayIdProducer;
import com.android.server.display.layout.Layout;
-import com.android.server.utils.FoldSettingWrapper;
+import com.android.server.utils.FoldSettingProvider;
import java.io.PrintWriter;
import java.util.Arrays;
@@ -149,7 +149,7 @@ class LogicalDisplayMapper implements DisplayDeviceRepository.Listener {
private final Listener mListener;
private final DisplayManagerService.SyncRoot mSyncRoot;
private final LogicalDisplayMapperHandler mHandler;
- private final FoldSettingWrapper mFoldSettingWrapper;
+ private final FoldSettingProvider mFoldSettingProvider;
private final PowerManager mPowerManager;
/**
@@ -196,26 +196,27 @@ class LogicalDisplayMapper implements DisplayDeviceRepository.Listener {
private boolean mInteractive;
private final DisplayManagerFlags mFlags;
- LogicalDisplayMapper(@NonNull Context context, @NonNull DisplayDeviceRepository repo,
+ LogicalDisplayMapper(@NonNull Context context, FoldSettingProvider foldSettingProvider,
+ @NonNull DisplayDeviceRepository repo,
@NonNull Listener listener, @NonNull DisplayManagerService.SyncRoot syncRoot,
- @NonNull Handler handler, FoldSettingWrapper foldSettingWrapper,
- DisplayManagerFlags flags) {
- this(context, repo, listener, syncRoot, handler, new DeviceStateToLayoutMap(
- (isDefault) -> isDefault ? DEFAULT_DISPLAY : sNextNonDefaultDisplayId++),
- foldSettingWrapper, flags);
+ @NonNull Handler handler, DisplayManagerFlags flags) {
+ this(context, foldSettingProvider, repo, listener, syncRoot, handler,
+ new DeviceStateToLayoutMap((isDefault) -> isDefault ? DEFAULT_DISPLAY
+ : sNextNonDefaultDisplayId++), flags);
}
- LogicalDisplayMapper(@NonNull Context context, @NonNull DisplayDeviceRepository repo,
+ LogicalDisplayMapper(@NonNull Context context, FoldSettingProvider foldSettingProvider,
+ @NonNull DisplayDeviceRepository repo,
@NonNull Listener listener, @NonNull DisplayManagerService.SyncRoot syncRoot,
@NonNull Handler handler, @NonNull DeviceStateToLayoutMap deviceStateToLayoutMap,
- FoldSettingWrapper foldSettingWrapper, DisplayManagerFlags flags) {
+ DisplayManagerFlags flags) {
mSyncRoot = syncRoot;
mPowerManager = context.getSystemService(PowerManager.class);
mInteractive = mPowerManager.isInteractive();
mHandler = new LogicalDisplayMapperHandler(handler.getLooper());
mDisplayDeviceRepo = repo;
mListener = listener;
- mFoldSettingWrapper = foldSettingWrapper;
+ mFoldSettingProvider = foldSettingProvider;
mSingleDisplayDemoMode = SystemProperties.getBoolean("persist.demo.singledisplay", false);
mSupportsConcurrentInternalDisplays = context.getResources().getBoolean(
com.android.internal.R.bool.config_supportsConcurrentInternalDisplays);
@@ -488,10 +489,13 @@ class LogicalDisplayMapper implements DisplayDeviceRepository.Listener {
});
} else if (sleepDevice) {
// Send the device to sleep when required.
+ int goToSleepFlag =
+ mFoldSettingProvider.shouldSleepOnFold() ? 0
+ : PowerManager.GO_TO_SLEEP_FLAG_SOFT_SLEEP;
mHandler.post(() -> {
mPowerManager.goToSleep(SystemClock.uptimeMillis(),
PowerManager.GO_TO_SLEEP_REASON_DEVICE_FOLD,
- PowerManager.GO_TO_SLEEP_FLAG_SOFT_SLEEP);
+ goToSleepFlag);
});
}
}
@@ -565,7 +569,8 @@ class LogicalDisplayMapper implements DisplayDeviceRepository.Listener {
&& mDeviceStatesOnWhichToSleep.get(pendingState)
&& !mDeviceStatesOnWhichToSleep.get(currentState)
&& !isOverrideActive
- && isInteractive && isBootCompleted && !mFoldSettingWrapper.shouldStayAwakeOnFold();
+ && isInteractive && isBootCompleted
+ && !mFoldSettingProvider.shouldStayAwakeOnFold();
}
private boolean areAllTransitioningDisplaysOffLocked() {
diff --git a/services/core/java/com/android/server/pm/DeletePackageHelper.java b/services/core/java/com/android/server/pm/DeletePackageHelper.java
index b8feb4d044bf..967998a790ac 100644
--- a/services/core/java/com/android/server/pm/DeletePackageHelper.java
+++ b/services/core/java/com/android/server/pm/DeletePackageHelper.java
@@ -435,6 +435,12 @@ final class DeletePackageHelper {
}
final int userId = user == null ? UserHandle.USER_ALL : user.getIdentifier();
+ if (outInfo != null) {
+ // Remember which users are affected, before the installed states are modified
+ outInfo.mRemovedUsers = (systemApp || userId == UserHandle.USER_ALL)
+ ? ps.queryInstalledUsers(allUserHandles, /* installed= */true)
+ : new int[]{userId};
+ }
if ((!systemApp || (flags & PackageManager.DELETE_SYSTEM_APP) != 0)
&& userId != UserHandle.USER_ALL) {
@@ -630,7 +636,6 @@ final class DeletePackageHelper {
// Preserve data by setting flag
flags |= PackageManager.DELETE_KEEP_DATA;
}
-
synchronized (mPm.mInstallLock) {
deleteInstalledPackageLIF(deletedPs, true, flags, allUserHandles, outInfo,
writeSettings);
diff --git a/services/core/java/com/android/server/pm/InstallPackageHelper.java b/services/core/java/com/android/server/pm/InstallPackageHelper.java
index dd043406f653..2712fa782c27 100644
--- a/services/core/java/com/android/server/pm/InstallPackageHelper.java
+++ b/services/core/java/com/android/server/pm/InstallPackageHelper.java
@@ -44,7 +44,6 @@ import static android.os.incremental.IncrementalManager.isIncrementalPath;
import static android.os.storage.StorageManager.FLAG_STORAGE_CE;
import static android.os.storage.StorageManager.FLAG_STORAGE_DE;
import static android.os.storage.StorageManager.FLAG_STORAGE_EXTERNAL;
-
import static com.android.server.pm.DexOptHelper.useArtService;
import static com.android.server.pm.InstructionSets.getAppDexInstructionSets;
import static com.android.server.pm.InstructionSets.getDexCodeInstructionSet;
@@ -1144,8 +1143,7 @@ final class InstallPackageHelper {
Trace.traceBegin(TRACE_TAG_PACKAGE_MANAGER, "parsePackage");
final ParsedPackage parsedPackage;
try (PackageParser2 pp = mPm.mInjector.getPreparingPackageParser()) {
- if (request.getPackageLite() == null || !PackageInstallerSession.isArchivedInstallation(
- request.getInstallFlags())) {
+ if (request.getPackageLite() == null || !request.isArchived()) {
// TODO: pass packageLite from install request instead of reparsing the package
parsedPackage = pp.parsePackage(tmpPackageFile, parseFlags, false);
AndroidPackageUtils.validatePackageDexMetadata(parsedPackage);
@@ -3556,7 +3554,7 @@ final class InstallPackageHelper {
logCriticalInfo(Log.WARN, "System package " + packageName
+ " no longer exists; its data will be wiped");
mInjector.getHandler().post(
- () -> mRemovePackageHelper.removePackageData(ps, userIds, null, 0, false));
+ () -> mRemovePackageHelper.removePackageData(ps, userIds));
expectingBetter.put(ps.getPackageName(), ps.getPath());
} else {
// we still have a disabled system package, but, it still might have
@@ -3631,7 +3629,7 @@ final class InstallPackageHelper {
// partition], completely remove the package data.
final PackageSetting ps = mPm.mSettings.getPackageLPr(packageName);
if (ps != null && mPm.mPackages.get(packageName) == null) {
- mRemovePackageHelper.removePackageData(ps, userIds, null, 0, false);
+ mRemovePackageHelper.removePackageData(ps, userIds);
}
logCriticalInfo(Log.WARN, msg);
}
diff --git a/services/core/java/com/android/server/pm/InstallRequest.java b/services/core/java/com/android/server/pm/InstallRequest.java
index fe7c0864d4d0..e1cfc418bfe5 100644
--- a/services/core/java/com/android/server/pm/InstallRequest.java
+++ b/services/core/java/com/android/server/pm/InstallRequest.java
@@ -21,7 +21,6 @@ import static android.content.pm.PackageManager.INSTALL_REASON_UNKNOWN;
import static android.content.pm.PackageManager.INSTALL_SCENARIO_DEFAULT;
import static android.content.pm.PackageManager.INSTALL_SUCCEEDED;
import static android.os.Process.INVALID_UID;
-
import static com.android.server.pm.PackageManagerService.SCAN_AS_INSTANT_APP;
import static com.android.server.pm.PackageManagerService.TAG;
@@ -327,6 +326,10 @@ final class InstallRequest {
return mRemovedInfo != null && mRemovedInfo.mRemovedPackage != null;
}
+ public boolean isArchived() {
+ return PackageInstallerSession.isArchivedInstallation(getInstallFlags());
+ }
+
@Nullable
public String getRemovedPackage() {
return mRemovedInfo != null ? mRemovedInfo.mRemovedPackage : null;
diff --git a/services/core/java/com/android/server/pm/PackageArchiverService.java b/services/core/java/com/android/server/pm/PackageArchiverService.java
index 29f49c874640..c7f067be8581 100644
--- a/services/core/java/com/android/server/pm/PackageArchiverService.java
+++ b/services/core/java/com/android/server/pm/PackageArchiverService.java
@@ -112,16 +112,15 @@ public class PackageArchiverService extends IPackageArchiverService.Stub {
callerPackageName, DELETE_KEEP_DATA, intentSender, userId);
}
- private ArchiveState createArchiveState(String packageName, int userId)
+ /**
+ * Creates archived state for the package and user.
+ */
+ public ArchiveState createArchiveState(String packageName, int userId)
throws PackageManager.NameNotFoundException {
PackageStateInternal ps = getPackageState(packageName, mPm.snapshotComputer(),
Binder.getCallingUid(), userId);
String responsibleInstallerPackage = getResponsibleInstallerPackage(ps);
- if (responsibleInstallerPackage == null) {
- throw new PackageManager.NameNotFoundException(
- TextUtils.formatSimple("No installer found to archive app %s.",
- packageName));
- }
+ verifyInstaller(responsibleInstallerPackage);
List<LauncherActivityInfo> mainActivities = getLauncherActivityInfos(ps, userId);
List<ArchiveActivityInfo> archiveActivityInfos = new ArrayList<>();
@@ -136,6 +135,26 @@ public class PackageArchiverService extends IPackageArchiverService.Stub {
return new ArchiveState(archiveActivityInfos, responsibleInstallerPackage);
}
+ private void verifyInstaller(String installerPackage)
+ throws PackageManager.NameNotFoundException {
+ if (TextUtils.isEmpty(installerPackage)) {
+ throw new PackageManager.NameNotFoundException("No installer found");
+ }
+ if (!verifySupportsUnarchival(installerPackage)) {
+ throw new PackageManager.NameNotFoundException("Installer does not support unarchival");
+ }
+ }
+
+ /**
+ * @return true if installerPackage support unarchival:
+ * - has an action Intent.ACTION_UNARCHIVE_PACKAGE,
+ * - has permissions to install packages.
+ */
+ public boolean verifySupportsUnarchival(String installerPackage) {
+ // TODO(b/278553670) Check if installerPackage supports unarchival.
+ return true;
+ }
+
@Override
public void requestUnarchive(
@NonNull String packageName,
@@ -246,7 +265,7 @@ public class PackageArchiverService extends IPackageArchiverService.Stub {
}
private String getResponsibleInstallerPackage(PackageStateInternal ps) {
- return ps.getInstallSource().mUpdateOwnerPackageName == null
+ return TextUtils.isEmpty(ps.getInstallSource().mUpdateOwnerPackageName)
? ps.getInstallSource().mInstallerPackageName
: ps.getInstallSource().mUpdateOwnerPackageName;
}
diff --git a/services/core/java/com/android/server/pm/PackageInstallerSession.java b/services/core/java/com/android/server/pm/PackageInstallerSession.java
index 1bdade2df6dc..0dd4111adbfa 100644
--- a/services/core/java/com/android/server/pm/PackageInstallerSession.java
+++ b/services/core/java/com/android/server/pm/PackageInstallerSession.java
@@ -40,7 +40,6 @@ import static android.provider.DeviceConfig.NAMESPACE_PACKAGE_MANAGER_SERVICE;
import static android.system.OsConstants.O_CREAT;
import static android.system.OsConstants.O_RDONLY;
import static android.system.OsConstants.O_WRONLY;
-
import static com.android.internal.annotations.VisibleForTesting.Visibility.PACKAGE;
import static com.android.internal.util.XmlUtils.readBitmapAttribute;
import static com.android.internal.util.XmlUtils.readByteArrayAttribute;
@@ -1166,6 +1165,11 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub {
throw new IllegalArgumentException(
"Archived installation can only use Streaming System DataLoader.");
}
+ if (!TextUtils.isEmpty(params.appPackageName) && !isArchivedInstallationAllowed(
+ params.appPackageName)) {
+ throw new IllegalArgumentException(
+ "Archived installation of this package is not allowed.");
+ }
}
}
@@ -2220,6 +2224,19 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub {
}
/**
+ * Check if this package can be installed archived.
+ */
+ private static boolean isArchivedInstallationAllowed(String packageName) {
+ final PackageManagerInternal pmi = LocalServices.getService(PackageManagerInternal.class);
+ final PackageStateInternal existingPkgSetting = pmi.getPackageStateInternal(packageName);
+ if (existingPkgSetting == null) {
+ return true;
+ }
+
+ return false;
+ }
+
+ /**
* Checks if the package can be installed on IncFs.
*/
private static boolean isIncrementalInstallationAllowed(String packageName) {
@@ -3371,6 +3388,23 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub {
}
}
+ if (isArchivedInstallation()) {
+ if (!isArchivedInstallationAllowed(mPackageName)) {
+ throw new PackageManagerException(
+ PackageManager.INSTALL_FAILED_SESSION_INVALID,
+ "Archived installation of this package is not allowed.");
+ }
+
+ if (!isInstalledByAdb(getInstallSource().mInitiatingPackageName)
+ && !mPm.mArchiverService.verifySupportsUnarchival(
+ getInstallSource().mInstallerPackageName)) {
+ throw new PackageManagerException(
+ PackageManager.INSTALL_FAILED_SESSION_INVALID,
+ "Installer has to support unarchival in order to install archived "
+ + "packages.");
+ }
+ }
+
if (isIncrementalInstallation()) {
if (!isIncrementalInstallationAllowed(mPackageName)) {
throw new PackageManagerException(
diff --git a/services/core/java/com/android/server/pm/PackageManagerService.java b/services/core/java/com/android/server/pm/PackageManagerService.java
index bb4fd66e995c..0c2f1ca54f73 100644
--- a/services/core/java/com/android/server/pm/PackageManagerService.java
+++ b/services/core/java/com/android/server/pm/PackageManagerService.java
@@ -36,7 +36,6 @@ import static android.os.storage.StorageManager.FLAG_STORAGE_CE;
import static android.os.storage.StorageManager.FLAG_STORAGE_DE;
import static android.os.storage.StorageManager.FLAG_STORAGE_EXTERNAL;
import static android.provider.DeviceConfig.NAMESPACE_PACKAGE_MANAGER_SERVICE;
-
import static com.android.internal.annotations.VisibleForTesting.Visibility;
import static com.android.internal.util.FrameworkStatsLog.BOOT_TIME_EVENT_DURATION__EVENT__OTA_PACKAGE_MANAGER_INIT_TIME;
import static com.android.server.pm.DexOptHelper.useArtService;
@@ -6323,7 +6322,6 @@ public class PackageManagerService implements PackageSender, TestUtilityService
archPkg.targetSdkVersion = apk.getTargetSdkVersion();
// These get translated in flags important for user data management.
- archPkg.clearUserDataAllowed = apk.isClearUserDataAllowed();
archPkg.backupAllowed = apk.isBackupAllowed();
archPkg.defaultToDeviceProtectedStorage =
apk.isDefaultToDeviceProtectedStorage();
diff --git a/services/core/java/com/android/server/pm/PackageMetrics.java b/services/core/java/com/android/server/pm/PackageMetrics.java
index c1580c4b1cb9..7ad336c9074d 100644
--- a/services/core/java/com/android/server/pm/PackageMetrics.java
+++ b/services/core/java/com/android/server/pm/PackageMetrics.java
@@ -120,7 +120,7 @@ final class PackageMetrics {
versionCode = ps.getVersionCode();
apksSize = getApksSize(ps.getPath());
}
- } catch (IllegalStateException e) {
+ } catch (IllegalStateException | NullPointerException e) {
// no-op
}
}
diff --git a/services/core/java/com/android/server/pm/PackageRemovedInfo.java b/services/core/java/com/android/server/pm/PackageRemovedInfo.java
index c762fd3f9648..5f4452884fc9 100644
--- a/services/core/java/com/android/server/pm/PackageRemovedInfo.java
+++ b/services/core/java/com/android/server/pm/PackageRemovedInfo.java
@@ -164,8 +164,7 @@ final class PackageRemovedInfo {
}
}
- public void populateUsers(int[] userIds, PackageSetting deletedPackageSetting) {
- mRemovedUsers = userIds;
+ public void populateBroadcastUsers(PackageSetting deletedPackageSetting) {
if (mRemovedUsers == null) {
mBroadcastUsers = null;
return;
@@ -173,8 +172,8 @@ final class PackageRemovedInfo {
mBroadcastUsers = EMPTY_INT_ARRAY;
mInstantUserIds = EMPTY_INT_ARRAY;
- for (int i = userIds.length - 1; i >= 0; --i) {
- final int userId = userIds[i];
+ for (int i = mRemovedUsers.length - 1; i >= 0; --i) {
+ final int userId = mRemovedUsers[i];
if (deletedPackageSetting.getInstantApp(userId)) {
mInstantUserIds = ArrayUtils.appendInt(mInstantUserIds, userId);
} else {
diff --git a/services/core/java/com/android/server/pm/PackageSetting.java b/services/core/java/com/android/server/pm/PackageSetting.java
index 7cac3e1b9842..88184c0cb490 100644
--- a/services/core/java/com/android/server/pm/PackageSetting.java
+++ b/services/core/java/com/android/server/pm/PackageSetting.java
@@ -818,7 +818,7 @@ public class PackageSetting extends SettingBase implements PackageStateInternal
if (userState.isInstalled()) {
return true;
}
- if (userState.getCeDataInode() > 0) {
+ if (userState.dataExists()) {
return true;
}
}
diff --git a/services/core/java/com/android/server/pm/RemovePackageHelper.java b/services/core/java/com/android/server/pm/RemovePackageHelper.java
index d4f30fed6967..2aedf0d8960c 100644
--- a/services/core/java/com/android/server/pm/RemovePackageHelper.java
+++ b/services/core/java/com/android/server/pm/RemovePackageHelper.java
@@ -295,25 +295,24 @@ final class RemovePackageHelper {
outInfo.mInstallerPackageName = ps.getInstallSource().mInstallerPackageName;
outInfo.mIsStaticSharedLib = pkg != null && pkg.getStaticSharedLibraryName() != null;
outInfo.mRemovedAppId = ps.getAppId();
- outInfo.mRemovedUsers = userIds;
- outInfo.mBroadcastUsers = userIds;
+ outInfo.mBroadcastUsers = outInfo.mRemovedUsers;
outInfo.mIsExternal = ps.isExternalStorage();
outInfo.mRemovedPackageVersionCode = ps.getVersionCode();
}
}
// Called to clean up disabled system packages
- public void removePackageData(final PackageSetting deletedPs, @NonNull int[] allUserHandles,
- PackageRemovedInfo outInfo, int flags, boolean writeSettings) {
+ public void removePackageData(final PackageSetting deletedPs, @NonNull int[] allUserHandles) {
synchronized (mPm.mInstallLock) {
- removePackageDataLIF(deletedPs, allUserHandles, outInfo, flags, writeSettings);
+ removePackageDataLIF(deletedPs, allUserHandles, /* outInfo= */ null,
+ /* flags= */ 0, /* writeSettings= */ false);
}
}
/*
* This method deletes the package from internal data structures. If the DELETE_KEEP_DATA
* flag is not set, the data directory is removed as well.
- * make sure this flag is set for partially installed apps. If not its meaningless to
+ * make sure this flag is set for partially installed apps. If not it's meaningless to
* delete a partially installed application.
*/
@GuardedBy("mPm.mInstallLock")
@@ -328,8 +327,7 @@ final class RemovePackageHelper {
outInfo.mInstallerPackageName = deletedPs.getInstallSource().mInstallerPackageName;
outInfo.mIsStaticSharedLib = deletedPkg != null
&& deletedPkg.getStaticSharedLibraryName() != null;
- outInfo.populateUsers(deletedPs.queryInstalledUsers(
- mUserManagerInternal.getUserIds(), true), deletedPs);
+ outInfo.populateBroadcastUsers(deletedPs);
outInfo.mIsExternal = deletedPs.isExternalStorage();
outInfo.mRemovedPackageVersionCode = deletedPs.getVersionCode();
}
diff --git a/services/core/java/com/android/server/pm/flags.aconfig b/services/core/java/com/android/server/pm/flags.aconfig
index 368a8432c805..7779c08e8d5a 100644
--- a/services/core/java/com/android/server/pm/flags.aconfig
+++ b/services/core/java/com/android/server/pm/flags.aconfig
@@ -6,3 +6,11 @@ flag {
description: "Feature flag for Quarantined state"
bug: "269127435"
}
+
+flag {
+ name: "new_match_uninstalled_enabled"
+ namespace: "package_manager_service"
+ description: "Feature flag for new MATCH_UNINSTALLED_PACKAGES behavior"
+ bug: "298681254"
+ is_fixed_read_only: true
+}
diff --git a/services/core/java/com/android/server/pm/pkg/PackageUserState.java b/services/core/java/com/android/server/pm/pkg/PackageUserState.java
index 7bc518c5516e..c05b3c2be622 100644
--- a/services/core/java/com/android/server/pm/pkg/PackageUserState.java
+++ b/services/core/java/com/android/server/pm/pkg/PackageUserState.java
@@ -242,4 +242,11 @@ public interface PackageUserState {
@Nullable
ArchiveState getArchiveState();
+ /**
+ * @return whether the data dir exists. True when the app is installed for the user, or when the
+ * app is uninstalled for the user with {@link PackageManager#DELETE_KEEP_DATA}.
+ *
+ * @hide
+ */
+ boolean dataExists();
}
diff --git a/services/core/java/com/android/server/pm/pkg/PackageUserStateDefault.java b/services/core/java/com/android/server/pm/pkg/PackageUserStateDefault.java
index 3534d7564c50..fc4b6863b9b8 100644
--- a/services/core/java/com/android/server/pm/pkg/PackageUserStateDefault.java
+++ b/services/core/java/com/android/server/pm/pkg/PackageUserStateDefault.java
@@ -196,4 +196,9 @@ class PackageUserStateDefault implements PackageUserStateInternal {
public ArchiveState getArchiveState() {
return null;
}
+
+ @Override
+ public boolean dataExists() {
+ return true;
+ }
}
diff --git a/services/core/java/com/android/server/pm/pkg/PackageUserStateImpl.java b/services/core/java/com/android/server/pm/pkg/PackageUserStateImpl.java
index 2349fbff11a7..0b35d8ae16ea 100644
--- a/services/core/java/com/android/server/pm/pkg/PackageUserStateImpl.java
+++ b/services/core/java/com/android/server/pm/pkg/PackageUserStateImpl.java
@@ -685,6 +685,10 @@ public class PackageUserStateImpl extends WatchableImpl implements PackageUserSt
return false;
}
+ @Override
+ public boolean dataExists() {
+ return getCeDataInode() > 0;
+ }
diff --git a/services/core/java/com/android/server/pm/pkg/PackageUserStateUtils.java b/services/core/java/com/android/server/pm/pkg/PackageUserStateUtils.java
index 54f7ebca1b66..9ab3060ce325 100644
--- a/services/core/java/com/android/server/pm/pkg/PackageUserStateUtils.java
+++ b/services/core/java/com/android/server/pm/pkg/PackageUserStateUtils.java
@@ -27,6 +27,7 @@ import android.os.Debug;
import android.util.DebugUtils;
import android.util.Slog;
+import com.android.server.pm.Flags;
import com.android.server.pm.pkg.component.ParsedMainComponent;
/** @hide */
@@ -82,15 +83,38 @@ public class PackageUserStateUtils {
return reportIfDebug(matchesUnaware || matchesAware, flags);
}
+ /**
+ * @return true if any of the following conditions is met:
+ * <p><ul>
+ * <li> If it is installed and not hidden for this user;
+ * <li> If it is installed but hidden for this user, still return true if
+ * {@link PackageManager#MATCH_UNINSTALLED_PACKAGES} or
+ * {@link PackageManager#MATCH_ARCHIVED_PACKAGES} is requested;
+ * <li> If MATCH_ANY_USER is requested, always return true, because the fact that
+ * this object exists means that the package must be installed or has data on at least one user;
+ * <li> (When feature enabled) If it is not installed but still has data (i.e., it was
+ * previously uninstalled with {@link PackageManager#DELETE_KEEP_DATA}), return true if the
+ * caller requested {@link PackageManager#MATCH_UNINSTALLED_PACKAGES} or
+ * {@link PackageManager#MATCH_ARCHIVED_PACKAGES};
+ * </ul><p>
+ */
public static boolean isAvailable(@NonNull PackageUserState state, long flags) {
- // True if it is installed for this user and it is not hidden. If it is hidden,
- // still return true if the caller requested MATCH_UNINSTALLED_PACKAGES
final boolean matchAnyUser = (flags & PackageManager.MATCH_ANY_USER) != 0;
final boolean matchUninstalled = (flags & PackageManager.MATCH_UNINSTALLED_PACKAGES) != 0;
final boolean matchArchived = (flags & PackageManager.MATCH_ARCHIVED_PACKAGES) != 0;
- return matchAnyUser
- || (state.isInstalled()
- && (!state.isHidden() || matchUninstalled || matchArchived));
+ final boolean matchDataExists = matchUninstalled || matchArchived;
+
+ if (matchAnyUser) {
+ return true;
+ }
+ if (state.isInstalled()) {
+ if (!state.isHidden()) {
+ return true;
+ } else return matchDataExists;
+ } else {
+ // not installed
+ return matchDataExists && Flags.newMatchUninstalledEnabled() && state.dataExists();
+ }
}
public static boolean reportIfDebug(boolean result, long flags) {
diff --git a/services/core/java/com/android/server/pm/pkg/parsing/ParsingPackageUtils.java b/services/core/java/com/android/server/pm/pkg/parsing/ParsingPackageUtils.java
index 2d55b9f8e16a..81c2f0760705 100644
--- a/services/core/java/com/android/server/pm/pkg/parsing/ParsingPackageUtils.java
+++ b/services/core/java/com/android/server/pm/pkg/parsing/ParsingPackageUtils.java
@@ -28,7 +28,6 @@ import static android.content.pm.PackageManager.INSTALL_PARSE_FAILED_UNEXPECTED_
import static android.os.Build.VERSION_CODES.DONUT;
import static android.os.Build.VERSION_CODES.O;
import static android.os.Trace.TRACE_TAG_PACKAGE_MANAGER;
-
import static com.android.server.pm.pkg.parsing.ParsingUtils.parseKnownActivityEmbeddingCerts;
import android.annotation.AnyRes;
@@ -514,7 +513,7 @@ public class ParsingPackageUtils {
pkg
// Default true
.setBackupAllowed(lite.isBackupAllowed())
- .setClearUserDataAllowed(lite.isClearUserDataAllowed())
+ .setClearUserDataAllowed(true)
.setClearUserDataOnFailedRestoreAllowed(
lite.isClearUserDataOnFailedRestoreAllowed())
.setAllowNativeHeapPointerTagging(true)
diff --git a/services/core/java/com/android/server/policy/PhoneWindowManager.java b/services/core/java/com/android/server/policy/PhoneWindowManager.java
index 63794d57fabc..4d38239973d7 100644
--- a/services/core/java/com/android/server/policy/PhoneWindowManager.java
+++ b/services/core/java/com/android/server/policy/PhoneWindowManager.java
@@ -607,10 +607,10 @@ public class PhoneWindowManager implements WindowManagerPolicy {
DisplayPolicy mDefaultDisplayPolicy;
// What we do when the user long presses on home
- private int mLongPressOnHomeBehavior;
+ int mLongPressOnHomeBehavior;
// What we do when the user double-taps on home
- private int mDoubleTapOnHomeBehavior;
+ int mDoubleTapOnHomeBehavior;
// Must match config_primaryShortPressTargetActivity in config.xml
ComponentName mPrimaryShortPressTargetActivity;
@@ -1853,7 +1853,9 @@ public class PhoneWindowManager implements WindowManagerPolicy {
Settings.Secure.TV_USER_SETUP_COMPLETE, 0, UserHandle.USER_CURRENT) != 0;
}
- private void handleShortPressOnHome(int displayId) {
+ private void handleShortPressOnHome(KeyEvent event) {
+ logKeyboardSystemsEvent(event, KeyboardLogEvent.HOME);
+
// Turn on the connected TV and switch HDMI input if we're a HDMI playback device.
final HdmiControl hdmiControl = getHdmiControl();
if (hdmiControl != null) {
@@ -1869,7 +1871,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
}
// Go home!
- launchHomeFromHotKey(displayId);
+ launchHomeFromHotKey(event.getDisplayId());
}
/**
@@ -1974,17 +1976,15 @@ public class PhoneWindowManager implements WindowManagerPolicy {
private class DisplayHomeButtonHandler {
private final int mDisplayId;
-
- private boolean mHomeDoubleTapPending;
private boolean mHomePressed;
private boolean mHomeConsumed;
-
+ private KeyEvent mPendingHomeKeyEvent;
private final Runnable mHomeDoubleTapTimeoutRunnable = new Runnable() {
@Override
public void run() {
- if (mHomeDoubleTapPending) {
- mHomeDoubleTapPending = false;
- handleShortPressOnHome(mDisplayId);
+ if (mPendingHomeKeyEvent != null) {
+ handleShortPressOnHome(mPendingHomeKeyEvent);
+ mPendingHomeKeyEvent = null;
}
}
};
@@ -2007,7 +2007,6 @@ public class PhoneWindowManager implements WindowManagerPolicy {
// If we have released the home key, and didn't do anything else
// while it was pressed, then it is time to go home!
if (!down) {
- logKeyboardSystemsEvent(event, KeyboardLogEvent.HOME);
if (mDisplayId == DEFAULT_DISPLAY) {
cancelPreloadRecentApps();
}
@@ -2029,7 +2028,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
if (mDoubleTapOnHomeBehavior != DOUBLE_TAP_HOME_PIP_MENU
|| mPictureInPictureVisible) {
mHandler.removeCallbacks(mHomeDoubleTapTimeoutRunnable); // just in case
- mHomeDoubleTapPending = true;
+ mPendingHomeKeyEvent = event;
mHandler.postDelayed(mHomeDoubleTapTimeoutRunnable,
ViewConfiguration.getDoubleTapTimeout());
return true;
@@ -2037,7 +2036,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
}
// Post to main thread to avoid blocking input pipeline.
- mHandler.post(() -> handleShortPressOnHome(mDisplayId));
+ mHandler.post(() -> handleShortPressOnHome(event));
return true;
}
@@ -2063,10 +2062,10 @@ public class PhoneWindowManager implements WindowManagerPolicy {
// Remember that home is pressed and handle special actions.
if (repeatCount == 0) {
mHomePressed = true;
- if (mHomeDoubleTapPending) {
- mHomeDoubleTapPending = false;
+ if (mPendingHomeKeyEvent != null) {
+ mPendingHomeKeyEvent = null;
mHandler.removeCallbacks(mHomeDoubleTapTimeoutRunnable);
- mHandler.post(this::handleDoubleTapOnHome);
+ mHandler.post(() -> handleDoubleTapOnHome(event));
// TODO(multi-display): Remove display id check once we support recents on
// multi-display
} else if (mDoubleTapOnHomeBehavior == DOUBLE_TAP_HOME_RECENT_SYSTEM_UI
@@ -2076,19 +2075,19 @@ public class PhoneWindowManager implements WindowManagerPolicy {
} else if ((event.getFlags() & KeyEvent.FLAG_LONG_PRESS) != 0) {
if (!keyguardOn) {
// Post to main thread to avoid blocking input pipeline.
- mHandler.post(() -> handleLongPressOnHome(event.getDeviceId(),
- event.getEventTime()));
+ mHandler.post(() -> handleLongPressOnHome(event));
}
}
return true;
}
- private void handleDoubleTapOnHome() {
+ private void handleDoubleTapOnHome(KeyEvent event) {
if (mHomeConsumed) {
return;
}
switch (mDoubleTapOnHomeBehavior) {
case DOUBLE_TAP_HOME_RECENT_SYSTEM_UI:
+ logKeyboardSystemsEvent(event, KeyboardLogEvent.APP_SWITCH);
mHomeConsumed = true;
toggleRecentApps();
break;
@@ -2103,7 +2102,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
}
}
- private void handleLongPressOnHome(int deviceId, long eventTime) {
+ private void handleLongPressOnHome(KeyEvent event) {
if (mHomeConsumed) {
return;
}
@@ -2115,13 +2114,16 @@ public class PhoneWindowManager implements WindowManagerPolicy {
"Home - Long Press");
switch (mLongPressOnHomeBehavior) {
case LONG_PRESS_HOME_ALL_APPS:
+ logKeyboardSystemsEvent(event, KeyboardLogEvent.ALL_APPS);
launchAllAppsAction();
break;
case LONG_PRESS_HOME_ASSIST:
- launchAssistAction(null, deviceId, eventTime,
+ logKeyboardSystemsEvent(event, KeyboardLogEvent.LAUNCH_ASSISTANT);
+ launchAssistAction(null, event.getDeviceId(), event.getEventTime(),
AssistUtils.INVOCATION_TYPE_HOME_BUTTON_LONG_PRESS);
break;
case LONG_PRESS_HOME_NOTIFICATION_PANEL:
+ logKeyboardSystemsEvent(event, KeyboardLogEvent.TOGGLE_NOTIFICATION_PANEL);
toggleNotificationPanel();
break;
default:
@@ -3269,7 +3271,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
switch (keyCode) {
case KeyEvent.KEYCODE_HOME:
- return handleHomeShortcuts(displayId, focusedToken, event);
+ return handleHomeShortcuts(focusedToken, event);
case KeyEvent.KEYCODE_MENU:
// Hijack modified menu keys for debugging features
final int chordBug = KeyEvent.META_SHIFT_ON;
@@ -3311,7 +3313,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
case KeyEvent.KEYCODE_H:
case KeyEvent.KEYCODE_ENTER:
if (event.isMetaPressed()) {
- return handleHomeShortcuts(displayId, focusedToken, event);
+ return handleHomeShortcuts(focusedToken, event);
}
break;
case KeyEvent.KEYCODE_I:
@@ -3661,15 +3663,15 @@ public class PhoneWindowManager implements WindowManagerPolicy {
upEvent.recycle();
}
- private boolean handleHomeShortcuts(int displayId, IBinder focusedToken, KeyEvent event) {
+ private boolean handleHomeShortcuts(IBinder focusedToken, KeyEvent event) {
// First we always handle the home key here, so applications
// can never break it, although if keyguard is on, we do let
// it handle it, because that gives us the correct 5 second
// timeout.
- DisplayHomeButtonHandler handler = mDisplayHomeButtonHandlers.get(displayId);
+ DisplayHomeButtonHandler handler = mDisplayHomeButtonHandlers.get(event.getDisplayId());
if (handler == null) {
- handler = new DisplayHomeButtonHandler(displayId);
- mDisplayHomeButtonHandlers.put(displayId, handler);
+ handler = new DisplayHomeButtonHandler(event.getDisplayId());
+ mDisplayHomeButtonHandlers.put(event.getDisplayId(), handler);
}
return handler.handleHomeButton(focusedToken, event);
}
@@ -5333,11 +5335,6 @@ public class PhoneWindowManager implements WindowManagerPolicy {
return false;
}
- if (theaterModeEnabled) {
- Settings.Global.putInt(mContext.getContentResolver(),
- Settings.Global.THEATER_MODE_ON, 0);
- }
-
mPowerManager.wakeUp(wakeTime, reason, details);
return true;
}
diff --git a/services/core/java/com/android/server/utils/FoldSettingProvider.java b/services/core/java/com/android/server/utils/FoldSettingProvider.java
new file mode 100644
index 000000000000..d62628b73019
--- /dev/null
+++ b/services/core/java/com/android/server/utils/FoldSettingProvider.java
@@ -0,0 +1,102 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.server.utils;
+
+import android.content.ContentResolver;
+import android.content.Context;
+import android.os.UserHandle;
+import android.provider.Settings;
+import android.util.Log;
+
+import com.android.internal.R;
+import com.android.internal.util.SettingsWrapper;
+
+import java.util.Set;
+
+/**
+ * This class provides a convenient way to access the {@link Settings.System#FOLD_LOCK_BEHAVIOR}.
+ * The {@link Settings.System#FOLD_LOCK_BEHAVIOR} setting controls the behavior of the device when
+ * it is folded, and provides the user with three different options to choose from. Those are:
+ * 1. Stay awake on fold: The device will remain unlocked when it is folded.
+ * 2. Selective stay awake: The device will remain unlocked when it is folded only if there are
+ * apps with wakelocks running. This is also the set default behavior.
+ * 3. Sleep on fold: The device will lock when it is folded, regardless of which apps are running
+ * or whether any wakelocks are held.
+ *
+ * Keep the setting values in this class in sync with the values in
+ * {@link com.android.settings.display.FoldLockBehaviorSettings}
+ */
+public class FoldSettingProvider {
+
+ public static final String SETTING_VALUE_STAY_AWAKE_ON_FOLD = "stay_awake_on_fold_key";
+ public static final String SETTING_VALUE_SELECTIVE_STAY_AWAKE = "selective_stay_awake_key";
+ public static final String SETTING_VALUE_SLEEP_ON_FOLD = "sleep_on_fold_key";
+ private static final String SETTING_VALUE_DEFAULT = SETTING_VALUE_SELECTIVE_STAY_AWAKE;
+ private static final Set<String> SETTING_VALUES = Set.of(SETTING_VALUE_STAY_AWAKE_ON_FOLD,
+ SETTING_VALUE_SELECTIVE_STAY_AWAKE, SETTING_VALUE_SLEEP_ON_FOLD);
+ private static final String TAG = "FoldSettingProvider";
+
+ private final ContentResolver mContentResolver;
+ private final boolean mIsFoldLockBehaviorAvailable;
+ private final SettingsWrapper mSettingsWrapper;
+
+ public FoldSettingProvider(Context context, SettingsWrapper settingsWrapper) {
+ mContentResolver = context.getContentResolver();
+ mSettingsWrapper = settingsWrapper;
+ mIsFoldLockBehaviorAvailable = context.getResources().getBoolean(
+ R.bool.config_fold_lock_behavior);
+ }
+
+ /**
+ * Returns whether the device should remain awake after folding.
+ */
+ public boolean shouldStayAwakeOnFold() {
+ return getFoldSettingValue().equals(SETTING_VALUE_STAY_AWAKE_ON_FOLD);
+ }
+
+ /**
+ * Returns whether the device should selective remain awake after folding.
+ */
+ public boolean shouldSelectiveStayAwakeOnFold() {
+ return getFoldSettingValue().equals(SETTING_VALUE_SELECTIVE_STAY_AWAKE);
+ }
+
+ /**
+ * Returns whether the device should strictly sleep after folding.
+ */
+ public boolean shouldSleepOnFold() {
+ return getFoldSettingValue().equals(SETTING_VALUE_SLEEP_ON_FOLD);
+ }
+
+ private String getFoldSettingValue() {
+ if (!mIsFoldLockBehaviorAvailable) {
+ return SETTING_VALUE_DEFAULT;
+ }
+ String foldSettingValue = mSettingsWrapper.getStringForUser(
+ mContentResolver,
+ Settings.System.FOLD_LOCK_BEHAVIOR,
+ UserHandle.USER_CURRENT);
+ foldSettingValue = (foldSettingValue != null) ? foldSettingValue : SETTING_VALUE_DEFAULT;
+ if (!SETTING_VALUES.contains(foldSettingValue)) {
+ Log.e(TAG,
+ "getFoldSettingValue: Invalid setting value, returning default setting value");
+ foldSettingValue = SETTING_VALUE_DEFAULT;
+ }
+
+ return foldSettingValue;
+ }
+}
diff --git a/services/core/java/com/android/server/utils/FoldSettingWrapper.java b/services/core/java/com/android/server/utils/FoldSettingWrapper.java
deleted file mode 100644
index 97a1ac06e24c..000000000000
--- a/services/core/java/com/android/server/utils/FoldSettingWrapper.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright (C) 2023 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.server.utils;
-
-import android.content.ContentResolver;
-import android.provider.Settings;
-
-/**
- * A wrapper class for the {@link Settings.System#STAY_AWAKE_ON_FOLD} setting.
- *
- * This class provides a convenient way to access the {@link Settings.System#STAY_AWAKE_ON_FOLD}
- * setting for testing.
- */
-public class FoldSettingWrapper {
- private final ContentResolver mContentResolver;
-
- public FoldSettingWrapper(ContentResolver contentResolver) {
- mContentResolver = contentResolver;
- }
-
- /**
- * Returns whether the device should remain awake after folding.
- */
- public boolean shouldStayAwakeOnFold() {
- try {
- return (Settings.System.getIntForUser(
- mContentResolver,
- Settings.System.STAY_AWAKE_ON_FOLD,
- 0) == 1);
- } catch (Settings.SettingNotFoundException e) {
- return false;
- }
- }
-}
diff --git a/services/core/java/com/android/server/wm/Dimmer.java b/services/core/java/com/android/server/wm/Dimmer.java
index 4f3ab8bbbe0a..ae29afa9fc49 100644
--- a/services/core/java/com/android/server/wm/Dimmer.java
+++ b/services/core/java/com/android/server/wm/Dimmer.java
@@ -22,6 +22,7 @@ import static com.android.server.wm.AlphaAnimationSpecProto.TO;
import static com.android.server.wm.AnimationSpecProto.ALPHA;
import static com.android.server.wm.SurfaceAnimator.ANIMATION_TYPE_DIMMER;
+import android.annotation.NonNull;
import android.graphics.Rect;
import android.util.Log;
import android.util.proto.ProtoOutputStream;
@@ -178,6 +179,7 @@ class Dimmer {
mSurfaceAnimatorStarter = surfaceAnimatorStarter;
}
+ @NonNull
WindowContainer<?> getHost() {
return mHost;
}
@@ -199,13 +201,6 @@ class Dimmer {
try {
final SurfaceControl ctl = makeDimLayer();
mDimState = new DimState(ctl);
- /**
- * See documentation on {@link #dimAbove} to understand lifecycle management of
- * Dim's via state resetting for Dim's with containers.
- */
- if (container == null) {
- mDimState.mDontReset = true;
- }
} catch (Surface.OutOfResourcesException e) {
Log.w(TAG, "OutOfResourcesException creating dim surface");
}
@@ -241,7 +236,7 @@ class Dimmer {
* @param container The container which to dim above. Should be a child of our host.
* @param alpha The alpha at which to Dim.
*/
- void dimAbove(WindowContainer container, float alpha) {
+ void dimAbove(@NonNull WindowContainer container, float alpha) {
dim(container, 1, alpha, 0);
}
@@ -253,7 +248,7 @@ class Dimmer {
* @param blurRadius The amount of blur added to the Dim.
*/
- void dimBelow(WindowContainer container, float alpha, int blurRadius) {
+ void dimBelow(@NonNull WindowContainer container, float alpha, int blurRadius) {
dim(container, -1, alpha, blurRadius);
}
@@ -316,7 +311,12 @@ class Dimmer {
if (!mDimState.isVisible) {
mDimState.isVisible = true;
t.show(mDimState.mDimLayer);
- startDimEnter(mLastRequestedDimContainer, mDimState.mSurfaceAnimator, t);
+ // Skip enter animation while starting window is on top of its activity
+ final WindowState ws = mLastRequestedDimContainer.asWindowState();
+ if (ws == null || ws.mActivityRecord == null
+ || ws.mActivityRecord.mStartingData == null) {
+ startDimEnter(mLastRequestedDimContainer, mDimState.mSurfaceAnimator, t);
+ }
}
return true;
}
diff --git a/services/core/java/com/android/server/wm/DisplayContent.java b/services/core/java/com/android/server/wm/DisplayContent.java
index 334464c8a503..daa73db4684d 100644
--- a/services/core/java/com/android/server/wm/DisplayContent.java
+++ b/services/core/java/com/android/server/wm/DisplayContent.java
@@ -743,9 +743,6 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
/** Set of activities in foreground size compat mode. */
private Set<ActivityRecord> mActiveSizeCompatActivities = new ArraySet<>();
- // Used in updating the display size
- private Point mTmpDisplaySize = new Point();
-
// Used in updating override configurations
private final Configuration mTempConfig = new Configuration();
@@ -4797,25 +4794,6 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
}, false /* traverseTopToBottom */);
}
- /**
- * Starts the Keyguard exit animation on all windows that don't belong to an app token.
- */
- void startKeyguardExitOnNonAppWindows(boolean onWallpaper, boolean goingToShade,
- boolean subtle) {
- final WindowManagerPolicy policy = mWmService.mPolicy;
- forAllWindows(w -> {
- if (w.mActivityRecord == null && w.canBeHiddenByKeyguard()
- && w.wouldBeVisibleIfPolicyIgnored() && !w.isVisible()) {
- w.startAnimation(policy.createHiddenByKeyguardExit(
- onWallpaper, goingToShade, subtle));
- }
- }, true /* traverseTopToBottom */);
- for (int i = mShellRoots.size() - 1; i >= 0; --i) {
- mShellRoots.valueAt(i).startAnimation(policy.createHiddenByKeyguardExit(
- onWallpaper, goingToShade, subtle));
- }
- }
-
/** @return {@code true} if there is window to wait before enabling the screen. */
boolean shouldWaitForSystemDecorWindowsOnBoot() {
if (!isDefaultDisplay && !supportsSystemDecorations()) {
diff --git a/services/core/java/com/android/server/wm/DisplayRotation.java b/services/core/java/com/android/server/wm/DisplayRotation.java
index 315c479cda30..d461d1ec02f0 100644
--- a/services/core/java/com/android/server/wm/DisplayRotation.java
+++ b/services/core/java/com/android/server/wm/DisplayRotation.java
@@ -948,7 +948,7 @@ public class DisplayRotation {
mDisplayWindowSettings.setUserRotation(mDisplayContent, userRotationMode,
userRotation);
if (changed) {
- mService.updateRotation(true /* alwaysSendConfiguration */,
+ mService.updateRotation(false /* alwaysSendConfiguration */,
false /* forceRelayout */);
}
}
@@ -2127,7 +2127,7 @@ public class DisplayRotation {
@Override
public void onChange(boolean selfChange) {
if (updateSettings()) {
- mService.updateRotation(true /* alwaysSendConfiguration */,
+ mService.updateRotation(false /* alwaysSendConfiguration */,
false /* forceRelayout */);
}
}
diff --git a/services/core/java/com/android/server/wm/LetterboxConfiguration.java b/services/core/java/com/android/server/wm/LetterboxConfiguration.java
index 97b3e3280f2b..45cf10bd3f5e 100644
--- a/services/core/java/com/android/server/wm/LetterboxConfiguration.java
+++ b/services/core/java/com/android/server/wm/LetterboxConfiguration.java
@@ -80,10 +80,10 @@ final class LetterboxConfiguration {
// Whether per-app user aspect ratio override settings is enabled
private static final String KEY_ENABLE_USER_ASPECT_RATIO_SETTINGS =
- "enable_app_compat_user_aspect_ratio_settings";
+ "enable_app_compat_aspect_ratio_user_settings";
// TODO(b/288142656): Enable user aspect ratio settings by default.
- private static final boolean DEFAULT_VALUE_ENABLE_USER_ASPECT_RATIO_SETTINGS = false;
+ private static final boolean DEFAULT_VALUE_ENABLE_USER_ASPECT_RATIO_SETTINGS = true;
// Whether per-app fullscreen user aspect ratio override option is enabled
private static final String KEY_ENABLE_USER_ASPECT_RATIO_FULLSCREEN =
diff --git a/services/core/java/com/android/server/wm/RootWindowContainer.java b/services/core/java/com/android/server/wm/RootWindowContainer.java
index d56acaa00f00..2fdfec04b895 100644
--- a/services/core/java/com/android/server/wm/RootWindowContainer.java
+++ b/services/core/java/com/android/server/wm/RootWindowContainer.java
@@ -258,10 +258,6 @@ class RootWindowContainer extends WindowContainer<DisplayContent>
*/
final SparseArray<SleepToken> mSleepTokens = new SparseArray<>();
- // The default minimal size that will be used if the activity doesn't specify its minimal size.
- // It will be calculated when the default display gets added.
- int mDefaultMinSizeOfResizeableTaskDp = -1;
-
// Whether tasks have moved and we need to rank the tasks before next OOM scoring
private boolean mTaskLayersChanged = true;
private int mTmpTaskLayerRank;
diff --git a/services/core/java/com/android/server/wm/Task.java b/services/core/java/com/android/server/wm/Task.java
index 21a4fe880ab6..21526e789c04 100644
--- a/services/core/java/com/android/server/wm/Task.java
+++ b/services/core/java/com/android/server/wm/Task.java
@@ -3543,11 +3543,6 @@ class Task extends TaskFragment {
? null : new PictureInPictureParams(top.pictureInPictureArgs);
}
- private boolean shouldDockBigOverlays() {
- final ActivityRecord topMostActivity = getTopMostActivity();
- return topMostActivity != null && topMostActivity.shouldDockBigOverlays;
- }
-
Rect getDisplayCutoutInsets() {
if (mDisplayContent == null || getDisplayInfo().displayCutout == null) return null;
final WindowState w = getTopVisibleAppMainWindow();
diff --git a/services/core/java/com/android/server/wm/Transition.java b/services/core/java/com/android/server/wm/Transition.java
index 81f91c739bc3..a6c64912edd3 100644
--- a/services/core/java/com/android/server/wm/Transition.java
+++ b/services/core/java/com/android/server/wm/Transition.java
@@ -440,10 +440,11 @@ class Transition implements BLASTSyncEngine.TransactionReadyListener {
boolean canApplyDim(@NonNull Task task) {
if (mTransientLaunches == null) return true;
final Dimmer dimmer = task.getDimmer();
- final WindowContainer<?> dimmerHost = dimmer != null ? dimmer.getHost() : null;
- if (dimmerHost == null) return false;
- if (isInTransientHide(dimmerHost)) {
- // The layer of dimmer is inside transient-hide task, then allow to dim.
+ if (dimmer == null) {
+ return false;
+ }
+ if (dimmer.getHost().asTask() != null) {
+ // Always allow to dim if the host only affects its task.
return true;
}
// The dimmer host of a translucent task can be a display, then it is not in transient-hide.
diff --git a/services/core/java/com/android/server/wm/WindowContainer.java b/services/core/java/com/android/server/wm/WindowContainer.java
index dae61da26b68..4a0f44b58ecf 100644
--- a/services/core/java/com/android/server/wm/WindowContainer.java
+++ b/services/core/java/com/android/server/wm/WindowContainer.java
@@ -1135,13 +1135,6 @@ class WindowContainer<E extends WindowContainer> extends ConfigurationContainer<
return parent != null && parent.isAttached();
}
- void setWaitingForDrawnIfResizingChanged() {
- for (int i = mChildren.size() - 1; i >= 0; --i) {
- final WindowContainer wc = mChildren.get(i);
- wc.setWaitingForDrawnIfResizingChanged();
- }
- }
-
void onResize() {
if (mControllableInsetProvider != null) {
mControllableInsetProvider.onWindowContainerBoundsChanged();
diff --git a/services/core/java/com/android/server/wm/WindowState.java b/services/core/java/com/android/server/wm/WindowState.java
index 9c04e0aab8f3..b12cc0b30f53 100644
--- a/services/core/java/com/android/server/wm/WindowState.java
+++ b/services/core/java/com/android/server/wm/WindowState.java
@@ -1717,29 +1717,6 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
}
/**
- * This is a form of rectangle "difference". It cut off each dimension of rect by the amount
- * that toRemove is "pushing into" it from the outside. Any dimension that fully contains
- * toRemove won't change.
- */
- private void cutRect(Rect rect, Rect toRemove) {
- if (toRemove.isEmpty()) return;
- if (toRemove.top < rect.bottom && toRemove.bottom > rect.top) {
- if (toRemove.right >= rect.right && toRemove.left >= rect.left) {
- rect.right = toRemove.left;
- } else if (toRemove.left <= rect.left && toRemove.right <= rect.right) {
- rect.left = toRemove.right;
- }
- }
- if (toRemove.left < rect.right && toRemove.right > rect.left) {
- if (toRemove.bottom >= rect.bottom && toRemove.top >= rect.top) {
- rect.bottom = toRemove.top;
- } else if (toRemove.top <= rect.top && toRemove.bottom <= rect.bottom) {
- rect.top = toRemove.bottom;
- }
- }
- }
-
- /**
* Retrieves the visible bounds of the window.
* @param bounds The rect which gets the bounds.
*/
@@ -3965,14 +3942,6 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
return mDragResizing != computeDragResizing();
}
- @Override
- void setWaitingForDrawnIfResizingChanged() {
- if (isDragResizeChanged()) {
- mWmService.mRoot.mWaitingForDrawn.add(this);
- }
- super.setWaitingForDrawnIfResizingChanged();
- }
-
/**
* Resets the state whether we reported a drag resize change to the app.
*/
@@ -5524,10 +5493,6 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
outRegion.translate(mWindowFrames.mFrame.left, mWindowFrames.mFrame.top);
}
- boolean hasTapExcludeRegion() {
- return !mTapExcludeRegion.isEmpty();
- }
-
boolean isImeLayeringTarget() {
return getDisplayContent().getImeTarget(IME_TARGET_LAYERING) == this;
}
diff --git a/services/core/java/com/android/server/wm/WindowToken.java b/services/core/java/com/android/server/wm/WindowToken.java
index 4d7335873074..e434f296bbb5 100644
--- a/services/core/java/com/android/server/wm/WindowToken.java
+++ b/services/core/java/com/android/server/wm/WindowToken.java
@@ -17,7 +17,6 @@
package com.android.server.wm;
import static android.app.WindowConfiguration.WINDOWING_MODE_PINNED;
-import static android.view.WindowManager.LayoutParams.TYPE_NAVIGATION_BAR;
import static com.android.internal.protolog.ProtoLogGroup.WM_DEBUG_ADD_REMOVE;
import static com.android.internal.protolog.ProtoLogGroup.WM_DEBUG_APP_TRANSITIONS;
@@ -746,17 +745,6 @@ class WindowToken extends WindowContainer<WindowState> {
return this;
}
- /**
- * Return whether windows from this token can layer above the
- * system bars, or in other words extend outside of the "Decor Frame"
- */
- boolean canLayerAboveSystemBars() {
- int layer = getWindowLayerFromType();
- int navLayer = mWmService.mPolicy.getWindowLayerFromTypeLw(TYPE_NAVIGATION_BAR,
- mOwnerCanManageAppTokens);
- return mOwnerCanManageAppTokens && (layer > navLayer);
- }
-
int getWindowLayerFromType() {
return mWmService.mPolicy.getWindowLayerFromTypeLw(windowType, mOwnerCanManageAppTokens,
mRoundedCornerOverlay);
diff --git a/services/core/jni/com_android_server_input_InputManagerService.cpp b/services/core/jni/com_android_server_input_InputManagerService.cpp
index 6e0d98cab8e6..55deb2203a03 100644
--- a/services/core/jni/com_android_server_input_InputManagerService.cpp
+++ b/services/core/jni/com_android_server_input_InputManagerService.cpp
@@ -372,7 +372,7 @@ public:
virtual void onPointerDisplayIdChanged(int32_t displayId, const FloatPoint& position);
/* --- PointerControllerPolicyInterface implementation --- */
- virtual std::shared_ptr<PointerControllerInterface> createPointerController() override;
+ std::shared_ptr<PointerControllerInterface> createPointerController() override;
private:
sp<InputManagerInterface> mInputManager;
@@ -489,7 +489,7 @@ void NativeInputManager::dump(std::string& dump) {
dump += StringPrintf(INDENT "Pointer Capture: %s, seq=%" PRIu32 "\n",
mLocked.pointerCaptureRequest.enable ? "Enabled" : "Disabled",
mLocked.pointerCaptureRequest.seq);
- forEachPointerControllerLocked([&dump](PointerController& pc) { pc.dump(dump); });
+ forEachPointerControllerLocked([&dump](PointerController& pc) { dump += pc.dump(); });
} // release lock
dump += "\n";
@@ -530,9 +530,8 @@ void NativeInputManager::setDisplayViewports(JNIEnv* env, jobjectArray viewportO
{ // acquire lock
std::scoped_lock _l(mLock);
mLocked.viewports = viewports;
- forEachPointerControllerLocked([viewports = std::move(viewports)](PointerController& pc) {
- pc.onDisplayViewportsUpdated(viewports);
- });
+ forEachPointerControllerLocked(
+ [&viewports](PointerController& pc) { pc.onDisplayViewportsUpdated(viewports); });
} // release lock
mInputManager->getReader().requestRefreshConfiguration(
diff --git a/services/devicepolicy/java/com/android/server/devicepolicy/RemoteBugreportManager.java b/services/devicepolicy/java/com/android/server/devicepolicy/RemoteBugreportManager.java
index 9a8e421d5d12..8684dbe73947 100644
--- a/services/devicepolicy/java/com/android/server/devicepolicy/RemoteBugreportManager.java
+++ b/services/devicepolicy/java/com/android/server/devicepolicy/RemoteBugreportManager.java
@@ -111,7 +111,7 @@ public class RemoteBugreportManager {
@Override
public void onReceive(Context context, Intent intent) {
final String action = intent.getAction();
- mInjector.getNotificationManager().cancel(LOG_TAG, NOTIFICATION_ID);
+ cancelNotification();
if (ACTION_BUGREPORT_SHARING_ACCEPTED.equals(action)) {
onBugreportSharingAccepted();
} else if (ACTION_BUGREPORT_SHARING_DECLINED.equals(action)) {
@@ -213,8 +213,7 @@ public class RemoteBugreportManager {
mRemoteBugreportServiceIsActive.set(true);
mRemoteBugreportSharingAccepted.set(false);
registerRemoteBugreportReceivers();
- mInjector.getNotificationManager().notifyAsUser(LOG_TAG, NOTIFICATION_ID,
- buildNotification(NOTIFICATION_BUGREPORT_STARTED), UserHandle.ALL);
+ notify(NOTIFICATION_BUGREPORT_STARTED);
mHandler.postDelayed(mRemoteBugreportTimeoutRunnable, REMOTE_BUGREPORT_TIMEOUT_MILLIS);
return true;
} catch (RemoteException re) {
@@ -258,13 +257,10 @@ public class RemoteBugreportManager {
final String bugreportHash = intent.getStringExtra(EXTRA_REMOTE_BUGREPORT_HASH);
if (mRemoteBugreportSharingAccepted.get()) {
shareBugreportWithDeviceOwnerIfExists(bugreportUriString, bugreportHash);
- mInjector.getNotificationManager().cancel(LOG_TAG,
- NOTIFICATION_ID);
+ cancelNotification();
} else {
mService.setDeviceOwnerRemoteBugreportUriAndHash(bugreportUriString, bugreportHash);
- mInjector.getNotificationManager().notifyAsUser(LOG_TAG, NOTIFICATION_ID,
- buildNotification(NOTIFICATION_BUGREPORT_FINISHED_NOT_ACCEPTED),
- UserHandle.ALL);
+ notify(NOTIFICATION_BUGREPORT_FINISHED_NOT_ACCEPTED);
}
mContext.unregisterReceiver(mRemoteBugreportFinishedReceiver);
}
@@ -274,7 +270,7 @@ public class RemoteBugreportManager {
mInjector.systemPropertiesSet(CTL_STOP, REMOTE_BUGREPORT_SERVICE);
mRemoteBugreportSharingAccepted.set(false);
mService.setDeviceOwnerRemoteBugreportUriAndHash(null, null);
- mInjector.getNotificationManager().cancel(LOG_TAG, NOTIFICATION_ID);
+ cancelNotification();
final Bundle extras = new Bundle();
extras.putInt(DeviceAdminReceiver.EXTRA_BUGREPORT_FAILURE_REASON,
DeviceAdminReceiver.BUGREPORT_FAILURE_FAILED_COMPLETING);
@@ -289,9 +285,7 @@ public class RemoteBugreportManager {
if (uriAndHash != null) {
shareBugreportWithDeviceOwnerIfExists(uriAndHash.first, uriAndHash.second);
} else if (mRemoteBugreportServiceIsActive.get()) {
- mInjector.getNotificationManager().notifyAsUser(LOG_TAG, NOTIFICATION_ID,
- buildNotification(NOTIFICATION_BUGREPORT_ACCEPTED_NOT_FINISHED),
- UserHandle.ALL);
+ notify(NOTIFICATION_BUGREPORT_ACCEPTED_NOT_FINISHED);
}
}
@@ -340,7 +334,16 @@ public class RemoteBugreportManager {
filterConsent.addAction(ACTION_BUGREPORT_SHARING_DECLINED);
filterConsent.addAction(ACTION_BUGREPORT_SHARING_ACCEPTED);
mContext.registerReceiver(mRemoteBugreportConsentReceiver, filterConsent);
- mInjector.getNotificationManager().notifyAsUser(LOG_TAG, NOTIFICATION_ID,
- buildNotification(NOTIFICATION_BUGREPORT_FINISHED_NOT_ACCEPTED), UserHandle.ALL);
+ notify(NOTIFICATION_BUGREPORT_FINISHED_NOT_ACCEPTED);
+ }
+
+ private void notify(@RemoteBugreportNotificationType int type) {
+ mInjector.getNotificationManager()
+ .notifyAsUser(LOG_TAG, NOTIFICATION_ID, buildNotification(type), UserHandle.ALL);
+ }
+
+ private void cancelNotification() {
+ mInjector.getNotificationManager()
+ .cancelAsUser(LOG_TAG, NOTIFICATION_ID, UserHandle.ALL);
}
}
diff --git a/services/tests/PackageManagerServiceTests/server/src/com/android/server/pm/PackageManagerServiceTest.java b/services/tests/PackageManagerServiceTests/server/src/com/android/server/pm/PackageManagerServiceTest.java
index a805e5c9f87e..bea654305a9f 100644
--- a/services/tests/PackageManagerServiceTests/server/src/com/android/server/pm/PackageManagerServiceTest.java
+++ b/services/tests/PackageManagerServiceTests/server/src/com/android/server/pm/PackageManagerServiceTest.java
@@ -125,7 +125,7 @@ public class PackageManagerServiceTest {
Assert.assertNull(pri.mBroadcastUsers);
// populateUsers with nothing leaves nothing
- pri.populateUsers(null, setting);
+ pri.populateBroadcastUsers(setting);
Assert.assertNull(pri.mBroadcastUsers);
// Create a real (non-null) PackageSetting and confirm that the removed
@@ -139,9 +139,10 @@ public class PackageManagerServiceTest {
.setSecondaryCpuAbiString("secondaryCpuAbiString")
.setCpuAbiOverrideString("cpuAbiOverrideString")
.build();
- pri.populateUsers(new int[]{
+ pri.mRemovedUsers = new int[]{
1, 2, 3, 4, 5
- }, setting);
+ };
+ pri.populateBroadcastUsers(setting);
Assert.assertNotNull(pri.mBroadcastUsers);
Assert.assertEquals(5, pri.mBroadcastUsers.length);
Assert.assertNotNull(pri.mInstantUserIds);
@@ -151,9 +152,10 @@ public class PackageManagerServiceTest {
pri.mBroadcastUsers = null;
final int EXCLUDED_USER_ID = 4;
setting.setInstantApp(true, EXCLUDED_USER_ID);
- pri.populateUsers(new int[]{
+ pri.mRemovedUsers = new int[]{
1, 2, 3, EXCLUDED_USER_ID, 5
- }, setting);
+ };
+ pri.populateBroadcastUsers(setting);
Assert.assertNotNull(pri.mBroadcastUsers);
Assert.assertEquals(4, pri.mBroadcastUsers.length);
Assert.assertNotNull(pri.mInstantUserIds);
diff --git a/services/tests/displayservicetests/src/com/android/server/display/AutomaticBrightnessControllerTest.java b/services/tests/displayservicetests/src/com/android/server/display/AutomaticBrightnessControllerTest.java
index d16c37a4c07a..2bdebe26e551 100644
--- a/services/tests/displayservicetests/src/com/android/server/display/AutomaticBrightnessControllerTest.java
+++ b/services/tests/displayservicetests/src/com/android/server/display/AutomaticBrightnessControllerTest.java
@@ -267,7 +267,8 @@ public class AutomaticBrightnessControllerTest {
/* shouldResetShortTermModel= */ true);
// There should be a user data point added to the mapper.
- verify(mBrightnessMappingStrategy).addUserDataPoint(1000f, 0.5f);
+ verify(mBrightnessMappingStrategy).addUserDataPoint(/* lux= */ 1000f,
+ /* brightness= */ 0.5f);
}
@Test
@@ -295,7 +296,8 @@ public class AutomaticBrightnessControllerTest {
mController.recalculateSplines(true, adjustments);
verify(mBrightnessMappingStrategy).clearUserDataPoints();
verify(mBrightnessMappingStrategy).recalculateSplines(true, adjustments);
- verify(mBrightnessMappingStrategy, times(2)).addUserDataPoint(currentLux, 0.5f);
+ verify(mBrightnessMappingStrategy, times(2)).addUserDataPoint(currentLux,
+ /* brightness= */ 0.5f);
clearInvocations(mBrightnessMappingStrategy);
@@ -342,7 +344,7 @@ public class AutomaticBrightnessControllerTest {
// Verify only happens on the first configure. (i.e. not again when switching back)
// Intentionally using any() to ensure it's not called whatsoever.
verify(mBrightnessMappingStrategy, times(1))
- .addUserDataPoint(123.0f, 0.5f);
+ .addUserDataPoint(/* lux= */ 123.0f, /* brightness= */ 0.5f);
verify(mBrightnessMappingStrategy, times(1))
.addUserDataPoint(anyFloat(), anyFloat());
}
@@ -385,7 +387,7 @@ public class AutomaticBrightnessControllerTest {
// Verify that we add the data point once when the user sets it, and again when we return
// interactive mode.
verify(mBrightnessMappingStrategy, times(2))
- .addUserDataPoint(123.0f, 0.51f);
+ .addUserDataPoint(/* lux= */ 123.0f, /* brightness= */ 0.51f);
}
@Test
@@ -428,7 +430,7 @@ public class AutomaticBrightnessControllerTest {
// Verify only happens on the first configure. (i.e. not again when switching back)
// Intentionally using any() to ensure it's not called whatsoever.
verify(mBrightnessMappingStrategy, times(1))
- .addUserDataPoint(123.0f, 0.5f);
+ .addUserDataPoint(/* lux= */ 123.0f, /* brightness= */ 0.5f);
verify(mBrightnessMappingStrategy, times(1))
.addUserDataPoint(anyFloat(), anyFloat());
}
@@ -474,7 +476,7 @@ public class AutomaticBrightnessControllerTest {
// Verify this happens on the first configure and again when switching back
// Intentionally using any() to ensure it's not called any other times whatsoever.
verify(mBrightnessMappingStrategy, times(2))
- .addUserDataPoint(123.0f, 0.5f);
+ .addUserDataPoint(/* lux= */ 123.0f, /* brightness= */ 0.5f);
verify(mBrightnessMappingStrategy, times(2))
.addUserDataPoint(anyFloat(), anyFloat());
}
@@ -533,7 +535,8 @@ public class AutomaticBrightnessControllerTest {
/* shouldResetShortTermModel= */ true);
// There should be a user data point added to the mapper.
- verify(mBrightnessMappingStrategy, times(1)).addUserDataPoint(1000f, 0.5f);
+ verify(mBrightnessMappingStrategy, times(1)).addUserDataPoint(/* lux= */ 1000f,
+ /* brightness= */ 0.5f);
verify(mBrightnessMappingStrategy, times(2)).setBrightnessConfiguration(any());
verify(mBrightnessMappingStrategy, times(3)).getBrightness(anyFloat(), any(), anyInt());
@@ -559,7 +562,8 @@ public class AutomaticBrightnessControllerTest {
/* shouldResetShortTermModel= */ true);
// Ensure we use the correct mapping strategy
- verify(mIdleBrightnessMappingStrategy, times(1)).addUserDataPoint(1000f, 0.5f);
+ verify(mIdleBrightnessMappingStrategy, times(1)).addUserDataPoint(/* lux= */ 1000f,
+ /* brightness= */ 0.5f);
}
@Test
diff --git a/services/tests/displayservicetests/src/com/android/server/display/BrightnessMappingStrategyTest.java b/services/tests/displayservicetests/src/com/android/server/display/BrightnessMappingStrategyTest.java
index ee7826f13578..97e582607133 100644
--- a/services/tests/displayservicetests/src/com/android/server/display/BrightnessMappingStrategyTest.java
+++ b/services/tests/displayservicetests/src/com/android/server/display/BrightnessMappingStrategyTest.java
@@ -445,7 +445,7 @@ public class BrightnessMappingStrategyTest {
// Add a data point in the middle of the curve where the user has set the brightness max
final int idx = LUX_LEVELS.length / 2;
- strategy.addUserDataPoint(LUX_LEVELS[idx], 1.0f);
+ strategy.addUserDataPoint(LUX_LEVELS[idx], /* brightness= */ 1.0f);
// Then make sure that all control points after the middle lux level are also set to max...
for (int i = idx; i < LUX_LEVELS.length; i++) {
@@ -662,11 +662,11 @@ public class BrightnessMappingStrategyTest {
GAMMA_CORRECTION_NITS);
BrightnessMappingStrategy strategy = BrightnessMappingStrategy.create(resources, ddc,
mMockDwbc);
- assertEquals(0.0f, strategy.getAutoBrightnessAdjustment(), 0.0001f /* tolerance */);
- strategy.addUserDataPoint(2500, 1.0f);
- assertEquals(+1.0f, strategy.getAutoBrightnessAdjustment(), 0.0001f /* tolerance */);
- strategy.addUserDataPoint(2500, 0.0f);
- assertEquals(-1.0f, strategy.getAutoBrightnessAdjustment(), 0.0001f /* tolerance */);
+ assertEquals(0.0f, strategy.getAutoBrightnessAdjustment(), /* delta= */ 0.0001f);
+ strategy.addUserDataPoint(/* lux= */ 2500, /* brightness= */ 1.0f);
+ assertEquals(+1.0f, strategy.getAutoBrightnessAdjustment(), /* delta= */ 0.0001f);
+ strategy.addUserDataPoint(/* lux= */ 2500, /* brightness= */ 0.0f);
+ assertEquals(-1.0f, strategy.getAutoBrightnessAdjustment(), /* delta= */ 0.0001f);
}
@Test
@@ -701,7 +701,7 @@ public class BrightnessMappingStrategyTest {
// Similarly, if we set a user data point at (x4, 1.0), the adjustment should be 1 - y4.
adjustment = 1.0f - y4;
gamma = (float) MathUtils.pow(MAXIMUM_GAMMA, -adjustment);
- strategy.addUserDataPoint(x4, 1.0f);
+ strategy.addUserDataPoint(x4, /* brightness= */ 1.0f);
assertEquals(MathUtils.pow(y0, gamma), strategy.getBrightness(x0), 0.0001f /* tolerance */);
assertEquals(MathUtils.pow(y2, gamma), strategy.getBrightness(x2), 0.0001f /* tolerance */);
assertEquals(1.0f, strategy.getBrightness(x4), 0.0001f /* tolerance */);
diff --git a/services/tests/displayservicetests/src/com/android/server/display/LogicalDisplayMapperTest.java b/services/tests/displayservicetests/src/com/android/server/display/LogicalDisplayMapperTest.java
index 69544356ab5b..065dd1f1f743 100644
--- a/services/tests/displayservicetests/src/com/android/server/display/LogicalDisplayMapperTest.java
+++ b/services/tests/displayservicetests/src/com/android/server/display/LogicalDisplayMapperTest.java
@@ -44,9 +44,13 @@ import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
+import static org.mockito.ArgumentMatchers.anyInt;
+import static org.mockito.ArgumentMatchers.anyLong;
import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.Mockito.atLeastOnce;
import static org.mockito.Mockito.clearInvocations;
import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.never;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
@@ -58,6 +62,7 @@ import android.os.IPowerManager;
import android.os.IThermalService;
import android.os.PowerManager;
import android.os.Process;
+import android.os.RemoteException;
import android.os.test.TestLooper;
import android.view.Display;
import android.view.DisplayAddress;
@@ -69,7 +74,7 @@ import androidx.test.filters.SmallTest;
import com.android.server.display.feature.DisplayManagerFlags;
import com.android.server.display.layout.DisplayIdProducer;
import com.android.server.display.layout.Layout;
-import com.android.server.utils.FoldSettingWrapper;
+import com.android.server.utils.FoldSettingProvider;
import org.junit.Before;
import org.junit.Test;
@@ -93,6 +98,7 @@ public class LogicalDisplayMapperTest {
private static int sUniqueTestDisplayId = 0;
private static final int DEVICE_STATE_CLOSED = 0;
private static final int DEVICE_STATE_OPEN = 2;
+ private static final int FLAG_GO_TO_SLEEP_ON_FOLD = 0;
private static int sNextNonDefaultDisplayId = DEFAULT_DISPLAY + 1;
private static final File NON_EXISTING_FILE = new File("/non_existing_folder/should_not_exist");
@@ -107,7 +113,7 @@ public class LogicalDisplayMapperTest {
@Mock LogicalDisplayMapper.Listener mListenerMock;
@Mock Context mContextMock;
- @Mock FoldSettingWrapper mFoldSettingWrapperMock;
+ @Mock FoldSettingProvider mFoldSettingProviderMock;
@Mock Resources mResourcesMock;
@Mock IPowerManager mIPowerManagerMock;
@Mock IThermalService mIThermalServiceMock;
@@ -120,7 +126,7 @@ public class LogicalDisplayMapperTest {
@Captor ArgumentCaptor<Integer> mDisplayEventCaptor;
@Before
- public void setUp() {
+ public void setUp() throws RemoteException {
// Share classloader to allow package private access.
System.setProperty("dexmaker.share_classloader", "true");
MockitoAnnotations.initMocks(this);
@@ -150,7 +156,9 @@ public class LogicalDisplayMapperTest {
when(mContextMock.getSystemServiceName(PowerManager.class))
.thenReturn(Context.POWER_SERVICE);
- when(mFoldSettingWrapperMock.shouldStayAwakeOnFold()).thenReturn(false);
+ when(mFoldSettingProviderMock.shouldStayAwakeOnFold()).thenReturn(false);
+ when(mFoldSettingProviderMock.shouldSleepOnFold()).thenReturn(false);
+ when(mIPowerManagerMock.isInteractive()).thenReturn(true);
when(mContextMock.getSystemService(PowerManager.class)).thenReturn(mPowerManager);
when(mContextMock.getResources()).thenReturn(mResourcesMock);
when(mResourcesMock.getBoolean(
@@ -166,9 +174,10 @@ public class LogicalDisplayMapperTest {
when(mFlagsMock.isConnectedDisplayManagementEnabled()).thenReturn(false);
mLooper = new TestLooper();
mHandler = new Handler(mLooper.getLooper());
- mLogicalDisplayMapper = new LogicalDisplayMapper(mContextMock, mDisplayDeviceRepo,
+ mLogicalDisplayMapper = new LogicalDisplayMapper(mContextMock, mFoldSettingProviderMock,
+ mDisplayDeviceRepo,
mListenerMock, new DisplayManagerService.SyncRoot(), mHandler,
- mDeviceStateToLayoutMapSpy, mFoldSettingWrapperMock, mFlagsMock);
+ mDeviceStateToLayoutMapSpy, mFlagsMock);
}
@@ -645,8 +654,8 @@ public class LogicalDisplayMapperTest {
}
@Test
- public void testDeviceShouldNotSleepWhenFoldSettingTrue() {
- when(mFoldSettingWrapperMock.shouldStayAwakeOnFold()).thenReturn(true);
+ public void testDeviceShouldNotSleepWhenStayAwakeSettingTrue() {
+ when(mFoldSettingProviderMock.shouldStayAwakeOnFold()).thenReturn(true);
assertFalse(mLogicalDisplayMapper.shouldDeviceBePutToSleep(DEVICE_STATE_CLOSED,
DEVICE_STATE_OPEN,
@@ -679,6 +688,26 @@ public class LogicalDisplayMapperTest {
}
@Test
+ public void testDeviceShouldPutToSleepWhenSleepSettingTrue() throws RemoteException {
+ when(mFoldSettingProviderMock.shouldSleepOnFold()).thenReturn(true);
+
+ finishBootAndFoldDevice();
+
+ verify(mIPowerManagerMock, atLeastOnce()).goToSleep(anyLong(), anyInt(),
+ eq(FLAG_GO_TO_SLEEP_ON_FOLD));
+ }
+
+ @Test
+ public void testDeviceShouldNotBePutToSleepWhenSleepSettingFalse() throws RemoteException {
+ when(mFoldSettingProviderMock.shouldSleepOnFold()).thenReturn(false);
+
+ finishBootAndFoldDevice();
+
+ verify(mIPowerManagerMock, never()).goToSleep(anyLong(), anyInt(),
+ eq(FLAG_GO_TO_SLEEP_ON_FOLD));
+ }
+
+ @Test
public void testDeviceStateLocked() {
DisplayDevice device1 = createDisplayDevice(TYPE_INTERNAL, 600, 800,
FLAG_ALLOWED_TO_BE_DEFAULT_DISPLAY);
@@ -930,6 +959,15 @@ public class LogicalDisplayMapperTest {
// Helper Methods
/////////////////
+ private void finishBootAndFoldDevice() {
+ mLogicalDisplayMapper.setDeviceStateLocked(DEVICE_STATE_OPEN, false);
+ advanceTime(1000);
+ mLogicalDisplayMapper.onBootCompleted();
+ advanceTime(1000);
+ mLogicalDisplayMapper.setDeviceStateLocked(DEVICE_STATE_CLOSED, false);
+ advanceTime(1000);
+ }
+
private void createDefaultDisplay(Layout layout, DisplayDevice device) {
createDefaultDisplay(layout, info(device).address);
}
diff --git a/services/tests/mockingservicestests/src/com/android/server/pm/PackageArchiverServiceTest.java b/services/tests/mockingservicestests/src/com/android/server/pm/PackageArchiverServiceTest.java
index e58a2342a718..80576a688fdd 100644
--- a/services/tests/mockingservicestests/src/com/android/server/pm/PackageArchiverServiceTest.java
+++ b/services/tests/mockingservicestests/src/com/android/server/pm/PackageArchiverServiceTest.java
@@ -18,9 +18,7 @@ package com.android.server.pm;
import static android.content.Intent.FLAG_RECEIVER_FOREGROUND;
import static android.content.pm.PackageManager.DELETE_KEEP_DATA;
-
import static com.google.common.truth.Truth.assertThat;
-
import static org.junit.Assert.assertThrows;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyInt;
@@ -207,8 +205,7 @@ public class PackageArchiverServiceTest {
() -> mArchiveService.requestArchive(PACKAGE, CALLER_PACKAGE, mIntentSender,
UserHandle.CURRENT));
assertThat(e.getCause()).isInstanceOf(PackageManager.NameNotFoundException.class);
- assertThat(e.getCause()).hasMessageThat().isEqualTo(
- String.format("No installer found to archive app %s.", PACKAGE));
+ assertThat(e.getCause()).hasMessageThat().isEqualTo("No installer found");
}
@Test
diff --git a/services/tests/mockingservicestests/src/com/android/server/utils/FoldSettingProviderTest.java b/services/tests/mockingservicestests/src/com/android/server/utils/FoldSettingProviderTest.java
new file mode 100644
index 000000000000..3514276ccb5b
--- /dev/null
+++ b/services/tests/mockingservicestests/src/com/android/server/utils/FoldSettingProviderTest.java
@@ -0,0 +1,143 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.server.utils;
+
+import static com.android.server.utils.FoldSettingProvider.SETTING_VALUE_SLEEP_ON_FOLD;
+import static com.android.server.utils.FoldSettingProvider.SETTING_VALUE_STAY_AWAKE_ON_FOLD;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.Mockito.when;
+
+import android.content.ContentResolver;
+import android.content.Context;
+import android.content.res.Resources;
+import android.os.UserHandle;
+import android.provider.Settings;
+
+import androidx.test.platform.app.InstrumentationRegistry;
+
+import com.android.internal.R;
+import com.android.internal.util.SettingsWrapper;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+
+public class FoldSettingProviderTest {
+
+ private static final String SETTING_VALUE_INVALID = "invalid_fold_lock_behavior";
+
+ @Mock
+ private Context mContext;
+ @Mock
+ private Resources mResources;
+ @Mock
+ private SettingsWrapper mSettingsWrapper;
+ private ContentResolver mContentResolver;
+ private FoldSettingProvider mFoldSettingProvider;
+
+ @Before
+ public void setUp() {
+ MockitoAnnotations.initMocks(this);
+
+ mContentResolver =
+ InstrumentationRegistry.getInstrumentation().getContext().getContentResolver();
+ when(mContext.getContentResolver()).thenReturn(mContentResolver);
+ when(mContext.getResources()).thenReturn(mResources);
+ setFoldLockBehaviorAvailability(true);
+
+ mFoldSettingProvider = new FoldSettingProvider(mContext, mSettingsWrapper);
+ }
+
+ @Test
+ public void foldSettingNotAvailable_returnDefaultSetting() {
+ setFoldLockBehaviorAvailability(false);
+ setFoldLockBehaviorSettingValue(SETTING_VALUE_STAY_AWAKE_ON_FOLD);
+ mFoldSettingProvider = new FoldSettingProvider(mContext, mSettingsWrapper);
+
+ boolean shouldSelectiveStayAwakeOnFold =
+ mFoldSettingProvider.shouldSelectiveStayAwakeOnFold();
+
+ assertThat(shouldSelectiveStayAwakeOnFold).isTrue();
+ }
+
+ @Test
+ public void foldSettingNotAvailable_notReturnStayAwakeOnFoldTrue() {
+ setFoldLockBehaviorAvailability(false);
+ setFoldLockBehaviorSettingValue(SETTING_VALUE_STAY_AWAKE_ON_FOLD);
+ mFoldSettingProvider = new FoldSettingProvider(mContext, mSettingsWrapper);
+
+ boolean shouldStayAwakeOnFold = mFoldSettingProvider.shouldStayAwakeOnFold();
+
+ assertThat(shouldStayAwakeOnFold).isFalse();
+ }
+
+ @Test
+ public void foldSettingNotAvailable_notReturnSleepOnFoldTrue() {
+ setFoldLockBehaviorAvailability(false);
+ setFoldLockBehaviorSettingValue(SETTING_VALUE_SLEEP_ON_FOLD);
+ mFoldSettingProvider = new FoldSettingProvider(mContext, mSettingsWrapper);
+
+ boolean shouldSleepOnFold = mFoldSettingProvider.shouldSleepOnFold();
+
+ assertThat(shouldSleepOnFold).isFalse();
+ }
+
+ @Test
+ public void foldSettingAvailable_returnCorrectFoldSetting() {
+ setFoldLockBehaviorSettingValue(SETTING_VALUE_STAY_AWAKE_ON_FOLD);
+
+ boolean shouldStayAwakeOnFold = mFoldSettingProvider.shouldStayAwakeOnFold();
+
+ assertThat(shouldStayAwakeOnFold).isTrue();
+ }
+
+ @Test
+ public void foldSettingInvalid_returnDefaultSetting() {
+ setFoldLockBehaviorSettingValue(SETTING_VALUE_INVALID);
+
+ boolean shouldSelectiveStayAwakeOnFold =
+ mFoldSettingProvider.shouldSelectiveStayAwakeOnFold();
+
+ assertThat(shouldSelectiveStayAwakeOnFold).isTrue();
+ }
+
+ @Test
+ public void foldSettingNotDefined_returnDefaultSetting() {
+ setFoldLockBehaviorSettingValue(null);
+
+ boolean shouldSelectiveStayAwakeOnFold =
+ mFoldSettingProvider.shouldSelectiveStayAwakeOnFold();
+
+ assertThat(shouldSelectiveStayAwakeOnFold).isTrue();
+ }
+
+ private void setFoldLockBehaviorAvailability(boolean isFoldLockBehaviorEnabled) {
+ when(mResources.getBoolean(R.bool.config_fold_lock_behavior)).thenReturn(
+ isFoldLockBehaviorEnabled);
+ }
+
+ private void setFoldLockBehaviorSettingValue(String foldLockBehaviorSettingValue) {
+ when(mSettingsWrapper.getStringForUser(any(),
+ eq(Settings.System.FOLD_LOCK_BEHAVIOR),
+ eq(UserHandle.USER_CURRENT))).thenReturn(foldLockBehaviorSettingValue);
+ }
+}
diff --git a/services/tests/servicestests/src/com/android/server/companion/virtual/VirtualDeviceTest.java b/services/tests/servicestests/src/com/android/server/companion/virtual/VirtualDeviceTest.java
index 28df24c3866a..c65452aa2fa1 100644
--- a/services/tests/servicestests/src/com/android/server/companion/virtual/VirtualDeviceTest.java
+++ b/services/tests/servicestests/src/com/android/server/companion/virtual/VirtualDeviceTest.java
@@ -16,21 +16,31 @@
package com.android.server.companion.virtual;
+import static android.companion.virtual.VirtualDeviceParams.DEVICE_POLICY_CUSTOM;
+import static android.companion.virtual.VirtualDeviceParams.DEVICE_POLICY_DEFAULT;
+import static android.companion.virtual.VirtualDeviceParams.POLICY_TYPE_SENSORS;
import static android.content.Context.DEVICE_ID_DEFAULT;
import static android.content.Context.DEVICE_ID_INVALID;
import static com.google.common.truth.Truth.assertThat;
import static org.junit.Assert.assertThrows;
+import static org.mockito.Mockito.when;
+import android.companion.virtual.IVirtualDevice;
import android.companion.virtual.VirtualDevice;
+import android.companion.virtual.flags.Flags;
import android.os.Parcel;
import android.platform.test.annotations.Presubmit;
+import android.platform.test.annotations.RequiresFlagsEnabled;
import androidx.test.ext.junit.runners.AndroidJUnit4;
+import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
@Presubmit
@RunWith(AndroidJUnit4.class)
@@ -40,24 +50,35 @@ public class VirtualDeviceTest {
private static final String PERSISTENT_ID = "persistentId";
private static final String DEVICE_NAME = "VirtualDeviceName";
+ @Mock
+ private IVirtualDevice mVirtualDevice;
+
+ @Before
+ public void setUp() throws Exception {
+ MockitoAnnotations.initMocks(this);
+ }
+
@Test
public void build_invalidId_shouldThrowIllegalArgumentException() {
assertThrows(
IllegalArgumentException.class,
- () -> new VirtualDevice(DEVICE_ID_INVALID, PERSISTENT_ID, DEVICE_NAME));
+ () -> new VirtualDevice(
+ mVirtualDevice, DEVICE_ID_INVALID, PERSISTENT_ID, DEVICE_NAME));
}
@Test
public void build_defaultId_shouldThrowIllegalArgumentException() {
assertThrows(
IllegalArgumentException.class,
- () -> new VirtualDevice(DEVICE_ID_DEFAULT, PERSISTENT_ID, DEVICE_NAME));
+ () -> new VirtualDevice(
+ mVirtualDevice, DEVICE_ID_DEFAULT, PERSISTENT_ID, DEVICE_NAME));
}
@Test
public void build_onlyRequiredFields() {
VirtualDevice virtualDevice =
- new VirtualDevice(VIRTUAL_DEVICE_ID, /*persistentId=*/null, /*name=*/null);
+ new VirtualDevice(
+ mVirtualDevice, VIRTUAL_DEVICE_ID, /*persistentId=*/null, /*name=*/null);
assertThat(virtualDevice.getDeviceId()).isEqualTo(VIRTUAL_DEVICE_ID);
assertThat(virtualDevice.getPersistentDeviceId()).isNull();
assertThat(virtualDevice.getName()).isNull();
@@ -66,15 +87,43 @@ public class VirtualDeviceTest {
@Test
public void parcelable_shouldRecreateSuccessfully() {
VirtualDevice originalDevice =
- new VirtualDevice(VIRTUAL_DEVICE_ID, PERSISTENT_ID, DEVICE_NAME);
+ new VirtualDevice(mVirtualDevice, VIRTUAL_DEVICE_ID, PERSISTENT_ID, DEVICE_NAME);
Parcel parcel = Parcel.obtain();
originalDevice.writeToParcel(parcel, 0);
parcel.setDataPosition(0);
VirtualDevice device = VirtualDevice.CREATOR.createFromParcel(parcel);
- assertThat(device).isEqualTo(originalDevice);
assertThat(device.getDeviceId()).isEqualTo(VIRTUAL_DEVICE_ID);
assertThat(device.getPersistentDeviceId()).isEqualTo(PERSISTENT_ID);
assertThat(device.getName()).isEqualTo(DEVICE_NAME);
}
+
+ @RequiresFlagsEnabled(Flags.FLAG_VDM_PUBLIC_APIS)
+ @Test
+ public void virtualDevice_getDisplayIds() throws Exception {
+ VirtualDevice virtualDevice =
+ new VirtualDevice(
+ mVirtualDevice, VIRTUAL_DEVICE_ID, /*persistentId=*/null, /*name=*/null);
+
+ when(mVirtualDevice.getDisplayIds()).thenReturn(new int[0]);
+ assertThat(virtualDevice.getDisplayIds()).hasLength(0);
+
+ final int[] displayIds = new int[]{7, 18};
+ when(mVirtualDevice.getDisplayIds()).thenReturn(displayIds);
+ assertThat(virtualDevice.getDisplayIds()).isEqualTo(displayIds);
+ }
+
+ @RequiresFlagsEnabled(Flags.FLAG_VDM_PUBLIC_APIS)
+ @Test
+ public void virtualDevice_hasCustomSensorSupport() throws Exception {
+ VirtualDevice virtualDevice =
+ new VirtualDevice(
+ mVirtualDevice, VIRTUAL_DEVICE_ID, /*persistentId=*/null, /*name=*/null);
+
+ when(mVirtualDevice.getDevicePolicy(POLICY_TYPE_SENSORS)).thenReturn(DEVICE_POLICY_DEFAULT);
+ assertThat(virtualDevice.hasCustomSensorSupport()).isFalse();
+
+ when(mVirtualDevice.getDevicePolicy(POLICY_TYPE_SENSORS)).thenReturn(DEVICE_POLICY_CUSTOM);
+ assertThat(virtualDevice.hasCustomSensorSupport()).isTrue();
+ }
}
diff --git a/services/tests/servicestests/src/com/android/server/companion/virtual/audio/VirtualAudioControllerTest.java b/services/tests/servicestests/src/com/android/server/companion/virtual/audio/VirtualAudioControllerTest.java
index 2bfa44ecb1d6..78655a5dd341 100644
--- a/services/tests/servicestests/src/com/android/server/companion/virtual/audio/VirtualAudioControllerTest.java
+++ b/services/tests/servicestests/src/com/android/server/companion/virtual/audio/VirtualAudioControllerTest.java
@@ -25,7 +25,6 @@ import static com.google.common.truth.Truth.assertThat;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.verify;
-import android.companion.virtual.VirtualDeviceParams;
import android.companion.virtual.audio.IAudioConfigChangedCallback;
import android.companion.virtual.audio.IAudioRoutingCallback;
import android.content.Context;
@@ -79,11 +78,10 @@ public class VirtualAudioControllerTest {
FLAG_SECURE,
SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS,
/* allowedUsers= */ new ArraySet<>(),
- /* allowedCrossTaskNavigations= */ new ArraySet<>(),
- /* blockedCrossTaskNavigations= */ new ArraySet<>(),
- /* allowedActivities= */ new ArraySet<>(),
- /* blockedActivities= */ new ArraySet<>(),
- VirtualDeviceParams.ACTIVITY_POLICY_DEFAULT_ALLOWED,
+ /* activityLaunchAllowedByDefault= */ true,
+ /* activityPolicyExceptions= */ new ArraySet<>(),
+ /* crossTaskNavigationAllowedByDefault= */ true,
+ /* crossTaskNavigationExceptions= */ new ArraySet<>(),
/* activityListener= */ null,
/* pipBlockedCallback= */ null,
/* activityBlockedCallback= */ null,
diff --git a/services/tests/wmtests/src/com/android/server/policy/ShortcutKeyTestBase.java b/services/tests/wmtests/src/com/android/server/policy/ShortcutKeyTestBase.java
index f83aecb605ca..8db09f9e3a16 100644
--- a/services/tests/wmtests/src/com/android/server/policy/ShortcutKeyTestBase.java
+++ b/services/tests/wmtests/src/com/android/server/policy/ShortcutKeyTestBase.java
@@ -115,43 +115,61 @@ class ShortcutKeyTestBase {
}
}
- void sendKeyCombination(int[] keyCodes, long duration) {
+ void sendKeyCombination(int[] keyCodes, long duration, boolean longPress) {
final long downTime = SystemClock.uptimeMillis();
final int count = keyCodes.length;
- final KeyEvent[] events = new KeyEvent[count];
int metaState = 0;
+
for (int i = 0; i < count; i++) {
final int keyCode = keyCodes[i];
final KeyEvent event = new KeyEvent(downTime, downTime, KeyEvent.ACTION_DOWN, keyCode,
0 /*repeat*/, metaState, KeyCharacterMap.VIRTUAL_KEYBOARD, 0 /*scancode*/,
0 /*flags*/, InputDevice.SOURCE_KEYBOARD);
event.setDisplayId(DEFAULT_DISPLAY);
- events[i] = event;
+ interceptKey(event);
// The order is important here, metaState could be updated and applied to the next key.
metaState |= MODIFIER.getOrDefault(keyCode, 0);
}
- for (KeyEvent event: events) {
- interceptKey(event);
- }
-
try {
Thread.sleep(duration);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
+ if (longPress) {
+ final long nextDownTime = SystemClock.uptimeMillis();
+ for (int i = 0; i < count; i++) {
+ final int keyCode = keyCodes[i];
+ final KeyEvent nextDownEvent = new KeyEvent(downTime, nextDownTime,
+ KeyEvent.ACTION_DOWN, keyCode, 1 /*repeat*/, metaState,
+ KeyCharacterMap.VIRTUAL_KEYBOARD, 0 /*scancode*/,
+ KeyEvent.FLAG_LONG_PRESS /*flags*/, InputDevice.SOURCE_KEYBOARD);
+ nextDownEvent.setDisplayId(DEFAULT_DISPLAY);
+ interceptKey(nextDownEvent);
+ }
+ }
+
+ final long eventTime = SystemClock.uptimeMillis();
for (int i = count - 1; i >= 0; i--) {
- final long eventTime = SystemClock.uptimeMillis();
final int keyCode = keyCodes[i];
final KeyEvent upEvent = new KeyEvent(downTime, eventTime, KeyEvent.ACTION_UP, keyCode,
0, metaState, KeyCharacterMap.VIRTUAL_KEYBOARD, 0 /*scancode*/, 0 /*flags*/,
InputDevice.SOURCE_KEYBOARD);
+ upEvent.setDisplayId(DEFAULT_DISPLAY);
interceptKey(upEvent);
metaState &= ~MODIFIER.getOrDefault(keyCode, 0);
}
}
+ void sendKeyCombination(int[] keyCodes, long duration) {
+ sendKeyCombination(keyCodes, duration, false /* longPress */);
+ }
+
+ void sendLongPressKeyCombination(int[] keyCodes) {
+ sendKeyCombination(keyCodes, ViewConfiguration.getLongPressTimeout(), true /* longPress */);
+ }
+
void sendKey(int keyCode) {
sendKey(keyCode, false);
}
@@ -179,6 +197,7 @@ class ShortcutKeyTestBase {
final KeyEvent upEvent = new KeyEvent(downTime, eventTime, KeyEvent.ACTION_UP, keyCode,
0 /*repeat*/, 0 /*metaState*/, KeyCharacterMap.VIRTUAL_KEYBOARD, 0 /*scancode*/,
0 /*flags*/, InputDevice.SOURCE_KEYBOARD);
+ upEvent.setDisplayId(DEFAULT_DISPLAY);
interceptKey(upEvent);
}
diff --git a/services/tests/wmtests/src/com/android/server/policy/ShortcutLoggingTests.java b/services/tests/wmtests/src/com/android/server/policy/ShortcutLoggingTests.java
index e13dc3eea729..479194673e80 100644
--- a/services/tests/wmtests/src/com/android/server/policy/ShortcutLoggingTests.java
+++ b/services/tests/wmtests/src/com/android/server/policy/ShortcutLoggingTests.java
@@ -16,6 +16,11 @@
package com.android.server.policy;
+import static com.android.server.policy.PhoneWindowManager.DOUBLE_TAP_HOME_RECENT_SYSTEM_UI;
+import static com.android.server.policy.PhoneWindowManager.LONG_PRESS_HOME_ALL_APPS;
+import static com.android.server.policy.PhoneWindowManager.LONG_PRESS_HOME_ASSIST;
+import static com.android.server.policy.PhoneWindowManager.LONG_PRESS_HOME_NOTIFICATION_PANEL;
+
import android.platform.test.annotations.Presubmit;
import android.view.KeyEvent;
@@ -226,6 +231,59 @@ public class ShortcutLoggingTests extends ShortcutKeyTestBase {
KeyboardLogEvent.LAUNCH_DEFAULT_MESSAGING, KeyEvent.KEYCODE_S, META_ON}};
}
+ @Keep
+ private static Object[][] longPressOnHomeTestArguments() {
+ // testName, testKeys, longPressOnHomeBehavior, expectedLogEvent, expectedKey,
+ // expectedModifierState
+ return new Object[][]{
+ {"Long press HOME key -> Toggle Notification panel",
+ new int[]{KeyEvent.KEYCODE_HOME}, LONG_PRESS_HOME_NOTIFICATION_PANEL,
+ KeyboardLogEvent.TOGGLE_NOTIFICATION_PANEL, KeyEvent.KEYCODE_HOME, 0},
+ {"Long press META + ENTER -> Toggle Notification panel",
+ new int[]{META_KEY, KeyEvent.KEYCODE_ENTER},
+ LONG_PRESS_HOME_NOTIFICATION_PANEL,
+ KeyboardLogEvent.TOGGLE_NOTIFICATION_PANEL, KeyEvent.KEYCODE_ENTER,
+ META_ON},
+ {"Long press META + H -> Toggle Notification panel",
+ new int[]{META_KEY, KeyEvent.KEYCODE_H}, LONG_PRESS_HOME_NOTIFICATION_PANEL,
+ KeyboardLogEvent.TOGGLE_NOTIFICATION_PANEL, KeyEvent.KEYCODE_H, META_ON},
+ {"Long press HOME key -> Launch assistant",
+ new int[]{KeyEvent.KEYCODE_HOME}, LONG_PRESS_HOME_ASSIST,
+ KeyboardLogEvent.LAUNCH_ASSISTANT, KeyEvent.KEYCODE_HOME, 0},
+ {"Long press META + ENTER -> Launch assistant",
+ new int[]{META_KEY, KeyEvent.KEYCODE_ENTER}, LONG_PRESS_HOME_ASSIST,
+ KeyboardLogEvent.LAUNCH_ASSISTANT, KeyEvent.KEYCODE_ENTER, META_ON},
+ {"Long press META + H -> Launch assistant",
+ new int[]{META_KEY, KeyEvent.KEYCODE_H}, LONG_PRESS_HOME_ASSIST,
+ KeyboardLogEvent.LAUNCH_ASSISTANT, KeyEvent.KEYCODE_H, META_ON},
+ {"Long press HOME key -> Open App Drawer",
+ new int[]{KeyEvent.KEYCODE_HOME}, LONG_PRESS_HOME_ALL_APPS,
+ KeyboardLogEvent.ALL_APPS, KeyEvent.KEYCODE_HOME, 0},
+ {"Long press META + ENTER -> Open App Drawer",
+ new int[]{META_KEY, KeyEvent.KEYCODE_ENTER}, LONG_PRESS_HOME_ALL_APPS,
+ KeyboardLogEvent.ALL_APPS, KeyEvent.KEYCODE_ENTER, META_ON},
+ {"Long press META + H -> Open App Drawer", new int[]{META_KEY, KeyEvent.KEYCODE_H},
+ LONG_PRESS_HOME_ALL_APPS, KeyboardLogEvent.ALL_APPS,
+ KeyEvent.KEYCODE_H, META_ON}};
+ }
+
+ @Keep
+ private static Object[][] doubleTapOnHomeTestArguments() {
+ // testName, testKeys, doubleTapOnHomeBehavior, expectedLogEvent, expectedKey,
+ // expectedModifierState
+ return new Object[][]{
+ {"Double tap HOME -> Open App switcher",
+ new int[]{KeyEvent.KEYCODE_HOME}, DOUBLE_TAP_HOME_RECENT_SYSTEM_UI,
+ KeyboardLogEvent.APP_SWITCH, KeyEvent.KEYCODE_HOME, 0},
+ {"Double tap META + ENTER -> Open App switcher",
+ new int[]{META_KEY, KeyEvent.KEYCODE_ENTER},
+ DOUBLE_TAP_HOME_RECENT_SYSTEM_UI, KeyboardLogEvent.APP_SWITCH,
+ KeyEvent.KEYCODE_ENTER, META_ON},
+ {"Double tap META + H -> Open App switcher",
+ new int[]{META_KEY, KeyEvent.KEYCODE_H}, DOUBLE_TAP_HOME_RECENT_SYSTEM_UI,
+ KeyboardLogEvent.APP_SWITCH, KeyEvent.KEYCODE_H, META_ON}};
+ }
+
@Before
public void setUp() {
setUpPhoneWindowManager(/*supportSettingsUpdate*/ true);
@@ -237,13 +295,37 @@ public class ShortcutLoggingTests extends ShortcutKeyTestBase {
mPhoneWindowManager.overrideStatusBarManagerInternal();
mPhoneWindowManager.overrideStartActivity();
mPhoneWindowManager.overrideUserSetupComplete();
+ mPhoneWindowManager.setupAssistForLaunch();
+ mPhoneWindowManager.overrideTogglePanel();
}
@Test
@Parameters(method = "shortcutTestArguments")
public void testShortcuts(String testName, int[] testKeys, KeyboardLogEvent expectedLogEvent,
int expectedKey, int expectedModifierState) {
- sendKeyCombination(testKeys, 0);
+ sendKeyCombination(testKeys, 0 /* duration */);
+ mPhoneWindowManager.assertShortcutLogged(VENDOR_ID, PRODUCT_ID, expectedLogEvent,
+ expectedKey, expectedModifierState, "Failed while executing " + testName);
+ }
+
+ @Test
+ @Parameters(method = "longPressOnHomeTestArguments")
+ public void testLongPressOnHome(String testName, int[] testKeys, int longPressOnHomeBehavior,
+ KeyboardLogEvent expectedLogEvent, int expectedKey, int expectedModifierState) {
+ mPhoneWindowManager.overrideLongPressOnHomeBehavior(longPressOnHomeBehavior);
+ sendLongPressKeyCombination(testKeys);
+ mPhoneWindowManager.assertShortcutLogged(VENDOR_ID, PRODUCT_ID, expectedLogEvent,
+ expectedKey, expectedModifierState, "Failed while executing " + testName);
+ }
+
+ @Test
+ @Parameters(method = "doubleTapOnHomeTestArguments")
+ public void testDoubleTapOnHomeBehavior(String testName, int[] testKeys,
+ int doubleTapOnHomeBehavior, KeyboardLogEvent expectedLogEvent, int expectedKey,
+ int expectedModifierState) {
+ mPhoneWindowManager.overriderDoubleTapOnHomeBehavior(doubleTapOnHomeBehavior);
+ sendKeyCombination(testKeys, 0 /* duration */);
+ sendKeyCombination(testKeys, 0 /* duration */);
mPhoneWindowManager.assertShortcutLogged(VENDOR_ID, PRODUCT_ID, expectedLogEvent,
expectedKey, expectedModifierState, "Failed while executing " + testName);
}
diff --git a/services/tests/wmtests/src/com/android/server/policy/TestPhoneWindowManager.java b/services/tests/wmtests/src/com/android/server/policy/TestPhoneWindowManager.java
index bc8f06a48ffb..e301da7c58fc 100644
--- a/services/tests/wmtests/src/com/android/server/policy/TestPhoneWindowManager.java
+++ b/services/tests/wmtests/src/com/android/server/policy/TestPhoneWindowManager.java
@@ -364,6 +364,14 @@ class TestPhoneWindowManager {
}
}
+ void overrideLongPressOnHomeBehavior(int behavior) {
+ mPhoneWindowManager.mLongPressOnHomeBehavior = behavior;
+ }
+
+ void overriderDoubleTapOnHomeBehavior(int behavior) {
+ mPhoneWindowManager.mDoubleTapOnHomeBehavior = behavior;
+ }
+
void overrideCanStartDreaming(boolean canDream) {
doReturn(canDream).when(mDreamManagerInternal).canStartDreaming(anyBoolean());
}
diff --git a/services/tests/wmtests/src/com/android/server/wm/DisplayRotationTests.java b/services/tests/wmtests/src/com/android/server/wm/DisplayRotationTests.java
index 6b504925281c..915b387ddb75 100644
--- a/services/tests/wmtests/src/com/android/server/wm/DisplayRotationTests.java
+++ b/services/tests/wmtests/src/com/android/server/wm/DisplayRotationTests.java
@@ -583,6 +583,7 @@ public class DisplayRotationTests {
enableOrientationSensor();
+ clearInvocations(sMockWm);
mOrientationSensorListener.onSensorChanged(createSensorEvent(Surface.ROTATION_90));
assertTrue(waitForUiHandler());
@@ -627,6 +628,7 @@ public class DisplayRotationTests {
when(mDisplayRotationImmersiveAppCompatPolicyMock.isRotationLockEnforced(
Surface.ROTATION_90)).thenReturn(false);
+ clearInvocations(sMockWm);
// And then ActivityRecord.setRequestedOrientation calls onSetRequestedOrientation.
mTarget.onSetRequestedOrientation();
@@ -864,6 +866,7 @@ public class DisplayRotationTests {
assertEquals(Surface.ROTATION_270, mTarget.rotationForOrientation(
SCREEN_ORIENTATION_UNSPECIFIED, Surface.ROTATION_0));
+ clearInvocations(sMockWm);
// ... until half-fold
mTarget.foldStateChanged(DeviceStateController.DeviceState.HALF_FOLDED);
assertTrue(waitForUiHandler());
@@ -899,6 +902,7 @@ public class DisplayRotationTests {
assertEquals(Surface.ROTATION_270, mTarget.rotationForOrientation(
SCREEN_ORIENTATION_UNSPECIFIED, Surface.ROTATION_0));
+ clearInvocations(sMockWm);
// ... half-fold -> still no rotation
mTarget.foldStateChanged(DeviceStateController.DeviceState.HALF_FOLDED);
assertTrue(waitForUiHandler());
diff --git a/telecomm/java/android/telecom/CallEndpoint.java b/telecomm/java/android/telecom/CallEndpoint.java
index ed4bf40061e2..a557cafd309a 100644
--- a/telecomm/java/android/telecom/CallEndpoint.java
+++ b/telecomm/java/android/telecom/CallEndpoint.java
@@ -127,7 +127,7 @@ public final class CallEndpoint implements Parcelable {
return false;
}
CallEndpoint endpoint = (CallEndpoint) obj;
- return getEndpointName().toString().contentEquals(endpoint.getEndpointName())
+ return Objects.equals(getEndpointName(), endpoint.getEndpointName())
&& getEndpointType() == endpoint.getEndpointType()
&& getIdentifier().equals(endpoint.getIdentifier());
}
diff --git a/tests/TrustTests/src/android/trust/test/CanUnlockWithActiveUnlockTest.kt b/tests/TrustTests/src/android/trust/test/IsActiveUnlockRunningTest.kt
index 7b68a829e23b..7b68a829e23b 100644
--- a/tests/TrustTests/src/android/trust/test/CanUnlockWithActiveUnlockTest.kt
+++ b/tests/TrustTests/src/android/trust/test/IsActiveUnlockRunningTest.kt