Move android.security test service to stub package

This actually broke other tests. Move the service to the stub package so
we can change targetPackage back to the stub.

Bug: 10569131
Bug: 13208402

Change-Id: I83f7e85548ab388aa9b708ff20fd392d62cc0286
(cherry picked from commit fd41eda0785343505a4a5cc0cc10cc5457784338)

Conflicts:
	tests/AndroidManifest.xml
diff --git a/tests/tests/security/Android.mk b/tests/tests/security/Android.mk
index 43b615f..f36be9d 100644
--- a/tests/tests/security/Android.mk
+++ b/tests/tests/security/Android.mk
@@ -24,8 +24,7 @@
 
 LOCAL_JNI_SHARED_LIBRARIES := libctssecurity_jni
 
-LOCAL_SRC_FILES := $(call all-java-files-under, src) \
-    src/android/security/cts/activity/ISecureRandomService.aidl
+LOCAL_SRC_FILES := $(call all-java-files-under, src)
 
 LOCAL_PACKAGE_NAME := CtsSecurityTestCases
 
diff --git a/tests/tests/security/AndroidManifest.xml b/tests/tests/security/AndroidManifest.xml
index 0a6a9d9..60d6713 100644
--- a/tests/tests/security/AndroidManifest.xml
+++ b/tests/tests/security/AndroidManifest.xml
@@ -25,14 +25,11 @@
 
     <application>
         <uses-library android:name="android.test.runner" />
-
-        <service android:name="android.security.cts.activity.SecureRandomService"
-                 android:process=":secureRandom"/>
     </application>
 
     <instrumentation android:name="android.test.InstrumentationCtsTestRunner"
-                     android:targetPackage="com.android.cts.security"
-                     android:label="CTS tests of com.android.cts.security"/>
+                     android:targetPackage="com.android.cts.stub"
+                     android:label="CTS tests of com.android.cts.stub"/>
 
 </manifest>
 
diff --git a/tests/tests/security/src/android/security/cts/activity/ISecureRandomService.aidl b/tests/tests/security/src/android/security/cts/activity/ISecureRandomService.aidl
deleted file mode 100644
index af264c9..0000000
--- a/tests/tests/security/src/android/security/cts/activity/ISecureRandomService.aidl
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Copyright 2013 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.security.cts.activity;
-
-interface ISecureRandomService {
-    int getRandomBytesAndPid(inout byte[] randomBytes);
-}
diff --git a/tests/tests/security/src/android/security/cts/activity/SecureRandomService.java b/tests/tests/security/src/android/security/cts/activity/SecureRandomService.java
deleted file mode 100644
index 2d425b3..0000000
--- a/tests/tests/security/src/android/security/cts/activity/SecureRandomService.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright 2013 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.security.cts.activity;
-
-import android.os.Handler;
-import android.os.IBinder;
-import android.os.Message;
-import android.security.cts.activity.ISecureRandomService;
-
-import android.app.Service;
-import android.content.Intent;
-
-import java.security.SecureRandom;
-
-public class SecureRandomService extends Service {
-    /**
-     * This helps the process shut down a little faster and get us a new
-     * PID earlier than calling stopService.
-     */
-    private Handler mShutdownHandler = new Handler() {
-        @Override
-        public void handleMessage(Message msg) {
-            stopSelf();
-        }
-    };
-
-    private final ISecureRandomService.Stub mBinder = new ISecureRandomService.Stub() {
-
-        /**
-         * Returns output from SecureRandom and the current process PID. Note
-         * that this should only be called once. To ensure that it's only called
-         * once, this will throw an error if it's called twice in a row.
-         */
-        public int getRandomBytesAndPid(byte[] randomBytes) {
-            mShutdownHandler.sendEmptyMessage(-1);
-
-            SecureRandom sr = new SecureRandom();
-            sr.nextBytes(randomBytes);
-            return android.os.Process.myPid();
-        }
-    };
-
-    @Override
-    public IBinder onBind(Intent intent) {
-        return mBinder;
-    }
-}