Revert^2 "4/N Remove #handleWtfs from PluginInitializer."
f3a62151d0
Change-Id: Id988d944dc028a2f24a42a26c7faa85cb6d078b9
This commit is contained in:
@@ -212,7 +212,6 @@ public class PluginActionManager<T extends Plugin> {
|
||||
private void onPluginConnected(PluginInstance<T> pluginInstance) {
|
||||
if (DEBUG) Log.d(TAG, "onPluginConnected");
|
||||
PluginPrefs.setHasPlugins(mContext);
|
||||
mInitializer.handleWtfs();
|
||||
pluginInstance.onCreate(mContext, mListener);
|
||||
}
|
||||
|
||||
|
||||
@@ -18,9 +18,4 @@ package com.android.systemui.shared.plugins;
|
||||
* Provides necessary components for initializing {@link PluginManagerImpl}.
|
||||
*/
|
||||
public interface PluginInitializer {
|
||||
|
||||
/**
|
||||
* Called from {@link PluginActionManager}.
|
||||
*/
|
||||
void handleWtfs();
|
||||
}
|
||||
|
||||
@@ -14,10 +14,7 @@
|
||||
|
||||
package com.android.systemui.plugins;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
import com.android.systemui.shared.plugins.PluginInitializer;
|
||||
import com.android.systemui.shared.plugins.PluginManagerImpl;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Singleton;
|
||||
@@ -25,25 +22,8 @@ import javax.inject.Singleton;
|
||||
/** */
|
||||
@Singleton
|
||||
public class PluginInitializerImpl implements PluginInitializer {
|
||||
|
||||
/**
|
||||
* True if WTFs should lead to crashes
|
||||
*/
|
||||
private static final boolean WTFS_SHOULD_CRASH = false;
|
||||
private boolean mWtfsSet;
|
||||
|
||||
@Inject
|
||||
public PluginInitializerImpl(PluginDependencyProvider dependencyProvider) {
|
||||
dependencyProvider.allowPluginDependency(ActivityStarter.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleWtfs() {
|
||||
if (WTFS_SHOULD_CRASH && !mWtfsSet) {
|
||||
mWtfsSet = true;
|
||||
Log.setWtfHandler((tag, what, system) -> {
|
||||
throw new PluginManagerImpl.CrashWhilePluginActiveException(what);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user