use of android.support.annotation.Nullable in project Signal-Android by WhisperSystems.
the class StickerSelectFragment method onCreateView.
@Nullable
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.scribble_select_sticker_fragment, container, false);
this.recyclerView = (RecyclerView) view.findViewById(R.id.stickers_recycler_view);
return view;
}
use of android.support.annotation.Nullable in project Signal-Android by WhisperSystems.
the class UpdateApkJob method getDigestForDownloadId.
@Nullable
private byte[] getDigestForDownloadId(long downloadId) {
try {
DownloadManager downloadManager = (DownloadManager) context.getSystemService(Context.DOWNLOAD_SERVICE);
FileInputStream fin = new FileInputStream(downloadManager.openDownloadedFile(downloadId).getFileDescriptor());
byte[] digest = FileUtils.getFileDigest(fin);
fin.close();
return digest;
} catch (IOException e) {
Log.w(TAG, e);
return null;
}
}
use of android.support.annotation.Nullable in project Signal-Android by WhisperSystems.
the class MotionView method findEntityAtPoint.
@Nullable
private MotionEntity findEntityAtPoint(float x, float y) {
MotionEntity selected = null;
PointF p = new PointF(x, y);
for (int i = entities.size() - 1; i >= 0; i--) {
if (entities.get(i).pointInLayerRect(p)) {
selected = entities.get(i);
break;
}
}
return selected;
}
use of android.support.annotation.Nullable in project Signal-Android by WhisperSystems.
the class KeyCachingService method getMasterSecret.
@Nullable
public static synchronized MasterSecret getMasterSecret(Context context) {
if (masterSecret == null && TextSecurePreferences.isPasswordDisabled(context)) {
try {
MasterSecret masterSecret = MasterSecretUtil.getMasterSecret(context, MasterSecretUtil.UNENCRYPTED_PASSPHRASE);
Intent intent = new Intent(context, KeyCachingService.class);
context.startService(intent);
return masterSecret;
} catch (InvalidPassphraseException e) {
Log.w("KeyCachingService", e);
}
}
return masterSecret;
}
use of android.support.annotation.Nullable in project Signal-Android by WhisperSystems.
the class PeerConnectionWrapper method createVideoCapturer.
@Nullable
private CameraVideoCapturer createVideoCapturer(@NonNull Context context) {
Log.w(TAG, "Camera2 enumerator supported: " + Camera2Enumerator.isSupported(context));
CameraEnumerator enumerator;
if (Camera2Enumerator.isSupported(context))
enumerator = new Camera2Enumerator(context);
else
enumerator = new Camera1Enumerator(true);
String[] deviceNames = enumerator.getDeviceNames();
for (String deviceName : deviceNames) {
if (enumerator.isFrontFacing(deviceName)) {
Log.w(TAG, "Creating front facing camera capturer.");
final CameraVideoCapturer videoCapturer = enumerator.createCapturer(deviceName, null);
if (videoCapturer != null) {
Log.w(TAG, "Found front facing capturer: " + deviceName);
return videoCapturer;
}
}
}
for (String deviceName : deviceNames) {
if (!enumerator.isFrontFacing(deviceName)) {
Log.w(TAG, "Creating other camera capturer.");
final CameraVideoCapturer videoCapturer = enumerator.createCapturer(deviceName, null);
if (videoCapturer != null) {
Log.w(TAG, "Found other facing capturer: " + deviceName);
return videoCapturer;
}
}
}
Log.w(TAG, "Video capture not supported!");
return null;
}
Aggregations