Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve unsigned firmware update on android #9625

Conversation

gwen2018
Copy link
Contributor

Improve unsigned firmware update:

  1. use file browser to pick the firmware file in any accessible directory
  2. error handling

Tracked on: DSO-17007, DSO-17550

@ev-mp ev-mp requested a review from remibettan August 16, 2021 06:03
Copy link
Contributor

@remibettan remibettan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please clarify the questions in my comments

intent.putExtra(getString(R.string.browse_folder), getString(R.string.realsense_folder) + File.separator + "firmware");
startActivityForResult(intent, OPEN_FILE_REQUEST_CODE);
Intent intent = new Intent();
intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION | Intent.FLAG_GRANT_PERSISTABLE_URI_PERMISSION);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please explain why do you need these permissions

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these are permissions for the uri, probably not needed as it's in the same app. removed it.


// firmware file in app local storage, for example,
// /storage/emulated/0/Android/data/com.intel.realsense.camera/files/Download
File downloadDir = getExternalFilesDir(Environment.DIRECTORY_DOWNLOADS);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I remember that the folder was /storage/emulated/0/Android/data/com.intel.realsense.camera/files/realsense/firmware.
Why do you change it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is temporary working directory for the unsigned fw, use the standard download folder, transparent to the user. avoid mixing with the custom folder that contains the signed firmware.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, in order to test it, the unsigned firmware should be located in /storage/emulated/0/Android/data/com.intel.realsense.camera/files/Download - correct?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@remibettan no, the unsigned firmware file can be in any accessible folder mounted on the system, then user pick the file through the file browser. The file will be copied to this app local folder and flash to the device. The process is transparent, user do not need to know the location of this folder.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gwen2018 sounds great.

Copy link
Contributor

@remibettan remibettan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work!

@ev-mp ev-mp merged commit 1d5e99d into IntelRealSense:development Sep 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants