Add @Nullable annotations to quiet errorprone.
Those are preventive annotations to prepare for incoming android update (coming with Chromium roll). Currently the roll is blocked partly because errorprone complains! Bug: webrtc:11095, chromium:1003532 Change-Id: If4e2879a522e895ce7fb1f2a9ad36d06f98f2a61 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/160002 Reviewed-by: Sami Kalliomäki <sakal@webrtc.org> Commit-Queue: Yves Gerey <yvesg@google.com> Cr-Commit-Position: refs/heads/master@{#29830}
This commit is contained in:
@ -87,7 +87,7 @@ public class AppRTCAudioManager {
|
|||||||
private AudioDevice userSelectedAudioDevice;
|
private AudioDevice userSelectedAudioDevice;
|
||||||
|
|
||||||
// Contains speakerphone setting: auto, true or false
|
// Contains speakerphone setting: auto, true or false
|
||||||
private final String useSpeakerphone;
|
@Nullable private final String useSpeakerphone;
|
||||||
|
|
||||||
// Proximity sensor object. It measures the proximity of an object in cm
|
// Proximity sensor object. It measures the proximity of an object in cm
|
||||||
// relative to the view screen of a device and can therefore be used to
|
// relative to the view screen of a device and can therefore be used to
|
||||||
|
@ -23,6 +23,7 @@ import android.net.Uri;
|
|||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.preference.PreferenceManager;
|
import android.preference.PreferenceManager;
|
||||||
|
import android.support.annotation.Nullable;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.ContextMenu;
|
import android.view.ContextMenu;
|
||||||
import android.view.KeyEvent;
|
import android.view.KeyEvent;
|
||||||
@ -300,6 +301,7 @@ public class ConnectActivity extends Activity {
|
|||||||
* Get a value from the shared preference or from the intent, if it does not
|
* Get a value from the shared preference or from the intent, if it does not
|
||||||
* exist the default is used.
|
* exist the default is used.
|
||||||
*/
|
*/
|
||||||
|
@Nullable
|
||||||
private String sharedPrefGetString(
|
private String sharedPrefGetString(
|
||||||
int attributeId, String intentName, int defaultId, boolean useFromIntent) {
|
int attributeId, String intentName, int defaultId, boolean useFromIntent) {
|
||||||
String defaultValue = getString(defaultId);
|
String defaultValue = getString(defaultId);
|
||||||
|
@ -78,6 +78,7 @@ public class Camera2Enumerator implements CameraEnumerator {
|
|||||||
== CameraMetadata.LENS_FACING_BACK;
|
== CameraMetadata.LENS_FACING_BACK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Nullable
|
||||||
@Override
|
@Override
|
||||||
public List<CaptureFormat> getSupportedFormats(String deviceName) {
|
public List<CaptureFormat> getSupportedFormats(String deviceName) {
|
||||||
return getSupportedFormats(context, deviceName);
|
return getSupportedFormats(context, deviceName);
|
||||||
@ -165,11 +166,13 @@ public class Camera2Enumerator implements CameraEnumerator {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Nullable
|
||||||
static List<CaptureFormat> getSupportedFormats(Context context, String cameraId) {
|
static List<CaptureFormat> getSupportedFormats(Context context, String cameraId) {
|
||||||
return getSupportedFormats(
|
return getSupportedFormats(
|
||||||
(CameraManager) context.getSystemService(Context.CAMERA_SERVICE), cameraId);
|
(CameraManager) context.getSystemService(Context.CAMERA_SERVICE), cameraId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Nullable
|
||||||
static List<CaptureFormat> getSupportedFormats(CameraManager cameraManager, String cameraId) {
|
static List<CaptureFormat> getSupportedFormats(CameraManager cameraManager, String cameraId) {
|
||||||
synchronized (cachedSupportedFormats) {
|
synchronized (cachedSupportedFormats) {
|
||||||
if (cachedSupportedFormats.containsKey(cameraId)) {
|
if (cachedSupportedFormats.containsKey(cameraId)) {
|
||||||
|
@ -395,6 +395,7 @@ public class PeerConnection {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Nullable
|
||||||
@CalledByNative("AdapterType")
|
@CalledByNative("AdapterType")
|
||||||
static AdapterType fromNativeIndex(int nativeIndex) {
|
static AdapterType fromNativeIndex(int nativeIndex) {
|
||||||
return BY_BITMASK.get(nativeIndex);
|
return BY_BITMASK.get(nativeIndex);
|
||||||
|
@ -18,6 +18,10 @@ package org.webrtc;
|
|||||||
class WebRtcClassLoader {
|
class WebRtcClassLoader {
|
||||||
@CalledByNative
|
@CalledByNative
|
||||||
static Object getClassLoader() {
|
static Object getClassLoader() {
|
||||||
return WebRtcClassLoader.class.getClassLoader();
|
Object loader = WebRtcClassLoader.class.getClassLoader();
|
||||||
|
if (loader == null) {
|
||||||
|
throw new RuntimeException("Failed to get WebRTC class loader.");
|
||||||
|
}
|
||||||
|
return loader;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user