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

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

Snap for 6029402 from 659f477f to qt-qpr2-release

Change-Id: I332e425d7b140a045297bb47cbb83c0934e389e8
parents fbdabc4d 659f477f
Loading
Loading
Loading
Loading
+58 −0
Original line number Diff line number Diff line
@@ -321,6 +321,7 @@ message Atom {
            218  [(log_from_module) = "permissioncontroller"];
        ExclusionRectStateChanged exclusion_rect_state_changed = 223;
        BackGesture back_gesture_reported_reported = 224;
        VmsClientConnectionStateChanged vms_client_connection_state_changed = 230;
    }

    // Pulled events will start at field 10000.
@@ -388,6 +389,7 @@ message Atom {
        CoolingDevice cooling_device = 10059;
        AppOps app_ops = 10060;
        ProcessSystemIonHeapSize process_system_ion_heap_size = 10061;
        VmsClientStats vms_client_stats = 10065;
    }

    // DO NOT USE field numbers above 100,000 in AOSP.
@@ -3708,6 +3710,33 @@ message RoleRequestResultReported {
    optional Result result = 9;
}

/**
 * Logs when a Vehicle Maps Service client's connection state has changed
 *
 * Logged from:
 *   packages/services/Car/service/src/com/android/car/stats/VmsClientLog.java
 */
message VmsClientConnectionStateChanged {
    // The UID of the VMS client app
    optional int32 uid = 1 [(is_uid) = true];

    enum State {
        UNKNOWN = 0;
        // Attempting to connect to the client
        CONNECTING = 1;
        // Client connection established
        CONNECTED = 2;
        // Client connection closed unexpectedly
        DISCONNECTED = 3;
        // Client connection closed by VMS
        TERMINATED = 4;
        // Error establishing the client connection
        CONNECTION_ERROR = 5;
    }

    optional State state  = 2;
}

//////////////////////////////////////////////////////////////////////
// Pulled atoms below this line //
//////////////////////////////////////////////////////////////////////
@@ -6819,3 +6848,32 @@ message PermissionAppsFragmentViewed {
    }
    optional Category category = 6;
}

/**
 * Pulls client metrics on data transferred via Vehicle Maps Service.
 * Metrics are keyed by uid + layer.
 *
 * Pulled from:
 *   packages/services/Car/service/src/com/android/car/stats/CarStatsService.java
 */
message VmsClientStats {
    // UID of the VMS client app
    optional int32 uid = 1 [(is_uid) = true];

    // VMS layer definition
    optional int32 layer_type = 2;
    optional int32 layer_channel = 3;
    optional int32 layer_version = 4;

    // Bytes and packets sent by the client for the layer
    optional int64 tx_bytes = 5;
    optional int64 tx_packets = 6;

    // Bytes and packets received by the client for the layer
    optional int64 rx_bytes = 7;
    optional int64 rx_packets = 8;

    // Bytes and packets dropped due to client error
    optional int64 dropped_bytes = 9;
    optional int64 dropped_packets = 10;
}
+346 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2019 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package android.app;

import android.annotation.NonNull;
import android.content.ComponentName;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
import android.os.IBinder;
import android.os.ParcelFileDescriptor;
import android.util.Log;

import java.io.IOException;
import java.io.InputStream;

/**
 * A no-op implementation of {@link WallpaperManager}.
 */
final class DisabledWallpaperManager extends WallpaperManager {

    private static final String TAG = DisabledWallpaperManager.class.getSimpleName();

    // Don't need to worry about synchronization
    private static DisabledWallpaperManager sInstance;

    // TODO(b/138939803): STOPSHIP changed to false and/or remove it
    private static final boolean DEBUG = true;

    @NonNull
    static DisabledWallpaperManager getInstance() {
        if (sInstance == null) {
            sInstance = new DisabledWallpaperManager();
        }
        return sInstance;
    }

    private DisabledWallpaperManager() {
        super(null, null, null);
    }

    @Override
    public boolean isWallpaperSupported() {
        return false;
    }

    @Override
    public boolean isSetWallpaperAllowed() {
        return false;
    }

    // TODO(b/138939803): STOPSHIP methods below should not be necessary,
    // callers should check if isWallpaperSupported(), consider removing them to keep this class
    // simpler

