Commit 978c5550 by Sebastián Katzer

Fix lint warnings

parent 620d3fc4
...@@ -44,6 +44,10 @@ abstract public class AbstractClearReceiver extends BroadcastReceiver { ...@@ -44,6 +44,10 @@ abstract public class AbstractClearReceiver extends BroadcastReceiver {
@Override @Override
public void onReceive(Context context, Intent intent) { public void onReceive(Context context, Intent intent) {
Bundle bundle = intent.getExtras(); Bundle bundle = intent.getExtras();
if (bundle == null)
return;
int toastId = bundle.getInt(Notification.EXTRA_ID); int toastId = bundle.getInt(Notification.EXTRA_ID);
Notification toast = Manager.getInstance(context).get(toastId); Notification toast = Manager.getInstance(context).get(toastId);
......
...@@ -52,6 +52,10 @@ abstract public class AbstractClickReceiver extends Activity { ...@@ -52,6 +52,10 @@ abstract public class AbstractClickReceiver extends Activity {
Intent intent = getIntent(); Intent intent = getIntent();
Bundle bundle = intent.getExtras(); Bundle bundle = intent.getExtras();
Context context = getApplicationContext(); Context context = getApplicationContext();
if (bundle == null)
return;
int toastId = bundle.getInt(Notification.EXTRA_ID); int toastId = bundle.getInt(Notification.EXTRA_ID);
Notification toast = Manager.getInstance(context).get(toastId); Notification toast = Manager.getInstance(context).get(toastId);
...@@ -97,6 +101,9 @@ abstract public class AbstractClickReceiver extends Activity { ...@@ -97,6 +101,9 @@ abstract public class AbstractClickReceiver extends Activity {
.getPackageManager() .getPackageManager()
.getLaunchIntentForPackage(pkgName); .getLaunchIntentForPackage(pkgName);
if (intent == null)
return;
intent.addFlags( intent.addFlags(
FLAG_ACTIVITY_REORDER_TO_FRONT | FLAG_ACTIVITY_SINGLE_TOP); FLAG_ACTIVITY_REORDER_TO_FRONT | FLAG_ACTIVITY_SINGLE_TOP);
......
...@@ -46,7 +46,11 @@ abstract public class AbstractTriggerReceiver extends BroadcastReceiver { ...@@ -46,7 +46,11 @@ abstract public class AbstractTriggerReceiver extends BroadcastReceiver {
@Override @Override
public void onReceive(Context context, Intent intent) { public void onReceive(Context context, Intent intent) {
Bundle bundle = intent.getExtras(); Bundle bundle = intent.getExtras();
int toastId = bundle.getInt(Notification.EXTRA_ID);
if (bundle == null)
return;
int toastId = bundle.getInt(Notification.EXTRA_ID, 0);
Options options = Manager.getInstance(context).getOptions(toastId); Options options = Manager.getInstance(context).getOptions(toastId);
if (options == null) if (options == null)
......
...@@ -68,10 +68,8 @@ public class IntervalTrigger extends DateTrigger { ...@@ -68,10 +68,8 @@ public class IntervalTrigger extends DateTrigger {
* Adds the amount of ticks to the calendar. * Adds the amount of ticks to the calendar.
* *
* @param cal The calendar to manipulate. * @param cal The calendar to manipulate.
*
* @return The calendar instance.
*/ */
Calendar addInterval(Calendar cal) { void addInterval(Calendar cal) {
switch (unit) { switch (unit) {
case SECOND: case SECOND:
cal.add(Calendar.SECOND, ticks); cal.add(Calendar.SECOND, ticks);
...@@ -98,8 +96,6 @@ public class IntervalTrigger extends DateTrigger { ...@@ -98,8 +96,6 @@ public class IntervalTrigger extends DateTrigger {
cal.add(Calendar.YEAR, ticks); cal.add(Calendar.YEAR, ticks);
break; break;
} }
return cal;
} }
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment