Messaging: Fix handling of default SMS app
Use RoleManager to Launch the correct activity and check the default app Get rid of deprecated methods used here to do the same Also add queries in manifest to allow the former method to work as well Change-Id: I4702aaa4b35a994e225e63534da8fb4975b9717a
This commit is contained in:
@@ -18,6 +18,7 @@ package com.android.messaging.ui;
|
||||
import android.app.Activity;
|
||||
import android.app.Fragment;
|
||||
import android.app.PendingIntent;
|
||||
import android.app.role.RoleManager;
|
||||
import android.appwidget.AppWidgetManager;
|
||||
import android.content.ActivityNotFoundException;
|
||||
import android.content.ClipData;
|
||||
@@ -497,9 +498,8 @@ public class UIIntentsImpl extends UIIntents {
|
||||
|
||||
@Override
|
||||
public Intent getChangeDefaultSmsAppIntent(final Activity activity) {
|
||||
final Intent intent = new Intent(Telephony.Sms.Intents.ACTION_CHANGE_DEFAULT);
|
||||
intent.putExtra(Telephony.Sms.Intents.EXTRA_PACKAGE_NAME, activity.getPackageName());
|
||||
return intent;
|
||||
RoleManager roleManager = activity.getSystemService(RoleManager.class);
|
||||
return roleManager.createRequestRoleIntent(RoleManager.ROLE_SMS);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user