    private static <T> T unsupported() {
        if (DEBUG) Log.w(TAG, "unsupported method called; returning null", new Exception());
        return null;
    }

    private static boolean unsupportedBoolean() {
        if (DEBUG) Log.w(TAG, "unsupported method called; returning false", new Exception());
        return false;
    }

    @Override
    public Drawable getDrawable() {
        return unsupported();
    }

    @Override
    public Drawable getBuiltInDrawable() {
        return unsupported();
    }

    @Override
    public Drawable getBuiltInDrawable(int which) {
        return unsupported();
    }

    @Override
    public Drawable getBuiltInDrawable(int outWidth, int outHeight, boolean scaleToFit,
            float horizontalAlignment, float verticalAlignment) {
        return unsupported();
    }

    @Override
    public Drawable getBuiltInDrawable(int outWidth, int outHeight, boolean scaleToFit,
            float horizontalAlignment, float verticalAlignment, int which) {
        return unsupported();
    }

    @Override
    public Drawable peekDrawable() {
        return unsupported();
    }

    @Override
    public Drawable getFastDrawable() {
        return unsupported();
    }

    @Override
    public Drawable peekFastDrawable() {
        return unsupported();
    }

    @Override
    public Bitmap getBitmap() {
        return unsupported();
    }

    @Override
    public Bitmap getBitmap(boolean hardware) {
        return unsupported();
    }

    @Override
    public Bitmap getBitmapAsUser(int userId, boolean hardware) {
        return unsupported();
    }

    @Override
    public ParcelFileDescriptor getWallpaperFile(int which) {
        return unsupported();
    }

    @Override
    public void addOnColorsChangedListener(OnColorsChangedListener listener, Handler handler) {
        unsupported();
    }

    @Override
    public void addOnColorsChangedListener(OnColorsChangedListener listener, Handler handler,
            int userId) {
        unsupported();
    }

    @Override
    public void removeOnColorsChangedListener(OnColorsChangedListener callback) {
        unsupported();
    }

    @Override
    public void removeOnColorsChangedListener(OnColorsChangedListener callback, int userId) {
        unsupported();
    }

    @Override
    public WallpaperColors getWallpaperColors(int which) {
        return unsupported();
    }

    @Override
    public WallpaperColors getWallpaperColors(int which, int userId) {
        return unsupported();
    }

    @Override
    public ParcelFileDescriptor getWallpaperFile(int which, int userId) {
        return unsupported();
    }

    @Override
    public void forgetLoadedWallpaper() {
        unsupported();
    }

    @Override
    public WallpaperInfo getWallpaperInfo() {
        return unsupported();
    }

    @Override
    public WallpaperInfo getWallpaperInfo(int userId) {
        return unsupported();
    }

    @Override
    public int getWallpaperId(int which) {
        return unsupported();
    }

    @Override
    public int getWallpaperIdForUser(int which, int userId) {
        return unsupported();
    }

    @Override
    public Intent getCropAndSetWallpaperIntent(Uri imageUri) {
        return unsupported();
    }

    @Override
    public void setResource(int resid) throws IOException {
        unsupported();
    }

    @Override
    public int setResource(int resid, int which) throws IOException {
        return unsupported();
    }

    @Override
    public void setBitmap(Bitmap bitmap) throws IOException {
        unsupported();
    }

    @Override
    public int setBitmap(Bitmap fullImage, Rect visibleCropHint, boolean allowBackup)
            throws IOException {
        return unsupported();
    }

    @Override
    public int setBitmap(Bitmap fullImage, Rect visibleCropHint, boolean allowBackup, int which)
            throws IOException {
        return unsupported();
    }

    @Override
    public int setBitmap(Bitmap fullImage, Rect visibleCropHint, boolean allowBackup, int which,
            int userId) throws IOException {
        return unsupported();
    }

    @Override
    public void setStream(InputStream bitmapData) throws IOException {
        unsupported();
    }

    @Override
    public int setStream(InputStream bitmapData, Rect visibleCropHint, boolean allowBackup)
            throws IOException {
        return unsupported();
    }

    @Override
    public int setStream(InputStream bitmapData, Rect visibleCropHint, boolean allowBackup,
            int which) throws IOException {
        return unsupported();
    }

    @Override
    public boolean hasResourceWallpaper(int resid) {
        return unsupportedBoolean();
    }

    @Override
    public int getDesiredMinimumWidth() {
        return unsupported();
    }

    @Override
    public int getDesiredMinimumHeight() {
        return unsupported();
    }

    @Override
    public void suggestDesiredDimensions(int minimumWidth, int minimumHeight) {
        unsupported();
    }

    @Override
    public void setDisplayPadding(Rect padding) {
        unsupported();
    }

    @Override
    public void setDisplayOffset(IBinder windowToken, int x, int y) {
        unsupported();
    }

    @Override
    public void clearWallpaper() {
        unsupported();
    }

    @Override
    public void clearWallpaper(int which, int userId) {
        unsupported();
    }

    @Override
    public boolean setWallpaperComponent(ComponentName name) {
        return unsupportedBoolean();
    }

    @Override
    public boolean setWallpaperComponent(ComponentName name, int userId) {
        return unsupportedBoolean();
    }

    @Override
    public void setWallpaperOffsets(IBinder windowToken, float xOffset, float yOffset) {
        unsupported();
    }

    @Override
    public void setWallpaperOffsetSteps(float xStep, float yStep) {
        unsupported();
    }

    @Override
    public void sendWallpaperCommand(IBinder windowToken, String action, int x, int y, int z,
            Bundle extras) {
        unsupported();
    }

    @Override
    public void clearWallpaperOffsets(IBinder windowToken) {
        unsupported();
    }

    @Override
    public void clear() throws IOException {
        unsupported();
    }

    @Override
    public void clear(int which) throws IOException {
        unsupported();
    }

    @Override
    public boolean isWallpaperBackupEligible(int which) {
        return unsupportedBoolean();
    }
}
+5 −0
Original line number Diff line number Diff line
@@ -61,4 +61,9 @@ interface IUiModeManager {
     * Tells if Night mode is locked or not.
     */
    boolean isNightModeLocked();

    /**
    * @hide
    */
    boolean setNightModeActivated(boolean active);
}
+3 −3
Original line number Diff line number Diff line
@@ -1657,7 +1657,7 @@ public class NotificationManager {
        @Override
        public int hashCode() {
            return Objects.hash(priorityCategories, priorityCallSenders, priorityMessageSenders,
                    suppressedVisualEffects);
                    suppressedVisualEffects, state);
        }

        @Override
@@ -1669,10 +1669,10 @@ public class NotificationManager {
                    && other.priorityCallSenders == priorityCallSenders
                    && other.priorityMessageSenders == priorityMessageSenders
                    && suppressedVisualEffectsEqual(suppressedVisualEffects,
                    other.suppressedVisualEffects);
                    other.suppressedVisualEffects)
                    && other.state == this.state;
        }


        private boolean suppressedVisualEffectsEqual(int suppressedEffects,
                int otherSuppressedVisualEffects) {
            if (suppressedEffects == otherSuppressedVisualEffects) {
+16 −5
Original line number Diff line number Diff line
@@ -694,11 +694,22 @@ final class SystemServiceRegistry {
            @Override
            public WallpaperManager createService(ContextImpl ctx)
                    throws ServiceNotFoundException {
                final IBinder b;
                final IBinder b = ServiceManager.getService(Context.WALLPAPER_SERVICE);
                if (b == null) {
                    // There are 2 reason service can be null:
                    // 1.Device doesn't support it - that's fine
                    // 2.App is running on instant mode - should fail
                    final boolean enabled = Resources.getSystem()
                            .getBoolean(com.android.internal.R.bool.config_enableWallpaperService);
                    if (!enabled) {
                        // Life moves on...
                        return DisabledWallpaperManager.getInstance();
                    }
                    if (ctx.getApplicationInfo().targetSdkVersion >= Build.VERSION_CODES.P) {
                    b = ServiceManager.getServiceOrThrow(Context.WALLPAPER_SERVICE);
                } else {
                    b = ServiceManager.getService(Context.WALLPAPER_SERVICE);
                        // Instant app
                        throw new ServiceNotFoundException(Context.WALLPAPER_SERVICE);
                    }
                    // Bad state - WallpaperManager methods will throw exception
                }
                IWallpaperManager service = IWallpaperManager.Stub.asInterface(b);
                return new WallpaperManager(service, ctx.getOuterContext(),
Loading