From a0da39f9961e55c645aaeadb174a97ae9e66d8ec Mon Sep 17 00:00:00 2001 From: twyen Date: Mon, 17 Jul 2017 17:51:50 -0700 Subject: Ignore SIM removed event when the system is shutting down When the SIM is removed, the VVM account will be deactivated to protect user data. When the system is shutting down, the modem shutdown process will be interpreted as SIM removal and the event will be sent. This causes VVM to return to "not activated" state every time the phone is rebooted. If the phone is booted without signal or in airplane mode, the VVM tab will be missing since activation is not attempted without signal. In this CL, BOOT_COMPLETED and ACTION_SHUTDOWN will be used to store the "shutting down" state in a shared preference. If the SIM is removed between ACTION_SHUTDOWN and BOOT_COMPLETED, it will be ignored. SIM removal in FBE is already ignored. SIM removal in power off state is never handled. If the broadcasts are missed (which is improbable), removing the SIM will not remove the VVM tab, until removing it again after the next boot. Bug: 63642638 Test: OmtpServiceTest PiperOrigin-RevId: 162298120 Change-Id: I8e093607529de75c28a4869861f18d28406f8042 --- .../voicemail/impl/VoicemailBootReceiver.java | 31 ---------------------- 1 file changed, 31 deletions(-) delete mode 100644 java/com/android/voicemail/impl/VoicemailBootReceiver.java (limited to 'java/com/android/voicemail/impl/VoicemailBootReceiver.java') diff --git a/java/com/android/voicemail/impl/VoicemailBootReceiver.java b/java/com/android/voicemail/impl/VoicemailBootReceiver.java deleted file mode 100644 index 0a3e61a01..000000000 --- a/java/com/android/voicemail/impl/VoicemailBootReceiver.java +++ /dev/null @@ -1,31 +0,0 @@ -/** - * Copyright (C) 2017 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.voicemail.impl; - -import android.content.BroadcastReceiver; -import android.content.Context; -import android.content.Intent; -import com.android.voicemail.VoicemailComponent; - -/** Receives {@link Intent#ACTION_BOOT_COMPLETED} for the voicemail module. */ -public class VoicemailBootReceiver extends BroadcastReceiver { - - @Override - public void onReceive(Context context, Intent intent) { - if (!VoicemailComponent.get(context).getVoicemailClient().isVoicemailModuleEnabled()) { - return; - } - StatusCheckJobService.schedule(context); - } -} -- cgit v1.2.3