Skip to content

Commit 3978c25

Browse files
authored
Merge branch 'master' into 605-resave-installation-local-datastore-enabled
2 parents 6748ecb + 6223d06 commit 3978c25

File tree

117 files changed

+2269
-1643
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

117 files changed

+2269
-1643
lines changed

CONTRIBUTING.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,15 @@ In order to accept your pull request, we need you to submit a CLA. You only need
2626
Complete your CLA here: <https://developers.facebook.com/opensource/cla>
2727

2828
## Bugs
29-
Although we try to keep developing on Parse easy, you still may run into some issues. General questions should be asked on [Google Groups][google-group], technical questions should be asked on [Stack Overflow][stack-overflow], and for everything else we'll be using GitHub issues.
29+
Although we try to keep developing on Parse easy, you still may run into some issues. Technical questions should be asked on [Stack Overflow][stack-overflow], and for everything else we'll be using GitHub issues.
3030

3131
### Known Issues
3232
We use GitHub issues to track public bugs. We will keep a close eye on this and try to make it clear when we have an internal fix in progress. Before filing a new issue, try to make sure your problem doesn't already exist.
3333

3434
### Reporting New Issues
3535
Not all issues are SDK issues. If you're unsure whether your bug is with the SDK or backend, you can test to see if it reproduces with our [REST API][rest-api] and [Parse API Console][parse-api-console]. If it does, you can report backend bugs [here][bug-reports].
3636

37-
To view the REST API network requests issued by the Parse SDK and responses from the Parse backend, please check out our [Network Debugging Tool][network-debugging-tool]. With this tool, you can either log network requests/responses to Android logcat, or log them to Chrome Debugger via Stetho.
37+
To view the REST API network requests issued by the Parse SDK and responses from the Parse backend, please check out [OkHttp Interceptors][network-debugging-tool]. With this tool, you can either log network requests/responses to Android logcat, or log them to Chrome Debugger via Stetho.
3838

3939
Details are key. The more information you provide us the easier it'll be for us to debug and the faster you'll receive a fix. Some examples of useful tidbits:
4040

@@ -56,11 +56,10 @@ We're still working on providing a code style for your IDE and getting a linter
5656
## License
5757
By contributing to Parse Android SDK, you agree that your contributions will be licensed under its license.
5858

59-
[google-group]: https://groups.google.com/forum/#!forum/parse-developers
6059
[stack-overflow]: http://stackoverflow.com/tags/parse.com
61-
[bug-reports]: https://www.parse.com/help#report
62-
[rest-api]: https://www.parse.com/docs/rest/guide
63-
[network-debugging-tool]: https://github.com/ParsePlatform/ParseInterceptors-Android/wiki
60+
[bug-reports]: https://github.com/parse-community/parse-server
61+
[rest-api]: http://docs.parseplatform.org/rest/guide/
62+
[network-debugging-tool]: https://github.com/square/okhttp/wiki/Interceptors
6463
[parse-api-console]: http://blog.parse.com/announcements/introducing-the-parse-api-console/
6564
[stacktrace-or-gtfo]: http://i.imgur.com/jacoj.jpg
6665
[tests-dir]: /Parse/src/test/java/com/parse

LICENSE

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,7 @@ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
2828
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2929
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
3030
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31+
32+
-----
33+
34+
As of April 5, 2017, Parse, LLC has transferred this code to the parse-community organization, and will no longer be contributing to or distributing this code.

PATENTS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,7 @@ necessarily infringed by the Software standing alone.
3131
A "Patent Assertion" is any lawsuit or other action alleging direct, indirect,
3232
or contributory infringement or inducement to infringe any patent, including a
3333
cross-claim or counterclaim.
34+
35+
-----
36+
37+
As of April 5, 2017, Parse, LLC has transferred this code to the parse-community organization, and will no longer be contributing to or distributing this code.

Parse/build.gradle

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ apply plugin: 'com.android.library'
44
apply plugin: 'com.github.kt3k.coveralls'
55

