LLS: Don't build LlsInfo when defComponent is empty

Unflattening an empty string will result in a null ComponentName
which will cause an IllegalArgumentException when building the
LiveLockScreenInfo.

Change-Id: I0bafddb48a47ef67d9833cd12bff7eb34369425e
This commit is contained in:
d34d 2016-03-31 09:49:42 -07:00
parent a50a323724
commit c99582205e
1 changed files with 2 additions and 1 deletions

View File

@ -30,6 +30,7 @@ import android.os.Message;
import android.os.RemoteCallbackList;
import android.os.RemoteException;
import android.os.SystemClock;
import android.text.TextUtils;
import android.util.Slog;
import com.android.server.SystemService;
@ -249,7 +250,7 @@ public class LiveLockScreenServiceBroker extends SystemService {
// Initialize the default LLS component
String defComponent = CMSettings.Secure.getString(mContext.getContentResolver(),
CMSettings.Secure.DEFAULT_LIVE_LOCK_SCREEN_COMPONENT);
if (defComponent != null) {
if (!TextUtils.isEmpty(defComponent)) {
mDefaultLlsInfo = new LiveLockScreenInfo.Builder()
.setComponent(ComponentName.unflattenFromString(defComponent))
.build();