From cd303789b10f5ed17ad203e40b4d0d8cf0d08d38 Mon Sep 17 00:00:00 2001 From: thelazyindian Date: Wed, 31 Oct 2018 18:06:18 +0530 Subject: [PATCH 1/3] CardinalOTA: Basic updates --- .idea/caches/build_file_checksums.ser | Bin 537 -> 542 bytes .idea/codeStyles/Project.xml | 56 +++++++++++------------ .idea/misc.xml | 10 ++-- .idea/vcs.xml | 2 +- app/build.gradle | 22 +++++---- build.gradle | 2 +- gradle/wrapper/gradle-wrapper.properties | 12 ++--- 7 files changed, 57 insertions(+), 47 deletions(-) diff --git a/.idea/caches/build_file_checksums.ser b/.idea/caches/build_file_checksums.ser index c5c756ea0326d22dada191cd68cc094dda1c95a6..95c4e19e2df0a1170a2c19f3eabfb7093f2d1957 100644 GIT binary patch delta 223 zcmbQqGLL1#bk?*}BIiy{oa3LsUz}P}l9`uYte0Mtn39uPTExH2z_zyOYkOxc* z3>5_o3=9Ix|4AL5n7Q?-MpRsIn!c)Z2?I}3X=Y9eOjjX89RnLkVLC%k?B_|>q;qac z=z5xbzA$+&qpZH+@wG?q)a>{;r%5nv0@LcVB@DXy8Tq-X`Xw2uIf+%3nRzLhiFx`^ v!}KS=Wt5)W!YDNP4Wo`;34=glL4iJY+k!0beTsN}l7sX6J;N0bB26m*-O^Nw delta 196 zcmbQoGLvP(bk>x(TP<}H=lBN*Bo-9JB$a07r0As=C8p%0mKHHEMLVteEdGOyBjf=S z14Bgt0|SFVvAK-Q_Dy!r8rR+Il+kNDUBbX$oLW+nnU`J+(^$w*$G|q3k5NoQ!`Uh( zv^ce>IHsT|GcP#?sv>6cbVglu9u(Wanm`sPpPsxqO)Gk$<;8fNOZp|*lf4;b1sVn0 YUWs;H&OTIqy!*n*isH$K81)z{067OoxBvhE diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml index 2715a34..30aa626 100644 --- a/.idea/codeStyles/Project.xml +++ b/.idea/codeStyles/Project.xml @@ -1,29 +1,29 @@ - - - - - - - - - - - - - + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index dc34569..e0d5b93 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -5,27 +5,31 @@ - + diff --git a/.idea/vcs.xml b/.idea/vcs.xml index 94a25f7..35eb1dd 100644 --- a/.idea/vcs.xml +++ b/.idea/vcs.xml @@ -1,6 +1,6 @@ - + \ No newline at end of file diff --git a/app/build.gradle b/app/build.gradle index b47ed1c..86db3bb 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,12 +1,12 @@ apply plugin: 'com.android.application' android { - compileSdkVersion 26 - buildToolsVersion '27.0.3' + compileSdkVersion 27 + buildToolsVersion '28.0.3' defaultConfig { applicationId "com.cardinal.ota" minSdkVersion 26 - targetSdkVersion 26 + targetSdkVersion 27 versionCode 1 versionName "1.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" @@ -20,18 +20,24 @@ android { packagingOptions { exclude 'org/htmlparser/parserapplications/filterbuilder/images/new.gif' } + lintOptions { + checkReleaseBuilds false + // Or, if you prefer, you can continue to check for errors in release builds, + // but continue the build even when errors are found: + abortOnError false + } } dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) - implementation 'com.android.support:support-v4:26.1.0' + implementation 'com.android.support:support-v4:27.1.0' androidTestImplementation('com.android.support.test.espresso:espresso-core:3.0.1', { exclude group: 'com.android.support', module: 'support-annotations' }) - implementation 'com.android.support:appcompat-v7:26.1.0' - implementation "com.android.support:support-compat:26.1.0" - implementation 'com.android.support:cardview-v7:26.1.0' + implementation 'com.android.support:appcompat-v7:27.1.0' + implementation "com.android.support:support-compat:27.1.0" + implementation 'com.android.support:cardview-v7:27.1.0' testImplementation 'junit:junit:4.12' implementation 'com.android.support.constraint:constraint-layout:1.0.2' - implementation 'com.android.support:design:26.1.0' + implementation 'com.android.support:design:27.1.0' } diff --git a/build.gradle b/build.gradle index 43c0708..8d3ef8e 100644 --- a/build.gradle +++ b/build.gradle @@ -7,7 +7,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:3.1.3' + classpath 'com.android.tools.build:gradle:3.2.1' // NOTE: Do not place your application dependencies here; they belong diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index e23eb1a..0a4a5a2 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Sun Apr 22 15:16:06 IST 2018 -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip +#Wed Oct 31 17:41:55 IST 2018 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip From a1ea5b5e6682aad7f557d90d4621c9b2a053aa28 Mon Sep 17 00:00:00 2001 From: thelazyindian Date: Wed, 31 Oct 2018 18:08:39 +0530 Subject: [PATCH 2/3] Revert "CardinalOTA: Disable fetchtask on boot for now" This reverts commit ce2db20766f9743de3fb2cbcb1443a44859ffe5c. --- app/src/main/java/com/cardinal/ota/BootReceiver.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/com/cardinal/ota/BootReceiver.java b/app/src/main/java/com/cardinal/ota/BootReceiver.java index 7574105..1612399 100644 --- a/app/src/main/java/com/cardinal/ota/BootReceiver.java +++ b/app/src/main/java/com/cardinal/ota/BootReceiver.java @@ -7,6 +7,6 @@ public class BootReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { - //Utils.scheduleFetchUpdate(context); + Utils.scheduleFetchUpdate(context); } } From ea9776b7dcd2be72e783ea1fe98806f9de83fe4b Mon Sep 17 00:00:00 2001 From: thelazyindian Date: Wed, 31 Oct 2018 18:19:01 +0530 Subject: [PATCH 3/3] CardinalOTA: Kill notification and service if no network --- app/src/main/java/com/cardinal/ota/FetchService.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/src/main/java/com/cardinal/ota/FetchService.java b/app/src/main/java/com/cardinal/ota/FetchService.java index 54c8782..ace321c 100644 --- a/app/src/main/java/com/cardinal/ota/FetchService.java +++ b/app/src/main/java/com/cardinal/ota/FetchService.java @@ -64,6 +64,11 @@ public void onCreate() { .build(); if (isConnected()) new FetchTask().execute(ctrBaseUrl.toString()); + else { + stopForeground(true); + NotificationManager notificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE); + notificationManager.cancel(1); + } } @Nullable