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

Commit c9e53d5c authored by Paul Mclean's avatar Paul Mclean Committed by Android (Google) Code Review
Browse files

Merge "Hide "Always Allow" checkbox for "record warning" cases."

parents 13cace2c c90234a3
Loading
Loading
Loading
Loading
+19 −17
Original line number Diff line number Diff line
@@ -71,6 +71,7 @@ public class UsbConfirmActivity extends AlertActivity

        final AlertController.AlertParams ap = mAlertParams;
        ap.mTitle = appName;
        boolean useRecordWarning = false;
        if (mDevice == null) {
            ap.mMessage = getString(R.string.usb_accessory_confirm_prompt, appName,
                    mAccessory.getDescription());
@@ -83,7 +84,7 @@ public class UsbConfirmActivity extends AlertActivity
                            packageName)
                            == android.content.pm.PackageManager.PERMISSION_GRANTED;
            boolean isAudioCaptureDevice = mDevice.getHasAudioCapture();
            boolean useRecordWarning = isAudioCaptureDevice && !hasRecordPermission;
            useRecordWarning = isAudioCaptureDevice && !hasRecordPermission;

            int strID = useRecordWarning
                    ? R.string.usb_device_confirm_prompt_warn
@@ -98,6 +99,7 @@ public class UsbConfirmActivity extends AlertActivity
        ap.mNegativeButtonListener = this;

        // add "always use" checkbox
        if (!useRecordWarning) {
            LayoutInflater inflater = (LayoutInflater) getSystemService(
                    Context.LAYOUT_INFLATER_SERVICE);
            ap.mView = inflater.inflate(com.android.internal.R.layout.always_use_checkbox, null);
@@ -113,7 +115,7 @@ public class UsbConfirmActivity extends AlertActivity
            mClearDefaultHint = (TextView) ap.mView.findViewById(
                    com.android.internal.R.id.clearDefaultHint);
            mClearDefaultHint.setVisibility(View.GONE);

        }
        setupAlert();

    }
@@ -133,7 +135,7 @@ public class UsbConfirmActivity extends AlertActivity
                IUsbManager service = IUsbManager.Stub.asInterface(b);
                final int uid = mResolveInfo.activityInfo.applicationInfo.uid;
                final int userId = UserHandle.myUserId();
                boolean alwaysUse = mAlwaysUse.isChecked();
                boolean alwaysUse = mAlwaysUse != null ? mAlwaysUse.isChecked() : false;
                Intent intent = null;

                if (mDevice != null) {