Skip to content

Commit

Permalink
Reduce application verbosity
Browse files Browse the repository at this point in the history
  • Loading branch information
trishika committed Mar 9, 2014
1 parent fc7f98f commit 61c5c82
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 32 deletions.
4 changes: 2 additions & 2 deletions src/main/java/org/droidupnp/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -136,15 +136,15 @@ public void onDestroy()
@Override
public void onResume()
{
Log.i(TAG, "onResume");
Log.v(TAG, "Resume activity");
upnpServiceController.resume(this);
super.onResume();
}

@Override
public void onPause()
{
Log.i(TAG, "onPause");
Log.v(TAG, "Pause activity");
upnpServiceController.pause();
upnpServiceController.getServiceListener().getServiceConnexion().onServiceDisconnected(null);
super.onPause();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ public void received(ActionInvocation actionInvocation, final DIDLContent didl)
@Override
public void updateStatus(Status status)
{
Log.i(TAG, "updateStatus ! ");
Log.v(TAG, "updateStatus ! ");
}

@Override
Expand Down Expand Up @@ -185,7 +185,7 @@ public void received(ActionInvocation actionInvocation, final DIDLContent didl)
@Override
public void updateStatus(Status status)
{
Log.i(TAG, "updateStatus ! ");
Log.v(TAG, "updateStatus ! ");
}

@Override
Expand Down
20 changes: 11 additions & 9 deletions src/main/java/org/droidupnp/controller/cling/ServiceListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,10 @@ public void refresh()
public Collection<IUpnpDevice> getDeviceList()
{
ArrayList<IUpnpDevice> deviceList = new ArrayList<IUpnpDevice>();
for (Device device : upnpService.getRegistry().getDevices())
{
deviceList.add(new CDevice(device));
if(upnpService != null && upnpService.getRegistry() != null) {
for (Device device : upnpService.getRegistry().getDevices()) {
deviceList.add(new CDevice(device));
}
}
return deviceList;
}
Expand All @@ -86,13 +87,14 @@ public Collection<IUpnpDevice> getFilteredDeviceList(ICallableFilter filter)
ArrayList<IUpnpDevice> deviceList = new ArrayList<IUpnpDevice>();
try
{
for (Device device : upnpService.getRegistry().getDevices())
{
IUpnpDevice upnpDevice = new CDevice(device);
filter.setDevice(upnpDevice);
if(upnpService != null && upnpService.getRegistry() != null) {
for (Device device : upnpService.getRegistry().getDevices()) {
IUpnpDevice upnpDevice = new CDevice(device);
filter.setDevice(upnpDevice);

if (filter.call())
deviceList.add(upnpDevice);
if (filter.call())
deviceList.add(upnpDevice);
}
}
}
catch (Exception e)
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/droidupnp/model/cling/TrackMetadata.java
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ public void parseTrackMetadata(String xml)
catch (Exception e)
{
// e.printStackTrace();
Log.e(TAG, "Error while parsing metadata !");
Log.e(TAG, "XML : " + xml);
Log.w(TAG, "Error while parsing metadata !");
Log.w(TAG, "XML : " + xml);
}
}

Expand Down
13 changes: 1 addition & 12 deletions src/main/java/org/droidupnp/view/ContentDirectoryFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -192,17 +192,14 @@ public void onActivityCreated(Bundle savedInstanceState)
contentDirectoryCommand = Main.factory.createContentDirectoryCommand();
}

Log.i(TAG, "Force refresh");
Log.d(TAG, "Force refresh");
refresh();

Log.d(TAG, "Activity created");
}

@Override
public void onDestroy()
{
super.onDestroy();
Log.i(TAG, "onDestroy");
Main.upnpServiceController.delSelectedContentDirectoryObserver(this);
Main.upnpServiceController.getContentDirectoryDiscovery().removeObserver(deviceObserver);
}
Expand Down Expand Up @@ -270,19 +267,11 @@ public void onSaveInstanceState(Bundle savedInstanceState)
@Override
public void onResume()
{
Log.i(TAG, "onResume");
super.onResume();
contentList.clear();
refresh();
}

@Override
public void onPause()
{
Log.i(TAG, "onPause");
super.onPause();
}

public Boolean goBack()
{
if(tree == null || tree.isEmpty())
Expand Down
5 changes: 0 additions & 5 deletions src/main/java/org/droidupnp/view/RendererFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,6 @@ public void onActivityCreated(Bundle savedInstanceState)

// Initially hide renderer
hide();

Log.d(TAG, "Activity created");
}

@Override
Expand All @@ -131,7 +129,6 @@ public void onResume()
@Override
public void onPause()
{
Log.d(TAG, "Pause Renderer");
device = null;
if (rendererCommand != null)
rendererCommand.pause();
Expand All @@ -141,7 +138,6 @@ public void onPause()
@Override
public void onDestroy()
{
Log.i(TAG, "Destroy");
Main.upnpServiceController.delSelectedRendererObserver(this);
super.onDestroy();
}
Expand Down Expand Up @@ -267,7 +263,6 @@ public void run()
@Override
public void update(Observable observable, Object data)
{
Log.d(TAG, "Renderer have changed");
startControlPoint();
}

Expand Down

0 comments on commit 61c5c82

Please sign in to comment.