Move emergency callback related intents to TelephonyManager
This CL also renames to have android.telephony prefix for one of the intents used internally. Also suppresses the lint errors for keeping android.intent.* which is needed for app compatiblily as 3rd party may have hardcoded in their manifest. Bug: 146240041 Test: Build Change-Id: Ib3e786b73af614d5ef0d8cf3e5a6642273060f68
This commit is contained in:
@@ -9801,7 +9801,10 @@ package android.telephony {
|
||||
method @RequiresPermission(android.Manifest.permission.READ_ACTIVE_EMERGENCY_SESSION) public void updateTestOtaEmergencyNumberDbFilePath(@NonNull String);
|
||||
field @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public static final String ACTION_ANOMALY_REPORTED = "android.telephony.action.ANOMALY_REPORTED";
|
||||
field public static final String ACTION_EMERGENCY_ASSISTANCE = "android.telephony.action.EMERGENCY_ASSISTANCE";
|
||||
field public static final String ACTION_EMERGENCY_CALLBACK_MODE_CHANGED = "android.intent.action.EMERGENCY_CALLBACK_MODE_CHANGED";
|
||||
field public static final String ACTION_EMERGENCY_CALL_STATE_CHANGED = "android.intent.action.EMERGENCY_CALL_STATE_CHANGED";
|
||||
field public static final String ACTION_NETWORK_SET_TIME = "android.telephony.action.NETWORK_SET_TIME";
|
||||
field public static final String ACTION_SHOW_NOTICE_ECM_BLOCK_OTHERS = "android.telephony.action.SHOW_NOTICE_ECM_BLOCK_OTHERS";
|
||||
field public static final String ACTION_SIM_APPLICATION_STATE_CHANGED = "android.telephony.action.SIM_APPLICATION_STATE_CHANGED";
|
||||
field public static final String ACTION_SIM_CARD_STATE_CHANGED = "android.telephony.action.SIM_CARD_STATE_CHANGED";
|
||||
field public static final String ACTION_SIM_SLOT_STATUS_CHANGED = "android.telephony.action.SIM_SLOT_STATUS_CHANGED";
|
||||
|
||||
@@ -81,7 +81,6 @@ import com.android.internal.colorextraction.drawable.ScrimDrawable;
|
||||
import com.android.internal.logging.MetricsLogger;
|
||||
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
|
||||
import com.android.internal.statusbar.IStatusBarService;
|
||||
import com.android.internal.telephony.TelephonyIntents;
|
||||
import com.android.internal.util.EmergencyAffordanceManager;
|
||||
import com.android.internal.util.ScreenRecordHelper;
|
||||
import com.android.internal.util.ScreenshotHelper;
|
||||
@@ -190,7 +189,7 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener,
|
||||
IntentFilter filter = new IntentFilter();
|
||||
filter.addAction(Intent.ACTION_CLOSE_SYSTEM_DIALOGS);
|
||||
filter.addAction(Intent.ACTION_SCREEN_OFF);
|
||||
filter.addAction(TelephonyIntents.ACTION_EMERGENCY_CALLBACK_MODE_CHANGED);
|
||||
filter.addAction(TelephonyManager.ACTION_EMERGENCY_CALLBACK_MODE_CHANGED);
|
||||
mBroadcastDispatcher.registerReceiver(mBroadcastReceiver, filter);
|
||||
|
||||
ConnectivityManager cm = (ConnectivityManager)
|
||||
@@ -314,7 +313,7 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener,
|
||||
mIsWaitingForEcmExit = true;
|
||||
// Launch ECM exit dialog
|
||||
Intent ecmDialogIntent =
|
||||
new Intent(TelephonyIntents.ACTION_SHOW_NOTICE_ECM_BLOCK_OTHERS, null);
|
||||
new Intent(TelephonyManager.ACTION_SHOW_NOTICE_ECM_BLOCK_OTHERS, null);
|
||||
ecmDialogIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
mContext.startActivity(ecmDialogIntent);
|
||||
} else {
|
||||
@@ -1420,7 +1419,7 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener,
|
||||
if (!SYSTEM_DIALOG_REASON_GLOBAL_ACTIONS.equals(reason)) {
|
||||
mHandler.sendMessage(mHandler.obtainMessage(MESSAGE_DISMISS, reason));
|
||||
}
|
||||
} else if (TelephonyIntents.ACTION_EMERGENCY_CALLBACK_MODE_CHANGED.equals(action)) {
|
||||
} else if (TelephonyManager.ACTION_EMERGENCY_CALLBACK_MODE_CHANGED.equals(action)) {
|
||||
// Airplane mode can be changed after ECM exits if airplane toggle button
|
||||
// is pressed during ECM mode
|
||||
if (!(intent.getBooleanExtra("PHONE_IN_ECM_STATE", false)) &&
|
||||
|
||||
@@ -26,11 +26,11 @@ import android.provider.Settings;
|
||||
import android.provider.Settings.Global;
|
||||
import android.service.quicksettings.Tile;
|
||||
import android.sysprop.TelephonyProperties;
|
||||
import android.telephony.TelephonyManager;
|
||||
import android.widget.Switch;
|
||||
|
||||
import com.android.internal.logging.MetricsLogger;
|
||||
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
|
||||
import com.android.internal.telephony.TelephonyIntents;
|
||||
import com.android.systemui.R;
|
||||
import com.android.systemui.broadcast.BroadcastDispatcher;
|
||||
import com.android.systemui.plugins.ActivityStarter;
|
||||
@@ -76,7 +76,7 @@ public class AirplaneModeTile extends QSTileImpl<BooleanState> {
|
||||
MetricsLogger.action(mContext, getMetricsCategory(), !airplaneModeEnabled);
|
||||
if (!airplaneModeEnabled && TelephonyProperties.in_ecm_mode().orElse(false)) {
|
||||
mActivityStarter.postStartActivityDismissingKeyguard(
|
||||
new Intent(TelephonyIntents.ACTION_SHOW_NOTICE_ECM_BLOCK_OTHERS), 0);
|
||||
new Intent(TelephonyManager.ACTION_SHOW_NOTICE_ECM_BLOCK_OTHERS), 0);
|
||||
return;
|
||||
}
|
||||
setEnabled(!airplaneModeEnabled);
|
||||
|
||||
@@ -62,7 +62,6 @@ import com.android.internal.globalactions.SinglePressAction;
|
||||
import com.android.internal.globalactions.ToggleAction;
|
||||
import com.android.internal.logging.MetricsLogger;
|
||||
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
|
||||
import com.android.internal.telephony.TelephonyIntents;
|
||||
import com.android.internal.util.EmergencyAffordanceManager;
|
||||
import com.android.internal.widget.LockPatternUtils;
|
||||
import com.android.server.policy.WindowManagerPolicy.WindowManagerFuncs;
|
||||
@@ -133,7 +132,7 @@ class LegacyGlobalActions implements DialogInterface.OnDismissListener, DialogIn
|
||||
IntentFilter filter = new IntentFilter();
|
||||
filter.addAction(Intent.ACTION_CLOSE_SYSTEM_DIALOGS);
|
||||
filter.addAction(Intent.ACTION_SCREEN_OFF);
|
||||
filter.addAction(TelephonyIntents.ACTION_EMERGENCY_CALLBACK_MODE_CHANGED);
|
||||
filter.addAction(TelephonyManager.ACTION_EMERGENCY_CALLBACK_MODE_CHANGED);
|
||||
context.registerReceiver(mBroadcastReceiver, filter);
|
||||
|
||||
ConnectivityManager cm = (ConnectivityManager)
|
||||
@@ -231,7 +230,7 @@ class LegacyGlobalActions implements DialogInterface.OnDismissListener, DialogIn
|
||||
mIsWaitingForEcmExit = true;
|
||||
// Launch ECM exit dialog
|
||||
Intent ecmDialogIntent =
|
||||
new Intent(TelephonyIntents.ACTION_SHOW_NOTICE_ECM_BLOCK_OTHERS, null);
|
||||
new Intent(TelephonyManager.ACTION_SHOW_NOTICE_ECM_BLOCK_OTHERS, null);
|
||||
ecmDialogIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
mContext.startActivity(ecmDialogIntent);
|
||||
} else {
|
||||
@@ -741,7 +740,7 @@ class LegacyGlobalActions implements DialogInterface.OnDismissListener, DialogIn
|
||||
if (!PhoneWindowManager.SYSTEM_DIALOG_REASON_GLOBAL_ACTIONS.equals(reason)) {
|
||||
mHandler.sendEmptyMessage(MESSAGE_DISMISS);
|
||||
}
|
||||
} else if (TelephonyIntents.ACTION_EMERGENCY_CALLBACK_MODE_CHANGED.equals(action)) {
|
||||
} else if (TelephonyManager.ACTION_EMERGENCY_CALLBACK_MODE_CHANGED.equals(action)) {
|
||||
// Airplane mode can be changed after ECM exits if airplane toggle button
|
||||
// is pressed during ECM mode
|
||||
if (!(intent.getBooleanExtra("PHONE_IN_ECM_STATE", false)) &&
|
||||
|
||||
@@ -1475,14 +1475,68 @@ public class TelephonyManager {
|
||||
* <p class="note">
|
||||
* Requires the READ_PHONE_STATE permission.
|
||||
*
|
||||
* <p class="note">This is a protected intent that can only be sent
|
||||
* by the system.
|
||||
* <p class="note">This is a protected intent that can only be sent by the system.
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
@SystemApi
|
||||
public static final String ACTION_NETWORK_SET_TIME = "android.telephony.action.NETWORK_SET_TIME";
|
||||
|
||||
/**
|
||||
* <p>Broadcast Action: The emergency callback mode is changed.
|
||||
* <ul>
|
||||
* <li><em>phoneinECMState</em> - A boolean value,true=phone in ECM, false=ECM off</li>
|
||||
* </ul>
|
||||
* <p class="note">
|
||||
* You can <em>not</em> receive this through components declared
|
||||
* in manifests, only by explicitly registering for it with
|
||||
* {@link android.content.Context#registerReceiver(android.content.BroadcastReceiver,
|
||||
* android.content.IntentFilter) Context.registerReceiver()}.
|
||||
*
|
||||
* <p class="note">This is a protected intent that can only be sent by the system.
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
@SystemApi
|
||||
@SuppressLint("ActionValue")
|
||||
public static final String ACTION_EMERGENCY_CALLBACK_MODE_CHANGED
|
||||
= "android.intent.action.EMERGENCY_CALLBACK_MODE_CHANGED";
|
||||
|
||||
/**
|
||||
* <p>Broadcast Action: The emergency call state is changed.
|
||||
* <ul>
|
||||
* <li><em>phoneInEmergencyCall</em> - A boolean value, true if phone in emergency call,
|
||||
* false otherwise</li>
|
||||
* </ul>
|
||||
* <p class="note">
|
||||
* You can <em>not</em> receive this through components declared
|
||||
* in manifests, only by explicitly registering for it with
|
||||
* {@link android.content.Context#registerReceiver(android.content.BroadcastReceiver,
|
||||
* android.content.IntentFilter) Context.registerReceiver()}.
|
||||
*
|
||||
* <p class="note">This is a protected intent that can only be sent by the system.
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
@SystemApi
|
||||
@SuppressLint("ActionValue")
|
||||
public static final String ACTION_EMERGENCY_CALL_STATE_CHANGED
|
||||
= "android.intent.action.EMERGENCY_CALL_STATE_CHANGED";
|
||||
|
||||
/**
|
||||
* <p>Broadcast Action: It indicates the Emergency callback mode blocks datacall/sms
|
||||
* <p class="note">.
|
||||
* This is to pop up a notice to show user that the phone is in emergency callback mode
|
||||
* and data calls and outgoing sms are blocked.
|
||||
*
|
||||
* <p class="note">This is a protected intent that can only be sent by the system.
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
@SystemApi
|
||||
public static final String ACTION_SHOW_NOTICE_ECM_BLOCK_OTHERS
|
||||
= "android.telephony.action.SHOW_NOTICE_ECM_BLOCK_OTHERS";
|
||||
|
||||
//
|
||||
//
|
||||
// Device Info
|
||||
|
||||
@@ -18,6 +18,7 @@ package com.android.internal.telephony;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.telephony.SubscriptionManager;
|
||||
import android.telephony.TelephonyManager;
|
||||
|
||||
/**
|
||||
* The intents that the telephony services broadcast.
|
||||
@@ -99,7 +100,7 @@ public class TelephonyIntents {
|
||||
* by the system.
|
||||
*/
|
||||
public static final String ACTION_EMERGENCY_CALLBACK_MODE_CHANGED
|
||||
= "android.intent.action.EMERGENCY_CALLBACK_MODE_CHANGED";
|
||||
= TelephonyManager.ACTION_EMERGENCY_CALLBACK_MODE_CHANGED;
|
||||
|
||||
/**
|
||||
* <p>Broadcast Action: The emergency call state is changed.
|
||||
@@ -120,7 +121,7 @@ public class TelephonyIntents {
|
||||
* by the system.
|
||||
*/
|
||||
public static final String ACTION_EMERGENCY_CALL_STATE_CHANGED
|
||||
= "android.intent.action.EMERGENCY_CALL_STATE_CHANGED";
|
||||
= TelephonyManager.ACTION_EMERGENCY_CALL_STATE_CHANGED;
|
||||
|
||||
/**
|
||||
* Broadcast Action: The phone's signal strength has changed. The intent will have the
|
||||
@@ -234,7 +235,7 @@ public class TelephonyIntents {
|
||||
* by the system.
|
||||
*/
|
||||
public static final String ACTION_SHOW_NOTICE_ECM_BLOCK_OTHERS
|
||||
= "com.android.internal.intent.action.ACTION_SHOW_NOTICE_ECM_BLOCK_OTHERS";
|
||||
= TelephonyManager.ACTION_SHOW_NOTICE_ECM_BLOCK_OTHERS;
|
||||
|
||||
/**
|
||||
* <p>Broadcast Action: Indicates that the action is forbidden by network.
|
||||
|
||||
Reference in New Issue
Block a user