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

Commit 63f5ad1d authored by Antony Sargent's avatar Antony Sargent Committed by Automerger Merge Worker
Browse files

Merge "Warn the user when a streamed app requests authentication" into udc-dev...

Merge "Warn the user when a streamed app requests authentication" into udc-dev am: 4ebdfbb3 am: f9e46b38

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/23030616



Change-Id: I59cdc4a1dcc03f6c4f9e433e9a4eecbed6cc8ff5
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 7a45029d f9e46b38
Loading
Loading
Loading
Loading
+3 −3
Original line number Original line Diff line number Diff line
@@ -5398,11 +5398,11 @@
    <string name="app_streaming_blocked_message" product="tablet">This can’t be accessed on your <xliff:g id="device" example="Chromebook">%1$s</xliff:g> at this time. Try on your tablet instead.</string>
    <string name="app_streaming_blocked_message" product="tablet">This can’t be accessed on your <xliff:g id="device" example="Chromebook">%1$s</xliff:g> at this time. Try on your tablet instead.</string>
    <!-- Message shown when an app is blocked from being streamed to a remote device. [CHAR LIMIT=NONE] -->
    <!-- Message shown when an app is blocked from being streamed to a remote device. [CHAR LIMIT=NONE] -->
    <string name="app_streaming_blocked_message" product="default">This can’t be accessed on your <xliff:g id="device" example="Chromebook">%1$s</xliff:g> at this time. Try on your phone instead.</string>
    <string name="app_streaming_blocked_message" product="default">This can’t be accessed on your <xliff:g id="device" example="Chromebook">%1$s</xliff:g> at this time. Try on your phone instead.</string>
    <!-- Message shown when the fingerprint permission is blocked from being streamed to a remote device. [CHAR LIMIT=NONE] -->
    <!-- Message shown when an app being streamed to another device requests authentication such as via the biometrics API, and the user needs to complete the on their device. [CHAR LIMIT=NONE] -->
    <string name="app_streaming_blocked_message_for_fingerprint_dialog" product="tv">This app is requesting additional security. Try on your Android TV device instead.</string>
    <string name="app_streaming_blocked_message_for_fingerprint_dialog" product="tv">This app is requesting additional security. Try on your Android TV device instead.</string>
    <!-- Message shown when the fingerprint permission is blocked from being streamed to a remote device. [CHAR LIMIT=NONE] -->
    <!-- Message shown when an app being streamed to another device requests authentication such as via the biometrics API, and the user needs to complete the on their device. [CHAR LIMIT=NONE] -->
    <string name="app_streaming_blocked_message_for_fingerprint_dialog" product="tablet">This app is requesting additional security. Try on your tablet instead.</string>
    <string name="app_streaming_blocked_message_for_fingerprint_dialog" product="tablet">This app is requesting additional security. Try on your tablet instead.</string>
    <!-- Message shown when the fingerprint permission is blocked from being streamed to a remote device. [CHAR LIMIT=NONE] -->
    <!-- Message shown when an app being streamed to another device requests authentication such as via the biometrics API, and the user needs to complete the on their device. [CHAR LIMIT=NONE] -->
    <string name="app_streaming_blocked_message_for_fingerprint_dialog" product="default">This app is requesting additional security. Try on your phone instead.</string>
    <string name="app_streaming_blocked_message_for_fingerprint_dialog" product="default">This app is requesting additional security. Try on your phone instead.</string>
    <!-- Message shown when the settings is blocked from being streamed to a remote device. [CHAR LIMIT=NONE] -->
    <!-- Message shown when the settings is blocked from being streamed to a remote device. [CHAR LIMIT=NONE] -->
    <string name="app_streaming_blocked_message_for_settings_dialog" product="tv">This can’t be accessed on your <xliff:g id="device" example="Chromebook">%1$s</xliff:g>. Try on your Android TV device instead.</string>
    <string name="app_streaming_blocked_message_for_settings_dialog" product="tv">This can’t be accessed on your <xliff:g id="device" example="Chromebook">%1$s</xliff:g>. Try on your Android TV device instead.</string>
+14 −1
Original line number Original line Diff line number Diff line
@@ -55,6 +55,7 @@ import android.util.SparseArray;
import android.view.Display;
import android.view.Display;
import android.widget.Toast;
import android.widget.Toast;


import com.android.internal.R;
import com.android.internal.annotations.GuardedBy;
import com.android.internal.annotations.GuardedBy;
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.util.DumpUtils;
import com.android.internal.util.DumpUtils;
@@ -156,7 +157,7 @@ public class VirtualDeviceManagerService extends SystemService {
            VirtualDeviceImpl virtualDevice = virtualDevicesSnapshot.get(i);
            VirtualDeviceImpl virtualDevice = virtualDevicesSnapshot.get(i);
            virtualDevice.showToastWhereUidIsRunning(appUid,
            virtualDevice.showToastWhereUidIsRunning(appUid,
                    getContext().getString(
                    getContext().getString(
                            com.android.internal.R.string.vdm_camera_access_denied,
                            R.string.vdm_camera_access_denied,
                            virtualDevice.getDisplayName()),
                            virtualDevice.getDisplayName()),
                    Toast.LENGTH_LONG, Looper.myLooper());
                    Toast.LENGTH_LONG, Looper.myLooper());
        }
        }
