Implement the Copyable interface to PhoneNumberPreferenceController

Change-Id: I70085cffe13047ac808d1bf08a467f693b1d8737
Fixes: 118398321
Test: manual and robotests
This commit is contained in:
Stanley Wang
2018-12-12 15:24:21 +08:00
parent d4dfba4237
commit 3f80d1b64b
7 changed files with 51 additions and 8 deletions

View File

@@ -19,7 +19,7 @@ package com.android.settings.slices;
/**
* Provide the copy ability for preference controller to copy the data to the clipboard.
*/
public interface CopyableSlice {
public interface Copyable {
/**
* Copy the key slice information to the clipboard.
* It is highly recommended to show the toast to notify users when implemented this function.

View File

@@ -185,7 +185,7 @@ public class SliceBroadcastReceiver extends BroadcastReceiver {
final BasePreferenceController controller = getPreferenceController(context, key);
if (!(controller instanceof CopyableSlice)) {
if (!(controller instanceof Copyable)) {
throw new IllegalArgumentException(
"Copyable action passed for a non-copyable key:" + key);
}
@@ -198,7 +198,7 @@ public class SliceBroadcastReceiver extends BroadcastReceiver {
return;
}
((CopyableSlice) controller).copy();
((Copyable) controller).copy();
}
/**

View File

@@ -94,7 +94,7 @@ public class SliceBuilderUtils {
return buildUnavailableSlice(context, sliceData);
}
if (controller instanceof CopyableSlice) {
if (controller instanceof Copyable) {
return buildCopyableSlice(context, sliceData, controller);
}