mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 20:33:53 +01:00
Revert to using target SDK hotfix for 2.8.4 (#1908)
* Revert "Cherry-pick dbrant's PR from master"
This reverts commit 718c70936d.
* Change target SDK to 26 temporarily
* Should actually target SDK 25
See https://developer.android.com/training/notify-user/channels
This commit is contained in:
parent
718c70936d
commit
0b0cfd49c6
3 changed files with 3 additions and 17 deletions
|
|
@ -5,9 +5,6 @@ import android.content.Context;
|
|||
import android.content.SharedPreferences;
|
||||
import android.database.sqlite.SQLiteDatabase;
|
||||
import android.support.multidex.MultiDexApplication;
|
||||
import android.os.Build;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.annotation.RequiresApi;
|
||||
|
||||
import com.facebook.drawee.backends.pipeline.Fresco;
|
||||
import com.facebook.imagepipeline.core.ImagePipelineConfig;
|
||||
|
|
@ -104,22 +101,10 @@ public class CommonsApplication extends MultiDexApplication {
|
|||
Stetho.initializeWithDefaults(this);
|
||||
}
|
||||
|
||||
createNotificationChannel(this);
|
||||
// Fire progress callbacks for every 3% of uploaded content
|
||||
System.setProperty("in.yuvi.http.fluent.PROGRESS_TRIGGER_THRESHOLD", "3.0");
|
||||
}
|
||||
|
||||
public static void createNotificationChannel(@NonNull Context context) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
NotificationManager manager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
|
||||
NotificationChannel channel = manager.getNotificationChannel(NOTIFICATION_CHANNEL_ID_ALL);
|
||||
if (channel == null) {
|
||||
channel = new NotificationChannel(NOTIFICATION_CHANNEL_ID_ALL,
|
||||
context.getString(R.string.notifications_channel_name_all), NotificationManager.IMPORTANCE_DEFAULT);
|
||||
manager.createNotificationChannel(channel);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Helps in setting up LeakCanary library
|
||||
|
|
|
|||
|
|
@ -122,7 +122,7 @@ public class UploadService extends HandlerService<Contribution> {
|
|||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
CommonsApplication.createNotificationChannel(getApplicationContext());
|
||||
|
||||
notificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -19,7 +19,8 @@ android.useDeprecatedNdk=true
|
|||
BUTTERKNIFE_VERSION=8.6.0
|
||||
org.gradle.jvmargs=-Xmx1536M
|
||||
buildToolsVersion=27.0.0
|
||||
targetSdkVersion=27
|
||||
#TODO: Change back to 27 in v2.9, see https://github.com/commons-app/apps-android-commons/issues/1877
|
||||
targetSdkVersion=25
|
||||
|
||||
#TODO: Temporary disabled. https://developer.android.com/studio/build/gradle-plugin-3-0-0-migration.html#aapt2
|
||||
#Refer to PR: https://github.com/commons-app/apps-android-commons/pull/932
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue