Merge "Add device config flag to ignore clipboard source package" into tm-qpr-dev am: fb435f4376
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20499567 Change-Id: Ib7f2a92be9363a6f8d39399e8adeef88940fef9a Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -583,6 +583,13 @@ public final class SystemUiDeviceConfigFlags {
|
|||||||
*/
|
*/
|
||||||
public static final String CLIPBOARD_OVERLAY_SHOW_ACTIONS = "clipboard_overlay_show_actions";
|
public static final String CLIPBOARD_OVERLAY_SHOW_ACTIONS = "clipboard_overlay_show_actions";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* (boolean) Whether to ignore the source package for determining whether to use remote copy
|
||||||
|
* behavior in the clipboard UI.
|
||||||
|
*/
|
||||||
|
public static final String CLIPBOARD_IGNORE_REMOTE_COPY_SOURCE =
|
||||||
|
"clipboard_ignore_remote_copy_source";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* (boolean) Whether to combine the broadcasts APPWIDGET_ENABLED and APPWIDGET_UPDATE
|
* (boolean) Whether to combine the broadcasts APPWIDGET_ENABLED and APPWIDGET_UPDATE
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -20,7 +20,10 @@ import android.content.ClipData;
|
|||||||
import android.content.ClipDescription;
|
import android.content.ClipDescription;
|
||||||
import android.content.ComponentName;
|
import android.content.ComponentName;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.os.Build;
|
||||||
|
import android.provider.DeviceConfig;
|
||||||
|
|
||||||
|
import com.android.internal.config.sysui.SystemUiDeviceConfigFlags;
|
||||||
import com.android.systemui.R;
|
import com.android.systemui.R;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
@@ -35,6 +38,12 @@ class ClipboardOverlayUtils {
|
|||||||
if (clipData != null && clipData.getDescription().getExtras() != null
|
if (clipData != null && clipData.getDescription().getExtras() != null
|
||||||
&& clipData.getDescription().getExtras().getBoolean(
|
&& clipData.getDescription().getExtras().getBoolean(
|
||||||
ClipDescription.EXTRA_IS_REMOTE_DEVICE)) {
|
ClipDescription.EXTRA_IS_REMOTE_DEVICE)) {
|
||||||
|
if (Build.isDebuggable() && DeviceConfig.getBoolean(
|
||||||
|
DeviceConfig.NAMESPACE_SYSTEMUI,
|
||||||
|
SystemUiDeviceConfigFlags.CLIPBOARD_IGNORE_REMOTE_COPY_SOURCE,
|
||||||
|
false)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
ComponentName remoteComponent = ComponentName.unflattenFromString(
|
ComponentName remoteComponent = ComponentName.unflattenFromString(
|
||||||
context.getResources().getString(R.string.config_remoteCopyPackage));
|
context.getResources().getString(R.string.config_remoteCopyPackage));
|
||||||
if (remoteComponent != null) {
|
if (remoteComponent != null) {
|
||||||
|
|||||||
Reference in New Issue
Block a user