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

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

Revert "4/N Remove #handleWtfs from PluginInitializer."

Revert submission 15560568-b194781951-flags-8

Reason for revert: Broken build.
Reverted Changes:
Ie522ae3cc:5/N Remove PluginInitializer entirely.
Icaeaaee28:4/N Remove #handleWtfs from PluginInitializer.
I1c86c246c:3/N Remove #getPrivilegedPlugins from PluginInitia...
Id525f27e3:2/N Rename PluginInstanceManager to PluginActionMa...

Change-Id: Ia5f864646ee8806ec4080349dda3d71c827c1e40
parent 12d8e155
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -212,6 +212,7 @@ 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);
    }

+5 −0
Original line number Diff line number Diff line
@@ -18,4 +18,9 @@ package com.android.systemui.shared.plugins;
 * Provides necessary components for initializing {@link PluginManagerImpl}.
 */
public interface PluginInitializer {

    /**
     * Called from {@link PluginActionManager}.
     */
    void handleWtfs();
}
+20 −0
Original line number Diff line number Diff line
@@ -14,7 +14,10 @@

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;
@@ -22,8 +25,25 @@ 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);
            });
        }
    }
}