Remove "IMS Account" preference under call settings.
Bug: 20090409
Change-Id: I92eaade55a10dbf117cb0c2eba7da923b8a91c6b
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index a0802fd..dcdae0c 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -505,12 +505,6 @@
android:uiOptions="splitActionBarWhenNarrow">
</activity>
- <activity android:name="ImsEditor"
- android:theme="@style/DialerSettingsLight"
- android:configChanges="orientation|screenSize|keyboardHidden"
- android:uiOptions="splitActionBarWhenNarrow">
- </activity>
-
<!-- End SIP -->
<activity android:name="ErrorDialogActivity"
diff --git a/res/values/array.xml b/res/values/array.xml
deleted file mode 100644
index 79b6034..0000000
--- a/res/values/array.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-
-<!-- Array resources for the Phone app. -->
-<resources>
- <!-- Array resource for IMS VT call quality entries-->
- <string-array translatable="true" name="ims_vt_call_quality_entries">
- <item>@string/ims_vt_call_quality_low</item>
- <item>@string/ims_vt_call_quality_high</item>
- </string-array>
-
- <!-- Array resource for IMS VT call quality values-->
- <string-array translatable="false" name="ims_vt_call_quality_values">
- <item>0</item>
- <item>1</item>
- </string-array>
-</resources>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 4118e0a..0b8bcef 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -1298,18 +1298,4 @@
<string name="tty_mode_key">button_tty_mode_key</string>
<!-- DO NOT TRANSLATE. Internal key for a voicemail notification preference. -->
<string name="wifi_calling_settings_key">button_wifi_calling_settings_key</string>
-
- <!-- IMS settings related strings -->
- <!-- Title of the ims editor screen. [CHAR LIMIT=NONE] -->
- <string name="ims_edit_title">IMS account details</string>
- <!-- Title displayed IMS account settings in the sip settings category. [CHAR LIMIT=NONE] -->
- <string name="ims_accounts_title">IMS Account</string>
-
- <!-- VT call quality settings. -->
- <string translatable="false" name="ims_vt_call_quality">VtCallQuality</string>
- <string name="ims_vt_call_quality_title">VT Call Quality</string>
- <string name="ims_vt_call_quality_low">Low</string>
- <string name="ims_vt_call_quality_high">High</string>
- <string name="ims_vt_call_quality_unknown">Unknown</string>
- <string name="ims_vt_call_quality_set_failed">Failed to set video quality</string>
</resources>
diff --git a/res/xml/call_feature_setting.xml b/res/xml/call_feature_setting.xml
index 4af9736..a6e78e4 100644
--- a/res/xml/call_feature_setting.xml
+++ b/res/xml/call_feature_setting.xml
@@ -148,15 +148,4 @@
android:targetClass="com.android.phone.CdmaCallOptions"/>
</PreferenceScreen>
-
- <PreferenceScreen
- android:key="ims_account_settings_key"
- android:title="@string/ims_accounts_title"
- android:persistent="false">
-
- <intent android:action="android.intent.action.MAIN"
- android:targetPackage="com.android.phone"
- android:targetClass="com.android.phone.ImsEditor" />
- </PreferenceScreen>
-
</PreferenceScreen>
diff --git a/res/xml/ims_edit.xml b/res/xml/ims_edit.xml
deleted file mode 100644
index f16e2f5..0000000
--- a/res/xml/ims_edit.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-
-<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
- android:title="@string/ims_edit_title"
- android:persistent="false">
-
- <ListPreference
- android:key="@string/ims_vt_call_quality"
- android:title="@string/ims_vt_call_quality_title"
- android:entries="@array/ims_vt_call_quality_entries"
- android:entryValues="@array/ims_vt_call_quality_values"
- android:summary="@string/ims_vt_call_quality_unknown"
- android:persistent="false"
- android:enabled="true"
- android:dialogTitle="@string/ims_vt_call_quality_title"/>
-
-</PreferenceScreen>
diff --git a/src/com/android/phone/ims/ImsEditor.java b/src/com/android/phone/ims/ImsEditor.java
deleted file mode 100644
index bbd4526..0000000
--- a/src/com/android/phone/ims/ImsEditor.java
+++ /dev/null
@@ -1,170 +0,0 @@
-/* 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.phone;
-
-import android.os.Bundle;
-import android.preference.ListPreference;
-import android.preference.Preference;
-import android.preference.PreferenceActivity;
-import android.preference.PreferenceScreen;
-import android.telephony.SubscriptionManager;
-import android.util.Log;
-import android.widget.Toast;
-
-import com.android.ims.ImsConfig;
-import com.android.ims.ImsConfigListener;
-import com.android.ims.ImsException;
-import com.android.ims.ImsManager;
-import com.android.phone.R;
-
-/**
- * The activity class for editing a new or existing IMS profile.
- */
-public class ImsEditor extends PreferenceActivity
- implements Preference.OnPreferenceChangeListener {
-
- private static final String TAG = ImsEditor.class.getSimpleName();
-
- private ListPreference mVideoCallQuality;
- private ImsConfig mImsConfig;
-
- @Override
- public void onResume() {
- super.onResume();
- Log.d(TAG, "onResume");
- getVideoQuality();
- }
-
- @Override
- public void onCreate(Bundle savedInstanceState) {
- Log.v(TAG, "start profile editor");
- super.onCreate(savedInstanceState);
-
- addPreferencesFromResource(R.xml.ims_edit);
- PreferenceScreen screen = getPreferenceScreen();
-
- mVideoCallQuality = (ListPreference) screen
- .findPreference(getString(R.string.ims_vt_call_quality));
- mVideoCallQuality.setOnPreferenceChangeListener(this);
-
- try {
- ImsManager imsManager = ImsManager.getInstance(getBaseContext(),
- SubscriptionManager.getDefaultVoiceSubId());
- mImsConfig = imsManager.getConfigInterface();
- } catch (ImsException e) {
- mImsConfig = null;
- Log.e(TAG, "ImsService is not running");
- }
- }
-
- private ImsConfigListener imsConfigListener = new ImsConfigListener.Stub() {
- public void onGetVideoQuality(int status, int quality) {
- if (hasRequestFailed(status)) {
- quality = ImsConfig.OperationValuesConstants.VIDEO_QUALITY_UNKNOWN;
- Log.e(TAG, "onGetVideoQuality: failed. errorCode = " + status);
- }
- Log.d(TAG, "onGetVideoQuality: value = " + quality);
- loadVideoCallQualityPrefs(quality);
- }
-
- public void onSetVideoQuality(int status) {
- if (hasRequestFailed(status)) {
- Log.e(TAG, "onSetVideoQuality: set failed. errorCode = " + status);
- Toast.makeText(getApplicationContext(), R.string.ims_vt_call_quality_set_failed,
- Toast.LENGTH_SHORT).show();
- getVideoQuality(); // Set request failed, get current value.
- } else {
- Log.d(TAG, "onSetVideoQuality: set succeeded.");
- }
- }
-
- public void onGetFeatureResponse(int feature, int network, int value, int status) {
- //TODO not required as of now
- }
-
- public void onSetFeatureResponse(int feature, int network, int value, int status) {
- //TODO not required as of now
- }
- };
-
- @Override
- public boolean onPreferenceChange(Preference pref, Object newValue) {
- if (pref.equals(mVideoCallQuality)) {
- if (newValue == null) {
- Log.e(TAG, "onPreferenceChange invalid value received");
- } else {
- final int quality = Integer.parseInt(newValue.toString());
- boolean result = setVideoQuality(quality);
- if (result) {
- loadVideoCallQualityPrefs(quality);
- }
- return result;
- }
- }
- return true;
- }
-
- private void loadVideoCallQualityPrefs(int vqValue) {
- Log.d(TAG, "loadVideoCallQualityPrefs, vqValue = " + vqValue);
- final String videoQuality = videoQualityToString(vqValue);
- mVideoCallQuality.setValue(String.valueOf(vqValue));
- mVideoCallQuality.setSummary(videoQuality);
- }
-
- private void getVideoQuality() {
- try {
- if (mImsConfig != null) {
- mImsConfig.getVideoQuality(imsConfigListener);
- } else {
- loadVideoCallQualityPrefs(ImsConfig.OperationValuesConstants.VIDEO_QUALITY_UNKNOWN);
- Log.e(TAG, "getVideoQuality failed. mImsConfig is null");
- }
- } catch (ImsException e) {
- Log.e(TAG, "getVideoQuality failed. Exception = " + e);
- }
- }
-
- private boolean setVideoQuality(int quality) {
- try {
- if (mImsConfig != null) {
- mImsConfig.setVideoQuality(quality, imsConfigListener);
- } else {
- Log.e(TAG, "setVideoQuality failed. mImsConfig is null");
- return false;
- }
- } catch (ImsException e) {
- Log.e(TAG, "setVideoQuality failed. Exception = " + e);
- return false;
- }
- return true;
- }
-
- private boolean hasRequestFailed(int result) {
- return (result != ImsConfig.OperationStatusConstants.SUCCESS);
- }
-
- private String videoQualityToString(int quality) {
- switch (quality) {
- case ImsConfig.OperationValuesConstants.VIDEO_QUALITY_HIGH:
- return getString(R.string.ims_vt_call_quality_high);
- case ImsConfig.OperationValuesConstants.VIDEO_QUALITY_LOW:
- return getString(R.string.ims_vt_call_quality_low);
- case ImsConfig.OperationValuesConstants.VIDEO_QUALITY_UNKNOWN:
- default:
- return getString(R.string.ims_vt_call_quality_unknown);
- }
- }
-}