diff options
author | Adnan Begovic <adnan@cyngn.com> | 2015-06-25 12:53:50 -0700 |
---|---|---|
committer | Adnan Begovic <adnan@cyngn.com> | 2015-10-26 16:12:36 -0700 |
commit | 28f65a49c84d32fd67c638d72276043ed3165822 (patch) | |
tree | 89090c766bec6cba13512091127a63fe13306c70 /src/com/android/settings/profiles | |
parent | b23be8fc9e25d18f69289aba5896d42d8a68a591 (diff) | |
download | packages_apps_Settings-28f65a49c84d32fd67c638d72276043ed3165822.zip packages_apps_Settings-28f65a49c84d32fd67c638d72276043ed3165822.tar.gz packages_apps_Settings-28f65a49c84d32fd67c638d72276043ed3165822.tar.bz2 |
Settings: Refactor to point at Profiles in CMSDK.
Change-Id: I589dd372a58d8aca0f804e419992c28188d5380c
Diffstat (limited to 'src/com/android/settings/profiles')
20 files changed, 87 insertions, 75 deletions
diff --git a/src/com/android/settings/profiles/AppGroupConfig.java b/src/com/android/settings/profiles/AppGroupConfig.java index b140a10..fb5af22 100644 --- a/src/com/android/settings/profiles/AppGroupConfig.java +++ b/src/com/android/settings/profiles/AppGroupConfig.java @@ -19,8 +19,7 @@ package com.android.settings.profiles; import android.app.AlertDialog; import android.app.Dialog; import android.app.NotificationGroup; -import android.app.ProfileManager; -import android.content.Context; +import cyanogenmod.app.ProfileManager; import android.content.DialogInterface; import android.content.pm.PackageInfo; import android.content.pm.PackageManager; @@ -30,7 +29,6 @@ import android.os.Bundle; import android.preference.Preference; import android.preference.PreferenceGroup; import android.preference.PreferenceScreen; -import android.util.Log; import android.view.ContextMenu; import android.view.ContextMenu.ContextMenuInfo; import android.view.LayoutInflater; diff --git a/src/com/android/settings/profiles/AppGroupList.java b/src/com/android/settings/profiles/AppGroupList.java index febea3f..2dfb654 100644 --- a/src/com/android/settings/profiles/AppGroupList.java +++ b/src/com/android/settings/profiles/AppGroupList.java @@ -21,14 +21,12 @@ import java.util.UUID; import android.annotation.Nullable; import android.app.AlertDialog; import android.app.NotificationGroup; -import android.app.ProfileManager; +import cyanogenmod.app.ProfileManager; import android.content.Context; import android.content.DialogInterface; import android.os.Bundle; import android.preference.Preference; -import android.preference.PreferenceActivity; import android.preference.PreferenceScreen; -import android.provider.Settings; import android.view.LayoutInflater; import android.view.View; @@ -39,7 +37,6 @@ import android.widget.Toast; import com.android.internal.util.cm.ScreenType; import com.android.settings.R; import com.android.settings.SettingsPreferenceFragment; -import com.android.settings.Utils; public class AppGroupList extends SettingsPreferenceFragment { @@ -57,7 +54,7 @@ public class AppGroupList extends SettingsPreferenceFragment { super.onCreate(savedInstanceState); addPreferencesFromResource(R.xml.appgroup_list); - mProfileManager = (ProfileManager) getActivity().getSystemService(Context.PROFILE_SERVICE); + mProfileManager = ProfileManager.getInstance(getActivity()); } @Override diff --git a/src/com/android/settings/profiles/NFCProfile.java b/src/com/android/settings/profiles/NFCProfile.java index a6e2334..b4bfe8c 100644 --- a/src/com/android/settings/profiles/NFCProfile.java +++ b/src/com/android/settings/profiles/NFCProfile.java @@ -19,8 +19,6 @@ package com.android.settings.profiles; import java.util.UUID; import android.app.Activity; -import android.app.Profile; -import android.app.ProfileManager; import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; @@ -32,6 +30,9 @@ import android.os.Parcelable; import android.provider.Settings; import android.widget.Toast; +import cyanogenmod.app.Profile; +import cyanogenmod.app.ProfileManager; + import com.android.settings.R; /** @@ -53,7 +54,7 @@ public class NFCProfile extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - mProfileManager = (ProfileManager) getSystemService(Context.PROFILE_SERVICE); + mProfileManager = ProfileManager.getInstance(this); } @Override diff --git a/src/com/android/settings/profiles/NFCProfileSelect.java b/src/com/android/settings/profiles/NFCProfileSelect.java index c66de64..2c2fab8 100644 --- a/src/com/android/settings/profiles/NFCProfileSelect.java +++ b/src/com/android/settings/profiles/NFCProfileSelect.java @@ -19,22 +19,17 @@ package com.android.settings.profiles; import java.util.UUID; import android.app.Activity; -import android.app.PendingIntent; -import android.app.Profile; -import android.app.ProfileManager; import android.app.AlertDialog.Builder; import android.content.Context; import android.content.DialogInterface; -import android.content.Intent; -import android.content.IntentFilter; -import android.nfc.NfcAdapter; -import android.nfc.Tag; import android.os.Bundle; -import android.util.Log; import android.view.View; import android.view.View.OnClickListener; import android.widget.Toast; +import cyanogenmod.app.Profile; +import cyanogenmod.app.ProfileManager; + import com.android.settings.R; /** @@ -58,7 +53,7 @@ public class NFCProfileSelect extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - mProfileManager = (ProfileManager) getSystemService(Context.PROFILE_SERVICE); + mProfileManager = ProfileManager.getInstance(this); setContentView(R.layout.nfc_select); setTitle(R.string.profile_unknown_nfc_tag); diff --git a/src/com/android/settings/profiles/NFCProfileUtils.java b/src/com/android/settings/profiles/NFCProfileUtils.java index 4c97c8d..3c6dcc6 100644 --- a/src/com/android/settings/profiles/NFCProfileUtils.java +++ b/src/com/android/settings/profiles/NFCProfileUtils.java @@ -19,7 +19,6 @@ package com.android.settings.profiles; import java.io.IOException; import java.util.UUID; -import android.app.Profile; import android.content.Context; import android.nfc.NdefMessage; import android.nfc.NdefRecord; @@ -29,6 +28,8 @@ import android.nfc.tech.NdefFormatable; import android.os.Vibrator; import android.util.Log; +import cyanogenmod.app.Profile; + public class NFCProfileUtils { private static final String TAG = "NFCUtils"; diff --git a/src/com/android/settings/profiles/NFCProfileWriter.java b/src/com/android/settings/profiles/NFCProfileWriter.java index 72b8c13..8b50ffe 100644 --- a/src/com/android/settings/profiles/NFCProfileWriter.java +++ b/src/com/android/settings/profiles/NFCProfileWriter.java @@ -20,8 +20,6 @@ import java.util.UUID; import android.app.Activity; import android.app.PendingIntent; -import android.app.Profile; -import android.app.ProfileManager; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; @@ -31,6 +29,9 @@ import android.os.Bundle; import android.util.Log; import android.widget.Toast; +import cyanogenmod.app.Profile; +import cyanogenmod.app.ProfileManager; + import com.android.settings.R; /** @@ -57,7 +58,7 @@ public class NFCProfileWriter extends Activity { public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); mNfcAdapter = NfcAdapter.getDefaultAdapter(this); - mProfileManager = (ProfileManager) getSystemService(Context.PROFILE_SERVICE); + mProfileManager = ProfileManager.getInstance(this); setContentView(R.layout.nfc_writer); setTitle(R.string.profile_write_nfc_tag); diff --git a/src/com/android/settings/profiles/ProfileGroupConfig.java b/src/com/android/settings/profiles/ProfileGroupConfig.java index df55102..8edd3d6 100644 --- a/src/com/android/settings/profiles/ProfileGroupConfig.java +++ b/src/com/android/settings/profiles/ProfileGroupConfig.java @@ -18,16 +18,17 @@ package com.android.settings.profiles; import java.util.UUID; -import android.app.Profile; -import android.app.ProfileGroup; -import android.app.ProfileGroup.Mode; -import android.app.ProfileManager; import android.net.Uri; import android.os.Bundle; import android.preference.ListPreference; import android.preference.Preference; import android.preference.Preference.OnPreferenceChangeListener; +import cyanogenmod.app.Profile; +import cyanogenmod.app.ProfileGroup; +import cyanogenmod.app.ProfileGroup.Mode; +import cyanogenmod.app.ProfileManager; + import com.android.settings.R; import com.android.settings.SettingsPreferenceFragment; diff --git a/src/com/android/settings/profiles/ProfilesSettings.java b/src/com/android/settings/profiles/ProfilesSettings.java index e97ce15..846dd1f 100644 --- a/src/com/android/settings/profiles/ProfilesSettings.java +++ b/src/com/android/settings/profiles/ProfilesSettings.java @@ -19,10 +19,6 @@ package com.android.settings.profiles; import android.app.ActionBar; import android.app.Activity; import android.app.AlertDialog; -import android.app.Fragment; -import android.app.FragmentManager; -import android.app.Profile; -import android.app.ProfileManager; import android.content.BroadcastReceiver; import android.content.Context; import android.content.DialogInterface; @@ -34,6 +30,7 @@ import android.support.v4.view.ViewPager; import android.support.v13.app.FragmentStatePagerAdapter; import android.util.Log; import android.view.Gravity; +import android.text.TextUtils; import android.view.LayoutInflater; import android.view.Menu; import android.view.MenuInflater; @@ -44,12 +41,17 @@ import android.widget.ImageView; import android.widget.Switch; import android.widget.TextView; +import cyanogenmod.app.Profile; +import cyanogenmod.app.ProfileManager; + import com.android.settings.R; import com.android.settings.SettingsActivity; import com.android.settings.SettingsPreferenceFragment; import com.android.settings.SubSettings; import com.android.settings.Utils; +import java.util.UUID; + public class ProfilesSettings extends SettingsPreferenceFragment { private static final String TAG = "ProfilesSettings"; @@ -117,7 +119,7 @@ public class ProfilesSettings extends SettingsPreferenceFragment { @Override public void onActivityCreated(Bundle savedInstanceState) { - mProfileManager = (ProfileManager) getActivity().getSystemService(Context.PROFILE_SERVICE); + mProfileManager = ProfileManager.getInstance(getActivity()); // After confirming PreferenceScreen is available, we call super. super.onActivityCreated(savedInstanceState); } diff --git a/src/com/android/settings/profiles/SetupActionsFragment.java b/src/com/android/settings/profiles/SetupActionsFragment.java index fbe3899..89b84bf 100644 --- a/src/com/android/settings/profiles/SetupActionsFragment.java +++ b/src/com/android/settings/profiles/SetupActionsFragment.java @@ -21,11 +21,7 @@ import android.app.AlertDialog; import android.app.BrightnessSettings; import android.app.ConnectionSettings; import android.app.Dialog; -import android.app.Fragment; import android.app.NotificationGroup; -import android.app.Profile; -import android.app.ProfileGroup; -import android.app.ProfileManager; import android.app.RingModeSettings; import android.app.StreamSettings; import android.bluetooth.BluetoothAdapter; @@ -44,12 +40,10 @@ import android.os.AsyncTask; import android.os.Bundle; import android.preference.SeekBarVolumizer; import android.provider.Settings; -import android.telecom.TelecomManager; import android.telephony.TelephonyManager; import android.text.Editable; import android.text.TextUtils; import android.text.TextWatcher; -import android.util.Log; import android.view.LayoutInflater; import android.view.Menu; import android.view.MenuInflater; @@ -58,13 +52,17 @@ import android.view.View; import android.view.ViewGroup; import android.view.inputmethod.InputMethodManager; import android.widget.AdapterView; -import android.widget.Button; import android.widget.CheckBox; import android.widget.CompoundButton; import android.widget.EditText; import android.widget.ListView; import android.widget.SeekBar; import android.widget.TextView; + +import cyanogenmod.app.Profile; +import cyanogenmod.app.ProfileGroup; +import cyanogenmod.app.ProfileManager; + import com.android.settings.R; import com.android.settings.SettingsActivity; import com.android.settings.SubSettings; @@ -167,7 +165,7 @@ public class SetupActionsFragment extends SettingsPreferenceFragment mNewProfileMode = getArguments().getBoolean(ProfilesSettings.EXTRA_NEW_PROFILE, false); } - mProfileManager = (ProfileManager) getActivity().getSystemService(Context.PROFILE_SERVICE); + mProfileManager = ProfileManager.getInstance(getActivity()); mAdapter = new ItemListAdapter(getActivity(), mItems); rebuildItemList(); @@ -259,13 +257,17 @@ public class SetupActionsFragment extends SettingsPreferenceFragment if (mProfileManager.getNotificationGroup(profileGroup.getUuid()) != null && !mProfile.getDefaultGroup().getUuid().equals( profileGroup.getUuid())) { - mItems.add(new AppGroupItem(mProfile, profileGroup)); + mItems.add(new AppGroupItem(mProfile, profileGroup, + mProfileManager.getNotificationGroup( + profileGroup.getUuid()))); groupsAdded++; } } if (groupsAdded > 0) { // add "Other" at the end - mItems.add(new AppGroupItem(mProfile, mProfile.getDefaultGroup())); + mItems.add(new AppGroupItem(mProfile, mProfile.getDefaultGroup(), + mProfileManager.getNotificationGroup( + mProfile.getDefaultGroup().getUuid()))); } } if (groupsAdded > 0) { diff --git a/src/com/android/settings/profiles/SetupDefaultProfileReceiver.java b/src/com/android/settings/profiles/SetupDefaultProfileReceiver.java index 10addf1..ea43d18 100644 --- a/src/com/android/settings/profiles/SetupDefaultProfileReceiver.java +++ b/src/com/android/settings/profiles/SetupDefaultProfileReceiver.java @@ -1,21 +1,24 @@ package com.android.settings.profiles; -import android.app.Profile; -import android.app.ProfileManager; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.provider.Settings; +import cyanogenmod.app.Profile; +import cyanogenmod.app.ProfileManager; + +import java.util.UUID; + public class SetupDefaultProfileReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { if (Settings.System.getInt(context.getContentResolver(), Settings.System.SYSTEM_PROFILES_ENABLED, 1) == 1) { - ProfileManager profileManager = (ProfileManager) context - .getSystemService(Context.PROFILE_SERVICE); - Profile defaultProfile = profileManager.getProfile("Default"); + ProfileManager profileManager = ProfileManager.getInstance(context); + Profile defaultProfile = profileManager.getProfile( + UUID.fromString("0230226d-0d05-494a-a9bd-d222a1117655")); if (defaultProfile != null) { SetupActionsFragment.fillProfileWithCurrentSettings(context, defaultProfile); profileManager.updateProfile(defaultProfile); diff --git a/src/com/android/settings/profiles/SetupTriggersFragment.java b/src/com/android/settings/profiles/SetupTriggersFragment.java index bd1f8ee..1fa6428 100644 --- a/src/com/android/settings/profiles/SetupTriggersFragment.java +++ b/src/com/android/settings/profiles/SetupTriggersFragment.java @@ -18,8 +18,6 @@ package com.android.settings.profiles; import android.annotation.Nullable; import android.app.ActionBar; import android.app.Activity; -import android.app.Profile; -import android.app.ProfileManager; import android.content.Context; import android.content.Intent; import android.content.pm.PackageManager; @@ -30,6 +28,10 @@ import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.Button; + +import cyanogenmod.app.Profile; +import cyanogenmod.app.ProfileManager; + import com.android.settings.R; import com.android.settings.SettingsPreferenceFragment; import com.android.settings.SubSettings; @@ -70,7 +72,7 @@ public class SetupTriggersFragment extends SettingsPreferenceFragment { mNewProfileMode = getArguments().getBoolean(ProfilesSettings.EXTRA_NEW_PROFILE, false); mPreselectedItem = getArguments().getInt(EXTRA_INITIAL_PAGE, 0); } - mProfileManager = (ProfileManager) getActivity().getSystemService(Context.PROFILE_SERVICE); + mProfileManager = ProfileManager.getInstance(getActivity()); } @Override diff --git a/src/com/android/settings/profiles/actions/item/AppGroupItem.java b/src/com/android/settings/profiles/actions/item/AppGroupItem.java index 8befd38..5558900 100644 --- a/src/com/android/settings/profiles/actions/item/AppGroupItem.java +++ b/src/com/android/settings/profiles/actions/item/AppGroupItem.java @@ -16,14 +16,16 @@ package com.android.settings.profiles.actions.item; import android.app.NotificationGroup; -import android.app.Profile; -import android.app.ProfileGroup; -import android.app.ProfileManager; import android.content.Context; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; + +import cyanogenmod.app.Profile; +import cyanogenmod.app.ProfileGroup; +import cyanogenmod.app.ProfileManager; + import com.android.settings.R; import com.android.settings.profiles.actions.ItemListAdapter; @@ -32,17 +34,19 @@ import java.util.UUID; public class AppGroupItem implements Item { Profile mProfile; ProfileGroup mGroup; + NotificationGroup mNotifGroup; public AppGroupItem() { // empty app group will act as a "Add/remove app groups" item } - public AppGroupItem(Profile profile, ProfileGroup group) { + public AppGroupItem(Profile profile, ProfileGroup group, NotificationGroup nGroup) { mProfile = profile; if (group == null) { throw new UnsupportedOperationException("profile group can't be null"); } mGroup = group; + mNotifGroup = nGroup; } @Override @@ -70,17 +74,12 @@ public class AppGroupItem implements Item { } else { view = convertView; } - - ProfileManager profileManager = (ProfileManager) parent.getContext() - .getSystemService(Context.PROFILE_SERVICE); - TextView text = (TextView) view.findViewById(R.id.title); TextView desc = (TextView) view.findViewById(R.id.summary); if (mGroup != null) { - NotificationGroup notifGroup = profileManager.getNotificationGroup(mGroup.getUuid()); - if (notifGroup != null) { - text.setText(notifGroup.getName()); + if (mNotifGroup != null) { + text.setText(mNotifGroup.getName()); } else { text.setText("<unknown>"); } diff --git a/src/com/android/settings/profiles/actions/item/DozeModeItem.java b/src/com/android/settings/profiles/actions/item/DozeModeItem.java index 6e2df52..a1918ae 100644 --- a/src/com/android/settings/profiles/actions/item/DozeModeItem.java +++ b/src/com/android/settings/profiles/actions/item/DozeModeItem.java @@ -15,12 +15,13 @@ */ package com.android.settings.profiles.actions.item; -import android.app.Profile; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; +import cyanogenmod.app.Profile; + import com.android.settings.R; import com.android.settings.profiles.actions.ItemListAdapter; diff --git a/src/com/android/settings/profiles/actions/item/LockModeItem.java b/src/com/android/settings/profiles/actions/item/LockModeItem.java index e9e93b5..5c27de2 100644 --- a/src/com/android/settings/profiles/actions/item/LockModeItem.java +++ b/src/com/android/settings/profiles/actions/item/LockModeItem.java @@ -15,12 +15,13 @@ */ package com.android.settings.profiles.actions.item; -import android.app.Profile; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; +import cyanogenmod.app.Profile; + import com.android.settings.R; import com.android.settings.profiles.actions.ItemListAdapter; diff --git a/src/com/android/settings/profiles/actions/item/ProfileNameItem.java b/src/com/android/settings/profiles/actions/item/ProfileNameItem.java index a31ac32..6ea133b 100644 --- a/src/com/android/settings/profiles/actions/item/ProfileNameItem.java +++ b/src/com/android/settings/profiles/actions/item/ProfileNameItem.java @@ -15,12 +15,13 @@ */ package com.android.settings.profiles.actions.item; -import android.app.Profile; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; +import cyanogenmod.app.Profile; + import com.android.settings.R; import com.android.settings.profiles.actions.ItemListAdapter; diff --git a/src/com/android/settings/profiles/actions/item/TriggerItem.java b/src/com/android/settings/profiles/actions/item/TriggerItem.java index 4ce6cbd..dd5686a 100644 --- a/src/com/android/settings/profiles/actions/item/TriggerItem.java +++ b/src/com/android/settings/profiles/actions/item/TriggerItem.java @@ -15,12 +15,14 @@ */ package com.android.settings.profiles.actions.item; -import android.app.Profile; import android.util.StringBuilderPrinter; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; + +import cyanogenmod.app.Profile; + import com.android.settings.R; import com.android.settings.profiles.actions.ItemListAdapter; diff --git a/src/com/android/settings/profiles/triggers/AbstractTriggerItem.java b/src/com/android/settings/profiles/triggers/AbstractTriggerItem.java index b028490..1682e06 100644 --- a/src/com/android/settings/profiles/triggers/AbstractTriggerItem.java +++ b/src/com/android/settings/profiles/triggers/AbstractTriggerItem.java @@ -15,7 +15,7 @@ */ package com.android.settings.profiles.triggers; -import android.app.Profile; +import cyanogenmod.app.Profile; public class AbstractTriggerItem { diff --git a/src/com/android/settings/profiles/triggers/BluetoothTriggerFragment.java b/src/com/android/settings/profiles/triggers/BluetoothTriggerFragment.java index d7fa67e..834a5fc 100644 --- a/src/com/android/settings/profiles/triggers/BluetoothTriggerFragment.java +++ b/src/com/android/settings/profiles/triggers/BluetoothTriggerFragment.java @@ -17,8 +17,6 @@ package com.android.settings.profiles.triggers; import android.app.AlertDialog; import android.app.ListFragment; -import android.app.Profile; -import android.app.ProfileManager; import android.bluetooth.BluetoothAdapter; import android.bluetooth.BluetoothClass; import android.bluetooth.BluetoothDevice; @@ -33,6 +31,10 @@ import android.widget.ArrayAdapter; import android.widget.ImageView; import android.widget.ListView; import android.widget.TextView; + +import cyanogenmod.app.Profile; +import cyanogenmod.app.ProfileManager; + import com.android.settings.R; import com.android.settings.profiles.ProfilesSettings; @@ -68,7 +70,7 @@ public class BluetoothTriggerFragment extends ListFragment { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - mProfileManager = (ProfileManager) getActivity().getSystemService(Context.PROFILE_SERVICE); + mProfileManager = ProfileManager.getInstance(getActivity()); if (getArguments() != null) { mProfile = getArguments().getParcelable(ProfilesSettings.EXTRA_PROFILE); } diff --git a/src/com/android/settings/profiles/triggers/NfcTriggerFragment.java b/src/com/android/settings/profiles/triggers/NfcTriggerFragment.java index 86194ad..411cc4f 100644 --- a/src/com/android/settings/profiles/triggers/NfcTriggerFragment.java +++ b/src/com/android/settings/profiles/triggers/NfcTriggerFragment.java @@ -17,7 +17,6 @@ package com.android.settings.profiles.triggers; import android.app.Fragment; import android.app.PendingIntent; -import android.app.Profile; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; @@ -30,6 +29,9 @@ import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.Toast; + +import cyanogenmod.app.Profile; + import com.android.settings.R; import com.android.settings.Settings; import com.android.settings.SubSettings; diff --git a/src/com/android/settings/profiles/triggers/WifiTriggerFragment.java b/src/com/android/settings/profiles/triggers/WifiTriggerFragment.java index 0f8fa6f..5ec1996 100644 --- a/src/com/android/settings/profiles/triggers/WifiTriggerFragment.java +++ b/src/com/android/settings/profiles/triggers/WifiTriggerFragment.java @@ -17,8 +17,6 @@ package com.android.settings.profiles.triggers; import android.app.AlertDialog; import android.app.ListFragment; -import android.app.Profile; -import android.app.ProfileManager; import android.content.Context; import android.content.DialogInterface; import android.content.res.Resources; @@ -29,10 +27,13 @@ import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ArrayAdapter; -import android.widget.BaseAdapter; import android.widget.ImageView; import android.widget.ListView; import android.widget.TextView; + +import cyanogenmod.app.Profile; +import cyanogenmod.app.ProfileManager; + import com.android.settings.R; import com.android.settings.profiles.ProfilesSettings; @@ -69,7 +70,7 @@ public class WifiTriggerFragment extends ListFragment { } else { throw new UnsupportedOperationException("no profile!"); } - mProfileManager = (ProfileManager) getActivity().getSystemService(Context.PROFILE_SERVICE); + mProfileManager = ProfileManager.getInstance(getActivity()); mWifiManager = (WifiManager) getActivity().getSystemService(Context.WIFI_SERVICE); } |