Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 466e665b authored by Kurt Partridge's avatar Kurt Partridge
Browse files

[FileEncap2] Remove mCanUpload instance variable

Change-Id: I62a100c4d73bb64a14a7994f7dd9af7b6946d064
parent 347b2ebe
Loading
Loading
Loading
Loading
+5 −6
Original line number Diff line number Diff line
@@ -56,7 +56,6 @@ public final class UploaderService extends IntentService {
    private static final int BUF_SIZE = 1024 * 8;
    protected static final int TIMEOUT_IN_MS = 1000 * 4;

    private boolean mCanUpload;
    private File mFilesDir;
    private URL mUrl;

@@ -68,7 +67,6 @@ public final class UploaderService extends IntentService {
    public void onCreate() {
        super.onCreate();

        mCanUpload = false;
        mFilesDir = null;
        mUrl = null;

@@ -83,12 +81,15 @@ public final class UploaderService extends IntentService {
            }
            mFilesDir = getFilesDir();
            mUrl = new URL(urlString);
            mCanUpload = true;
        } catch (MalformedURLException e) {
            e.printStackTrace();
        }
    }

    public boolean isPossibleToUpload() {
        return hasUploadingPermission() && mUrl != null && !IS_INHIBITING_AUTO_UPLOAD;
    }

    private boolean hasUploadingPermission() {
        final PackageManager packageManager = getPackageManager();
        return packageManager.checkPermission(Manifest.permission.INTERNET,
@@ -97,9 +98,7 @@ public final class UploaderService extends IntentService {

    @Override
    protected void onHandleIntent(Intent intent) {
        if (!mCanUpload) {
            return;
        }
        if (!isPossibleToUpload()) return;
        boolean isUploadingUnconditionally = false;
        Bundle bundle = intent.getExtras();
        if (bundle != null && bundle.containsKey(EXTRA_UPLOAD_UNCONDITIONALLY)) {