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

Commit 91c69703 authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 6663666 from c0dee7a7 to rvc-qpr1-release

Change-Id: Ifd14545d9a0ee2e8021c69010d66a687bd7e43af
parents 59e3d29a c0dee7a7
Loading
Loading
Loading
Loading
+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;
    }

+0 −1
Original line number Diff line number Diff line
@@ -4801,7 +4801,6 @@ public class Notification implements Parcelable
            contentView.setViewVisibility(R.id.time, View.GONE);
            contentView.setImageViewIcon(R.id.profile_badge, null);
            contentView.setViewVisibility(R.id.profile_badge, View.GONE);
            contentView.setViewVisibility(R.id.alerted_icon, View.GONE);
            mN.mUsesStandardHeader = false;
        }

+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
+11 −0
Original line number Diff line number Diff line
@@ -1900,6 +1900,17 @@ public abstract class NotificationListenerService extends Service {
            mIsBubble = isBubble;
        }

        /**
         * @hide
         */
        public @NonNull Ranking withAudiblyAlertedInfo(@Nullable Ranking previous) {
            if (previous != null && previous.mLastAudiblyAlertedMs > 0
                    && this.mLastAudiblyAlertedMs <= 0) {
                this.mLastAudiblyAlertedMs = previous.mLastAudiblyAlertedMs;
            }
            return this;
        }

        /**
         * @hide
         */
Loading