Add wifi calling suggestion
Change-Id: I737736d675fe0a4606ff1ccfd7d4ec6b69e1fd73
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 4ff16f9..14e5a0d 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -2638,6 +2638,22 @@
android:value="true" />
</activity>
+ <activity android:name="Settings$WifiCallingSuggestionActivity"
+ android:label="@string/wifi_calling_settings_title"
+ android:icon="@drawable/ic_settings_wireless"
+ android:taskAffinity="">
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN" />
+ <category android:name="com.android.settings.suggested.category.SETTINGS_ONLY" />
+ </intent-filter>
+ <meta-data android:name="com.android.settings.FRAGMENT_CLASS"
+ android:value="com.android.settings.WifiCallingSettings" />
+ <meta-data android:name="com.android.settings.dismiss"
+ android:value="10" />
+ <meta-data android:name="com.android.settings.title"
+ android:resource="@string/wifi_calling_suggestion_title" />
+ </activity>
+
<provider
android:name=".search.SettingsSearchIndexablesProvider"
android:authorities="com.android.settings"
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 5e58847..d169d0c 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -1892,6 +1892,8 @@
<!-- Wireless networks, item title to go into the WFC settings [CHAR LIMIT=30] -->
<string name="wifi_calling_settings_title">Wi-Fi calling</string>
+ <!-- Title of suggestion to turn on wifi calling [CHAR LIMIT=30] -->
+ <string name="wifi_calling_suggestion_title">Enable Wi-Fi Calling</string>
<!-- WFC mode [CHAR LIMIT=30] -->
<string name="wifi_calling_mode_title">Calling preference</string>
<!-- WFC mode dialog [CHAR LIMIT=30] -->
diff --git a/src/com/android/settings/Settings.java b/src/com/android/settings/Settings.java
index 4141274..e20f93c 100644
--- a/src/com/android/settings/Settings.java
+++ b/src/com/android/settings/Settings.java
@@ -118,6 +118,7 @@
public static class TopLevelSettings extends SettingsActivity { /* empty */ }
public static class ApnSettingsActivity extends SettingsActivity { /* empty */ }
public static class WifiCallingSettingsActivity extends SettingsActivity { /* empty */ }
+ public static class WifiCallingSuggestionActivity extends SettingsActivity { /* empty */ }
public static class MemorySettingsActivity extends SettingsActivity { /* empty */ }
public static class OverlaySettingsActivity extends SettingsActivity { /* empty */ }
public static class WriteSettingsActivity extends SettingsActivity { /* empty */ }
diff --git a/src/com/android/settings/dashboard/SuggestionsChecks.java b/src/com/android/settings/dashboard/SuggestionsChecks.java
index b483ac7..d9512b3 100644
--- a/src/com/android/settings/dashboard/SuggestionsChecks.java
+++ b/src/com/android/settings/dashboard/SuggestionsChecks.java
@@ -24,7 +24,9 @@
import android.os.IBinder;
import android.os.RemoteException;
import android.os.ServiceManager;
+import com.android.ims.ImsManager;
import com.android.settings.Settings.WallpaperSuggestionActivity;
+import com.android.settings.Settings.WifiCallingSuggestionActivity;
import com.android.settings.Settings.ZenModeAutomationSuggestionActivity;
import com.android.settingslib.drawer.Tile;
@@ -47,10 +49,20 @@
return hasEnabledZenAutoRules();
} else if (className.equals(WallpaperSuggestionActivity.class.getName())) {
return hasWallpaperSet();
+ } else if (className.equals(WifiCallingSuggestionActivity.class.getName())) {
+ return isWifiCallingUnavailableOrEnabled();
}
return false;
}
+ public boolean isWifiCallingUnavailableOrEnabled() {
+ if (!ImsManager.isWfcEnabledByPlatform(mContext)) {
+ return true;
+ }
+ return ImsManager.isWfcEnabledByUser(mContext)
+ && ImsManager.isNonTtyOrTtyOnVolteEnabled(mContext);
+ }
+
private boolean hasEnabledZenAutoRules() {
List<AutomaticZenRule> zenRules = NotificationManager.from(mContext).getAutomaticZenRules();
final int N = zenRules.size();