Add NonNull/Nullable annotations

Change-Id: Id2a343765b29226a13ba41102df4bca739112192
Fix: 126701786
Test: Manual
This commit is contained in:
Todd Kennedy
2019-03-25 11:20:01 -07:00
parent aecff3d7c4
commit 63ff464661
2 changed files with 24 additions and 18 deletions

View File

@@ -491,12 +491,12 @@ package android.app {
ctor public InstantAppResolverService();
method public final void attachBaseContext(android.content.Context);
method public final android.os.IBinder onBind(android.content.Intent);
method @Deprecated public void onGetInstantAppIntentFilter(int[], String, android.app.InstantAppResolverService.InstantAppResolutionCallback);
method @Deprecated public void onGetInstantAppIntentFilter(android.content.Intent, int[], String, android.app.InstantAppResolverService.InstantAppResolutionCallback);
method public void onGetInstantAppIntentFilter(android.content.Intent, int[], android.os.UserHandle, String, android.app.InstantAppResolverService.InstantAppResolutionCallback);
method @Deprecated public void onGetInstantAppResolveInfo(int[], String, android.app.InstantAppResolverService.InstantAppResolutionCallback);
method @Deprecated public void onGetInstantAppResolveInfo(android.content.Intent, int[], String, android.app.InstantAppResolverService.InstantAppResolutionCallback);
method public void onGetInstantAppResolveInfo(android.content.Intent, int[], android.os.UserHandle, String, android.app.InstantAppResolverService.InstantAppResolutionCallback);
method @Deprecated public void onGetInstantAppIntentFilter(@Nullable int[], @NonNull String, @NonNull android.app.InstantAppResolverService.InstantAppResolutionCallback);
method @Deprecated public void onGetInstantAppIntentFilter(@NonNull android.content.Intent, @Nullable int[], @NonNull String, @NonNull android.app.InstantAppResolverService.InstantAppResolutionCallback);
method public void onGetInstantAppIntentFilter(@NonNull android.content.Intent, @Nullable int[], @NonNull android.os.UserHandle, @NonNull String, @NonNull android.app.InstantAppResolverService.InstantAppResolutionCallback);
method @Deprecated public void onGetInstantAppResolveInfo(@Nullable int[], @NonNull String, @NonNull android.app.InstantAppResolverService.InstantAppResolutionCallback);
method @Deprecated public void onGetInstantAppResolveInfo(@NonNull android.content.Intent, @Nullable int[], @NonNull String, @NonNull android.app.InstantAppResolverService.InstantAppResolutionCallback);
method public void onGetInstantAppResolveInfo(@NonNull android.content.Intent, @Nullable int[], @NonNull android.os.UserHandle, @NonNull String, @NonNull android.app.InstantAppResolverService.InstantAppResolutionCallback);
}
public static final class InstantAppResolverService.InstantAppResolutionCallback {

View File

@@ -16,6 +16,8 @@
package android.app;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.SystemApi;
import android.content.Context;
import android.content.Intent;
@@ -61,8 +63,8 @@ public abstract class InstantAppResolverService extends Service {
* String, InstantAppResolutionCallback)}.
*/
@Deprecated
public void onGetInstantAppResolveInfo(
int digestPrefix[], String token, InstantAppResolutionCallback callback) {
public void onGetInstantAppResolveInfo(@Nullable int[] digestPrefix, @NonNull String token,
@NonNull InstantAppResolutionCallback callback) {
throw new IllegalStateException("Must define onGetInstantAppResolveInfo");
}
@@ -75,8 +77,8 @@ public abstract class InstantAppResolverService extends Service {
* String, InstantAppResolutionCallback)}.
*/
@Deprecated
public void onGetInstantAppIntentFilter(
int digestPrefix[], String token, InstantAppResolutionCallback callback) {
public void onGetInstantAppIntentFilter(@Nullable int[] digestPrefix, @NonNull String token,
@NonNull InstantAppResolutionCallback callback) {
throw new IllegalStateException("Must define onGetInstantAppIntentFilter");
}
@@ -105,8 +107,9 @@ public abstract class InstantAppResolverService extends Service {
* String, InstantAppResolutionCallback)}.
*/
@Deprecated
public void onGetInstantAppResolveInfo(Intent sanitizedIntent, int[] hostDigestPrefix,
String token, InstantAppResolutionCallback callback) {
public void onGetInstantAppResolveInfo(@NonNull Intent sanitizedIntent,
@Nullable int[] hostDigestPrefix, @NonNull String token,
@NonNull InstantAppResolutionCallback callback) {
// if not overridden, forward to old methods and filter out non-web intents
if (sanitizedIntent.isWebIntent()) {
onGetInstantAppResolveInfo(hostDigestPrefix, token, callback);
@@ -135,8 +138,9 @@ public abstract class InstantAppResolverService extends Service {
* String, InstantAppResolutionCallback)}.
*/
@Deprecated
public void onGetInstantAppIntentFilter(Intent sanitizedIntent, int[] hostDigestPrefix,
String token, InstantAppResolutionCallback callback) {
public void onGetInstantAppIntentFilter(@NonNull Intent sanitizedIntent,
@Nullable int[] hostDigestPrefix,
@NonNull String token, @NonNull InstantAppResolutionCallback callback) {
Log.e(TAG, "New onGetInstantAppIntentFilter is not overridden");
// if not overridden, forward to old methods and filter out non-web intents
if (sanitizedIntent.isWebIntent()) {
@@ -167,8 +171,9 @@ public abstract class InstantAppResolverService extends Service {
*
* @see InstantAppResolveInfo
*/
public void onGetInstantAppResolveInfo(Intent sanitizedIntent, int[] hostDigestPrefix,
UserHandle userHandle, String token, InstantAppResolutionCallback callback) {
public void onGetInstantAppResolveInfo(@NonNull Intent sanitizedIntent,
@Nullable int[] hostDigestPrefix, @NonNull UserHandle userHandle,
@NonNull String token, @NonNull InstantAppResolutionCallback callback) {
// If not overridden, forward to the old method.
onGetInstantAppResolveInfo(sanitizedIntent, hostDigestPrefix, token, callback);
}
@@ -189,8 +194,9 @@ public abstract class InstantAppResolverService extends Service {
* to the currently visible installer via {@link Intent#EXTRA_INSTANT_APP_TOKEN}.
* @param callback The {@link InstantAppResolutionCallback} to provide results to.
*/
public void onGetInstantAppIntentFilter(Intent sanitizedIntent, int[] hostDigestPrefix,
UserHandle userHandle, String token, InstantAppResolutionCallback callback) {
public void onGetInstantAppIntentFilter(@NonNull Intent sanitizedIntent,
@Nullable int[] hostDigestPrefix, @NonNull UserHandle userHandle,
@NonNull String token, @NonNull InstantAppResolutionCallback callback) {
// If not overridden, forward to the old method.
onGetInstantAppIntentFilter(sanitizedIntent, hostDigestPrefix, token, callback);
}