Change user agent + comment code for a next use for battery

This commit is contained in:
tom79 2019-06-04 15:01:26 +02:00
parent bbb57c4c0c
commit 15790761af
2 changed files with 14 additions and 1 deletions

View File

@ -18,6 +18,7 @@ import android.Manifest;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.app.ActivityManager;
import android.content.ActivityNotFoundException;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
@ -29,6 +30,7 @@ import android.os.AsyncTask;
import android.os.Build;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.provider.Settings;
import android.support.annotation.NonNull;
import android.support.design.widget.AppBarLayout;
import android.support.design.widget.FloatingActionButton;
@ -1130,6 +1132,17 @@ public abstract class BaseMainActivity extends BaseActivity
// editor.putBoolean(Helper.SET_NOTIF_HOMETIMELINE, set_push_hometimeline.isChecked());
editor.putBoolean(Helper.SET_POPUP_PUSH, true);
editor.apply();
/*if( set_push_notification.isChecked() ){
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.M) {
try {
Intent intent = new Intent(Settings.ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS);
intent.setData(Uri.parse("package:" + getApplicationContext().getPackageName()));
startActivity(intent);
} catch (ActivityNotFoundException e) {
e.printStackTrace();
}
}
}*/
}
});
try {

View File

@ -439,7 +439,7 @@ public class Helper {
public static final String RECEIVE_PICTURE = "receive_picture";
//User agent
public static final String USER_AGENT = "Mastalab/"+ BuildConfig.VERSION_NAME + " Android/"+ Build.VERSION.RELEASE;
public static final String USER_AGENT = "Fedilab/"+ BuildConfig.VERSION_NAME + " Android/"+ Build.VERSION.RELEASE;
public static final String SET_YANDEX_API_KEY = "set_yandex_api_key";
public static final String SET_DEEPL_API_KEY = "set_deepl_api_key";