|
27 | 27 | import static android.content.Context.BIND_WAIVE_PRIORITY;
|
28 | 28 | import static java.lang.Integer.toHexString;
|
29 | 29 |
|
| 30 | +import android.os.Build; |
30 | 31 | import androidx.annotation.RequiresApi;
|
| 32 | +import io.grpc.ExperimentalApi; |
31 | 33 |
|
32 | 34 | /**
|
33 | 35 | * An immutable set of flags affecting the behavior of {@link android.content.Context#bindService}.
|
@@ -101,6 +103,26 @@ public Builder setAdjustWithActivity(boolean newValue) {
|
101 | 103 | return setFlag(BIND_ADJUST_WITH_ACTIVITY, newValue);
|
102 | 104 | }
|
103 | 105 |
|
| 106 | + // TODO(b/274061424): Reference official constant and add RequiresApi declaration in place of |
| 107 | + // informal Javadoc warning when U is final. |
| 108 | + /** |
| 109 | + * Sets or clears the {@code android.content.Context#BIND_ALLOW_ACTIVITY_STARTS} flag. |
| 110 | + * |
| 111 | + * <p>This method allows for testing and development on Android U developer previews. Before |
| 112 | + * releasing production code which depends on this flag, verify that either the |
| 113 | + * {@code BIND_ALLOW_ACTIVITY_STARTS} flag has not changed from 0x200 during SDK development, |
| 114 | + * or wait for this method to be updated to point to the final flag and made non-experimental. |
| 115 | + * |
| 116 | + * <p>This flag has no additional meaning at the gRPC layer. See the Android docs for more. |
| 117 | + * |
| 118 | + * @return this, for fluent construction |
| 119 | + */ |
| 120 | + @ExperimentalApi("To be finalized after Android U SDK finalization") |
| 121 | + public Builder setAllowActivityStarts(boolean newValue) { |
| 122 | + // https://developer.android.com/reference/android/content/Context#BIND_ALLOW_ACTIVITY_STARTS |
| 123 | + return setFlag(0x200, newValue); |
| 124 | + } |
| 125 | + |
104 | 126 | /**
|
105 | 127 | * Sets or clears the {@link android.content.Context#BIND_ALLOW_OOM_MANAGEMENT} flag.
|
106 | 128 | *
|
|
0 commit comments