Compare commits
10 commits
154db2ac68
...
fd916079a2
Author | SHA1 | Date | |
---|---|---|---|
|
fd916079a2 | ||
|
80fd1d030a | ||
|
727ee7f903 | ||
|
385088d479 | ||
|
7b3ce8801e | ||
|
517ad76ed9 | ||
|
28f4876c95 | ||
|
6f099e9493 | ||
|
585f1a8141 | ||
|
39594ae1f9 |
3 changed files with 21 additions and 1 deletions
|
@ -2269,6 +2269,15 @@ public class SatelliteController extends Handler {
|
|||
int error = evaluateOemSatelliteRequestAllowed(true);
|
||||
if (error == SATELLITE_RESULT_SUCCESS) {
|
||||
mNtnSignalStrengthChangedListeners.put(callback.asBinder(), callback);
|
||||
synchronized (mNtnSignalsStrengthLock) {
|
||||
try {
|
||||
callback.onNtnSignalStrengthChanged(mNtnSignalStrength);
|
||||
plogd("registerForNtnSignalStrengthChanged: " + mNtnSignalStrength);
|
||||
} catch (RemoteException ex) {
|
||||
ploge("registerForNtnSignalStrengthChanged: RemoteException ex="
|
||||
+ ex);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
throw new RemoteException(new IllegalStateException("registration fails: " + error));
|
||||
}
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
|
||||
package com.android.internal.telephony.satellite;
|
||||
|
||||
import static android.content.Intent.FLAG_ACTIVITY_CLEAR_TOP;
|
||||
import static android.telephony.ServiceState.STATE_EMERGENCY_ONLY;
|
||||
import static android.telephony.ServiceState.STATE_IN_SERVICE;
|
||||
import static android.telephony.ServiceState.STATE_OUT_OF_SERVICE;
|
||||
|
@ -29,6 +30,7 @@ import static com.android.internal.telephony.satellite.SatelliteController.INVAL
|
|||
|
||||
import android.annotation.NonNull;
|
||||
import android.annotation.Nullable;
|
||||
import android.app.ActivityOptions;
|
||||
import android.app.PendingIntent;
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
|
@ -700,10 +702,15 @@ public class SatelliteSOSMessageRecommender extends Handler {
|
|||
intent = new Intent(Intent.ACTION_SENDTO, uri);
|
||||
} else {
|
||||
intent = new Intent(action);
|
||||
intent.addFlags(FLAG_ACTIVITY_CLEAR_TOP);
|
||||
}
|
||||
Bundle activityOptions = ActivityOptions.makeBasic()
|
||||
.setPendingIntentCreatorBackgroundActivityStartMode(
|
||||
ActivityOptions.MODE_BACKGROUND_ACTIVITY_START_ALLOWED)
|
||||
.toBundle();
|
||||
intent.setComponent(new ComponentName(packageName, className));
|
||||
return PendingIntent.getActivity(mContext, 0, intent,
|
||||
PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_IMMUTABLE);
|
||||
PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_IMMUTABLE, activityOptions);
|
||||
}
|
||||
|
||||
private boolean isEmergencyCallToSatelliteHandoverTypeT911Enforced() {
|
||||
|
|
|
@ -2389,6 +2389,10 @@ public class SatelliteControllerTest extends TelephonyTest {
|
|||
verifyRegisterForNtnSignalStrengthChanged(SUB_ID, callback,
|
||||
SATELLITE_RESULT_SUCCESS);
|
||||
verifyRequestNtnSignalStrength(expectedLevel, SATELLITE_RESULT_SUCCESS);
|
||||
processAllMessages();
|
||||
assertTrue(waitForForEvents(
|
||||
semaphore, 1, "testRegisterForNtnSignalStrengthChanged"));
|
||||
assertEquals(expectedLevel, signalStrength[0].getLevel());
|
||||
|
||||
expectedLevel = NTN_SIGNAL_STRENGTH_GOOD;
|
||||
sendNtnSignalStrengthChangedEvent(expectedLevel, null);
|
||||
|
|
Loading…
Reference in a new issue