diff --git a/build.gradle b/build.gradle index a36eb6f37..0be9e214a 100644 --- a/build.gradle +++ b/build.gradle @@ -30,9 +30,9 @@ repositories { dependencies { compile 'com.actionbarsherlock:actionbarsherlock:4.4.0@aar' - compile 'com.android.support:support-v4:20.0.0' + compile 'com.android.support:support-v4:21.0.0' compile 'se.emilsjolander:stickylistheaders:2.2.0' - compile 'com.google.android.gms:play-services:5.0.89' + compile 'com.google.android.gms:play-services:6.1.11' compile 'com.astuetz:pagerslidingtabstrip:1.0.1' compile 'org.w3c:smil:1.0.0' compile 'org.apache.httpcomponents:httpclient-android:4.3.5' @@ -48,9 +48,7 @@ dependencies { dependencyVerification { verify = [ 'com.actionbarsherlock:actionbarsherlock:5ab04d74101f70024b222e3ff9c87bee151ec43331b4a2134b6cc08cf8565819', - 'com.android.support:support-v4:81f2b1c2c94efd5a4ec7fcd97b6cdcd00e87a933905c5c86103c7319eb024572', 'se.emilsjolander:stickylistheaders:89146b46c96fea0e40200474a2625cda10fe94891e4128f53cdb42375091b9b6', - 'com.google.android.gms:play-services:38f326e525830f1d70f60f594ceafcbdf5b312287ddbecd338fd1ed7958a4b1e', 'com.astuetz:pagerslidingtabstrip:f1641396732c7132a7abb837e482e5ee2b0ebb8d10813fc52bbaec2c15c184c2', 'org.w3c:smil:085dc40f2bb249651578bfa07499fd08b16ad0886dbe2c4078586a408da62f9b', 'org.apache.httpcomponents:httpclient-android:6f56466a9bd0d42934b90bfbfe9977a8b654c058bf44a12bdc2877c4e1f033f1', diff --git a/jobqueue/src/main/java/org/whispersystems/jobqueue/EncryptionKeys.java b/jobqueue/src/main/java/org/whispersystems/jobqueue/EncryptionKeys.java index bdfe60872..a67356799 100644 --- a/jobqueue/src/main/java/org/whispersystems/jobqueue/EncryptionKeys.java +++ b/jobqueue/src/main/java/org/whispersystems/jobqueue/EncryptionKeys.java @@ -1,3 +1,19 @@ +/** + * Copyright (C) 2014 Open Whisper Systems + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package org.whispersystems.jobqueue; public class EncryptionKeys { diff --git a/jobqueue/src/main/java/org/whispersystems/jobqueue/Job.java b/jobqueue/src/main/java/org/whispersystems/jobqueue/Job.java index 508da4f7a..3a3875922 100644 --- a/jobqueue/src/main/java/org/whispersystems/jobqueue/Job.java +++ b/jobqueue/src/main/java/org/whispersystems/jobqueue/Job.java @@ -1,3 +1,19 @@ +/** + * Copyright (C) 2014 Open Whisper Systems + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package org.whispersystems.jobqueue; import org.whispersystems.jobqueue.requirements.Requirement; diff --git a/jobqueue/src/main/java/org/whispersystems/jobqueue/JobConsumer.java b/jobqueue/src/main/java/org/whispersystems/jobqueue/JobConsumer.java index 9dd391857..773a7a874 100644 --- a/jobqueue/src/main/java/org/whispersystems/jobqueue/JobConsumer.java +++ b/jobqueue/src/main/java/org/whispersystems/jobqueue/JobConsumer.java @@ -1,3 +1,19 @@ +/** + * Copyright (C) 2014 Open Whisper Systems + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package org.whispersystems.jobqueue; import org.whispersystems.jobqueue.persistence.PersistentStorage; diff --git a/jobqueue/src/main/java/org/whispersystems/jobqueue/JobManager.java b/jobqueue/src/main/java/org/whispersystems/jobqueue/JobManager.java index 0f4aeb096..5c4b1e2e2 100644 --- a/jobqueue/src/main/java/org/whispersystems/jobqueue/JobManager.java +++ b/jobqueue/src/main/java/org/whispersystems/jobqueue/JobManager.java @@ -1,3 +1,19 @@ +/** + * Copyright (C) 2014 Open Whisper Systems + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package org.whispersystems.jobqueue; import android.content.Context; diff --git a/jobqueue/src/main/java/org/whispersystems/jobqueue/JobParameters.java b/jobqueue/src/main/java/org/whispersystems/jobqueue/JobParameters.java index 589340a8c..e42672371 100644 --- a/jobqueue/src/main/java/org/whispersystems/jobqueue/JobParameters.java +++ b/jobqueue/src/main/java/org/whispersystems/jobqueue/JobParameters.java @@ -1,3 +1,19 @@ +/** + * Copyright (C) 2014 Open Whisper Systems + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package org.whispersystems.jobqueue; import org.whispersystems.jobqueue.requirements.Requirement; diff --git a/jobqueue/src/main/java/org/whispersystems/jobqueue/JobQueue.java b/jobqueue/src/main/java/org/whispersystems/jobqueue/JobQueue.java index 91e3a9021..6218a3140 100644 --- a/jobqueue/src/main/java/org/whispersystems/jobqueue/JobQueue.java +++ b/jobqueue/src/main/java/org/whispersystems/jobqueue/JobQueue.java @@ -1,3 +1,19 @@ +/** + * Copyright (C) 2014 Open Whisper Systems + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package org.whispersystems.jobqueue; import java.util.HashMap; diff --git a/jobqueue/src/main/java/org/whispersystems/jobqueue/dependencies/ContextDependent.java b/jobqueue/src/main/java/org/whispersystems/jobqueue/dependencies/ContextDependent.java index 0cdc91abe..582caf7ef 100644 --- a/jobqueue/src/main/java/org/whispersystems/jobqueue/dependencies/ContextDependent.java +++ b/jobqueue/src/main/java/org/whispersystems/jobqueue/dependencies/ContextDependent.java @@ -1,3 +1,19 @@ +/** + * Copyright (C) 2014 Open Whisper Systems + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package org.whispersystems.jobqueue.dependencies; import android.content.Context; diff --git a/jobqueue/src/main/java/org/whispersystems/jobqueue/persistence/JavaJobSerializer.java b/jobqueue/src/main/java/org/whispersystems/jobqueue/persistence/JavaJobSerializer.java index 761ef6117..719f51fd0 100644 --- a/jobqueue/src/main/java/org/whispersystems/jobqueue/persistence/JavaJobSerializer.java +++ b/jobqueue/src/main/java/org/whispersystems/jobqueue/persistence/JavaJobSerializer.java @@ -1,3 +1,19 @@ +/** + * Copyright (C) 2014 Open Whisper Systems + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package org.whispersystems.jobqueue.persistence; import android.content.Context; diff --git a/jobqueue/src/main/java/org/whispersystems/jobqueue/persistence/JobSerializer.java b/jobqueue/src/main/java/org/whispersystems/jobqueue/persistence/JobSerializer.java index dea6cacf3..226c9b649 100644 --- a/jobqueue/src/main/java/org/whispersystems/jobqueue/persistence/JobSerializer.java +++ b/jobqueue/src/main/java/org/whispersystems/jobqueue/persistence/JobSerializer.java @@ -1,3 +1,19 @@ +/** + * Copyright (C) 2014 Open Whisper Systems + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package org.whispersystems.jobqueue.persistence; import org.whispersystems.jobqueue.EncryptionKeys; diff --git a/jobqueue/src/main/java/org/whispersystems/jobqueue/persistence/PersistentStorage.java b/jobqueue/src/main/java/org/whispersystems/jobqueue/persistence/PersistentStorage.java index 9e99882b5..30ed1cb84 100644 --- a/jobqueue/src/main/java/org/whispersystems/jobqueue/persistence/PersistentStorage.java +++ b/jobqueue/src/main/java/org/whispersystems/jobqueue/persistence/PersistentStorage.java @@ -1,3 +1,19 @@ +/** + * Copyright (C) 2014 Open Whisper Systems + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package org.whispersystems.jobqueue.persistence; import android.content.ContentValues; diff --git a/jobqueue/src/main/java/org/whispersystems/jobqueue/requirements/NetworkRequirement.java b/jobqueue/src/main/java/org/whispersystems/jobqueue/requirements/NetworkRequirement.java index 1f1f7c3be..924e9cca6 100644 --- a/jobqueue/src/main/java/org/whispersystems/jobqueue/requirements/NetworkRequirement.java +++ b/jobqueue/src/main/java/org/whispersystems/jobqueue/requirements/NetworkRequirement.java @@ -1,3 +1,19 @@ +/** + * Copyright (C) 2014 Open Whisper Systems + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package org.whispersystems.jobqueue.requirements; import android.content.Context; diff --git a/jobqueue/src/main/java/org/whispersystems/jobqueue/requirements/NetworkRequirementProvider.java b/jobqueue/src/main/java/org/whispersystems/jobqueue/requirements/NetworkRequirementProvider.java index c16863568..60d375c27 100644 --- a/jobqueue/src/main/java/org/whispersystems/jobqueue/requirements/NetworkRequirementProvider.java +++ b/jobqueue/src/main/java/org/whispersystems/jobqueue/requirements/NetworkRequirementProvider.java @@ -1,3 +1,19 @@ +/** + * Copyright (C) 2014 Open Whisper Systems + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package org.whispersystems.jobqueue.requirements; import android.content.BroadcastReceiver; @@ -11,7 +27,11 @@ public class NetworkRequirementProvider implements RequirementProvider { private RequirementListener listener; + private final NetworkRequirement requirement; + public NetworkRequirementProvider(Context context) { + this.requirement = new NetworkRequirement(context); + context.getApplicationContext().registerReceiver(new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { @@ -19,11 +39,7 @@ public class NetworkRequirementProvider implements RequirementProvider { return; } - ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE); - NetworkInfo netInfo = cm.getActiveNetworkInfo(); - boolean connected = netInfo != null && netInfo.isConnectedOrConnecting(); - - if (connected) { + if (requirement.isPresent()) { listener.onRequirementStatusChanged(); } } diff --git a/jobqueue/src/main/java/org/whispersystems/jobqueue/requirements/Requirement.java b/jobqueue/src/main/java/org/whispersystems/jobqueue/requirements/Requirement.java index 22e7a40bc..058497e49 100644 --- a/jobqueue/src/main/java/org/whispersystems/jobqueue/requirements/Requirement.java +++ b/jobqueue/src/main/java/org/whispersystems/jobqueue/requirements/Requirement.java @@ -1,3 +1,19 @@ +/** + * Copyright (C) 2014 Open Whisper Systems + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package org.whispersystems.jobqueue.requirements; import java.io.Serializable; diff --git a/jobqueue/src/main/java/org/whispersystems/jobqueue/requirements/RequirementListener.java b/jobqueue/src/main/java/org/whispersystems/jobqueue/requirements/RequirementListener.java index 34460d6f8..2b2cb1b64 100644 --- a/jobqueue/src/main/java/org/whispersystems/jobqueue/requirements/RequirementListener.java +++ b/jobqueue/src/main/java/org/whispersystems/jobqueue/requirements/RequirementListener.java @@ -1,3 +1,19 @@ +/** + * Copyright (C) 2014 Open Whisper Systems + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package org.whispersystems.jobqueue.requirements; public interface RequirementListener { diff --git a/jobqueue/src/main/java/org/whispersystems/jobqueue/requirements/RequirementProvider.java b/jobqueue/src/main/java/org/whispersystems/jobqueue/requirements/RequirementProvider.java index caaddd197..838909237 100644 --- a/jobqueue/src/main/java/org/whispersystems/jobqueue/requirements/RequirementProvider.java +++ b/jobqueue/src/main/java/org/whispersystems/jobqueue/requirements/RequirementProvider.java @@ -1,3 +1,19 @@ +/** + * Copyright (C) 2014 Open Whisper Systems + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package org.whispersystems.jobqueue.requirements; public interface RequirementProvider {