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

Commit b07994d2 authored by Dave Mankoff's avatar Dave Mankoff
Browse files

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
parent 0b7ba466
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -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);
    }

+0 −5
Original line number Diff line number Diff line
@@ -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();
}
+0 −20
Original line number Diff line number Diff line
@@ -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);
            });
        }
    }
}