Settings crashed by a null worker
-Add worker checker -Add test case Bug: 153356562 Test: make -j42 RunSettingsRoboTests Change-Id: I129ff63a48b3785aacc846fe1dd67a926a8e5e1f
This commit is contained in:
@@ -25,6 +25,7 @@ import android.content.Intent;
|
||||
import android.graphics.Bitmap;
|
||||
import android.media.session.MediaController;
|
||||
import android.net.Uri;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.core.graphics.drawable.IconCompat;
|
||||
import androidx.slice.Slice;
|
||||
@@ -104,6 +105,10 @@ public class MediaOutputIndicatorSlice implements CustomSliceable {
|
||||
|
||||
@Override
|
||||
public void onNotifyChange(Intent i) {
|
||||
if (getWorker() == null) {
|
||||
Log.d(TAG, "onNotifyChange: Worker is null");
|
||||
return;
|
||||
}
|
||||
final MediaController mediaController = getWorker().getActiveLocalMediaController();
|
||||
final Intent intent = new Intent()
|
||||
.setPackage(Utils.SETTINGS_PACKAGE_NAME)
|
||||
|
Reference in New Issue
Block a user