Trampoline SMS disambig dialog to Telephony

SmsManager used to display a "select default SMS
subscription" dialog every time SmsManager was used
and no default SMS subscription was set. This change
fixes the following issues:
1_ getSubscriptionId no longer pops up a disambig
dialog.
2) The disambig dialog no longer sets the
default, rather it waits for the response from the
user and performs the operation when it receives
a response.
2a) Dialogs can no longer be created from background
services, so we now have a restriction that if
the disambig dialog is shown via a background service,
we will use phone 0 as default (backwards compat for
apps targeting <Q) or fail (on apps targeting Q+).
3) If there is only one active subscription, use that
to perform the operation on MSIM devices instead of
asking and only displaying the one active subscription.
4) Certain non "user-facing" APIs that are used by
carrier apps no longer will pop up a UI.

Bug: 131713446
Bug: 130853716
Bug: 129141025

Test: run SmsManagerTestApp; atest TelephonyFrameworksTests

Change-Id: I6be1c6d7bf6b6ee614b6a7d0369147e3b1890588
This commit is contained in:
Brad Ebinger
2019-04-30 11:37:27 -07:00
parent fa82dddcf6
commit 360415aa13
4 changed files with 851 additions and 100 deletions

View File

@@ -602,6 +602,7 @@ java_defaults {
"telephony/java/com/android/ims/ImsConfigListener.aidl",
"telephony/java/com/android/internal/telephony/IApnSourceService.aidl",
"telephony/java/com/android/internal/telephony/ICarrierConfigLoader.aidl",
"telephony/java/com/android/internal/telephony/IIntegerConsumer.aidl",
"telephony/java/com/android/internal/telephony/IMms.aidl",
"telephony/java/com/android/internal/telephony/INumberVerificationCallback.aidl",
"telephony/java/com/android/internal/telephony/IOnSubscriptionsChangedListener.aidl",

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,23 @@
/*
* Copyright (C) 2019 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;
// Copies consumer pattern for an operation that requires an integer result from another process to
// finish.
oneway interface IIntegerConsumer {
void accept(int result);
}

View File

@@ -18,6 +18,7 @@ package com.android.internal.telephony;
import android.app.PendingIntent;
import android.content.Intent;
import android.content.IntentSender;
import android.os.Bundle;
import android.os.IBinder;
import android.os.Messenger;
@@ -52,6 +53,7 @@ import android.telephony.ims.aidl.IImsRegistration;
import android.telephony.ims.aidl.IImsRegistrationCallback;
import com.android.ims.internal.IImsServiceFeatureCallback;
import com.android.internal.telephony.CellNetworkScanResult;
import com.android.internal.telephony.IIntegerConsumer;
import com.android.internal.telephony.INumberVerificationCallback;
import com.android.internal.telephony.OperatorInfo;
@@ -1970,4 +1972,10 @@ interface ITelephony {
boolean isDataEnabledForApn(int apnType, int subId, String callingPackage);
boolean isApnMetered(int apnType, int subId);
/**
* Enqueue a pending sms Consumer, which will answer with the user specified selection for an
* outgoing SmsManager operation.
*/
oneway void enqueueSmsPickResult(String callingPackage, IIntegerConsumer subIdResult);
}