Removed checking wether PVR is enabled in RemoteActivity, as this was only needed to aid in the transition when PVR was implemented

This commit is contained in:
Synced Synapse 2016-11-15 15:47:11 +00:00
parent b7b1470484
commit 39ee0b6634
4 changed files with 1 additions and 38 deletions

View File

@ -127,12 +127,6 @@ public class Settings {
public static final String KEY_PREF_CURRENT_HOST_ID = "current_host_id";
public static final int DEFAULT_PREF_CURRENT_HOST_ID = -1;
public static final String KEY_PREF_CHECKED_EVENT_SERVER_CONNECTION = "checked_event_server_connection";
public static final boolean DEFAULT_PREF_CHECKED_EVENT_SERVER_CONNECTION = false;
public static final String KEY_PREF_CHECKED_PVR_ENABLED = "checked_pvr_enabled";
public static final boolean DEFAULT_PREF_CHECKED_PVR_ENABLED = false;
public static final String KEY_PREF_NAV_DRAWER_ITEMS = "pref_nav_drawer_items";
public static String getNavDrawerItemsPrefKey(int hostId) {
return Settings.KEY_PREF_NAV_DRAWER_ITEMS + hostId;

View File

@ -189,8 +189,6 @@ public class RemoteActivity extends BaseActivity
} else {
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
}
checkPVREnabledAndSetMenuItems();
}
@Override
@ -200,25 +198,6 @@ public class RemoteActivity extends BaseActivity
hostConnectionObserver = null;
}
// TODO: Remove this method after deployment of 2.0.0, as it is only needed to
// facilitate the transition by checking if PVR is enabled and set the side menu
// items accordingly
private void checkPVREnabledAndSetMenuItems() {
if (hostManager.getHostInfo() == null) return;
SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(this);
// Check if PVR is enabled for the current host
String prefKey = Settings.KEY_PREF_CHECKED_PVR_ENABLED + String.valueOf(hostManager.getHostInfo().getId());
boolean checkedPVREnabled = sp.getBoolean(prefKey, Settings.DEFAULT_PREF_CHECKED_PVR_ENABLED);
if (!checkedPVREnabled) {
AddHostFragmentFinish.checkPVREnabledAndSetMenuItems(this, new Handler());
sp.edit()
.putBoolean(prefKey, true)
.apply();
}
}
/**
* Override hardware volume keys and send to Kodi
*/

View File

@ -92,11 +92,7 @@ public class AddHostFragmentFinish extends Fragment {
// Check if PVR is enabled for the current host
HostManager hostManager = HostManager.getInstance(getActivity());
if (hostManager.getHostInfo() != null) {
AddHostFragmentFinish.checkPVREnabledAndSetMenuItems(getActivity(), new Handler());
String prefKey = Settings.KEY_PREF_CHECKED_PVR_ENABLED + String.valueOf(hostManager.getHostInfo().getId());
PreferenceManager.getDefaultSharedPreferences(getActivity()).edit()
.putBoolean(prefKey, true)
.apply();
checkPVREnabledAndSetMenuItems(getActivity(), new Handler());
}
// Start the syncing process
@ -129,8 +125,6 @@ public class AddHostFragmentFinish extends Fragment {
* Checks wheter PVR is enabled and sets a Preference that controls the items to show on
* the navigation drawer accordingly: if PVR is disabled, hide the PVR item, otherwise show it
*
* This
*
* @param context Context
*/
public static void checkPVREnabledAndSetMenuItems(final Context context, Handler handler) {

View File

@ -386,10 +386,6 @@ public class HostFragmentManualConfiguration extends Fragment {
} else {
hostConnectionChecked(hostInfo);
}
PreferenceManager.getDefaultSharedPreferences(getActivity())
.edit()
.putBoolean(Settings.KEY_PREF_CHECKED_EVENT_SERVER_CONNECTION, true)
.apply();
}
/**