Fix STK CTS test failure

Bug: 31039972
Change-Id: Iba3066b6bedb10f5d08d07f707425dad80b94689
diff --git a/tests/tests/security/src/android/security/cts/STKFrameworkTest.java b/tests/tests/security/src/android/security/cts/STKFrameworkTest.java
index 1fae3c8..284ad82 100644
--- a/tests/tests/security/src/android/security/cts/STKFrameworkTest.java
+++ b/tests/tests/security/src/android/security/cts/STKFrameworkTest.java
@@ -18,11 +18,16 @@
 import android.content.ComponentName;
 import android.content.Intent;
 import android.test.AndroidTestCase;
+import android.content.pm.PackageManager;
 
 public class STKFrameworkTest extends AndroidTestCase {
-    @Override
+   private boolean mHasTelephony;
+
+   @Override
     protected void setUp() throws Exception {
         super.setUp();
+	mHasTelephony = getContext().getPackageManager().hasSystemFeature(
+                PackageManager.FEATURE_TELEPHONY);
     }
 
     @Override
@@ -35,7 +40,11 @@
      * zero-permission malicious application
      */
     public void testInterceptedSIMCommandsToTelephony() {
-        Intent intent = new Intent();
+        if (!mHasTelephony) {
+		return;
+	}
+
+	Intent intent = new Intent();
         intent.setAction("android.intent.action.stk.command");
         intent.putExtra("STK CMD", "test");
         ComponentName cn =