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
This commit is contained in:
Jaesung Chung
2017-10-20 10:39:38 +09:00
parent f44efafe75
commit ff50e248e5
3 changed files with 13 additions and 2 deletions

View File

@@ -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>

View File

@@ -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>

View File

@@ -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;
}