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

Commit ff50e248 authored by Jaesung Chung's avatar Jaesung Chung
Browse files

Make media projection permission dialog configurable

This CL introduces the new config_mediaProjectPermissionDialogComponent
symbol to specify the dialog component of media project permission
dialog. With this CL, IoT devices will be able to use the other dialog
in the IoT system UI app instead of the default dialog in the system UI
app.

Bug: 65864256
Test: android.view.cts.SurfaceViewSyncTest
Change-Id: I0684372757a00ddf173fc16e4a29f1e181cc1e8f
parent f44efafe
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -3128,4 +3128,7 @@
    <!-- Class names of device specific services inheriting com.android.server.SystemService. The
         classes are instantiated in the order of the array. -->
    <string-array translatable="false" name="config_deviceSpecificSystemServices"></string-array>

    <!-- Component name of media projection permission dialog -->
    <string name="config_mediaProjectionPermissionDialogComponent" translateable="false">com.android.systemui/com.android.systemui.media.MediaProjectionPermissionActivity</string>
</resources>
+3 −0
Original line number Diff line number Diff line
@@ -3124,4 +3124,7 @@
  <java-symbol type="string" name="shortcut_restore_not_supported" />
  <java-symbol type="string" name="shortcut_restore_signature_mismatch" />
  <java-symbol type="string" name="shortcut_restore_unknown_issue" />

  <!-- From media projection -->
  <java-symbol type="string" name="config_mediaProjectionPermissionDialogComponent" />
</resources>
+7 −2
Original line number Diff line number Diff line
@@ -20,8 +20,10 @@ import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.SystemService;
import android.app.Activity;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.media.projection.IMediaProjection;
import android.os.Handler;
import android.os.IBinder;
@@ -71,8 +73,11 @@ public final class MediaProjectionManager {
     */
    public Intent createScreenCaptureIntent() {
        Intent i = new Intent();
        i.setClassName("com.android.systemui",
                "com.android.systemui.media.MediaProjectionPermissionActivity");
        final ComponentName mediaProjectionPermissionDialogComponent =
                ComponentName.unflattenFromString(mContext.getResources().getString(
                        com.android.internal.R.string
                        .config_mediaProjectionPermissionDialogComponent));
        i.setComponent(mediaProjectionPermissionDialogComponent);
        return i;
    }