Make it explicit that it may return null.

Given that some places where this method is invoked does a null check,
it seems reasonable to make this assumption explicit. That way if devs
use the method in the future, then they will be aware of the contract.
This commit is contained in:
Peter Serwylo 2017-02-24 10:29:01 +11:00 committed by mvp76
parent 875b0d091f
commit 0b1940c4bf

View File

@ -6,6 +6,7 @@ import android.content.ContentResolver;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.support.annotation.Nullable;
import android.support.v4.app.TaskStackBuilder;
import android.support.v4.content.LocalBroadcastManager;
@ -76,6 +77,7 @@ public class AppUpdateStatusManager {
localBroadcastManager = LocalBroadcastManager.getInstance(context.getApplicationContext());
}
@Nullable
public AppUpdateStatus get(String key) {
synchronized (appMapping) {
return appMapping.get(key);
@ -204,6 +206,7 @@ public class AppUpdateStatusManager {
}
}
@Nullable
public Apk getApk(String key) {
synchronized (appMapping) {
AppUpdateStatus entry = appMapping.get(key);