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

Commit 2e585fb6 authored by Linux Build Service Account's avatar Linux Build Service Account
Browse files

Promotion of android_ui.lnx.2.1.c1-00019.

CRs      Change ID                                   Subject
--------------------------------------------------------------------------------------------------------------
1098207   I371512a55d48f3d8d040b9a41ddf1caedf68b532   Settings: don't check UsbSecurity since the feature is d
662147   Ib3965d7dea8d59b244abdc6ffe61ef21109346fb   Bluetooth: Handle onPause in DevicePickerFragment class

Change-Id: I654252a3d112d007e21a10af37dd8a6433f3d384
CRs-Fixed: 1098207, 662147
parents bbc270d2 0b417d6b
Loading
Loading
Loading
Loading
+18 −0
Original line number Diff line number Diff line
@@ -48,6 +48,7 @@ public final class DevicePickerFragment extends DeviceListPreferenceFragment {
    private String mLaunchPackage;
    private String mLaunchClass;
    private boolean mStartScanOnResume;
    private boolean mDeviceSelected;

    @Override
    void addPreferencesForActivity() {
@@ -103,12 +104,28 @@ public final class DevicePickerFragment extends DeviceListPreferenceFragment {
    public void onResume() {
        super.onResume();
        addCachedDevices();
        mDeviceSelected = false;
        if (mStartScanOnResume) {
            mLocalAdapter.startScanning(true);
            mStartScanOnResume = false;
        }
    }

    @Override
    public void onPause() {
        super.onPause();
        /* Check if any device was selected, if no device selected
         * send  ACTION_DEVICE_NOT_SELECTED intent, otherwise
         * don;t do anything */
        if (!mDeviceSelected) {
            Intent intent = new Intent(BluetoothDevicePicker.ACTION_DEVICE_NOT_SELECTED);
            if (mLaunchPackage != null && mLaunchClass != null) {
                intent.setClassName(mLaunchPackage, mLaunchClass);
            }
            getActivity().sendBroadcast(intent);
        }
    }

    @Override
    void onDevicePreferenceClick(BluetoothDevicePreference btPreference) {
        mLocalAdapter.stopScanning();
@@ -144,6 +161,7 @@ public final class DevicePickerFragment extends DeviceListPreferenceFragment {
    }

    private void sendDevicePickedIntent(BluetoothDevice device) {
        mDeviceSelected = true;
        Intent intent = new Intent(BluetoothDevicePicker.ACTION_DEVICE_SELECTED);
        intent.putExtra(BluetoothDevice.EXTRA_DEVICE, device);
        if (mLaunchPackage != null && mLaunchClass != null) {
+4 −1
Original line number Diff line number Diff line
@@ -138,10 +138,12 @@ public class UsbModeChooserActivity extends Activity {

    private void inflateOption(final int mode, boolean selected, LinearLayout container,
            final boolean disallowedByAdmin) {
        /** UsbSecurity is disable
        boolean isSimCardInserted = SystemProperties.getBoolean(
            "persist.sys.sim.activate", false);
        boolean isUsbSecurityEnable = SystemProperties.getBoolean(
            "persist.sys.usb.security", false);
        **/

        View v = mLayoutInflater.inflate(R.layout.restricted_radio_with_summary, container, false);

@@ -174,10 +176,11 @@ public class UsbModeChooserActivity extends Activity {
            }
        });
        ((Checkable) v).setChecked(selected);
        /** UsbSecurity is disable
        if( !isSimCardInserted && isUsbSecurityEnable )
        {
            v.setEnabled(selected);
        }
        }**/
        container.addView(v);
    }