Merge "Fixed a NP when replying to a message"
This commit is contained in:
@@ -461,7 +461,7 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene
|
||||
@Override
|
||||
protected void onVisibilityChanged(View changedView, int visibility) {
|
||||
super.onVisibilityChanged(changedView, visibility);
|
||||
if (changedView == this) {
|
||||
if (changedView == this && mOnVisibilityChangedListener != null) {
|
||||
mOnVisibilityChangedListener.accept(visibility == VISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ import android.content.pm.ShortcutManager;
|
||||
import android.support.test.filters.SmallTest;
|
||||
import android.testing.AndroidTestingRunner;
|
||||
import android.testing.TestableLooper;
|
||||
import android.view.View;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageButton;
|
||||
|
||||
@@ -88,4 +89,10 @@ public class RemoteInputViewTest extends SysuiTestCase {
|
||||
assertEquals(RemoteInput.SOURCE_FREE_FORM_INPUT,
|
||||
RemoteInput.getResultsSource(resultIntent));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testNoCrashWithoutVisibilityListener() {
|
||||
mView.setOnVisibilityChangedListener(null);
|
||||
mView.onVisibilityChanged(mView, View.VISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user