Loading src/java/com/android/internal/telephony/SubscriptionController.java +38 −0 Original line number Diff line number Diff line Loading @@ -2099,6 +2099,43 @@ public class SubscriptionController extends ISub.Stub { } } /** * Set device to device status sharing preference * @param sharing the sharing preference to set * @param subId * @return the number of records updated */ @Override public int setDeviceToDeviceStatusSharing(int sharing, int subId) { if (DBG) logd("[setDeviceToDeviceStatusSharing]- sharing:" + sharing + " subId:" + subId); enforceModifyPhoneState("setDeviceToDeviceStatusSharing"); // Now that all security checks passes, perform the operation as ourselves. final long identity = Binder.clearCallingIdentity(); try { validateSubId(subId); if (sharing < 0) { if (DBG) logd("[setDeviceToDeviceStatusSharing]- fail"); return -1; } ContentValues value = new ContentValues(1); value.put(SubscriptionManager.D2D_STATUS_SHARING, sharing); if (DBG) logd("[setDeviceToDeviceStatusSharing]- sharing:" + sharing + " set"); int result = updateDatabase(value, subId, true); // Refresh the Cache of Active Subscription Info List refreshCachedActiveSubscriptionInfoList(); notifySubscriptionInfoChanged(); return result; } finally { Binder.restoreCallingIdentity(identity); } } public void syncGroupedSetting(int refSubId) { logd("syncGroupedSetting"); try (Cursor cursor = mContext.getContentResolver().query( Loading Loading @@ -3116,6 +3153,7 @@ public class SubscriptionController extends ISub.Stub { case SubscriptionManager.DATA_ENABLED_OVERRIDE_RULES: case SubscriptionManager.ALLOWED_NETWORK_TYPES: case SubscriptionManager.VOIMS_OPT_IN_STATUS: case SubscriptionManager.D2D_STATUS_SHARING: resultValue = cursor.getString(0); break; default: Loading tests/telephonytests/src/com/android/internal/telephony/FakeTelephonyProvider.java +2 −1 Original line number Diff line number Diff line Loading @@ -115,7 +115,8 @@ public class FakeTelephonyProvider extends MockContentProvider { + Telephony.SimInfo.COLUMN_ALLOWED_NETWORK_TYPES + " BIGINT DEFAULT -1," + Telephony.SimInfo.COLUMN_IMS_RCS_UCE_ENABLED + " INTEGER DEFAULT 0, " + Telephony.SimInfo.COLUMN_RCS_CONFIG + " BLOB," + Telephony.SimInfo.COLUMN_ALLOWED_NETWORK_TYPES_FOR_REASONS + " TEXT" + Telephony.SimInfo.COLUMN_ALLOWED_NETWORK_TYPES_FOR_REASONS + " TEXT," + Telephony.SimInfo.COLUMN_D2D_STATUS_SHARING + " INTEGER DEFAULT 0" + ");"; } Loading Loading
src/java/com/android/internal/telephony/SubscriptionController.java +38 −0 Original line number Diff line number Diff line Loading @@ -2099,6 +2099,43 @@ public class SubscriptionController extends ISub.Stub { } } /** * Set device to device status sharing preference * @param sharing the sharing preference to set * @param subId * @return the number of records updated */ @Override public int setDeviceToDeviceStatusSharing(int sharing, int subId) { if (DBG) logd("[setDeviceToDeviceStatusSharing]- sharing:" + sharing + " subId:" + subId); enforceModifyPhoneState("setDeviceToDeviceStatusSharing"); // Now that all security checks passes, perform the operation as ourselves. final long identity = Binder.clearCallingIdentity(); try { validateSubId(subId); if (sharing < 0) { if (DBG) logd("[setDeviceToDeviceStatusSharing]- fail"); return -1; } ContentValues value = new ContentValues(1); value.put(SubscriptionManager.D2D_STATUS_SHARING, sharing); if (DBG) logd("[setDeviceToDeviceStatusSharing]- sharing:" + sharing + " set"); int result = updateDatabase(value, subId, true); // Refresh the Cache of Active Subscription Info List refreshCachedActiveSubscriptionInfoList(); notifySubscriptionInfoChanged(); return result; } finally { Binder.restoreCallingIdentity(identity); } } public void syncGroupedSetting(int refSubId) { logd("syncGroupedSetting"); try (Cursor cursor = mContext.getContentResolver().query( Loading Loading @@ -3116,6 +3153,7 @@ public class SubscriptionController extends ISub.Stub { case SubscriptionManager.DATA_ENABLED_OVERRIDE_RULES: case SubscriptionManager.ALLOWED_NETWORK_TYPES: case SubscriptionManager.VOIMS_OPT_IN_STATUS: case SubscriptionManager.D2D_STATUS_SHARING: resultValue = cursor.getString(0); break; default: Loading
tests/telephonytests/src/com/android/internal/telephony/FakeTelephonyProvider.java +2 −1 Original line number Diff line number Diff line Loading @@ -115,7 +115,8 @@ public class FakeTelephonyProvider extends MockContentProvider { + Telephony.SimInfo.COLUMN_ALLOWED_NETWORK_TYPES + " BIGINT DEFAULT -1," + Telephony.SimInfo.COLUMN_IMS_RCS_UCE_ENABLED + " INTEGER DEFAULT 0, " + Telephony.SimInfo.COLUMN_RCS_CONFIG + " BLOB," + Telephony.SimInfo.COLUMN_ALLOWED_NETWORK_TYPES_FOR_REASONS + " TEXT" + Telephony.SimInfo.COLUMN_ALLOWED_NETWORK_TYPES_FOR_REASONS + " TEXT," + Telephony.SimInfo.COLUMN_D2D_STATUS_SHARING + " INTEGER DEFAULT 0" + ");"; } Loading