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:
parent
b7b1470484
commit
39ee0b6634
|
@ -127,12 +127,6 @@ public class Settings {
|
||||||
public static final String KEY_PREF_CURRENT_HOST_ID = "current_host_id";
|
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 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 final String KEY_PREF_NAV_DRAWER_ITEMS = "pref_nav_drawer_items";
|
||||||
public static String getNavDrawerItemsPrefKey(int hostId) {
|
public static String getNavDrawerItemsPrefKey(int hostId) {
|
||||||
return Settings.KEY_PREF_NAV_DRAWER_ITEMS + hostId;
|
return Settings.KEY_PREF_NAV_DRAWER_ITEMS + hostId;
|
||||||
|
|
|
@ -189,8 +189,6 @@ public class RemoteActivity extends BaseActivity
|
||||||
} else {
|
} else {
|
||||||
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
|
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
|
||||||
}
|
}
|
||||||
|
|
||||||
checkPVREnabledAndSetMenuItems();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -200,25 +198,6 @@ public class RemoteActivity extends BaseActivity
|
||||||
hostConnectionObserver = null;
|
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
|
* Override hardware volume keys and send to Kodi
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -92,11 +92,7 @@ public class AddHostFragmentFinish extends Fragment {
|
||||||
// Check if PVR is enabled for the current host
|
// Check if PVR is enabled for the current host
|
||||||
HostManager hostManager = HostManager.getInstance(getActivity());
|
HostManager hostManager = HostManager.getInstance(getActivity());
|
||||||
if (hostManager.getHostInfo() != null) {
|
if (hostManager.getHostInfo() != null) {
|
||||||
AddHostFragmentFinish.checkPVREnabledAndSetMenuItems(getActivity(), new Handler());
|
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();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Start the syncing process
|
// 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
|
* 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
|
* the navigation drawer accordingly: if PVR is disabled, hide the PVR item, otherwise show it
|
||||||
*
|
*
|
||||||
* This
|
|
||||||
*
|
|
||||||
* @param context Context
|
* @param context Context
|
||||||
*/
|
*/
|
||||||
public static void checkPVREnabledAndSetMenuItems(final Context context, Handler handler) {
|
public static void checkPVREnabledAndSetMenuItems(final Context context, Handler handler) {
|
||||||
|
|
|
@ -386,10 +386,6 @@ public class HostFragmentManualConfiguration extends Fragment {
|
||||||
} else {
|
} else {
|
||||||
hostConnectionChecked(hostInfo);
|
hostConnectionChecked(hostInfo);
|
||||||
}
|
}
|
||||||
PreferenceManager.getDefaultSharedPreferences(getActivity())
|
|
||||||
.edit()
|
|
||||||
.putBoolean(Settings.KEY_PREF_CHECKED_EVENT_SERVER_CONNECTION, true)
|
|
||||||
.apply();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue