Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 527c44e8 authored by Glenn Kasten's avatar Glenn Kasten Committed by Android (Google) Code Review
Browse files

Merge "Don't check return value of new for being == null"

parents b14d771c 62b9aec7
Loading
Loading
Loading
Loading
+24 −30
Original line number Diff line number Diff line
@@ -1026,10 +1026,6 @@ public class AudioService extends IAudioService.Stub {
                return true;
            }
            mSoundPool = new SoundPool(NUM_SOUNDPOOL_CHANNELS, AudioSystem.STREAM_SYSTEM, 0);
            if (mSoundPool == null) {
                Log.w(TAG, "loadSoundEffects() could not allocate sound pool");
                return false;
            }

            try {
                mSoundPoolCallBack = null;
@@ -2104,7 +2100,6 @@ public class AudioService extends IAudioService.Stub {
                    mSoundPool.play(SOUND_EFFECT_FILES_MAP[effectType][1], volFloat, volFloat, 0, 0, 1.0f);
                } else {
                    MediaPlayer mediaPlayer = new MediaPlayer();
                    if (mediaPlayer != null) {
                    try {
                        String filePath = Environment.getRootDirectory() + SOUND_EFFECTS_PATH + SOUND_EFFECT_FILES[SOUND_EFFECT_FILES_MAP[effectType][0]];
                        mediaPlayer.setDataSource(filePath);
@@ -2133,7 +2128,6 @@ public class AudioService extends IAudioService.Stub {
                }
            }
        }
        }

        private void onHandlePersistMediaButtonReceiver(ComponentName receiver) {
            Settings.System.putString(mContentResolver, Settings.System.MEDIA_BUTTON_RECEIVER,
+4 −6
Original line number Diff line number Diff line
@@ -161,13 +161,11 @@ public class SoundPool
        int id = 0;
        try {
            File f = new File(path);
            if (f != null) {
            ParcelFileDescriptor fd = ParcelFileDescriptor.open(f, ParcelFileDescriptor.MODE_READ_ONLY);
            if (fd != null) {
                id = _load(fd.getFileDescriptor(), 0, f.length(), priority);
                fd.close();
            }
            }
        } catch (java.io.IOException e) {
            Log.e(TAG, "error loading " + path);
        }
+1 −3
Original line number Diff line number Diff line
@@ -472,9 +472,7 @@ public class ThumbnailUtils {
        byte [] thumbData = null;
        try {
            exif = new ExifInterface(filePath);
            if (exif != null) {
            thumbData = exif.getThumbnail();
            }
        } catch (IOException ex) {
            Log.w(TAG, ex);
        }