Implement createManageBlockedNumbersIntent API.
BUG: 27364137
Change-Id: Iaced9910db04df73cc3d7503e4ec6c4a3e4fb15a
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 86f6cdc..4262877 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -91,7 +91,12 @@
android:configChanges="orientation|screenSize|keyboardHidden"
android:theme="@style/Theme.Telecom.BlockedNumbers"
android:process=":ui"
- android:exported="false" />
+ android:exported="true">
+ <intent-filter>
+ <action android:name="android.telecom.action.MANAGE_BLOCKED_NUMBERS" />
+ <category android:name="android.intent.category.DEFAULT" />
+ </intent-filter>
+ </activity>
<!-- Activity that starts the outgoing call process by listening to CALL intent which
contain contact information in the intent's data. CallActivity handles any data
URL with the schemes "tel", "sip", and "voicemail". It also handles URLs linked to
diff --git a/src/com/android/server/telecom/TelecomServiceImpl.java b/src/com/android/server/telecom/TelecomServiceImpl.java
index c4ad40a..c0dc930 100644
--- a/src/com/android/server/telecom/TelecomServiceImpl.java
+++ b/src/com/android/server/telecom/TelecomServiceImpl.java
@@ -1190,11 +1190,12 @@
BlockedNumbersActivity.start(mContext);
}
- // TODO: Add a link to TelecomManager#createManageBlockedNumbersIntent
+ /**
+ * @see android.telecom.TelecomManager#createManageBlockedNumbersIntent
+ */
@Override
public Intent createManageBlockedNumbersIntent() {
- // TODO: Implement this.
- return null;
+ return BlockedNumbersActivity.getIntentForStartingActivity();
}
};
diff --git a/src/com/android/server/telecom/settings/BlockedNumbersActivity.java b/src/com/android/server/telecom/settings/BlockedNumbersActivity.java
index 5c46161..61fb6d3 100644
--- a/src/com/android/server/telecom/settings/BlockedNumbersActivity.java
+++ b/src/com/android/server/telecom/settings/BlockedNumbersActivity.java
@@ -24,7 +24,6 @@
import android.content.*;
import android.database.Cursor;
import android.os.Bundle;
-import android.os.Process;
import android.os.UserManager;
import android.provider.BlockedNumberContract;
import android.text.Editable;
@@ -33,7 +32,6 @@
import android.view.LayoutInflater;
import android.view.MenuItem;
import android.view.View;
-import android.view.WindowManager;
import android.view.inputmethod.InputMethodManager;
import android.widget.*;
import com.android.server.telecom.R;
@@ -43,6 +41,9 @@
*/
public class BlockedNumbersActivity extends ListActivity
implements LoaderManager.LoaderCallbacks<Cursor>, View.OnClickListener, TextWatcher {
+ private static final String ACTION_MANAGE_BLOCKED_NUMBERS =
+ "android.telecom.action.MANAGE_BLOCKED_NUMBERS";
+ private static final String TELECOM_PACKAGE = "com.android.server.telecom";
private static final String[] PROJECTION = new String[] {
BlockedNumberContract.BlockedNumbers.COLUMN_ID,
BlockedNumberContract.BlockedNumbers.COLUMN_ORIGINAL_NUMBER
@@ -67,6 +68,12 @@
context.startActivity(intent);
}
+ public static Intent getIntentForStartingActivity() {
+ Intent intent = new Intent(ACTION_MANAGE_BLOCKED_NUMBERS);
+ intent.setPackage(TELECOM_PACKAGE);
+ return intent;
+ }
+
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);