66
group = 'com.parse'
7-
version = '1.14.1-SNAPSHOT'
7+
version = '1.15.2-SNAPSHOT'
88

99
buildscript {
1010
repositories {
@@ -39,14 +39,22 @@ android {
3939
}
4040
}
4141

42-
ext.okhttpVersion = '3.6.0'
42+
ext {
43+
okhttpVersion = '3.6.0'
44+
}
45+
4346
dependencies {
47+
compile "com.android.support:support-annotations:$supportLibVersion"
4448
compile 'com.parse.bolts:bolts-tasks:1.4.0'
4549
compile "com.squareup.okhttp3:okhttp:$okhttpVersion"
4650
provided 'com.facebook.stetho:stetho:1.4.2'
4751

52+
//Be aware, tests fail on 3.3.2 Wait to update until
53+
//java.lang.NoClassDefFoundError: android/content/pm/VersionedPackage
54+
//issue is fixed in Robolectric
55+
//https://github.com/robolectric/robolectric/issues/2562
4856
testCompile 'org.robolectric:robolectric:3.3'
49-
testCompile 'org.skyscreamer:jsonassert:1.4.0'
57+
testCompile 'org.skyscreamer:jsonassert:1.5.0'
5058
testCompile 'org.mockito:mockito-core:1.10.19'
5159
testCompile "com.squareup.okhttp3:mockwebserver:$okhttpVersion"
5260
}
@@ -123,7 +131,7 @@ uploadArchives {
123131
pom.project {
124132
name 'Parse-Android'
125133
artifactId = 'parse-android'
126-
packaging 'jar'
134+
packaging 'aar'
127135
description 'A library that gives you access to the powerful Parse cloud platform from your Android app.'
128136
url 'https://github.com/ParsePlatform/Parse-SDK-Android'
129137

Parse/src/main/java/com/parse/ConfigCallback.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,5 @@ public interface ConfigCallback extends ParseCallback2<ParseConfig, ParseExcepti
4040
* The exception raised by the fetch, or {@code null} if it succeeded.
4141
*/
4242
@Override
43-
public void done(ParseConfig config, ParseException e);
43+
void done(ParseConfig config, ParseException e);
4444
}

Parse/src/main/java/com/parse/CountCallback.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,5 @@ public interface CountCallback {
4444
* @param e
4545
* The exception raised by the count, or null if it succeeded.
4646
*/
47-
public void done(int count, ParseException e);
47+
void done(int count, ParseException e);
4848
}

Parse/src/main/java/com/parse/DeleteCallback.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,5 @@ public interface DeleteCallback extends ParseCallback1<ParseException> {
4040
* The exception raised by the delete, or {@code null} if it succeeded.
4141
*/
4242
@Override
43-
public void done(ParseException e);
43+
void done(ParseException e);
4444
}

Parse/src/main/java/com/parse/FindCallback.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,5 @@ public interface FindCallback<T extends ParseObject> extends ParseCallback2<List
4545
* The exception raised by the save, or null if it succeeded.
4646
*/
4747
@Override
48-
public void done(List<T> objects, ParseException e);
48+
void done(List<T> objects, ParseException e);
4949
}

Parse/src/main/java/com/parse/FunctionCallback.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,5 @@ public interface FunctionCallback<T> extends ParseCallback2<T, ParseException> {
4545
* The exception raised by the cloud call, or {@code null} if it succeeded.
4646
*/
4747
@Override
48-
public void done(T object, ParseException e);
48+
void done(T object, ParseException e);
4949
}

Parse/src/main/java/com/parse/GcmRegistrar.java

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@
3838
private static final String REGISTRATION_ID_EXTRA = "registration_id";
3939
private static final String ERROR_EXTRA = "error";
4040

41-
// Client-side key for [email protected]. See parse/config/gcm.yml for server-side key.
42-
private static final String PARSE_SENDER_ID = "1076345567071";
4341
private static final String SENDER_ID_EXTRA = "com.parse.push.gcm_sender_id";
4442

4543
public static final String REGISTER_ACTION = "com.google.android.c2dm.intent.REGISTER";
@@ -134,24 +132,33 @@ private Task<Void> sendRegistrationRequestAsync() {
134132
// a 32-bit integer. For `android:value="567327206255"`, this returns a truncated integer
135133
// because 567327206255 is larger than the largest 32-bit integer.
136134
Bundle metaData = ManifestInfo.getApplicationMetadata(context);
137-
String senderIDs = PARSE_SENDER_ID;
135+
String senderID = null;
136+
138137
if (metaData != null) {
139138
Object senderIDExtra = metaData.get(SENDER_ID_EXTRA);
140139

141140
if (senderIDExtra != null) {
142-
String senderID = actualSenderIDFromExtra(senderIDExtra);
141+
senderID = actualSenderIDFromExtra(senderIDExtra);
143142

144-
if (senderID != null) {
145-
senderIDs += ("," + senderID);
146-
} else {
143+
if (senderID == null) {
147144
PLog.e(TAG, "Found " + SENDER_ID_EXTRA + " <meta-data> element with value \"" +
148145
senderIDExtra.toString() + "\", but the value is missing the expected \"id:\" " +
149146
"prefix.");
147+
return null;
150148
}
151149
}
152150
}
153151

154-
request = Request.createAndSend(context, senderIDs);
152+
if (senderID == null) {
153+
PLog.e(TAG, "You must provide " + SENDER_ID_EXTRA + " in your AndroidManifest.xml\n" +
154+
"Make sure to prefix with the value with id:\n\n" +
155+
"<meta-data\n" +
156+
" android:name=\"com.parse.push.gcm_sender_id\"\n" +
157+
" android:value=\"id:<YOUR_GCM_SENDER_ID>\" />");
158+
return null;
159+
}
160+
161+
request = Request.createAndSend(context, senderID);
155162
return request.getTask().continueWith(new Continuation<String, Void>() {
156163
@Override
157164
public Void then(Task<String> task) {

Parse/src/main/java/com/parse/GetCallback.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,5 @@ public interface GetCallback<T extends ParseObject> extends ParseCallback2<T, Pa
4343
* The exception raised by the fetch, or {@code null} if it succeeded.
4444
*/
4545
@Override
46-
public void done(T object, ParseException e);
46+
void done(T object, ParseException e);
4747
}

Parse/src/main/java/com/parse/GetDataCallback.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,6 @@ public interface GetDataCallback extends ParseCallback2<byte[], ParseException>
3535
* The exception raised by the fetch, or {@code null} if it succeeded.
3636
*/
3737
@Override
38-
public void done(byte[] data, ParseException e);
38+
void done(byte[] data, ParseException e);
3939
}
4040

Parse/src/main/java/com/parse/GetDataStreamCallback.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,5 @@ public interface GetDataStreamCallback extends ParseCallback2<InputStream, Parse
3737
* The exception raised by the fetch, or {@code null} if it succeeded.
3838
*/
3939
@Override
40-
public void done(InputStream input, ParseException e);
40+
void done(InputStream input, ParseException e);
4141
}

Parse/src/main/java/com/parse/GetFileCallback.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,5 @@ public interface GetFileCallback extends ParseCallback2<File, ParseException> {
3737
* The exception raised by the fetch, or {@code null} if it succeeded.
3838
*/
3939
@Override
40-
public void done(File file, ParseException e);
40+
void done(File file, ParseException e);
4141
}

Parse/src/main/java/com/parse/LocalIdManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ synchronized String createLocalId() {
129129

130130
if (!isLocalId(localId)) {
131131
throw new IllegalStateException("Generated an invalid local id: \"" + localId + "\". "
132-
+ "This should never happen. Contact us at https://parse.com/help");
132+
+ "This should never happen. Open a bug at https://github.com/parse-community/parse-server");
133133
}
134134

135135
return localId;

Parse/src/main/java/com/parse/LocationCallback.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,5 @@ public interface LocationCallback extends ParseCallback2<ParseGeoPoint, ParseExc
4444
* The exception raised by the location fetch, or {@code null} if it succeeded.
4545
*/
4646
@Override
47-
public void done(ParseGeoPoint geoPoint, ParseException e);
47+
void done(ParseGeoPoint geoPoint, ParseException e);
4848
}

Parse/src/main/java/com/parse/LocationNotifier.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
/* package */ static Task<Location> getCurrentLocationAsync(Context context,
6161
long timeout, Criteria criteria) {
6262
final TaskCompletionSource<Location> tcs = new TaskCompletionSource<>();
63-
final Capture<ScheduledFuture<?>> timeoutFuture = new Capture<ScheduledFuture<?>>();
63+
final Capture<ScheduledFuture<?>> timeoutFuture = new Capture<>();
6464
final LocationManager manager =
6565
(LocationManager) context.getSystemService(Context.LOCATION_SERVICE);
6666
final LocationListener listener = new LocationListener() {

Parse/src/main/java/com/parse/LockSet.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@
1616
import java.util.concurrent.locks.Lock;
1717

1818
/** package */ class LockSet {
19-
private static WeakHashMap<Lock, Long> stableIds = new WeakHashMap<Lock, Long>();
19+
private static final WeakHashMap<Lock, Long> stableIds = new WeakHashMap<>();
2020
private static long nextStableId = 0L;
2121

2222
private final Set<Lock> locks;
2323

2424
public LockSet(Collection<Lock> locks) {
25-
this.locks = new TreeSet<Lock>(new Comparator<Lock>() {
25+
this.locks = new TreeSet<>(new Comparator<Lock>() {
2626
@Override
2727
public int compare(Lock lhs, Lock rhs) {
2828
Long lhsId = getStableId(lhs);

Parse/src/main/java/com/parse/LogInCallback.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,5 @@ public interface LogInCallback extends ParseCallback2<ParseUser, ParseException>
4343
* The exception raised by the login, or {@code null} if it succeeded.
4444
*/
4545
@Override
46-
public void done(ParseUser user, ParseException e);
46+
void done(ParseUser user, ParseException e);
4747
}

Parse/src/main/java/com/parse/LogOutCallback.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,5 @@ public interface LogOutCallback extends ParseCallback1<ParseException> {
3939
* The exception raised by the log out, or {@code null} if it succeeded.
4040
*/
4141
@Override
42-
public void done(ParseException e);
42+
void done(ParseException e);
4343
}

Parse/src/main/java/com/parse/ManifestInfo.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ private static boolean hasAnyGcmSpecificDeclaration() {
463463
}
464464

465465
private static boolean isGooglePlayServicesAvailable() {
466-
return Build.VERSION.SDK_INT >= 8 && getPackageInfo("com.google.android.gsf") != null;
466+
return getPackageInfo("com.google.android.gsf") != null;
467467
}
468468

469469
private static ManifestCheckResult gcmSupportLevel() {

Parse/src/main/java/com/parse/NotificationCompat.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -314,15 +314,15 @@ public Builder setStyle(Style style) {
314314
*/
315315
@Deprecated
316316
public Notification getNotification() {
317-
return (Notification) IMPL.build(this);
317+
return IMPL.build(this);
318318
}
319319

320320
/**
321321
* Combine all of the options that have been set and return a new {@link Notification}
322322
* object.
323323
*/
324324
public Notification build() {
325-
return (Notification) IMPL.build(this);
325+
return IMPL.build(this);
326326
}
327327

328328
protected static CharSequence limitCharSequenceLength(CharSequence cs) {

Parse/src/main/java/com/parse/OfflineStore.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public Task<Void> then(Task<Void> ignore) throws Exception {
106106
}
107107
}
108108
tasks.clear();
109-
return Task.forResult((Void) null);
109+
return Task.forResult(null);
110110
}
111111
}
112112
});

0 commit comments

Comments
 (0)