Commit 978c5550 by Sebastián Katzer

Fix lint warnings

parent 620d3fc4
......@@ -44,6 +44,10 @@ abstract public class AbstractClearReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
Bundle bundle = intent.getExtras();
if (bundle == null)
return;
int toastId = bundle.getInt(Notification.EXTRA_ID);
Notification toast = Manager.getInstance(context).get(toastId);
......
......@@ -52,6 +52,10 @@ abstract public class AbstractClickReceiver extends Activity {
Intent intent = getIntent();
Bundle bundle = intent.getExtras();
Context context = getApplicationContext();
if (bundle == null)
return;
int toastId = bundle.getInt(Notification.EXTRA_ID);
Notification toast = Manager.getInstance(context).get(toastId);
......@@ -97,6 +101,9 @@ abstract public class AbstractClickReceiver extends Activity {
.getPackageManager()
.getLaunchIntentForPackage(pkgName);
if (intent == null)
return;
intent.addFlags(
FLAG_ACTIVITY_REORDER_TO_FRONT | FLAG_ACTIVITY_SINGLE_TOP);
......
......@@ -46,7 +46,11 @@ abstract public class AbstractTriggerReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
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);
if (options == null)
......
......@@ -68,10 +68,8 @@ public class IntervalTrigger extends DateTrigger {
* Adds the amount of ticks to the calendar.
*
* @param cal The calendar to manipulate.
*
* @return The calendar instance.
*/
Calendar addInterval(Calendar cal) {
void addInterval(Calendar cal) {
switch (unit) {
case SECOND:
cal.add(Calendar.SECOND, ticks);
......@@ -98,8 +96,6 @@ public class IntervalTrigger extends DateTrigger {
cal.add(Calendar.YEAR, ticks);
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