Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5d7efb6c authored by David Riley's avatar David Riley
Browse files

Fix handling, documentation and testing of updateable flags.

Remove BIND_ABOVE_CLIENT from updateable flags since there
is not a clear use and its implementation is probelmatic.

Add additional documentation to encourage future authors to
validate changes to BIND_UPDATEABLE_FLAGS.

Make BindServiceFlags values accessible from tests.

Bug: 443357277
Flag: android.content.flags.enable_update_service_bindings
Test: atest android.app.cts.service.ServiceTest
Change-Id: I13fa20e87c67e49c0d20aed50c1b1e252c0161a8
parent 897d275e
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -1094,6 +1094,10 @@ package android.content {
    field public static final String TEST_NETWORK_SERVICE = "test_network";
  }

  public static final class Context.BindServiceFlags {
    method @FlaggedApi("android.content.flags.enable_update_service_bindings") public long getValue();
  }

  public class ContextWrapper extends android.content.Context {
    method public int getDisplayId();
    method public void updateDisplay(int);
+6 −1
Original line number Diff line number Diff line
@@ -366,6 +366,8 @@ public abstract class Context {
         * @return Return flags in 64 bits long integer.
         * @hide
         */
        @TestApi
        @FlaggedApi(FLAG_ENABLE_UPDATE_SERVICE_BINDINGS)
        public long getValue() {
            return mValue;
        }
@@ -786,11 +788,14 @@ public abstract class Context {
    /**
     * These bind flags may be updated (i.e. added or removed) for an existing
     * connection.
     *
     * Any updates here should also modify the {@link #getUpdateableFlags} documentation
     * as well as verify that no checks from {@link #bindService} and
     * {@code ActiveServices.bindServiceLocked} are being skipped.
     * @hide
     */
    public static final long BIND_UPDATEABLE_FLAGS =
            Context.BIND_NOT_FOREGROUND
                    | Context.BIND_ABOVE_CLIENT
                    | Context.BIND_ALLOW_OOM_MANAGEMENT
                    | Context.BIND_WAIVE_PRIORITY
                    | Context.BIND_IMPORTANT