Commit accf45c7 authored by Francisco Cunha's avatar Francisco Cunha Committed by Hussein

PA4-792 - Fix background run permission request in SettingsActivity

The permission request was happening before the MessageList started so
it was moved to Messagelist to ensure that is being shown at the start of
the app
parent 31429c0e
......@@ -12,17 +12,6 @@ import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.Parcelable;
import androidx.annotation.NonNull;
import com.google.android.material.navigation.NavigationView;
import androidx.core.view.GravityCompat;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentManager.OnBackStackChangedListener;
import androidx.fragment.app.FragmentTransaction;
import androidx.drawerlayout.widget.DrawerLayout;
import androidx.appcompat.app.ActionBarDrawerToggle;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import android.view.Gravity;
import android.view.KeyEvent;
import android.view.LayoutInflater;
......@@ -37,6 +26,16 @@ import android.widget.ImageView;
import android.widget.ProgressBar;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.appcompat.app.ActionBarDrawerToggle;
import androidx.core.view.GravityCompat;
import androidx.drawerlayout.widget.DrawerLayout;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentManager.OnBackStackChangedListener;
import androidx.fragment.app.FragmentTransaction;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.fsck.k9.Account;
import com.fsck.k9.Account.SortType;
import com.fsck.k9.AccountStats;
......@@ -84,6 +83,7 @@ import com.fsck.k9.view.MessageHeader;
import com.fsck.k9.view.MessageTitleView;
import com.fsck.k9.view.ViewSwitcher;
import com.fsck.k9.view.ViewSwitcher.OnSwitchCompleteListener;
import com.google.android.material.navigation.NavigationView;
import com.pedrogomez.renderers.ListAdapteeCollection;
import com.pedrogomez.renderers.RVRendererAdapter;
import com.pedrogomez.renderers.RendererBuilder;
......@@ -96,6 +96,7 @@ import java.util.List;
import javax.inject.Inject;
import foundation.pEp.jniadapter.Rating;
import security.pEp.permissions.PermissionRequester;
import timber.log.Timber;
......@@ -111,6 +112,8 @@ public class MessageList extends PepActivity implements MessageListFragmentListe
@Inject AccountUtils accountUtils;
@Inject
NotificationChannelManager channelUtils;
@Inject
PermissionRequester permissionRequester;
@Deprecated
//TODO: Remove after 2017-09-11
......@@ -368,6 +371,8 @@ public class MessageList extends PepActivity implements MessageListFragmentListe
return;
}
permissionRequester.requestBatteryOptimizationPermission();
findFragments();
initializeDisplayMode(savedInstanceState);
initializeLayout();
......
......@@ -213,7 +213,6 @@ class SettingsActivity : PEpImporterActivity(), PreferenceFragmentCompat.OnPrefe
return
}
permissionRequester.requestBatteryOptimizationPermission()
val startup = intent.getBooleanExtra(EXTRA_STARTUP, true)
if (startup && K9.startIntegratedInbox() && !K9.isHideSpecialAccounts()) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment