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

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

Snap for 6285821 from 3e8ad0c6 to qt-qpr3-release

Change-Id: Ie882d21b44ec9cd44f87ed2605f58a85d07c3cc8
parents 0bc88674 3e8ad0c6
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -287,7 +287,8 @@ interface IActivityManager {
    void handleApplicationStrictModeViolation(in IBinder app, int penaltyMask,
            in StrictMode.ViolationInfo crashInfo);
    boolean isTopActivityImmersive();
    void crashApplication(int uid, int initialPid, in String packageName, int userId, in String message);
    void crashApplication(int uid, int initialPid, in String packageName, int userId,
            in String message, boolean force);
    @UnsupportedAppUsage
    String getProviderMimeType(in Uri uri, int userId);
    // Cause the specified process to dump the specified heap.
+9 −7
Original line number Diff line number Diff line
@@ -26,18 +26,18 @@ import android.content.res.Resources;
import android.hardware.display.DisplayManager;
import android.hardware.display.DisplayManager.DisplayListener;
import android.os.Binder;
import android.os.Handler;
import android.os.IBinder;
import android.os.Message;
import android.util.DisplayMetrics;
import android.util.Log;
import android.util.TypedValue;
import android.view.ContextThemeWrapper;
import android.view.Display;
import android.view.Gravity;
import android.view.Window;
import android.view.WindowManager;
import android.view.WindowManagerImpl;
import android.os.Handler;
import android.os.Message;
import android.util.DisplayMetrics;
import android.util.Log;
import android.util.TypedValue;

/**
 * Base class for presentations.
@@ -116,7 +116,9 @@ import android.util.TypedValue;
 * The display manager keeps track of all displays in the system.  However, not all
 * displays are appropriate for showing presentations.  For example, if an activity
 * attempted to show a presentation on the main display it might obscure its own content
 * (it's like opening a dialog on top of your activity).
 * (it's like opening a dialog on top of your activity).  Creating a presentation on the main
 * display will result in {@link android.view.WindowManager.InvalidDisplayException} being thrown
 * when invoking {@link #show()}.
 * </p><p>
 * Here's how to identify suitable displays for showing presentations using
 * {@link DisplayManager#getDisplays(String)} and the
@@ -243,7 +245,7 @@ public class Presentation extends Dialog {
    /**
     * Inherited from {@link Dialog#show}. Will throw
     * {@link android.view.WindowManager.InvalidDisplayException} if the specified secondary
     * {@link Display} can't be found.
     * {@link Display} can't be found or if it does not have {@link Display#FLAG_PRESENTATION} set.
     */
    @Override
    public void show() {
+85 −0
Original line number Diff line number Diff line
@@ -701,6 +701,33 @@ public final class CameraManager {
        public void onCameraAccessPrioritiesChanged() {
            // default empty implementation
        }

        /**
         * A camera device has been opened by an application.
         *
         * <p>The default implementation of this method does nothing.</p>
         *
         * @param cameraId The unique identifier of the new camera.
         * @param packageId The package Id of the application opening the camera.
         *
         * @see #onCameraClosed
         */
        /** @hide */
        public void onCameraOpened(@NonNull String cameraId, @NonNull String packageId) {
            // default empty implementation
        }

        /**
         * A previously-opened camera has been closed.
         *
         * <p>The default implementation of this method does nothing.</p>
         *
         * @param cameraId The unique identifier of the closed camera.
         */
        /** @hide */
        public void onCameraClosed(@NonNull String cameraId) {
            // default empty implementation
        }
    }

    /**
@@ -1139,6 +1166,38 @@ public final class CameraManager {
            }
        }

        private void postSingleCameraOpenedUpdate(final AvailabilityCallback callback,
                final Executor executor, final String id, final String packageId) {
            final long ident = Binder.clearCallingIdentity();
            try {
                executor.execute(
                    new Runnable() {
                        @Override
                        public void run() {
                            callback.onCameraOpened(id, packageId);
                        }
                    });
            } finally {
                Binder.restoreCallingIdentity(ident);
            }
        }

        private void postSingleCameraClosedUpdate(final AvailabilityCallback callback,
                final Executor executor, final String id) {
            final long ident = Binder.clearCallingIdentity();
            try {
                executor.execute(
                    new Runnable() {
                        @Override
                        public void run() {
                            callback.onCameraClosed(id);
                        }
                    });
            } finally {
                Binder.restoreCallingIdentity(ident);
            }
        }

        private void postSingleUpdate(final AvailabilityCallback callback, final Executor executor,
                final String id, final int status) {
            if (isAvailable(status)) {
@@ -1401,6 +1460,32 @@ public final class CameraManager {
            }
        }

        @Override
        public void onCameraOpened(String cameraId, String clientPackageId) {
            synchronized (mLock) {
                final int callbackCount = mCallbackMap.size();
                for (int i = 0; i < callbackCount; i++) {
                    Executor executor = mCallbackMap.valueAt(i);
                    final AvailabilityCallback callback = mCallbackMap.keyAt(i);

                    postSingleCameraOpenedUpdate(callback, executor, cameraId, clientPackageId);
                }
            }
        }

        @Override
        public void onCameraClosed(String cameraId) {
            synchronized (mLock) {
                final int callbackCount = mCallbackMap.size();
                for (int i = 0; i < callbackCount; i++) {
                    Executor executor = mCallbackMap.valueAt(i);
                    final AvailabilityCallback callback = mCallbackMap.keyAt(i);

                    postSingleCameraClosedUpdate(callback, executor, cameraId);
                }
            }
        }

        /**
         * Try to connect to camera service after some delay if any client registered camera
         * availability callback or torch status callback.
+8 −0
Original line number Diff line number Diff line
@@ -1267,6 +1267,14 @@
        android:description="@string/permdesc_camera"
        android:protectionLevel="dangerous|instant" />

    <!-- Allows receiving the camera service notifications when a camera is opened
            (by a certain application package) or closed.
        @hide -->
    <permission android:name="android.permission.CAMERA_OPEN_CLOSE_LISTENER"
        android:permissionGroup="android.permission-group.UNDEFINED"
        android:label="@string/permlab_cameraOpenCloseListener"
        android:description="@string/permdesc_cameraOpenCloseListener"
        android:protectionLevel="signature" />

    <!-- ====================================================================== -->
    <!-- Permissions for accessing the device sensors                           -->
+5 −0
Original line number Diff line number Diff line
@@ -1151,6 +1151,11 @@
    <!-- Description of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
    <string name="permdesc_camera">This app can take pictures and record videos using the camera at any time.</string>

    <!-- Title of an application permission, listed so the user can choose whether they want to allow the application to do this. [CHAR_LIMIT=NONE] -->
    <string name="permlab_cameraOpenCloseListener">Allow an application or service to receive callbacks about camera devices being opened or closed.</string>
    <!-- Description of an application permission, listed so the user can choose whether they want to allow the application to do this. [CHAR_LIMIT=NONE] -->
    <string name="permdesc_cameraOpenCloseListener">This signature app can receive callbacks when any camera device is being opened (by what application package) or closed.</string>

    <!-- Title of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
    <string name="permlab_vibrate">control vibration</string>
    <!-- Description of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
Loading