Add D2D sharing level setting APIs.
Test: unit test, cts test Bug: 163085177 Change-Id: I86f88d68c8629a0329dcde7b2d17928cacec37e7 Merged-In: I86f88d68c8629a0329dcde7b2d17928cacec37e7
This commit is contained in:
@@ -40794,6 +40794,7 @@ package android.telephony {
|
||||
method public static int getDefaultSmsSubscriptionId();
|
||||
method public static int getDefaultSubscriptionId();
|
||||
method public static int getDefaultVoiceSubscriptionId();
|
||||
method public int getDeviceToDeviceStatusSharing(int);
|
||||
method @NonNull @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public java.util.List<android.telephony.SubscriptionInfo> getOpportunisticSubscriptions();
|
||||
method public static int getSlotIndex(int);
|
||||
method @Nullable public int[] getSubscriptionIds(int);
|
||||
@@ -40806,6 +40807,7 @@ package android.telephony {
|
||||
method public void removeOnOpportunisticSubscriptionsChangedListener(@NonNull android.telephony.SubscriptionManager.OnOpportunisticSubscriptionsChangedListener);
|
||||
method public void removeOnSubscriptionsChangedListener(android.telephony.SubscriptionManager.OnSubscriptionsChangedListener);
|
||||
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void removeSubscriptionsFromGroup(@NonNull java.util.List<java.lang.Integer>, @NonNull android.os.ParcelUuid);
|
||||
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setDeviceToDeviceStatusSharing(int, int);
|
||||
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean setOpportunistic(boolean, int);
|
||||
method public void setSubscriptionOverrideCongested(int, boolean, long);
|
||||
method public void setSubscriptionOverrideCongested(int, boolean, @NonNull int[], long);
|
||||
@@ -40817,6 +40819,11 @@ package android.telephony {
|
||||
field public static final String ACTION_DEFAULT_SUBSCRIPTION_CHANGED = "android.telephony.action.DEFAULT_SUBSCRIPTION_CHANGED";
|
||||
field public static final String ACTION_MANAGE_SUBSCRIPTION_PLANS = "android.telephony.action.MANAGE_SUBSCRIPTION_PLANS";
|
||||
field public static final String ACTION_REFRESH_SUBSCRIPTION_PLANS = "android.telephony.action.REFRESH_SUBSCRIPTION_PLANS";
|
||||
field public static final int D2D_SHARING_ALL = 3; // 0x3
|
||||
field public static final int D2D_SHARING_ALL_CONTACTS = 1; // 0x1
|
||||
field public static final int D2D_SHARING_DISABLED = 0; // 0x0
|
||||
field public static final int D2D_SHARING_STARRED_CONTACTS = 2; // 0x2
|
||||
field public static final String D2D_STATUS_SHARING = "d2d_sharing_status";
|
||||
field public static final int DATA_ROAMING_DISABLE = 0; // 0x0
|
||||
field public static final int DATA_ROAMING_ENABLE = 1; // 0x1
|
||||
field public static final int DEFAULT_SUBSCRIPTION_ID = 2147483647; // 0x7fffffff
|
||||
|
||||
@@ -5327,5 +5327,12 @@ public final class Telephony {
|
||||
* @hide
|
||||
*/
|
||||
public static final String COLUMN_RCS_CONFIG = "rcs_config";
|
||||
|
||||
/**
|
||||
* TelephonyProvider column name for device to device sharing status.
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
public static final String COLUMN_D2D_STATUS_SHARING = "d2d_sharing_status";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -581,6 +581,43 @@ public class SubscriptionManager {
|
||||
})
|
||||
public @interface SimDisplayNameSource {}
|
||||
|
||||
/**
|
||||
* Device status is not shared to a remote party.
|
||||
*/
|
||||
public static final int D2D_SHARING_DISABLED = 0;
|
||||
|
||||
/**
|
||||
* Device status is shared with all numbers in the user's contacts.
|
||||
*/
|
||||
public static final int D2D_SHARING_ALL_CONTACTS = 1;
|
||||
|
||||
/**
|
||||
* Device status is shared with all starred contacts.
|
||||
*/
|
||||
public static final int D2D_SHARING_STARRED_CONTACTS = 2;
|
||||
|
||||
/**
|
||||
* Device status is shared whenever possible.
|
||||
*/
|
||||
public static final int D2D_SHARING_ALL = 3;
|
||||
|
||||
/** @hide */
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
@IntDef(prefix = {"D2D_SHARING_"},
|
||||
value = {
|
||||
D2D_SHARING_DISABLED,
|
||||
D2D_SHARING_ALL_CONTACTS,
|
||||
D2D_SHARING_STARRED_CONTACTS,
|
||||
D2D_SHARING_ALL
|
||||
})
|
||||
public @interface DeviceToDeviceStatusSharing {}
|
||||
|
||||
/**
|
||||
* TelephonyProvider column name for device to device sharing status.
|
||||
* <P>Type: INTEGER (int)</P>
|
||||
*/
|
||||
public static final String D2D_STATUS_SHARING = SimInfo.COLUMN_D2D_STATUS_SHARING;
|
||||
|
||||
/**
|
||||
* TelephonyProvider column name for the color of a SIM.
|
||||
* <P>Type: INTEGER (int)</P>
|
||||
@@ -3356,6 +3393,36 @@ public class SubscriptionManager {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the device to device status sharing user preference for a subscription ID. The setting
|
||||
* app uses this method to indicate with whom they wish to share device to device status
|
||||
* information.
|
||||
* @param sharing the status sharing preference
|
||||
* @param subId the unique Subscription ID in database
|
||||
*/
|
||||
@RequiresPermission(Manifest.permission.MODIFY_PHONE_STATE)
|
||||
public void setDeviceToDeviceStatusSharing(@DeviceToDeviceStatusSharing int sharing,
|
||||
int subId) {
|
||||
if (VDBG) {
|
||||
logd("[setDeviceToDeviceStatusSharing] + sharing: " + sharing + " subId: " + subId);
|
||||
}
|
||||
setSubscriptionPropertyHelper(subId, "setDeviceToDeviceSharingStatus",
|
||||
(iSub)->iSub.setDeviceToDeviceStatusSharing(sharing, subId));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the user-chosen device to device status sharing preference
|
||||
* @param subId Subscription id of subscription
|
||||
* @return The device to device status sharing preference
|
||||
*/
|
||||
public @DeviceToDeviceStatusSharing int getDeviceToDeviceStatusSharing(int subId) {
|
||||
if (VDBG) {
|
||||
logd("[getDeviceToDeviceStatusSharing] + subId: " + subId);
|
||||
}
|
||||
return getIntegerSubscriptionProperty(subId, D2D_STATUS_SHARING, D2D_SHARING_DISABLED,
|
||||
mContext);
|
||||
}
|
||||
|
||||
/**
|
||||
* DO NOT USE.
|
||||
* This API is designed for features that are not finished at this point. Do not call this API.
|
||||
|
||||
@@ -300,4 +300,6 @@ interface ISub {
|
||||
boolean canDisablePhysicalSubscription();
|
||||
|
||||
int setUiccApplicationsEnabled(boolean enabled, int subscriptionId);
|
||||
|
||||
int setDeviceToDeviceStatusSharing(int sharing, int subId);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user