Fix bug where certain apps wouldn't be considered to handle intents, cleaned up imports

This commit is contained in:
Anthony Restaino 2016-10-27 22:25:19 -04:00
parent a6b755e6c4
commit 9aed39c49c
9 changed files with 22 additions and 27 deletions

View File

@ -85,7 +85,7 @@ public class TabsManager {
mPostInitializationWorkList.clear(); mPostInitializationWorkList.clear();
} }
public void doAfterInitialization(@NonNull Runnable runnable) { public synchronized void doAfterInitialization(@NonNull Runnable runnable) {
if (mIsInitialized) { if (mIsInitialized) {
runnable.run(); runnable.run();
} else { } else {
@ -93,7 +93,7 @@ public class TabsManager {
} }
} }
private void finishInitialization() { private synchronized void finishInitialization() {
mIsInitialized = true; mIsInitialized = true;
for (Runnable runnable : mPostInitializationWorkList) { for (Runnable runnable : mPostInitializationWorkList) {
runnable.run(); runnable.run();

View File

@ -1,8 +1,5 @@
package acr.browser.lightning.bus; package acr.browser.lightning.bus;
import android.support.annotation.Nullable;
import android.support.annotation.StringRes;
public final class BrowserEvents { public final class BrowserEvents {
private BrowserEvents() { private BrowserEvents() {

View File

@ -32,7 +32,6 @@ import acr.browser.lightning.BuildConfig;
import acr.browser.lightning.R; import acr.browser.lightning.R;
import acr.browser.lightning.activity.MainActivity; import acr.browser.lightning.activity.MainActivity;
import acr.browser.lightning.app.BrowserApp; import acr.browser.lightning.app.BrowserApp;
import acr.browser.lightning.bus.BrowserEvents;
import acr.browser.lightning.constant.Constants; import acr.browser.lightning.constant.Constants;
import acr.browser.lightning.dialog.BrowserDialog; import acr.browser.lightning.dialog.BrowserDialog;
import acr.browser.lightning.preference.PreferenceManager; import acr.browser.lightning.preference.PreferenceManager;

View File

@ -21,7 +21,6 @@ import java.net.URL;
import acr.browser.lightning.R; import acr.browser.lightning.R;
import acr.browser.lightning.app.BrowserApp; import acr.browser.lightning.app.BrowserApp;
import acr.browser.lightning.bus.BrowserEvents;
import acr.browser.lightning.utils.Utils; import acr.browser.lightning.utils.Utils;
/** /**

View File

@ -11,7 +11,6 @@ import android.support.annotation.NonNull;
import android.support.annotation.Nullable; import android.support.annotation.Nullable;
import android.support.v4.app.Fragment; import android.support.v4.app.Fragment;
import android.support.v4.view.ViewCompat; import android.support.v4.view.ViewCompat;
import android.util.Log;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;

View File

@ -241,6 +241,8 @@ public class GeneralSettingsFragment extends LightningPreferenceFragment impleme
case Constants.PROXY_MANUAL: case Constants.PROXY_MANUAL:
manualProxyPicker(); manualProxyPicker();
break; break;
case Constants.NO_PROXY:
break;
} }
mPreferenceManager.setProxyChoice(choice); mPreferenceManager.setProxyChoice(choice);

View File

@ -62,17 +62,15 @@ public class DrawableUtils {
public static int mixColor(float fraction, int startValue, int endValue) { public static int mixColor(float fraction, int startValue, int endValue) {
int startInt = startValue; int startA = (startValue >> 24) & 0xff;
int startA = (startInt >> 24) & 0xff; int startR = (startValue >> 16) & 0xff;
int startR = (startInt >> 16) & 0xff; int startG = (startValue >> 8) & 0xff;
int startG = (startInt >> 8) & 0xff; int startB = startValue & 0xff;
int startB = startInt & 0xff;
int endInt = endValue; int endA = (endValue >> 24) & 0xff;
int endA = (endInt >> 24) & 0xff; int endR = (endValue >> 16) & 0xff;
int endR = (endInt >> 16) & 0xff; int endG = (endValue >> 8) & 0xff;
int endG = (endInt >> 8) & 0xff; int endB = endValue & 0xff;
int endB = endInt & 0xff;
return (startA + (int) (fraction * (endA - startA))) << 24 | return (startA + (int) (fraction * (endA - startA))) << 24 |
(startR + (int) (fraction * (endR - startR))) << 16 | (startR + (int) (fraction * (endR - startR))) << 16 |

View File

@ -102,7 +102,9 @@ public class IntentUtils {
// to launch a new intent for every URL, using OR only // to launch a new intent for every URL, using OR only
// launches a new one if there is a non-browser app that // launches a new one if there is a non-browser app that
// can handle it. // can handle it.
if (filter.countDataAuthorities() == 0 || filter.countDataPaths() == 0) { // Previously we checked the number of data paths, but it is unnecessary
// filter.countDataAuthorities() == 0 || filter.countDataPaths() == 0
if (filter.countDataAuthorities() == 0) {
// Generic handler, skip // Generic handler, skip
continue; continue;
} }

View File

@ -16,7 +16,6 @@ import javax.inject.Singleton;
import acr.browser.lightning.R; import acr.browser.lightning.R;
import acr.browser.lightning.app.BrowserApp; import acr.browser.lightning.app.BrowserApp;
import acr.browser.lightning.bus.BrowserEvents;
import acr.browser.lightning.constant.Constants; import acr.browser.lightning.constant.Constants;
import acr.browser.lightning.dialog.BrowserDialog; import acr.browser.lightning.dialog.BrowserDialog;
import acr.browser.lightning.preference.PreferenceManager; import acr.browser.lightning.preference.PreferenceManager;