Bug 969637 - NullPointerException in org.mozilla.gecko.GeckoConnectivityReceiver.start. r=wesj
This commit is contained in:
@@ -56,6 +56,7 @@ class MemoryMonitor extends BroadcastReceiver {
|
||||
private final PressureDecrementer mPressureDecrementer;
|
||||
private int mMemoryPressure;
|
||||
private boolean mStoragePressure;
|
||||
private boolean mInited;
|
||||
|
||||
private MemoryMonitor() {
|
||||
mPressureDecrementer = new PressureDecrementer();
|
||||
@@ -63,13 +64,18 @@ class MemoryMonitor extends BroadcastReceiver {
|
||||
mStoragePressure = false;
|
||||
}
|
||||
|
||||
public void init(Context context) {
|
||||
public void init(final Context context) {
|
||||
if (mInited) {
|
||||
return;
|
||||
}
|
||||
|
||||
IntentFilter filter = new IntentFilter();
|
||||
filter.addAction(Intent.ACTION_DEVICE_STORAGE_LOW);
|
||||
filter.addAction(Intent.ACTION_DEVICE_STORAGE_OK);
|
||||
filter.addAction(ACTION_MEMORY_DUMP);
|
||||
filter.addAction(ACTION_FORCE_PRESSURE);
|
||||
context.getApplicationContext().registerReceiver(this, filter);
|
||||
mInited = true;
|
||||
}
|
||||
|
||||
public void onLowMemory() {
|
||||
|
||||
Reference in New Issue
Block a user