No-Display Activity to handle SIM Activation intent.
New Activity handles the new SIM_ACTIVATION_REQUEST intent and prints
out a log statement when received.
Change-Id: I155b27eb4540a3af280cd840b357f4efe1290c55
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index b802dee..88a017d 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -276,6 +276,18 @@
</intent-filter>
</activity>
+ <!-- Trampoline activity that handles the SIM_ACTIVATION_REQUEST intent. -->
+ <activity android:name="com.android.services.telephony.activation.SimActivationActivity"
+ android:permission="android.permission.PERFORM_SIM_ACTIVATION"
+ android:label="@string/phoneIconLabel"
+ android:theme="@android:style/Theme.NoDisplay"
+ android:excludeFromRecents="true">
+ <intent-filter>
+ <action android:name="android.intent.action.SIM_ACTIVATION_REQUEST" />
+ <category android:name="android.intent.category.DEFAULT" />
+ </intent-filter>
+ </activity>
+
<!-- "Mobile network settings" screen, used on both
non-voice-capable tablets and regular phone devices. -->
<activity android:name="MobileNetworkSettings"
diff --git a/src/com/android/services/telephony/activation/SimActivationActivity.java b/src/com/android/services/telephony/activation/SimActivationActivity.java
new file mode 100644
index 0000000..acc0cdf
--- /dev/null
+++ b/src/com/android/services/telephony/activation/SimActivationActivity.java
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2015 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 com.android.services.telephony.activation;
+
+import android.app.Activity;
+import android.content.Intent;
+import android.os.Bundle;
+
+import com.android.services.telephony.Log;
+
+/**
+ * Invisible activity that handles the android.intent.action.SIM_ACTIVATION_REQUEST intent.
+ * This activity is protected by the android.permission.PERFORM_SIM_ACTIVATION permission.
+ */
+public class SimActivationActivity extends Activity {
+ @Override
+ protected void onCreate(Bundle icicle) {
+ super.onCreate(icicle);
+
+ Intent intent = getIntent();
+ if (Intent.ACTION_SIM_ACTIVATION_REQUEST.equals(intent.getAction())) {
+ Log.i(this, "Activation requested " + intent);
+ }
+ finish();
+ }
+}