diff options
author | Wink Saville <wink@google.com> | 2014-11-22 10:08:16 -0800 |
---|---|---|
committer | Wink Saville <wink@google.com> | 2014-11-22 10:08:16 -0800 |
commit | d09c4cad65c708f2c4810d24295456708a2000d2 (patch) | |
tree | 27dd308bdb4d662a149287a7cc168770a065a992 /telephony/java/com | |
parent | 85f463c5b59350fa4c4a05007f8a7b65a9a89da3 (diff) | |
download | frameworks_base-d09c4cad65c708f2c4810d24295456708a2000d2.zip frameworks_base-d09c4cad65c708f2c4810d24295456708a2000d2.tar.gz frameworks_base-d09c4cad65c708f2c4810d24295456708a2000d2.tar.bz2 |
Additional changes to SubscriptionManager API as per API council.
bug: 17575308
Change-Id: Idd98aa46c15a9219ccf28091c62602ac8bf16c62
Diffstat (limited to 'telephony/java/com')
3 files changed, 70 insertions, 26 deletions
diff --git a/telephony/java/com/android/internal/telephony/IOnSubscriptionsChangedListener.aidl b/telephony/java/com/android/internal/telephony/IOnSubscriptionsChangedListener.aidl new file mode 100644 index 0000000..493b1ff --- /dev/null +++ b/telephony/java/com/android/internal/telephony/IOnSubscriptionsChangedListener.aidl @@ -0,0 +1,22 @@ +/* + * Copyright (C) 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.internal.telephony; + +oneway interface IOnSubscriptionsChangedListener { + void onSubscriptionsChanged(); +} + diff --git a/telephony/java/com/android/internal/telephony/ISub.aidl b/telephony/java/com/android/internal/telephony/ISub.aidl index d82c492..ca82083 100755 --- a/telephony/java/com/android/internal/telephony/ISub.aidl +++ b/telephony/java/com/android/internal/telephony/ISub.aidl @@ -22,51 +22,71 @@ import com.android.internal.telephony.ISubscriptionListener; interface ISub { /** - * Get the SubscriptionInfo according to an index - * @param subId The unique SubscriptionInfo index in database - * @return SubscriptionInfo, maybe null + * @return a list of all subscriptions in the database, this includes + * all subscriptions that have been seen. */ - SubscriptionInfo getSubInfoForSubscriber(int subId); + List<SubscriptionInfo> getAllSubInfoList(); /** - * Get the SubscriptionInfo according to an IccId - * @param iccId the IccId of SIM card - * @return SubscriptionInfo, maybe null + * @return the count of all subscriptions in the database, this includes + * all subscriptions that have been seen. */ - List<SubscriptionInfo> getSubInfoUsingIccId(String iccId); + int getAllSubInfoCount(); /** - * Get the SubscriptionInfo according to slotId - * @param slotId the slot which the SIM is inserted - * @return SubscriptionInfo, maybe null + * Get the active SubscriptionInfo with the subId key + * @param subId The unique SubscriptionInfo key in database + * @return SubscriptionInfo, maybe null if its not active */ - List<SubscriptionInfo> getSubInfoUsingSlotId(int slotId); + SubscriptionInfo getActiveSubscriptionInfo(int subId); /** - * Get all the SubscriptionInfo(s) in subinfo database - * @return Array list of all SubInfoRecords in database, include thsoe that were inserted before + * Get the active SubscriptionInfo associated with the iccId + * @param iccId the IccId of SIM card + * @return SubscriptionInfo, maybe null if its not active */ - List<SubscriptionInfo> getAllSubInfoList(); + SubscriptionInfo getActiveSubscriptionInfoForIccId(String iccId); /** - * Get the SubscriptionInfo(s) of the currently inserted SIM(s) - * @return Array list of currently inserted SubscriptionInfo(s) + * Get the active SubscriptionInfo associated with the slotIdx + * @param slotIdx the slot which the subscription is inserted + * @return SubscriptionInfo, maybe null if its not active */ - List<SubscriptionInfo> getActiveSubInfoList(); + SubscriptionInfo getActiveSubscriptionInfoForSimSlotIndex(int slotIdx); /** - * Get the SUB count of all SUB(s) in subinfo database - * @return all SIM count in database, include what was inserted before + * Get the SubscriptionInfo(s) of the active subscriptions. The records will be sorted + * by {@link SubscriptionInfo#getSimSlotIndex} then by {@link SubscriptionInfo#getSubscriptionId}. + * + * @return Sorted list of the currently {@link SubscriptionInfo} records available on the device. + * <ul> + * <li> + * If null is returned the current state is unknown but if a {@link OnSubscriptionsChangedListener} + * has been registered {@link OnSubscriptionsChangedListener#onSubscriptionsChanged} will be + * invoked in the future. + * </li> + * <li> + * If the list is empty then there are no {@link SubscriptionInfo} records currently available. + * </li> + * <li> + * if the list is non-empty the list is sorted by {@link SubscriptionInfo#getSimSlotIndex} + * then by {@link SubscriptionInfo#getSubscriptionId}. + * </li> + * </ul> */ - int getAllSubInfoCount(); + List<SubscriptionInfo> getActiveSubscriptionInfoList(); /** - * Get the count of active SUB(s) - * @return active SIM count + * @return the number of active subscriptions */ int getActiveSubInfoCount(); /** + * @return the maximum number of subscriptions this device will support at any one time. + */ + int getActiveSubInfoCountMax(); + + /** * Add a new SubscriptionInfo to subinfo database if needed * @param iccId the IccId of the SIM card * @param slotId the slot which the SIM is inserted diff --git a/telephony/java/com/android/internal/telephony/ITelephonyRegistry.aidl b/telephony/java/com/android/internal/telephony/ITelephonyRegistry.aidl index 1a1f8fe..ba62f5f 100644 --- a/telephony/java/com/android/internal/telephony/ITelephonyRegistry.aidl +++ b/telephony/java/com/android/internal/telephony/ITelephonyRegistry.aidl @@ -27,11 +27,13 @@ import android.telephony.SignalStrength; import android.telephony.CellInfo; import android.telephony.VoLteServiceState; import com.android.internal.telephony.IPhoneStateListener; -import com.android.internal.telephony.ISubscriptionListener; +import com.android.internal.telephony.IOnSubscriptionsChangedListener; interface ITelephonyRegistry { - void registerSubscriptionListener(String pkg, ISubscriptionListener callback, int events); - void unregisterSubscriptionListener(String pkg, ISubscriptionListener callback); + void registerOnSubscriptionsChangedListener(String pkg, + IOnSubscriptionsChangedListener callback); + void unregisterOnSubscriptionsChangedListener(String pkg, + IOnSubscriptionsChangedListener callback); void listen(String pkg, IPhoneStateListener callback, int events, boolean notifyNow); void listenForSubscriber(in int subId, String pkg, IPhoneStateListener callback, int events, boolean notifyNow); |