Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 51d273b0 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Revert the removal of FBE related checks." into rvc-dev am: b76fb5e7...

Merge "Revert the removal of FBE related checks." into rvc-dev am: b76fb5e7 am: 8051188e am: 26b5bb14

Change-Id: If5a981c1dbc0235b9005ce8b3ca92bc9e82d0457
parents 7ca64289 26b5bb14
Loading
Loading
Loading
Loading
+19 −19
Original line number Original line Diff line number Diff line
@@ -39,6 +39,7 @@ import android.content.ContentValues;
import android.content.Context;
import android.content.Context;
import android.content.Intent;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.IntentFilter;
import android.content.pm.IPackageManager;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager;
import android.database.Cursor;
import android.database.Cursor;
import android.database.SQLException;
import android.database.SQLException;
@@ -49,8 +50,11 @@ import android.os.Bundle;
import android.os.Message;
import android.os.Message;
import android.os.PowerManager;
import android.os.PowerManager;
import android.os.PowerWhitelistManager;
import android.os.PowerWhitelistManager;
import android.os.RemoteException;
import android.os.ServiceManager;
import android.os.UserHandle;
import android.os.UserHandle;
import android.os.UserManager;
import android.os.UserManager;
import android.os.storage.StorageManager;
import android.provider.Telephony;
import android.provider.Telephony;
import android.provider.Telephony.Sms.Intents;
import android.provider.Telephony.Sms.Intents;
import android.service.carrier.CarrierMessagingService;
import android.service.carrier.CarrierMessagingService;
@@ -661,22 +665,18 @@ public abstract class InboundSmsHandler extends StateMachine {
            return Intents.RESULT_SMS_HANDLED;
            return Intents.RESULT_SMS_HANDLED;
        }
        }


//        // onlyCore indicates if the device is in cryptkeeper
        // onlyCore indicates if the device is in cryptkeeper
//        boolean onlyCore = false;
        boolean onlyCore = false;
//        try {
        try {
//            onlyCore = IPackageManager.Stub.asInterface(
            onlyCore = IPackageManager.Stub.asInterface(ServiceManager.getService("package"))
//                    TelephonyFrameworkInitializer
                    .isOnlyCoreApps();
//                            .getTelephonyServiceManager()
        } catch (RemoteException e) {
//                            .getPackageManagerServiceRegisterer()
        }
//                            .get()).
        if (onlyCore) {
//                    isOnlyCoreApps();
            // Device is unable to receive SMS in encrypted state
//        } catch (RemoteException e) {
            log("Received a short message in encrypted state. Rejecting.");
//        }
            return Intents.RESULT_SMS_RECEIVED_WHILE_ENCRYPTED;
//        if (onlyCore) {
        }
//            // Device is unable to receive SMS in encrypted state
//            log("Received a short message in encrypted state. Rejecting.");
//            return Intents.RESULT_SMS_RECEIVED_WHILE_ENCRYPTED;
//        }


        int result = dispatchMessageRadioSpecific(smsb);
        int result = dispatchMessageRadioSpecific(smsb);


@@ -1059,9 +1059,9 @@ public abstract class InboundSmsHandler extends StateMachine {
    @UnsupportedAppUsage
    @UnsupportedAppUsage
    private void showNewMessageNotification() {
    private void showNewMessageNotification() {
        // Do not show the notification on non-FBE devices.
        // Do not show the notification on non-FBE devices.
        // if (!StorageManager.isFileEncryptedNativeOrEmulated()) {
        if (!StorageManager.isFileEncryptedNativeOrEmulated()) {
        //     return;
            return;
        // }
        }
        log("Show new message notification.");
        log("Show new message notification.");
        PendingIntent intent = PendingIntent.getBroadcast(
        PendingIntent intent = PendingIntent.getBroadcast(
            mContext,
            mContext,
+9 −13
Original line number Original line Diff line number Diff line
@@ -26,6 +26,7 @@ import android.os.Handler;
import android.os.Message;
import android.os.Message;
import android.os.PowerManager;
import android.os.PowerManager;
import android.os.RegistrantList;
import android.os.RegistrantList;
import android.os.storage.StorageManager;
import android.sysprop.TelephonyProperties;
import android.sysprop.TelephonyProperties;
import android.telephony.PhoneCapability;
import android.telephony.PhoneCapability;
import android.telephony.SubscriptionManager;
import android.telephony.SubscriptionManager;
@@ -100,20 +101,15 @@ public class PhoneConfigurationManager {


        mPhones = PhoneFactory.getPhones();
        mPhones = PhoneFactory.getPhones();


        /*
        if (!StorageManager.inCryptKeeperBounce()) {
         * To support FDE (deprecated), additional check is needed:
         *
         * if (!StorageManager.inCryptKeeperBounce()) {
         *     // for loop below
         * } else {
         *     for (Phone phone : mPhones) {
         *         phone.mCi.registerForOn(mHandler, Phone.EVENT_RADIO_ON, phone);
         *     }
         * }
         */
            for (Phone phone : mPhones) {
            for (Phone phone : mPhones) {
                phone.mCi.registerForAvailable(mHandler, Phone.EVENT_RADIO_AVAILABLE, phone);
                phone.mCi.registerForAvailable(mHandler, Phone.EVENT_RADIO_AVAILABLE, phone);
            }
            }
        } else {
            for (Phone phone : mPhones) {
                phone.mCi.registerForOn(mHandler, Phone.EVENT_RADIO_ON, phone);
            }
        }
    }
    }


    private PhoneCapability getDefaultCapability() {
    private PhoneCapability getDefaultCapability() {
+6 −10
Original line number Original line Diff line number Diff line
@@ -32,6 +32,7 @@ import android.os.Handler;
import android.os.Message;
import android.os.Message;
import android.os.Registrant;
import android.os.Registrant;
import android.os.RegistrantList;
import android.os.RegistrantList;
import android.os.storage.StorageManager;
import android.preference.PreferenceManager;
import android.preference.PreferenceManager;
import android.telephony.CarrierConfigManager;
import android.telephony.CarrierConfigManager;
import android.telephony.TelephonyManager;
import android.telephony.TelephonyManager;
@@ -229,16 +230,11 @@ public class UiccController extends Handler {
        for (int i = 0; i < mCis.length; i++) {
        for (int i = 0; i < mCis.length; i++) {
            mCis[i].registerForIccStatusChanged(this, EVENT_ICC_STATUS_CHANGED, i);
            mCis[i].registerForIccStatusChanged(this, EVENT_ICC_STATUS_CHANGED, i);


            /*
            if (!StorageManager.inCryptKeeperBounce()) {
             * To support FDE (deprecated), additional check is needed:
             *
             * if (!StorageManager.inCryptKeeperBounce()) {
             *     mCis[i].registerForAvailable(this, EVENT_RADIO_AVAILABLE, i);
             * } else {
             *     mCis[i].registerForOn(this, EVENT_RADIO_ON, i);
             * }
             */
                mCis[i].registerForAvailable(this, EVENT_RADIO_AVAILABLE, i);
                mCis[i].registerForAvailable(this, EVENT_RADIO_AVAILABLE, i);
            } else {
                mCis[i].registerForOn(this, EVENT_RADIO_ON, i);
            }


            mCis[i].registerForNotAvailable(this, EVENT_RADIO_UNAVAILABLE, i);
            mCis[i].registerForNotAvailable(this, EVENT_RADIO_UNAVAILABLE, i);
            mCis[i].registerForIccRefresh(this, EVENT_SIM_REFRESH, i);
            mCis[i].registerForIccRefresh(this, EVENT_SIM_REFRESH, i);