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

Commit e2fc1055 authored by Jeff Sharkey's avatar Jeff Sharkey Committed by Android (Google) Code Review
Browse files

Merge "Avoid caching services with missing binders."

parents 8eefa048 49ca529a
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -66,6 +66,7 @@ import android.os.Looper;
import android.os.Parcelable;
import android.os.PersistableBundle;
import android.os.RemoteException;
import android.os.ServiceManager.ServiceNotFoundException;
import android.os.StrictMode;
import android.os.SystemProperties;
import android.os.UserHandle;
@@ -5591,7 +5592,11 @@ public class Activity extends ContextThemeWrapper
            return;
        }

        try {
            mSearchManager = new SearchManager(this, null);
        } catch (ServiceNotFoundException e) {
            throw new IllegalStateException(e);
        }
    }

    @Override
+4 −3
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@ import android.os.RemoteException;
import android.os.IBinder;
import android.os.IUserManager;
import android.os.ServiceManager;
import android.os.ServiceManager.ServiceNotFoundException;
import android.os.UserHandle;
import android.os.UserManager;
import android.view.IWindowManager;
@@ -192,12 +193,12 @@ public class KeyguardManager {
    }


    KeyguardManager() {
    KeyguardManager() throws ServiceNotFoundException {
        mWM = WindowManagerGlobal.getWindowManagerService();
        mTrustManager = ITrustManager.Stub.asInterface(
                ServiceManager.getService(Context.TRUST_SERVICE));
                ServiceManager.getServiceOrThrow(Context.TRUST_SERVICE));
        mUserManager = IUserManager.Stub.asInterface(
                ServiceManager.getService(Context.USER_SERVICE));
                ServiceManager.getServiceOrThrow(Context.USER_SERVICE));
    }

    /**
+5 −4
Original line number Diff line number Diff line
@@ -31,6 +31,7 @@ import android.os.Bundle;
import android.os.Handler;
import android.os.RemoteException;
import android.os.ServiceManager;
import android.os.ServiceManager.ServiceNotFoundException;
import android.os.UserHandle;
import android.text.TextUtils;
import android.util.Log;
@@ -536,7 +537,7 @@ public class SearchManager
    /**
     * Reference to the shared system search service.
     */
    private static ISearchManager mService;
    private final ISearchManager mService;

    private final Context mContext;

@@ -547,11 +548,11 @@ public class SearchManager

    private SearchDialog mSearchDialog;

    /*package*/ SearchManager(Context context, Handler handler)  {
    /*package*/ SearchManager(Context context, Handler handler) throws ServiceNotFoundException {
        mContext = context;
        mHandler = handler;
        mService = ISearchManager.Stub.asInterface(
                ServiceManager.getService(Context.SEARCH_SERVICE));
                ServiceManager.getServiceOrThrow(Context.SEARCH_SERVICE));
    }

    /**
@@ -620,7 +621,7 @@ public class SearchManager
            return;
        }

        UiModeManager uiModeManager = new UiModeManager();
        final UiModeManager uiModeManager = mContext.getSystemService(UiModeManager.class);
        // Don't show search dialog on televisions.
        if (uiModeManager.getCurrentModeType() != Configuration.UI_MODE_TYPE_TELEVISION) {
            ensureSearchDialog();
+130 −119

File changed.

Preview size limit exceeded, changes collapsed.

+3 −2
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@ import android.content.Context;
import android.content.res.Configuration;
import android.os.RemoteException;
import android.os.ServiceManager;
import android.os.ServiceManager.ServiceNotFoundException;
import android.util.Log;

import java.lang.annotation.Retention;
@@ -123,9 +124,9 @@ public class UiModeManager {

    private IUiModeManager mService;

    /*package*/ UiModeManager() {
    /*package*/ UiModeManager() throws ServiceNotFoundException {
        mService = IUiModeManager.Stub.asInterface(
                ServiceManager.getService(Context.UI_MODE_SERVICE));
                ServiceManager.getServiceOrThrow(Context.UI_MODE_SERVICE));
    }

    /**
Loading