summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--packages/SettingsLib/src/com/android/settingslib/mobile/dataservice/DataServiceUtils.java46
-rw-r--r--packages/SettingsLib/src/com/android/settingslib/mobile/dataservice/MobileNetworkDatabase.java14
-rw-r--r--packages/SettingsLib/src/com/android/settingslib/mobile/dataservice/UiccInfoDao.java12
-rw-r--r--packages/SettingsLib/src/com/android/settingslib/mobile/dataservice/UiccInfoEntity.java74
4 files changed, 7 insertions, 139 deletions
diff --git a/packages/SettingsLib/src/com/android/settingslib/mobile/dataservice/DataServiceUtils.java b/packages/SettingsLib/src/com/android/settingslib/mobile/dataservice/DataServiceUtils.java
index 4028b73a2c71..714f9519f378 100644
--- a/packages/SettingsLib/src/com/android/settingslib/mobile/dataservice/DataServiceUtils.java
+++ b/packages/SettingsLib/src/com/android/settingslib/mobile/dataservice/DataServiceUtils.java
@@ -18,9 +18,7 @@ package com.android.settingslib.mobile.dataservice;
import android.telephony.SubscriptionInfo;
import android.telephony.SubscriptionManager;
-import android.telephony.UiccCardInfo;
import android.telephony.UiccPortInfo;
-import android.telephony.UiccSlotInfo;
import android.telephony.UiccSlotMapping;
public class DataServiceUtils {
@@ -71,53 +69,9 @@ public class DataServiceUtils {
public static final String COLUMN_ID = "sudId";
/**
- * The name of the physical slot index column, see
- * {@link UiccSlotMapping#getPhysicalSlotIndex()}.
- */
- public static final String COLUMN_PHYSICAL_SLOT_INDEX = "physicalSlotIndex";
-
- /**
- * The name of the logical slot index column, see
- * {@link UiccSlotMapping#getLogicalSlotIndex()}.
- */
- public static final String COLUMN_LOGICAL_SLOT_INDEX = "logicalSlotIndex";
-
- /**
- * The name of the card ID column, see {@link UiccCardInfo#getCardId()}.
- */
- public static final String COLUMN_CARD_ID = "cardId";
-
- /**
- * The name of the eUICC state column, see {@link UiccCardInfo#isEuicc()}.
- */
- public static final String COLUMN_IS_EUICC = "isEuicc";
-
- /**
- * The name of the multiple enabled profiles supported state column, see
- * {@link UiccCardInfo#isMultipleEnabledProfilesSupported()}.
- */
- public static final String COLUMN_IS_MULTIPLE_ENABLED_PROFILES_SUPPORTED =
- "isMultipleEnabledProfilesSupported";
-
- /**
- * The name of the card state column, see {@link UiccSlotInfo#getCardStateInfo()}.
- */
- public static final String COLUMN_CARD_STATE = "cardState";
-
- /**
- * The name of the removable state column, see {@link UiccSlotInfo#isRemovable()}.
- */
- public static final String COLUMN_IS_REMOVABLE = "isRemovable";
-
- /**
* The name of the active state column, see {@link UiccPortInfo#isActive()}.
*/
public static final String COLUMN_IS_ACTIVE = "isActive";
-
- /**
- * The name of the port index column, see {@link UiccPortInfo#getPortIndex()}.
- */
- public static final String COLUMN_PORT_INDEX = "portIndex";
}
/**
diff --git a/packages/SettingsLib/src/com/android/settingslib/mobile/dataservice/MobileNetworkDatabase.java b/packages/SettingsLib/src/com/android/settingslib/mobile/dataservice/MobileNetworkDatabase.java
index c92204fa1f39..5f7fa278082b 100644
--- a/packages/SettingsLib/src/com/android/settingslib/mobile/dataservice/MobileNetworkDatabase.java
+++ b/packages/SettingsLib/src/com/android/settingslib/mobile/dataservice/MobileNetworkDatabase.java
@@ -19,14 +19,13 @@ package com.android.settingslib.mobile.dataservice;
import android.content.Context;
import android.util.Log;
-import java.util.List;
-import java.util.Objects;
-
import androidx.lifecycle.LiveData;
import androidx.room.Database;
import androidx.room.Room;
import androidx.room.RoomDatabase;
-import androidx.sqlite.db.SupportSQLiteDatabase;
+
+import java.util.List;
+import java.util.Objects;
@Database(entities = {SubscriptionInfoEntity.class, UiccInfoEntity.class,
MobileNetworkInfoEntity.class}, exportSchema = false, version = 1)
@@ -132,13 +131,6 @@ public abstract class MobileNetworkDatabase extends RoomDatabase {
}
/**
- * Query the UICC info by the subscription ID from the UiccInfoEntity table.
- */
- public LiveData<UiccInfoEntity> queryUiccInfoById(String id) {
- return mUiccInfoDao().queryUiccInfoById(id);
- }
-
- /**
* Delete the subscriptionInfo info by the subscription ID from the SubscriptionInfoEntity
* table.
*/
diff --git a/packages/SettingsLib/src/com/android/settingslib/mobile/dataservice/UiccInfoDao.java b/packages/SettingsLib/src/com/android/settingslib/mobile/dataservice/UiccInfoDao.java
index 7e60421d0ab4..90e5189fdf1d 100644
--- a/packages/SettingsLib/src/com/android/settingslib/mobile/dataservice/UiccInfoDao.java
+++ b/packages/SettingsLib/src/com/android/settingslib/mobile/dataservice/UiccInfoDao.java
@@ -16,14 +16,14 @@
package com.android.settingslib.mobile.dataservice;
-import java.util.List;
-
import androidx.lifecycle.LiveData;
import androidx.room.Dao;
import androidx.room.Insert;
import androidx.room.OnConflictStrategy;
import androidx.room.Query;
+import java.util.List;
+
@Dao
public interface UiccInfoDao {
@@ -34,14 +34,6 @@ public interface UiccInfoDao {
+ DataServiceUtils.UiccInfoData.COLUMN_ID)
LiveData<List<UiccInfoEntity>> queryAllUiccInfos();
- @Query("SELECT * FROM " + DataServiceUtils.UiccInfoData.TABLE_NAME + " WHERE "
- + DataServiceUtils.UiccInfoData.COLUMN_ID + " = :subId")
- LiveData<UiccInfoEntity> queryUiccInfoById(String subId);
-
- @Query("SELECT * FROM " + DataServiceUtils.UiccInfoData.TABLE_NAME + " WHERE "
- + DataServiceUtils.UiccInfoData.COLUMN_IS_EUICC + " = :isEuicc")
- LiveData<List<UiccInfoEntity>> queryUiccInfosByEuicc(boolean isEuicc);
-
@Query("SELECT COUNT(*) FROM " + DataServiceUtils.UiccInfoData.TABLE_NAME)
int count();
diff --git a/packages/SettingsLib/src/com/android/settingslib/mobile/dataservice/UiccInfoEntity.java b/packages/SettingsLib/src/com/android/settingslib/mobile/dataservice/UiccInfoEntity.java
index 2ccf295007dc..0f80edf52d80 100644
--- a/packages/SettingsLib/src/com/android/settingslib/mobile/dataservice/UiccInfoEntity.java
+++ b/packages/SettingsLib/src/com/android/settingslib/mobile/dataservice/UiccInfoEntity.java
@@ -26,20 +26,9 @@ import androidx.room.PrimaryKey;
@Entity(tableName = DataServiceUtils.UiccInfoData.TABLE_NAME)
public class UiccInfoEntity {
- public UiccInfoEntity(@NonNull String subId, @NonNull String physicalSlotIndex,
- int logicalSlotIndex, int cardId, boolean isEuicc,
- boolean isMultipleEnabledProfilesSupported, int cardState, boolean isRemovable,
- boolean isActive, int portIndex) {
+ public UiccInfoEntity(@NonNull String subId, boolean isActive) {
this.subId = subId;
- this.physicalSlotIndex = physicalSlotIndex;
- this.logicalSlotIndex = logicalSlotIndex;
- this.cardId = cardId;
- this.isEuicc = isEuicc;
- this.isMultipleEnabledProfilesSupported = isMultipleEnabledProfilesSupported;
- this.cardState = cardState;
- this.isRemovable = isRemovable;
this.isActive = isActive;
- this.portIndex = portIndex;
}
@PrimaryKey
@@ -47,48 +36,14 @@ public class UiccInfoEntity {
@NonNull
public String subId;
- @ColumnInfo(name = DataServiceUtils.UiccInfoData.COLUMN_PHYSICAL_SLOT_INDEX)
- @NonNull
- public String physicalSlotIndex;
-
- @ColumnInfo(name = DataServiceUtils.UiccInfoData.COLUMN_LOGICAL_SLOT_INDEX)
- public int logicalSlotIndex;
-
- @ColumnInfo(name = DataServiceUtils.UiccInfoData.COLUMN_CARD_ID)
- public int cardId;
-
- @ColumnInfo(name = DataServiceUtils.UiccInfoData.COLUMN_IS_EUICC)
- public boolean isEuicc;
-
- @ColumnInfo(name = DataServiceUtils.UiccInfoData.COLUMN_IS_MULTIPLE_ENABLED_PROFILES_SUPPORTED)
- public boolean isMultipleEnabledProfilesSupported;
-
- @ColumnInfo(name = DataServiceUtils.UiccInfoData.COLUMN_CARD_STATE)
- public int cardState;
-
- @ColumnInfo(name = DataServiceUtils.UiccInfoData.COLUMN_IS_REMOVABLE)
- public boolean isRemovable;
-
@ColumnInfo(name = DataServiceUtils.UiccInfoData.COLUMN_IS_ACTIVE)
public boolean isActive;
- @ColumnInfo(name = DataServiceUtils.UiccInfoData.COLUMN_PORT_INDEX)
- public int portIndex;
-
-
@Override
public int hashCode() {
int result = 17;
result = 31 * result + subId.hashCode();
- result = 31 * result + physicalSlotIndex.hashCode();
- result = 31 * result + logicalSlotIndex;
- result = 31 * result + cardId;
- result = 31 * result + Boolean.hashCode(isEuicc);
- result = 31 * result + Boolean.hashCode(isMultipleEnabledProfilesSupported);
- result = 31 * result + cardState;
- result = 31 * result + Boolean.hashCode(isRemovable);
result = 31 * result + Boolean.hashCode(isActive);
- result = 31 * result + portIndex;
return result;
}
@@ -102,40 +57,15 @@ public class UiccInfoEntity {
}
UiccInfoEntity info = (UiccInfoEntity) obj;
- return TextUtils.equals(subId, info.subId)
- && TextUtils.equals(physicalSlotIndex, info.physicalSlotIndex)
- && logicalSlotIndex == info.logicalSlotIndex
- && cardId == info.cardId
- && isEuicc == info.isEuicc
- && isMultipleEnabledProfilesSupported == info.isMultipleEnabledProfilesSupported
- && cardState == info.cardState
- && isRemovable == info.isRemovable
- && isActive == info.isActive
- && portIndex == info.portIndex;
+ return TextUtils.equals(subId, info.subId) && isActive == info.isActive;
}
public String toString() {
StringBuilder builder = new StringBuilder();
builder.append(" {UiccInfoEntity(subId = ")
.append(subId)
- .append(", logicalSlotIndex = ")
- .append(physicalSlotIndex)
- .append(", logicalSlotIndex = ")
- .append(logicalSlotIndex)
- .append(", cardId = ")
- .append(cardId)
- .append(", isEuicc = ")
- .append(isEuicc)
- .append(", isMultipleEnabledProfilesSupported = ")
- .append(isMultipleEnabledProfilesSupported)
- .append(", cardState = ")
- .append(cardState)
- .append(", isRemovable = ")
- .append(isRemovable)
.append(", isActive = ")
.append(isActive)
- .append(", portIndex = ")
- .append(portIndex)
.append(")}");
return builder.toString();
}