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

Commit 7936df08 authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 6664334 from 27b403d4 to rvc-release

Change-Id: Ic176fe08bf54755237bbd647bbbeb052801f1446
parents 47db357e 27b403d4
Loading
Loading
Loading
Loading
+13 −1
Original line number Diff line number Diff line
@@ -68,6 +68,8 @@ public final class Telecom extends BaseCommand {
    private static final String COMMAND_UNREGISTER_PHONE_ACCOUNT = "unregister-phone-account";
    private static final String COMMAND_SET_DEFAULT_DIALER = "set-default-dialer";
    private static final String COMMAND_GET_DEFAULT_DIALER = "get-default-dialer";
    private static final String COMMAND_STOP_BLOCK_SUPPRESSION = "stop-block-suppression";

    /**
     * Change the system dialer package name if a package name was specified,
     * Example: adb shell telecom set-system-dialer <PACKAGE>
@@ -115,6 +117,8 @@ public final class Telecom extends BaseCommand {
                + "usage: telecom set-sim-count <COUNT>\n"
                + "usage: telecom get-sim-config\n"
                + "usage: telecom get-max-phones\n"
                + "usage: telecom stop-block-suppression: Stop suppressing the blocked number"
                        + " provider after a call to emergency services.\n"
                + "usage: telecom set-emer-phone-account-filter <PACKAGE>\n"
                + "\n"
                + "telecom set-phone-account-enabled: Enables the given phone account, if it has"
@@ -207,6 +211,9 @@ public final class Telecom extends BaseCommand {
            case COMMAND_UNREGISTER_PHONE_ACCOUNT:
                runUnregisterPhoneAccount();
                break;
            case COMMAND_STOP_BLOCK_SUPPRESSION:
                runStopBlockSuppression();
                break;
            case COMMAND_SET_DEFAULT_DIALER:
                runSetDefaultDialer();
                break;
@@ -324,8 +331,13 @@ public final class Telecom extends BaseCommand {
        System.out.println("Success - " + handle + " unregistered.");
    }

    private void runStopBlockSuppression() throws RemoteException {
        mTelecomService.stopBlockSuppression();
    }

    private void runSetDefaultDialer() throws RemoteException {
        final String packageName = nextArgRequired();
        String packageName = nextArg();
        if ("default".equals(packageName)) packageName = null;
        mTelecomService.setTestDefaultDialer(packageName);
        System.out.println("Success - " + packageName + " set as override default dialer.");
    }
+22 −17
Original line number Diff line number Diff line
@@ -1900,26 +1900,31 @@ class ContextImpl extends Context {

    @Override
    public Object getSystemService(String name) {
        if (vmIncorrectContextUseEnabled()) {
            // We may override this API from outer context.
        final boolean isUiContext = isUiContext() || getOuterContext().isUiContext();
            final boolean isUiContext = isUiContext() || isOuterUiContext();
            // Check incorrect Context usage.
        if (isUiComponent(name) && !isUiContext && vmIncorrectContextUseEnabled()) {
            if (isUiComponent(name) && !isUiContext) {
                final String errorMessage = "Tried to access visual service "
                        + SystemServiceRegistry.getSystemServiceClassName(name)
                        + " from a non-visual Context:" + getOuterContext();
            final String message = "Visual services, such as WindowManager, WallpaperService or "
                    + "LayoutInflater should be accessed from Activity or other visual Context. "
                    + "Use an Activity or a Context created with "
                    + "Context#createWindowContext(int, Bundle), which are adjusted to the "
                    + "configuration and visual bounds of an area on screen.";
                final String message = "Visual services, such as WindowManager, WallpaperService "
                        + "or LayoutInflater should be accessed from Activity or other visual "
                        + "Context. Use an Activity or a Context created with "
                        + "Context#createWindowContext(int, Bundle), which are adjusted to "
                        + "the configuration and visual bounds of an area on screen.";
                final Exception exception = new IllegalAccessException(errorMessage);
                StrictMode.onIncorrectContextUsed(message, exception);
            Log.e(TAG, errorMessage + message, exception);
                Log.e(TAG, errorMessage + " " + message, exception);
            }
        }

        return SystemServiceRegistry.getSystemService(this, name);
    }

    private boolean isOuterUiContext() {
        return getOuterContext() != null && getOuterContext().isUiContext();
    }

    @Override
    public String getSystemServiceName(Class<?> serviceClass) {
        return SystemServiceRegistry.getSystemServiceName(serviceClass);
@@ -2371,7 +2376,7 @@ class ContextImpl extends Context {
        context.setResources(createResources(mToken, mPackageInfo, mSplitName, displayId,
                overrideConfiguration, getDisplayAdjustments(displayId).getCompatibilityInfo(),
                mResources.getLoaders()));
        context.mIsUiContext = isUiContext() || getOuterContext().isUiContext();
        context.mIsUiContext = isUiContext() || isOuterUiContext();
        return context;
    }

+3 −0
Original line number Diff line number Diff line
@@ -1151,6 +1151,9 @@ public class ContextWrapper extends Context {
     */
    @Override
    public boolean isUiContext() {
        if (mBase == null) {
            return false;
        }
        return mBase.isUiContext();
    }
}
+1 −2
Original line number Diff line number Diff line
@@ -4666,8 +4666,7 @@ public abstract class PackageManager {
     * Marks an application exempt from having its permissions be automatically revoked when
     * the app is unused for an extended period of time.
     *
     * Only the installer on record that installed the given package, or a holder of
     * {@code WHITELIST_AUTO_REVOKE_PERMISSIONS} is allowed to call this.
     * Only the installer on record that installed the given package is allowed to call this.
     *
     * Packages start in whitelisted state, and it is the installer's responsibility to
     * un-whitelist the packages it installs, unless auto-revoking permissions from that package
+5 −0
Original line number Diff line number Diff line
@@ -149,6 +149,11 @@ class InlineSuggestionSession {
     */
    @MainThread
    void invalidate() {
        try {
            mCallback.onInlineSuggestionsSessionInvalidated();
        } catch (RemoteException e) {
            Log.w(TAG, "onInlineSuggestionsSessionInvalidated() remote exception:" + e);
        }
        if (mResponseCallback != null) {
            consumeInlineSuggestionsResponse(EMPTY_RESPONSE);
            mResponseCallback.invalidate();
Loading