diff options
author | Jordan Liu <jminjie@google.com> | 2020-04-22 11:20:14 -0700 |
---|---|---|
committer | Jordan Liu <jminjie@google.com> | 2020-04-24 11:32:34 -0700 |
commit | fb9433915484e7c4c8cbbf9fc30e7d0b0e64cbc1 (patch) | |
tree | d6576351bb721e2885612ec34ed780cf29d57759 /src/com/android | |
parent | d1cdfd54e44d32d7dd7b1f841eb07a41c1c00324 (diff) | |
download | CellBroadcastReceiver-fb9433915484e7c4c8cbbf9fc30e7d0b0e64cbc1.tar.gz |
Add tests to CellBroadcastAlertDialogTest
Bug: 148482334
Test: atest CellBroadcastAlertDialogTest
Change-Id: Iba804e1e8f10461b06af280e158c5bc883ff7136
Diffstat (limited to 'src/com/android')
-rw-r--r-- | src/com/android/cellbroadcastreceiver/CellBroadcastAlertDialog.java | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/com/android/cellbroadcastreceiver/CellBroadcastAlertDialog.java b/src/com/android/cellbroadcastreceiver/CellBroadcastAlertDialog.java index c4896ebf3..160d54cf0 100644 --- a/src/com/android/cellbroadcastreceiver/CellBroadcastAlertDialog.java +++ b/src/com/android/cellbroadcastreceiver/CellBroadcastAlertDialog.java @@ -59,6 +59,8 @@ import android.widget.ImageView; import android.widget.TextView; import android.widget.Toast; +import com.android.internal.annotations.VisibleForTesting; + import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.util.ArrayList; @@ -76,7 +78,8 @@ public class CellBroadcastAlertDialog extends Activity { private static final String TAG = "CellBroadcastAlertDialog"; /** Intent extra for non-emergency alerts sent when user selects the notification. */ - static final String FROM_NOTIFICATION_EXTRA = "from_notification"; + @VisibleForTesting + public static final String FROM_NOTIFICATION_EXTRA = "from_notification"; // Intent extra to identify if notification was sent while trying to move away from the dialog // without acknowledging the dialog @@ -598,7 +601,8 @@ public class CellBroadcastAlertDialog extends Activity { * @param intent The new intent containing one or more {@link SmsCbMessage}. */ @Override - protected void onNewIntent(Intent intent) { + @VisibleForTesting + public void onNewIntent(Intent intent) { ArrayList<SmsCbMessage> newMessageList = intent.getParcelableArrayListExtra( CellBroadcastAlertService.SMS_CB_MESSAGE_EXTRA); if (newMessageList != null) { @@ -662,7 +666,8 @@ public class CellBroadcastAlertDialog extends Activity { * Stop animating warning icon and stop the {@link CellBroadcastAlertAudio} * service if necessary. */ - void dismiss() { + @VisibleForTesting + public void dismiss() { Log.d(TAG, "dismiss"); // Stop playing alert sound/vibration/speech (if started) stopService(new Intent(this, CellBroadcastAlertAudio.class)); |