@@ -621,6 +622,18 @@ public class VirtualDeviceManagerService extends SystemService {
            }
            }
        }
        }


        @Override
        public void onAuthenticationPrompt(int uid) {
            synchronized (mVirtualDeviceManagerLock) {
                for (int i = 0; i < mVirtualDevices.size(); i++) {
                    VirtualDeviceImpl device = mVirtualDevices.valueAt(i);
                    device.showToastWhereUidIsRunning(uid,
                            R.string.app_streaming_blocked_message_for_fingerprint_dialog,
                            Toast.LENGTH_LONG, Looper.getMainLooper());
                }
            }
        }

        @Override
        @Override
        public int getBaseVirtualDisplayFlags(IVirtualDevice virtualDevice) {
        public int getBaseVirtualDisplayFlags(IVirtualDevice virtualDevice) {
            return ((VirtualDeviceImpl) virtualDevice).getBaseVirtualDisplayFlags();
            return ((VirtualDeviceImpl) virtualDevice).getBaseVirtualDisplayFlags();
+6 −0
Original line number Original line Diff line number Diff line
@@ -70,6 +70,7 @@ import com.android.internal.R;
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.util.ArrayUtils;
import com.android.internal.util.ArrayUtils;
import com.android.server.SystemService;
import com.android.server.SystemService;
import com.android.server.companion.virtual.VirtualDeviceManagerInternal;


import java.util.ArrayList;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Arrays;
@@ -262,6 +263,11 @@ public class AuthService extends SystemService {


            final long identity = Binder.clearCallingIdentity();
            final long identity = Binder.clearCallingIdentity();
            try {
            try {
                VirtualDeviceManagerInternal vdm = getLocalService(
                        VirtualDeviceManagerInternal.class);
                if (vdm != null) {
                    vdm.onAuthenticationPrompt(callingUid);
                }
                return mBiometricService.authenticate(
                return mBiometricService.authenticate(
                        token, sessionId, userId, receiver, opPackageName, promptInfo);
                        token, sessionId, userId, receiver, opPackageName, promptInfo);
            } finally {
            } finally {
+11 −0
Original line number Original line Diff line number Diff line
@@ -91,6 +91,7 @@ import com.android.server.biometrics.sensors.LockoutTracker;
import com.android.server.biometrics.sensors.fingerprint.aidl.FingerprintProvider;
import com.android.server.biometrics.sensors.fingerprint.aidl.FingerprintProvider;
import com.android.server.biometrics.sensors.fingerprint.hidl.Fingerprint21;
import com.android.server.biometrics.sensors.fingerprint.hidl.Fingerprint21;
import com.android.server.biometrics.sensors.fingerprint.hidl.Fingerprint21UdfpsMock;
import com.android.server.biometrics.sensors.fingerprint.hidl.Fingerprint21UdfpsMock;
import com.android.server.companion.virtual.VirtualDeviceManagerInternal;


import com.google.android.collect.Lists;
import com.google.android.collect.Lists;


@@ -329,6 +330,16 @@ public class FingerprintService extends SystemService {
                    return -1;
                    return -1;
                }
                }
            }
            }
            final long identity2 = Binder.clearCallingIdentity();
            try {
                VirtualDeviceManagerInternal vdm = getLocalService(
                        VirtualDeviceManagerInternal.class);
                if (vdm != null) {
                    vdm.onAuthenticationPrompt(callingUid);
                }
            } finally {
                Binder.restoreCallingIdentity(identity2);
            }
            return provider.second.scheduleAuthenticate(token, operationId,
            return provider.second.scheduleAuthenticate(token, operationId,
                    0 /* cookie */, new ClientMonitorCallbackConverter(receiver), options,
                    0 /* cookie */, new ClientMonitorCallbackConverter(receiver), options,
                    restricted, statsClient, isKeyguard);
                    restricted, statsClient, isKeyguard);
+5 −0
Original line number Original line Diff line number Diff line
@@ -69,6 +69,11 @@ public abstract class VirtualDeviceManagerInternal {
     */
     */
    public abstract void onAppsOnVirtualDeviceChanged();
    public abstract void onAppsOnVirtualDeviceChanged();


    /**
     * Notifies that an authentication prompt is about to be shown for an app with the given uid.
     */
    public abstract void onAuthenticationPrompt(int uid);

    /**
    /**
     * Gets the owner uid for a deviceId.
     * Gets the owner uid for a deviceId.
     *
     *
Loading