OSDN Git Service

SoundSettings: Prevent NPE due to linked volumes change
authorZhao Wei Liew <zhaoweiliew@gmail.com>
Sun, 22 Jan 2017 13:53:25 +0000 (21:53 +0800)
committerZhao Wei Liew <zhaoweiliew@gmail.com>
Mon, 23 Jan 2017 04:00:35 +0000 (04:00 +0000)
commit58c35d5a93ab5fdfd98d37e7f1f67f838a0a53bc
treed5ab00583d1311badf4d1ae4f913891aea30fe88
parent3cbc805e518306fa19835a56d7f5a67b14226465
SoundSettings: Prevent NPE due to linked volumes change

In AOSP, mRingOrNotificationPreference can never be null.

However, ever since the linked notification volumes change
in commit 6430dbd2d2f89c45e35750a4923f10f1b8bd839d, there is a
possibility that mRingOrNotificationPreference is null,
causing an NPE when calling showIcon() on it.

Add a null check to prevent that.

Change-Id: I8d7231f50fc1f04acdc706e2d2c775bed7803fca
(cherry picked from commit bd47a5a5f61b772441df865804cb69ee5e7b00e4)
src/com/android/settings/notification/SoundSettings.java