diff options
author | Stephen Bird <sbird@cyngn.com> | 2016-04-22 12:27:37 -0700 |
---|---|---|
committer | Stephen Bird <sbird@cyngn.com> | 2016-04-22 15:23:11 -0700 |
commit | 536b9f5beb1a7d367bd306c0c664ed5cc6f9ee1c (patch) | |
tree | 289bd6cdfe86c6758e08ef2fa414a7dbcf2f43b8 /src | |
parent | b436d85994959c3a7ab66bbfee2c4dd4d9b9db11 (diff) | |
download | packages_apps_InCallUI-536b9f5beb1a7d367bd306c0c664ed5cc6f9ee1c.tar.gz packages_apps_InCallUI-536b9f5beb1a7d367bd306c0c664ed5cc6f9ee1c.tar.bz2 packages_apps_InCallUI-536b9f5beb1a7d367bd306c0c664ed5cc6f9ee1c.zip |
CallButtons: Prevent FRP bypass via the video calling option
When OOBE is open, phone calls can be placed to the device.
The incall dialog feature to change to a video call is exploitable
via the dialogs that it creates.
Check to ensure that the device is provisioned by us before showing
this button.
Change-Id: I49db4df359118a8ea4194b94abf9024fd32064d5
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/incallui/CallButtonPresenter.java | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/com/android/incallui/CallButtonPresenter.java b/src/com/android/incallui/CallButtonPresenter.java index cb7b6a03..648bf431 100644 --- a/src/com/android/incallui/CallButtonPresenter.java +++ b/src/com/android/incallui/CallButtonPresenter.java @@ -32,6 +32,7 @@ import android.os.Bundle; import android.os.Handler; import android.os.Looper; import android.os.ResultReceiver; +import android.provider.Settings; import android.telecom.CallAudioState; import android.telecom.InCallService.VideoCall; import android.telecom.PhoneAccount; @@ -61,6 +62,8 @@ import com.cyanogen.ambient.incall.extension.OriginCodes; import com.cyanogen.ambient.incall.extension.StatusCodes; import com.cyanogen.ambient.incall.extension.StartCallRequest; +import cyanogenmod.providers.CMSettings; + import java.util.List; import java.util.Objects; @@ -578,6 +581,13 @@ public class CallButtonPresenter extends Presenter<CallButtonPresenter.CallButto QtiCallUtils.hasVoiceCapabilities(mCall)); } + private boolean isDeviceProvisionedInSettingsDb(Context context) { + return (CMSettings.Secure.getInt(context.getContentResolver(), + CMSettings.Secure.CM_SETUP_WIZARD_COMPLETED, 0) != 0) + && (Settings.Global.getInt(context.getContentResolver(), + Settings.Global.DEVICE_PROVISIONED, 0) != 0); + } + /** * Updates the buttons applicable for the UI. * @@ -609,7 +619,8 @@ public class CallButtonPresenter extends Presenter<CallButtonPresenter.CallButto (QtiCallUtils.hasVideoCapabilities(call) || QtiCallUtils.hasVoiceCapabilities(call) || (contactInCallPlugins != null && !contactInCallPlugins.isEmpty())) && - (callState == Call.State.ACTIVE || callState == Call.State.ONHOLD); + (callState == Call.State.ACTIVE || callState == Call.State.ONHOLD) + && isDeviceProvisionedInSettingsDb(ui.getContext()); final boolean showMute = call.can(android.telecom.Call.Details.CAPABILITY_MUTE); final boolean showAddParticipant = call.can( |