Loading src/java/com/android/internal/telephony/SubscriptionInfoUpdater.java +8 −1 Original line number Diff line number Diff line Loading @@ -122,6 +122,13 @@ public class SubscriptionInfoUpdater extends Handler { public SubscriptionInfoUpdater( Looper looper, Context context, Phone[] phone, CommandsInterface[] ci) { this(looper, context, phone, ci, IPackageManager.Stub.asInterface(ServiceManager.getService("package"))); } @VisibleForTesting public SubscriptionInfoUpdater( Looper looper, Context context, Phone[] phone, CommandsInterface[] ci, IPackageManager packageMgr) { super(looper); logd("Constructor invoked"); Loading @@ -129,7 +136,7 @@ public class SubscriptionInfoUpdater extends Handler { mPhone = phone; mSubscriptionManager = SubscriptionManager.from(mContext); mEuiccManager = (EuiccManager) mContext.getSystemService(Context.EUICC_SERVICE); mPackageManager = IPackageManager.Stub.asInterface(ServiceManager.getService("package")); mPackageManager = packageMgr; mCarrierServiceBindHelper = new CarrierServiceBindHelper(mContext); initializeCarrierApps(); Loading src/java/com/android/internal/telephony/imsphone/ImsPhoneConnection.java +3 −0 Original line number Diff line number Diff line Loading @@ -458,6 +458,9 @@ public class ImsPhoneConnection extends Connection implements Rlog.d(LOG_TAG, "onDisconnect: no parent"); } synchronized (this) { if (mRttTextHandler != null) { mRttTextHandler.tearDown(); } if (mImsCall != null) mImsCall.close(); mImsCall = null; } Loading src/java/com/android/internal/telephony/imsphone/ImsRttTextHandler.java +9 −7 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ import android.telephony.Rlog; import com.android.internal.annotations.VisibleForTesting; import java.io.IOException; import java.nio.channels.ClosedByInterruptException; import java.util.concurrent.CountDownLatch; public class ImsRttTextHandler extends Handler { Loading Loading @@ -79,17 +80,16 @@ public class ImsRttTextHandler extends Handler { String charsReceived; try { charsReceived = mReaderThreadRttTextStream.read(); } catch (ClosedByInterruptException e) { Rlog.i(LOG_TAG, "RttReaderThread - Thread interrupted. Finishing."); break; } catch (IOException e) { Rlog.e(LOG_TAG, "RttReaderThread - IOException encountered " + "reading from in-call: %s", e); "reading from in-call: ", e); obtainMessage(TEARDOWN).sendToTarget(); break; } if (charsReceived == null) { if (Thread.currentThread().isInterrupted()) { Rlog.i(LOG_TAG, "RttReaderThread - Thread interrupted. Finishing."); break; } Rlog.e(LOG_TAG, "RttReaderThread - Stream closed unexpectedly. Attempt to " + "reinitialize."); obtainMessage(TEARDOWN).sendToTarget(); Loading Loading @@ -145,7 +145,7 @@ public class ImsRttTextHandler extends Handler { int numCodepointsBuffered = mBufferedTextToNetwork .codePointCount(0, mBufferedTextToNetwork.length()); if (numCodepointsBuffered >= MAX_BUFFERED_CHARACTER_COUNT) { sendMessageAtFrontOfQueue(obtainMessage(ATTEMPT_SEND_TO_NETWORK)); sendMessage(obtainMessage(ATTEMPT_SEND_TO_NETWORK)); } else { sendEmptyMessageDelayed( ATTEMPT_SEND_TO_NETWORK, MAX_BUFFERING_DELAY_MILLIS); Loading Loading @@ -175,12 +175,13 @@ public class ImsRttTextHandler extends Handler { case EXPIRE_SENT_CODEPOINT_COUNT: mCodepointsAvailableForTransmission += msg.arg1; if (mCodepointsAvailableForTransmission > 0) { sendMessageAtFrontOfQueue(obtainMessage(ATTEMPT_SEND_TO_NETWORK)); sendMessage(obtainMessage(ATTEMPT_SEND_TO_NETWORK)); } break; case TEARDOWN: try { if (mReaderThread != null) { mReaderThread.interrupt(); mReaderThread.join(1000); } } catch (InterruptedException e) { Loading @@ -202,6 +203,7 @@ public class ImsRttTextHandler extends Handler { } public void initialize(Connection.RttTextStream rttTextStream) { Rlog.i(LOG_TAG, "Initializing: " + this); obtainMessage(INITIALIZE, rttTextStream).sendToTarget(); } Loading src/java/com/android/internal/telephony/uicc/UiccCarrierPrivilegeRules.java +2 −1 Original line number Diff line number Diff line Loading @@ -312,7 +312,8 @@ public class UiccCarrierPrivilegeRules extends Handler { // gained carrier privileges (as an indication that a matching SIM has been inserted). PackageInfo pInfo = packageManager.getPackageInfo(packageName, PackageManager.GET_SIGNATURES | PackageManager.MATCH_DISABLED_UNTIL_USED_COMPONENTS); | PackageManager.MATCH_DISABLED_UNTIL_USED_COMPONENTS | PackageManager.MATCH_HIDDEN_UNTIL_INSTALLED_COMPONENTS); return getCarrierPrivilegeStatus(pInfo); } catch (PackageManager.NameNotFoundException ex) { log("Package " + packageName + " not found for carrier privilege status check"); Loading tests/telephonytests/src/com/android/internal/telephony/CarrierAppUtilsTest.java +251 −163 File changed.Preview size limit exceeded, changes collapsed. Show changes Loading
src/java/com/android/internal/telephony/SubscriptionInfoUpdater.java +8 −1 Original line number Diff line number Diff line Loading @@ -122,6 +122,13 @@ public class SubscriptionInfoUpdater extends Handler { public SubscriptionInfoUpdater( Looper looper, Context context, Phone[] phone, CommandsInterface[] ci) { this(looper, context, phone, ci, IPackageManager.Stub.asInterface(ServiceManager.getService("package"))); } @VisibleForTesting public SubscriptionInfoUpdater( Looper looper, Context context, Phone[] phone, CommandsInterface[] ci, IPackageManager packageMgr) { super(looper); logd("Constructor invoked"); Loading @@ -129,7 +136,7 @@ public class SubscriptionInfoUpdater extends Handler { mPhone = phone; mSubscriptionManager = SubscriptionManager.from(mContext); mEuiccManager = (EuiccManager) mContext.getSystemService(Context.EUICC_SERVICE); mPackageManager = IPackageManager.Stub.asInterface(ServiceManager.getService("package")); mPackageManager = packageMgr; mCarrierServiceBindHelper = new CarrierServiceBindHelper(mContext); initializeCarrierApps(); Loading
src/java/com/android/internal/telephony/imsphone/ImsPhoneConnection.java +3 −0 Original line number Diff line number Diff line Loading @@ -458,6 +458,9 @@ public class ImsPhoneConnection extends Connection implements Rlog.d(LOG_TAG, "onDisconnect: no parent"); } synchronized (this) { if (mRttTextHandler != null) { mRttTextHandler.tearDown(); } if (mImsCall != null) mImsCall.close(); mImsCall = null; } Loading
src/java/com/android/internal/telephony/imsphone/ImsRttTextHandler.java +9 −7 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ import android.telephony.Rlog; import com.android.internal.annotations.VisibleForTesting; import java.io.IOException; import java.nio.channels.ClosedByInterruptException; import java.util.concurrent.CountDownLatch; public class ImsRttTextHandler extends Handler { Loading Loading @@ -79,17 +80,16 @@ public class ImsRttTextHandler extends Handler { String charsReceived; try { charsReceived = mReaderThreadRttTextStream.read(); } catch (ClosedByInterruptException e) { Rlog.i(LOG_TAG, "RttReaderThread - Thread interrupted. Finishing."); break; } catch (IOException e) { Rlog.e(LOG_TAG, "RttReaderThread - IOException encountered " + "reading from in-call: %s", e); "reading from in-call: ", e); obtainMessage(TEARDOWN).sendToTarget(); break; } if (charsReceived == null) { if (Thread.currentThread().isInterrupted()) { Rlog.i(LOG_TAG, "RttReaderThread - Thread interrupted. Finishing."); break; } Rlog.e(LOG_TAG, "RttReaderThread - Stream closed unexpectedly. Attempt to " + "reinitialize."); obtainMessage(TEARDOWN).sendToTarget(); Loading Loading @@ -145,7 +145,7 @@ public class ImsRttTextHandler extends Handler { int numCodepointsBuffered = mBufferedTextToNetwork .codePointCount(0, mBufferedTextToNetwork.length()); if (numCodepointsBuffered >= MAX_BUFFERED_CHARACTER_COUNT) { sendMessageAtFrontOfQueue(obtainMessage(ATTEMPT_SEND_TO_NETWORK)); sendMessage(obtainMessage(ATTEMPT_SEND_TO_NETWORK)); } else { sendEmptyMessageDelayed( ATTEMPT_SEND_TO_NETWORK, MAX_BUFFERING_DELAY_MILLIS); Loading Loading @@ -175,12 +175,13 @@ public class ImsRttTextHandler extends Handler { case EXPIRE_SENT_CODEPOINT_COUNT: mCodepointsAvailableForTransmission += msg.arg1; if (mCodepointsAvailableForTransmission > 0) { sendMessageAtFrontOfQueue(obtainMessage(ATTEMPT_SEND_TO_NETWORK)); sendMessage(obtainMessage(ATTEMPT_SEND_TO_NETWORK)); } break; case TEARDOWN: try { if (mReaderThread != null) { mReaderThread.interrupt(); mReaderThread.join(1000); } } catch (InterruptedException e) { Loading @@ -202,6 +203,7 @@ public class ImsRttTextHandler extends Handler { } public void initialize(Connection.RttTextStream rttTextStream) { Rlog.i(LOG_TAG, "Initializing: " + this); obtainMessage(INITIALIZE, rttTextStream).sendToTarget(); } Loading
src/java/com/android/internal/telephony/uicc/UiccCarrierPrivilegeRules.java +2 −1 Original line number Diff line number Diff line Loading @@ -312,7 +312,8 @@ public class UiccCarrierPrivilegeRules extends Handler { // gained carrier privileges (as an indication that a matching SIM has been inserted). PackageInfo pInfo = packageManager.getPackageInfo(packageName, PackageManager.GET_SIGNATURES | PackageManager.MATCH_DISABLED_UNTIL_USED_COMPONENTS); | PackageManager.MATCH_DISABLED_UNTIL_USED_COMPONENTS | PackageManager.MATCH_HIDDEN_UNTIL_INSTALLED_COMPONENTS); return getCarrierPrivilegeStatus(pInfo); } catch (PackageManager.NameNotFoundException ex) { log("Package " + packageName + " not found for carrier privilege status check"); Loading
tests/telephonytests/src/com/android/internal/telephony/CarrierAppUtilsTest.java +251 −163 File changed.Preview size limit exceeded, changes collapsed. Show changes