Merge "Add onPreProvisioningRecevied to RcsProvisioningCallback"

This commit is contained in:
Hui Wang
2021-03-12 18:22:52 +00:00
committed by Gerrit Code Review
4 changed files with 52 additions and 2 deletions

View File

@@ -11542,6 +11542,7 @@ package android.telephony.ims {
method public void onAutoConfigurationErrorReceived(int, @NonNull String); method public void onAutoConfigurationErrorReceived(int, @NonNull String);
method public void onConfigurationChanged(@NonNull byte[]); method public void onConfigurationChanged(@NonNull byte[]);
method public void onConfigurationReset(); method public void onConfigurationReset();
method public void onPreProvisioningReceived(@NonNull byte[]);
method public void onRemoved(); method public void onRemoved();
} }
@@ -12011,6 +12012,7 @@ package android.telephony.ims.stub {
method public int getConfigInt(int); method public int getConfigInt(int);
method public String getConfigString(int); method public String getConfigString(int);
method public final void notifyAutoConfigurationErrorReceived(int, @NonNull String); method public final void notifyAutoConfigurationErrorReceived(int, @NonNull String);
method public final void notifyPreProvisioningReceived(@NonNull byte[]);
method public final void notifyProvisionedValueChanged(int, int); method public final void notifyProvisionedValueChanged(int, int);
method public final void notifyProvisionedValueChanged(int, String); method public final void notifyProvisionedValueChanged(int, String);
method public void notifyRcsAutoConfigurationReceived(@NonNull byte[], boolean); method public void notifyRcsAutoConfigurationReceived(@NonNull byte[], boolean);

View File

@@ -993,6 +993,16 @@ public class ProvisioningManager {
} }
} }
@Override
public void onPreProvisioningReceived(byte[] configXml) {
final long identity = Binder.clearCallingIdentity();
try {
mExecutor.execute(() -> mLocalCallback.onPreProvisioningReceived(configXml));
} finally {
Binder.restoreCallingIdentity(identity);
}
}
private void setExecutor(Executor executor) { private void setExecutor(Executor executor) {
mExecutor = executor; mExecutor = executor;
} }
@@ -1005,7 +1015,7 @@ public class ProvisioningManager {
* due to various triggers defined in GSMA RCC.14 for ACS(auto configuration * due to various triggers defined in GSMA RCC.14 for ACS(auto configuration
* server) or other operator defined triggers. If RCS provisioning is already * server) or other operator defined triggers. If RCS provisioning is already
* completed at the time of callback registration, then this method shall be * completed at the time of callback registration, then this method shall be
* invoked with the current configuration * invoked with the current configuration.
* @param configXml The RCS configuration XML received by OTA. It is defined * @param configXml The RCS configuration XML received by OTA. It is defined
* by GSMA RCC.07. * by GSMA RCC.07.
*/ */
@@ -1038,6 +1048,20 @@ public class ProvisioningManager {
*/ */
public void onRemoved() {} public void onRemoved() {}
/**
* Some carriers using ACS (auto configuration server) may send a carrier-specific
* pre-provisioning configuration XML if the user has not been provisioned for RCS
* services yet. When this provisioning XML is received, the framework will move
* into a "not provisioned" state for RCS. In order for provisioning to proceed,
* the application must parse this configuration XML and perform the carrier specific
* opt-in flow for RCS services. If the user accepts, {@link #triggerRcsReconfiguration}
* must be called in order for the device to move out of this state and try to fetch
* the RCS provisioning information.
*
* @param configXml the pre-provisioning config in carrier specified format.
*/
public void onPreProvisioningReceived(@NonNull byte[] configXml) {}
/**@hide*/ /**@hide*/
public final IRcsConfigCallback getBinder() { public final IRcsConfigCallback getBinder() {
return mBinder; return mBinder;

View File

@@ -25,5 +25,6 @@ oneway interface IRcsConfigCallback {
void onAutoConfigurationErrorReceived(int errorCode, String errorString); void onAutoConfigurationErrorReceived(int errorCode, String errorString);
void onConfigurationReset(); void onConfigurationReset();
void onRemoved(); void onRemoved();
void onPreProvisioningReceived(in byte[] config);
} }

View File

@@ -542,11 +542,34 @@ public class ImsConfigImplBase {
} }
mRcsCallbacks.broadcastAction(c -> { mRcsCallbacks.broadcastAction(c -> {
try { try {
//TODO compressed by default?
c.onAutoConfigurationErrorReceived(errorCode, errorString); c.onAutoConfigurationErrorReceived(errorCode, errorString);
} catch (RemoteException e) { } catch (RemoteException e) {
Log.w(TAG, "dead binder in notifyAutoConfigurationErrorReceived, skipping."); Log.w(TAG, "dead binder in notifyAutoConfigurationErrorReceived, skipping.");
} }
}); });
} }
/**
* Notifies application that pre-provisioning config is received.
*
* <p>Some carriers using ACS (auto configuration server) may send a carrier-specific
* pre-provisioning configuration XML if the user has not been provisioned for RCS
* services yet. When such provisioning XML is received, ACS client must call this
* method to notify the application with the XML.
*
* @param configXml the pre-provisioning config in carrier specified format.
*/
public final void notifyPreProvisioningReceived(@NonNull byte[] configXml) {
// can be null in testing
if (mRcsCallbacks == null) {
return;
}
mRcsCallbacks.broadcastAction(c -> {
try {
c.onPreProvisioningReceived(configXml);
} catch (RemoteException e) {
Log.w(TAG, "dead binder in notifyPreProvisioningReceived, skipping.");
}
});
}
} }