4/N Remove #handleWtfs from PluginInitializer.

This method never did anything because of the way its member
constants were set.

Bug: 194781951
Test: manual
Change-Id: Icaeaaee28ddcc046252f01e8a9c0442605a93219
This commit is contained in:
Dave Mankoff
2021-08-13 12:21:53 -04:00
parent 0b7ba4662a
commit b07994d29a
3 changed files with 0 additions and 26 deletions

View File

@@ -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);
}

View File

@@ -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();
}

View File

@@ -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);
});
}
}
}