diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 1735a517e25c05cb7c71dbe20e1e1c1d07a783f5..f94b6ba5dbbef48a009398239354fa9afd1ce388 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -2486,33 +2486,41 @@
+ android:theme="@style/GlifTheme.Light"
+ android:exported="false"
+ android:configChanges="keyboardHidden|orientation|screenSize"/>
+ android:theme="@style/GlifTheme.Light"
+ android:exported="false"
+ android:configChanges="keyboardHidden|orientation|screenSize"/>
+ android:theme="@style/GlifTheme.Light"
+ android:exported="false"
+ android:configChanges="keyboardHidden|orientation|screenSize"/>
+ android:theme="@style/GlifTheme.Light"
+ android:exported="false"
+ android:configChanges="keyboardHidden|orientation|screenSize"/>
diff --git a/res/drawable/ic_storage_wizard_external.xml b/res/drawable/ic_storage_wizard_external.xml
index 99e2698633d762016e50d49bb751f7e341512037..c6fefa1e99d85bbb6dc8246bcc5c82711450a76e 100644
--- a/res/drawable/ic_storage_wizard_external.xml
+++ b/res/drawable/ic_storage_wizard_external.xml
@@ -1,3 +1,4 @@
+
-
-
-
-
-
-
+
+
+
+
+
+
+ android:pathData="M78.8155 104.538V100.521C78.8155 99.9967 78.3786 99.5601 77.8544 99.5601V78.6001C77.8544 75.8054 75.5825 73.6221 72.8738 73.6221H26.8252C24.0291 73.6221 21.8447 75.8054 21.8447 78.6001V174.492C21.8447 177.287 24.1165 179.47 26.8252 179.47H72.7864C75.5825 179.47 77.767 177.199 77.767 174.492V125.585C78.2913 125.585 78.7282 125.149 78.7282 124.625V114.581C78.7282 114.057 78.2913 113.621 77.767 113.621V105.586C78.3786 105.499 78.8155 105.062 78.8155 104.538ZM76.8058 174.492C76.8058 176.675 74.9709 178.509 72.7864 178.509H26.8252C24.6408 178.509 22.8058 176.675 22.8058 174.492V78.6001C22.8058 76.4167 24.5534 74.5827 26.8252 74.5827H72.7864C74.9709 74.5827 76.8058 76.3294 76.8058 78.6001V174.492Z" />
+
+
+
+
+
+
+
+
+ android:fillColor="@android:color/transparent"
+ android:pathData="M317.184 74.3208H156.32V171.697H317.184V74.3208Z" />
+
+ android:pathData="M134.65 182.09H338.854V184.186C338.854 185.758 337.631 186.981 336.058 186.981H137.447C135.874 186.981 134.65 185.758 134.65 184.186V182.09Z" />
+
+
+
+
+
+
+ android:fillColor="#81C995"
+ android:pathData="M292.893 144.275L296.738 140.432H294.816C293.767 140.432 292.893 141.305 292.893 142.353V144.275Z" />
+
+
+
+ android:pathData="M107.126 114.669H109.66V112.136H107.126V114.669ZM117.087 114.669H119.621V112.136H117.087V114.669ZM107.126 109.691H109.66V104.713H107.126V109.691ZM112.107 114.669H114.641V109.691H112.107V114.669ZM112.107 107.158H114.641V104.626H112.107V107.158ZM117.087 109.691H119.621V104.713H117.087V109.691ZM105.903 118.424C105.204 118.424 104.592 118.162 104.155 117.726C103.718 117.289 103.456 116.678 103.456 115.979V101.045L110.971 93.5342H120.932C121.631 93.5342 122.243 93.7962 122.68 94.2328C123.204 94.7568 123.379 95.2808 123.379 95.9795V115.892C123.379 116.59 123.116 117.202 122.68 117.638C122.155 118.162 121.631 118.337 120.932 118.337L105.903 118.424ZM105.903 115.892H120.845V95.9795H111.932L105.903 102.006V115.892ZM105.903 115.892V102.006L111.932 95.9795H120.845V115.892H105.903Z" />
+ android:pathData="M96.7281 150.388L101.447 145.672L98.8252 143.052L89.7379 152.222L98.8252 161.305L101.447 158.772L96.7281 154.056H137.01V150.388H96.7281Z" />
-
+ android:fillColor="?android:attr/colorAccent"
+ android:pathData="M130.019 137.026L125.301 141.742L127.922 144.362L137.01 135.192L127.922 126.109L125.301 128.642L130.019 133.358H89.7379V137.026H130.019Z" />
+
+
\ No newline at end of file
diff --git a/res/drawable/ic_storage_wizard_internal.xml b/res/drawable/ic_storage_wizard_internal.xml
index 41768f7727d9269c7393113a130eaa2890a34129..70bafa944cea37ed320d250a556611514944d331 100644
--- a/res/drawable/ic_storage_wizard_internal.xml
+++ b/res/drawable/ic_storage_wizard_internal.xml
@@ -1,3 +1,4 @@
+
+ android:width="360dp"
+ android:height="262dp"
+ android:viewportWidth="360"
+ android:viewportHeight="262">
+
+ android:fillColor="@android:color/transparent"
+ android:pathData="M335.691 262H24.3087C10.9485 262 0 250.795 0 237.127V24.9075C0 11.2049 10.9485 0 24.3087 0H335.787C349.051 0 360 11.2049 360 24.8725V237.224C360 250.795 349.051 262 335.691 262Z" />
+ android:fillColor="#DADCE0"
+ android:pathData="M239.199 85.3246V77.0192C239.199 76.4695 238.981 75.9421 238.593 75.5526C238.205 75.163 237.678 74.943 237.128 74.9407V31.3439C237.126 28.5906 236.031 25.9508 234.083 24.0039C232.135 22.057 229.494 20.9623 226.739 20.96H131.182C128.428 20.9646 125.789 22.0604 123.843 24.007C121.897 25.9536 120.803 28.5921 120.801 31.3439V230.656C120.803 233.408 121.897 236.046 123.843 237.993C125.789 239.94 128.428 241.035 131.182 241.04H226.739C229.494 241.038 232.135 239.943 234.083 237.996C236.031 236.049 237.126 233.409 237.128 230.656V128.921C237.677 128.921 238.204 128.703 238.592 128.315C238.981 127.927 239.199 127.401 239.199 126.852V106.084C239.199 105.534 238.981 105.007 238.593 104.617C238.205 104.228 237.678 104.008 237.128 104.005V87.4119C237.401 87.4108 237.671 87.3559 237.923 87.2503C238.175 87.1448 238.404 86.9908 238.596 86.7969C238.788 86.6031 238.941 86.3733 239.044 86.1207C239.148 85.8681 239.2 85.5976 239.199 85.3246ZM235.049 230.656C235.046 232.858 234.17 234.969 232.612 236.526C231.054 238.083 228.942 238.959 226.739 238.961H131.182C128.978 238.959 126.866 238.083 125.308 236.526C123.75 234.969 122.874 232.858 122.872 230.656V31.3439C122.874 29.1419 123.75 27.0307 125.308 25.4736C126.866 23.9166 128.978 23.0408 131.182 23.0385H226.739C228.942 23.0408 231.054 23.9166 232.612 25.4736C234.17 27.0307 235.046 29.1419 235.049 31.3439V230.656Z" />
+ android:fillColor="#81C995"
+ android:pathData="M209.91 52.243H226.424V35.737H209.91V52.243ZM209.91 54.601C209.599 54.6045 209.29 54.5443 209.003 54.4242C208.716 54.304 208.457 54.1264 208.241 53.9023C208.018 53.6879 207.842 53.4299 207.723 53.1444C207.604 52.8589 207.545 52.5521 207.55 52.243V35.737C207.55 35.1116 207.799 34.5118 208.241 34.0696C208.684 33.6274 209.284 33.379 209.91 33.379H226.424C226.729 33.3764 227.03 33.4355 227.311 33.5526C227.592 33.6696 227.846 33.8423 228.058 34.0602C228.282 34.2758 228.46 34.5351 228.58 34.822C228.701 35.1088 228.761 35.4173 228.757 35.7283V52.2343C228.75 52.8575 228.5 53.4533 228.059 53.8941C227.618 54.3348 227.022 54.5854 226.398 54.5923L209.91 54.601ZM211.089 49.885H225.245L220.815 43.99L217.319 48.706L214.698 45.169L211.089 49.885ZM209.91 35.737V52.243V35.737Z" />
+ android:fillColor="#8AB4F8"
+ android:pathData="M176.208 36.1475H148.247V56.2341H144.97C144.185 56.2341 143.408 56.3886 142.683 56.6888C141.958 56.989 141.299 57.429 140.744 57.9837C140.189 58.5384 139.749 59.197 139.448 59.9217C139.148 60.6465 138.993 61.4233 138.993 62.2077C138.993 62.9922 139.148 63.769 139.448 64.4937C139.749 65.2185 140.189 65.877 140.744 66.4317C141.299 66.9864 141.958 67.4264 142.683 67.7266C143.408 68.0268 144.185 68.1813 144.97 68.1813H146.316C147.789 68.1973 149.212 67.6454 150.289 66.6404C151.366 65.6354 152.015 64.2544 152.1 62.7841V42.3132H168.702V56.3826H165.425C163.84 56.3826 162.32 57.012 161.199 58.1322C160.078 59.2525 159.449 60.7719 159.449 62.3562C159.449 63.9405 160.078 65.4599 161.199 66.5802C162.32 67.7004 163.84 68.3298 165.425 68.3298H166.771C168.244 68.3457 169.667 67.7939 170.744 66.7889C171.822 65.7839 172.47 64.4029 172.555 62.9326V41.9202C173.622 41.3688 174.523 40.5434 175.165 39.5288C175.807 38.5143 176.167 37.3472 176.208 36.1475Z" />
+ android:fillColor="#F28B82"
+ android:pathData="M160.96 79.0195H156.958L159.623 84.3556H155.621L152.913 79.0195H150.291L152.913 84.3556H148.911L146.237 79.0195H143.572L146.237 84.3556H142.235L139.561 79.0195C138.866 79.0195 138.199 79.2956 137.708 79.7869C137.216 80.2783 136.94 80.9447 136.94 81.6395V97.6565C136.94 98.3562 137.214 99.0282 137.704 99.5278C138.194 100.028 138.861 100.315 139.561 100.329H160.925C161.634 100.327 162.312 100.044 162.813 99.5436C163.314 99.0429 163.597 98.3645 163.599 97.6565V81.6832C163.597 80.982 163.319 80.3097 162.825 79.8114C162.332 79.3131 161.662 79.0287 160.96 79.0195Z" />
+ android:fillColor="#8AB4F8"
+ android:pathData="M220.544 165.934H208.957C208.19 165.934 207.455 166.238 206.912 166.78C206.37 167.322 206.065 168.058 206.065 168.824V173.706H202.413C202.047 173.701 201.684 173.77 201.346 173.91C201.008 174.05 200.702 174.257 200.447 174.518C200.17 174.766 199.949 175.069 199.799 175.407C199.648 175.746 199.571 176.113 199.573 176.483L199.468 198.78C199.466 199.146 199.535 199.508 199.673 199.847C199.811 200.186 200.015 200.494 200.272 200.755C200.529 201.015 200.835 201.222 201.172 201.364C201.51 201.506 201.872 201.581 202.238 201.583L218.971 201.662C219.71 201.662 220.42 201.37 220.945 200.85C221.47 200.33 221.769 199.623 221.776 198.884V194.928H226.311C227.079 194.926 227.816 194.62 228.359 194.076C228.903 193.533 229.209 192.797 229.212 192.029V174.58L220.544 165.934ZM219.032 198.858L202.299 198.78L202.404 176.475H206.065V191.994C206.064 192.374 206.138 192.751 206.283 193.103C206.428 193.455 206.64 193.774 206.909 194.044C207.178 194.313 207.497 194.527 207.848 194.672C208.2 194.818 208.577 194.893 208.957 194.893H219.05L219.032 198.858ZM223.401 189.112H211.858V186.221H223.436L223.401 189.112ZM223.401 183.322H211.858V180.422H223.436L223.401 183.322ZM226.293 176.073H219.058V168.824L226.311 176.073H226.293Z" />
+ android:fillColor="#CEEAD6"
+ android:pathData="M149.068 201.827C158.908 201.827 166.884 193.855 166.884 184.02C166.884 174.185 158.908 166.213 149.068 166.213C139.228 166.213 131.251 174.185 131.251 184.02C131.251 193.855 139.228 201.827 149.068 201.827Z" />
+ android:fillColor="#5BB974"
+ android:pathData="M141.125 191.479C140.725 191.499 140.326 191.423 139.961 191.257C139.596 191.092 139.276 190.841 139.028 190.527C138.778 190.205 138.598 189.834 138.502 189.438C138.406 189.042 138.394 188.63 138.469 188.23L139.587 180.239C139.726 179.221 140.233 178.289 141.012 177.619C141.775 176.936 142.766 176.565 143.79 176.58H154.346C155.37 176.565 156.361 176.936 157.124 177.619C157.903 178.289 158.41 179.221 158.549 180.239L159.667 188.23C159.742 188.63 159.73 189.042 159.634 189.438C159.537 189.834 159.358 190.205 159.108 190.527C158.859 190.842 158.538 191.094 158.171 191.26C157.805 191.425 157.404 191.5 157.002 191.479C156.648 191.48 156.298 191.412 155.971 191.278C155.641 191.14 155.343 190.935 155.097 190.675L152.703 188.282H145.45L143.056 190.675C142.809 190.933 142.512 191.139 142.183 191.278C141.847 191.415 141.488 191.483 141.125 191.479ZM141.553 189.182L144.594 186.151H153.542L156.583 189.182C156.71 189.264 156.853 189.321 157.002 189.348C157.088 189.352 157.175 189.339 157.256 189.309C157.337 189.279 157.411 189.233 157.474 189.173C157.531 189.112 157.573 189.038 157.594 188.957C157.616 188.876 157.616 188.791 157.596 188.71L156.408 180.51C156.34 180.008 156.093 179.548 155.713 179.214C155.332 178.88 154.843 178.695 154.337 178.693H143.79C143.284 178.695 142.795 178.88 142.414 179.214C142.034 179.548 141.787 180.008 141.719 180.51L140.54 188.71C140.52 188.791 140.52 188.876 140.542 188.957C140.563 189.038 140.604 189.112 140.662 189.173C140.723 189.232 140.796 189.278 140.876 189.308C140.955 189.338 141.04 189.351 141.125 189.348C141.274 189.311 141.418 189.255 141.553 189.182ZM154.398 185.086C154.539 185.087 154.678 185.061 154.809 185.009C154.939 184.956 155.058 184.879 155.158 184.78C155.258 184.681 155.337 184.563 155.39 184.432C155.443 184.301 155.468 184.161 155.464 184.02C155.466 183.88 155.44 183.74 155.388 183.61C155.335 183.479 155.257 183.361 155.157 183.262C155.058 183.162 154.939 183.084 154.809 183.031C154.678 182.978 154.539 182.952 154.398 182.955C154.257 182.952 154.118 182.978 153.987 183.031C153.857 183.084 153.738 183.162 153.639 183.262C153.54 183.361 153.461 183.479 153.408 183.61C153.356 183.74 153.33 183.88 153.332 184.02C153.327 184.161 153.351 184.302 153.404 184.433C153.457 184.564 153.536 184.682 153.638 184.78C153.737 184.88 153.856 184.959 153.986 185.012C154.117 185.064 154.257 185.089 154.398 185.086ZM152.266 181.889C152.407 181.891 152.546 181.865 152.677 181.812C152.807 181.76 152.926 181.682 153.026 181.584C153.126 181.485 153.205 181.366 153.258 181.235C153.31 181.105 153.336 180.965 153.332 180.824C153.334 180.683 153.308 180.544 153.256 180.413C153.203 180.283 153.125 180.165 153.025 180.065C152.926 179.966 152.807 179.887 152.677 179.835C152.546 179.782 152.407 179.756 152.266 179.758C152.125 179.755 151.985 179.78 151.854 179.833C151.723 179.885 151.605 179.964 151.506 180.064C151.407 180.164 151.329 180.283 151.277 180.413C151.224 180.544 151.198 180.683 151.2 180.824C151.198 180.964 151.224 181.104 151.276 181.234C151.329 181.365 151.407 181.483 151.507 181.583C151.606 181.682 151.725 181.76 151.855 181.813C151.986 181.866 152.125 181.892 152.266 181.889ZM144.542 185.086H146.141V183.226H148.002V181.654H146.141V179.785H144.542V181.654H142.672V183.252H144.542V185.086ZM141.553 189.182C141.504 189.238 141.441 189.28 141.37 189.304C141.292 189.333 141.209 189.348 141.125 189.348C141.04 189.351 140.955 189.338 140.876 189.308C140.796 189.278 140.723 189.232 140.662 189.173C140.604 189.112 140.563 189.038 140.542 188.957C140.52 188.876 140.52 188.791 140.54 188.71L141.719 180.51C141.787 180.008 142.034 179.548 142.414 179.214C142.795 178.88 143.284 178.695 143.79 178.693H154.346C154.852 178.695 155.341 178.88 155.721 179.214C156.102 179.548 156.349 180.008 156.417 180.51L157.596 188.71C157.616 188.791 157.616 188.876 157.594 188.957C157.573 189.038 157.531 189.112 157.474 189.173C157.411 189.233 157.337 189.279 157.256 189.309C157.175 189.339 157.088 189.352 157.002 189.348C156.921 189.348 156.841 189.333 156.766 189.304C156.695 189.28 156.632 189.238 156.583 189.182L153.542 186.151H144.594L141.553 189.182Z" />
-
+ android:fillColor="#FEEFC3"
+ android:pathData="M197.301 94.1194C207.141 94.1194 215.117 86.1468 215.117 76.3121C215.117 66.4775 207.141 58.5049 197.301 58.5049C187.461 58.5049 179.484 66.4775 179.484 76.3121C179.484 86.1468 187.461 94.1194 197.301 94.1194Z" />
+
+
+
+
+
\ No newline at end of file
diff --git a/res/drawable/ic_storage_wizard_ready.xml b/res/drawable/ic_storage_wizard_ready.xml
new file mode 100644
index 0000000000000000000000000000000000000000..c09c9ec5310e73b1eb39d2c8b676cae16c14ae5e
--- /dev/null
+++ b/res/drawable/ic_storage_wizard_ready.xml
@@ -0,0 +1,40 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/res/drawable/ic_swap_horiz.xml b/res/drawable/ic_swap_horiz.xml
index a38833becab9402822eb4102348988ab5dde5070..c41c9a343812570739045a589208bc69a4ad9ae4 100644
--- a/res/drawable/ic_swap_horiz.xml
+++ b/res/drawable/ic_swap_horiz.xml
@@ -20,5 +20,5 @@
android:viewportHeight="24.0">
+ android:fillColor="?android:attr/textColorPrimary"/>
diff --git a/res/drawable/ic_test_tick.xml b/res/drawable/ic_test_tick.xml
new file mode 100644
index 0000000000000000000000000000000000000000..9585806e985a51555a30d77f13ff71009feaf12f
--- /dev/null
+++ b/res/drawable/ic_test_tick.xml
@@ -0,0 +1,26 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/res/layout/storage_internal_format.xml b/res/layout/storage_internal_format.xml
index 0b49d7e1660df4e8b1b34acdca205a0af40c0ffd..f8224c4b6a4b3b439298298c845e828baab7c267 100644
--- a/res/layout/storage_internal_format.xml
+++ b/res/layout/storage_internal_format.xml
@@ -14,16 +14,16 @@
limitations under the License.
-->
-
+ android:layout_height="wrap_content"
+ android:fillViewport="true">
-
+ android:layout_height="wrap_content"
+ android:orientation="vertical">
-
-
-
-
+ android:padding="4dp">
+
+
+
-
+
diff --git a/res/layout/storage_wizard_generic.xml b/res/layout/storage_wizard_generic.xml
index e7881d3be87ed008777ffe1462c57dfdfa923be9..fc0bab1a8d828ae0d9c957b18be4b24cdb81e26f 100644
--- a/res/layout/storage_wizard_generic.xml
+++ b/res/layout/storage_wizard_generic.xml
@@ -14,32 +14,52 @@
limitations under the License.
-->
-
+ android:layout_height="wrap_content"
+ android:fitsSystemWindows="true">
-
-
-
-
-
-
-
-
-
+ android:layout_height="match_parent">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/res/layout/storage_wizard_init.xml b/res/layout/storage_wizard_init.xml
index e1e783312b1988f2590fb92624c3d20d2748014f..2d21e0e983ca72c926dfb5b3c7e29c9d522fa3e8 100644
--- a/res/layout/storage_wizard_init.xml
+++ b/res/layout/storage_wizard_init.xml
@@ -14,124 +14,30 @@
limitations under the License.
-->
-
+ android:layout_height="wrap_content"
+ android:fitsSystemWindows="true">
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ android:layout_height="match_parent">
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/res/layout/storage_wizard_init_external.xml b/res/layout/storage_wizard_init_external.xml
new file mode 100644
index 0000000000000000000000000000000000000000..38df28bc4365efb9713f1aa12645ff2ad894f496
--- /dev/null
+++ b/res/layout/storage_wizard_init_external.xml
@@ -0,0 +1,35 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/res/layout/storage_wizard_init_internal.xml b/res/layout/storage_wizard_init_internal.xml
new file mode 100644
index 0000000000000000000000000000000000000000..0a180703ed82d2e936d2aa7491ea97110297f1e2
--- /dev/null
+++ b/res/layout/storage_wizard_init_internal.xml
@@ -0,0 +1,35 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/res/layout/storage_wizard_progress.xml b/res/layout/storage_wizard_progress.xml
index 577ec3cbfc8a7f64b9ea3dde0be062d006846ecc..890be7076e9b0d07d2f3150743d709b6796ee444 100644
--- a/res/layout/storage_wizard_progress.xml
+++ b/res/layout/storage_wizard_progress.xml
@@ -14,47 +14,55 @@
limitations under the License.
-->
-
+ android:layout_height="wrap_content"
+ android:fitsSystemWindows="true">
-
-
-
-
-
-
-
-
-
-
-
-
+ android:layout_height="match_parent">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/res/menu/storage_volume.xml b/res/menu/storage_volume.xml
index 422355d0fb73c6530ad62e72f4032f81ca61fba6..b8725fb5d028ebccfe9850a26208ed31f1411edb 100644
--- a/res/menu/storage_volume.xml
+++ b/res/menu/storage_volume.xml
@@ -29,10 +29,10 @@
android:title="@string/storage_menu_format" />
+ android:title="@string/storage_menu_format_option" />
+ android:title="@string/storage_menu_format_option" />
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index 26ebbf699b7b750bddfc4b81442ea275dd2a94c1..a4f5e0432ac36ca972205a50434b71fada97ffc3 100755
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -498,4 +498,6 @@
40dp
30dp
27dp
+
+ 88dp
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 2c18441151a17f34e16cb2f70e94557dc8a31dcc..067e43d53fbf34c8f621c82586452d9a76b42e36 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -3512,12 +3512,14 @@
Mount
Eject
-
- Format
+
+ Format SD card for portable storage
+
+ Format card
Format as portable
-
- Format as internal
+
+ Format
Migrate data
@@ -3590,8 +3592,10 @@
\n\nTo use this ^1, you have to set it up first.
- After formatting, you can use this ^1 in other devices.
-\n\nAll data on this ^1 will be erased. Consider backing up first.
+ You can format this SD card to store photos, videos, music,
+ and more and access them on other devices.
+ \n\nAll data on this SD card will be erased.
+ \n\nBefore formatting
\n\nBack up photos & other media
\nMove your media files to alternative storage on this device, or transfer them to a computer using a USB cable.
\n\nBack up apps
@@ -3615,16 +3619,19 @@
System includes files used to run Android version %s
-
+
+ Guest mode users cannot format SD cards
+
+
Set up your ^1
- Use as portable storage
+ Format SD card for portable storage
- For moving photos and other media between devices.
+ Save photos, videos, music, and more and access them from other devices
- Use as internal storage
+ Format SD card for internal storage
- For storing anything on this device only, including apps and photos. Requires formatting that prevents it from working with other devices.
+ Save apps \u0026 media to use on this phone only
Format as internal storage
@@ -3679,13 +3686,11 @@
- Your ^1 is ready to use
+ ^1 formatted
- Your ^1 is all set to use with photos and other media.
+ You can start using your ^1
- Your new ^1 is working.
-\n\nTo move photos, files, and app data to this device, go to Settings > Storage.
-
+ You can start using your ^1
Move ^1
@@ -3715,26 +3720,26 @@
How will you use this ^1?
-
- Use for extra tablet storage
-
- For apps, files, and media on this tablet only
+
+ Format SD card for internal storage
+
+ Store apps \u0026 media to use on this tablet only. <a href="https://support.google.com/android/answer/12153449">Learn more about setting up an SD card</a>
- Tablet storage
-
- Use for extra phone storage
-
- For apps, files, and media on this phone only
+ Format
+
+ Format SD card for internal storage
+
+ Store apps \u0026 media to use on this phone only. <a href="https://support.google.com/android/answer/12153449">Learn more about setting up an SD card</a>
- Phone storage
+ Format
Or
-
- Use for portable storage
-
- For transferring files and media between devices
+
+ Format SD card for portable storage
+
+ Store photos, videos, music, and more and access them from other devices. <a href="https://support.google.com/android/answer/12153449">Learn more about setting up an SD card</a>
- Portable storage
+ Format
Set up later
@@ -3743,6 +3748,9 @@
This ^1 needs to be formatted to store apps, files, and media.
\n\nFormatting will erase existing content on the ^2. To avoid losing content, back it up to another ^3 or device.
+
+ This ^1 needs to be formatted to store photos, videos, music, and more.
+ \n\nFormatting will erase existing content on the ^2. To avoid losing content, back it up to another ^3 or device.
Format ^1
@@ -3786,12 +3794,11 @@
Continue
- You can move content to ^1
+ You can start using your ^1
- To move content to ^1, go to Settings > Storage
+ You can start using your ^1
- Your content was moved to ^1.
-\n\nTo manage this ^2, go to Settings > Storage.
+ You can start using your ^1
Battery status
@@ -7836,6 +7843,10 @@
Back
Next
+
+ Switch to portable
+
+ Format another way
Finish
diff --git a/src/com/android/settings/deviceinfo/PublicVolumeSettings.java b/src/com/android/settings/deviceinfo/PublicVolumeSettings.java
index f7dd85ab67a6b96e1817344b1589b191fd09038a..d43b2541db71d6dadc0782a8e988e1e25f2e7e58 100644
--- a/src/com/android/settings/deviceinfo/PublicVolumeSettings.java
+++ b/src/com/android/settings/deviceinfo/PublicVolumeSettings.java
@@ -19,6 +19,7 @@ package com.android.settings.deviceinfo;
import android.app.ActivityManager;
import android.app.settings.SettingsEnums;
import android.content.Context;
+import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.os.UserManager;
@@ -57,15 +58,34 @@ public class PublicVolumeSettings extends SettingsPreferenceFragment {
private String mVolumeId;
private VolumeInfo mVolume;
+ private final View.OnClickListener mUnmountListener = new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ new UnmountTask(getActivity(), mVolume).execute();
+ }
+ };
private DiskInfo mDisk;
-
private UsageProgressBarPreference mSummary;
-
private Preference mMount;
private Preference mFormatPublic;
- private Preference mFormatPrivate;
private Button mUnmount;
+ private final StorageEventListener mStorageListener = new StorageEventListener() {
+ @Override
+ public void onVolumeStateChanged(VolumeInfo vol, int oldState, int newState) {
+ if (Objects.equals(mVolume.getId(), vol.getId())) {
+ mVolume = vol;
+ update();
+ }
+ }
+ @Override
+ public void onVolumeRecordChanged(VolumeRecord rec) {
+ if (Objects.equals(mVolume.getFsUuid(), rec.getFsUuid())) {
+ mVolume = mStorageManager.findVolumeById(mVolumeId);
+ update();
+ }
+ }
+ };
private boolean mIsPermittedToAdopt;
private boolean isVolumeValid() {
@@ -120,10 +140,7 @@ public class PublicVolumeSettings extends SettingsPreferenceFragment {
mUnmount = new Button(getActivity());
mUnmount.setText(R.string.storage_menu_unmount);
mUnmount.setOnClickListener(mUnmountListener);
- mFormatPublic = buildAction(R.string.storage_menu_format);
- if (mIsPermittedToAdopt) {
- mFormatPrivate = buildAction(R.string.storage_menu_format_private);
- }
+ mFormatPublic = buildAction(R.string.storage_menu_format_option);
}
@Override
@@ -176,9 +193,6 @@ public class PublicVolumeSettings extends SettingsPreferenceFragment {
mUnmount.setVisibility(View.GONE);
}
addPreference(mFormatPublic);
- if (mDisk.isAdoptable() && mIsPermittedToAdopt) {
- addPreference(mFormatPrivate);
- }
}
private void addPreference(Preference pref) {
@@ -215,39 +229,14 @@ public class PublicVolumeSettings extends SettingsPreferenceFragment {
@Override
public boolean onPreferenceTreeClick(Preference pref) {
+ final Intent intent = new Intent(getActivity(), StorageWizardInit.class);
+ intent.putExtra(VolumeInfo.EXTRA_VOLUME_ID, mVolume.getId());
if (pref == mMount) {
new MountTask(getActivity(), mVolume).execute();
} else if (pref == mFormatPublic) {
- StorageWizardFormatConfirm.showPublic(getActivity(), mDisk.getId());
- } else if (pref == mFormatPrivate) {
- StorageWizardFormatConfirm.showPrivate(getActivity(), mDisk.getId());
+ startActivity(intent);
}
return super.onPreferenceTreeClick(pref);
}
-
- private final View.OnClickListener mUnmountListener = new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- new UnmountTask(getActivity(), mVolume).execute();
- }
- };
-
- private final StorageEventListener mStorageListener = new StorageEventListener() {
- @Override
- public void onVolumeStateChanged(VolumeInfo vol, int oldState, int newState) {
- if (Objects.equals(mVolume.getId(), vol.getId())) {
- mVolume = vol;
- update();
- }
- }
-
- @Override
- public void onVolumeRecordChanged(VolumeRecord rec) {
- if (Objects.equals(mVolume.getFsUuid(), rec.getFsUuid())) {
- mVolume = mStorageManager.findVolumeById(mVolumeId);
- update();
- }
- }
- };
-}
+}
\ No newline at end of file
diff --git a/src/com/android/settings/deviceinfo/StorageWizardBase.java b/src/com/android/settings/deviceinfo/StorageWizardBase.java
index b1b956e5fb57fef81625824fc0f0bc2d19064a73..801baecbc4ea076f6c8fc15ebd43e2a94670a0e9 100644
--- a/src/com/android/settings/deviceinfo/StorageWizardBase.java
+++ b/src/com/android/settings/deviceinfo/StorageWizardBase.java
@@ -41,17 +41,19 @@ import android.widget.TextView;
import androidx.fragment.app.FragmentActivity;
import com.android.settings.R;
-import com.android.settingslib.Utils;
+import com.android.settings.SetupWizardUtils;
import com.google.android.setupcompat.template.FooterBarMixin;
import com.google.android.setupcompat.template.FooterButton;
import com.google.android.setupdesign.GlifLayout;
+import com.google.android.setupdesign.util.ThemeHelper;
import java.text.NumberFormat;
import java.util.List;
import java.util.Objects;
public abstract class StorageWizardBase extends FragmentActivity {
+
private static final String TAG = "StorageWizardBase";
protected static final String EXTRA_FORMAT_FORGET_UUID = "format_forget_uuid";
@@ -70,6 +72,8 @@ public abstract class StorageWizardBase extends FragmentActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
+ setTheme(SetupWizardUtils.getTheme(this, getIntent()));
+ ThemeHelper.trySetDynamicColor(this);
super.onCreate(savedInstanceState);
mStorage = getSystemService(StorageManager.class);
@@ -97,20 +101,20 @@ public abstract class StorageWizardBase extends FragmentActivity {
mFooterBarMixin = getGlifLayout().getMixin(FooterBarMixin.class);
mFooterBarMixin.setSecondaryButton(
- new FooterButton.Builder(this)
- .setText(R.string.wizard_back)
- .setListener(this::onNavigateBack)
- .setButtonType(FooterButton.ButtonType.OTHER)
- .setTheme(R.style.SudGlifButton_Secondary)
- .build()
+ new FooterButton.Builder(this)
+ .setText(R.string.wizard_back)
+ .setListener(this::onNavigateBack)
+ .setButtonType(FooterButton.ButtonType.OTHER)
+ .setTheme(R.style.SudGlifButton_Secondary)
+ .build()
);
mFooterBarMixin.setPrimaryButton(
- new FooterButton.Builder(this)
- .setText(R.string.wizard_next)
- .setListener(this::onNavigateNext)
- .setButtonType(FooterButton.ButtonType.NEXT)
- .setTheme(R.style.SudGlifButton_Primary)
- .build()
+ new FooterButton.Builder(this)
+ .setText(R.string.wizard_next)
+ .setListener(this::onNavigateNext)
+ .setButtonType(FooterButton.ButtonType.NEXT)
+ .setTheme(R.style.SudGlifButton_Primary)
+ .build()
);
mBack = mFooterBarMixin.getSecondaryButton();
mNext = mFooterBarMixin.getPrimaryButton();
@@ -149,7 +153,7 @@ public abstract class StorageWizardBase extends FragmentActivity {
protected void setCurrentProgress(int progress) {
getProgressBar().setProgress(progress);
((TextView) requireViewById(R.id.storage_wizard_progress_summary)).setText(
- NumberFormat.getPercentInstance().format((double) progress / 100));
+ NumberFormat.getPercentInstance().format((double) progress / 100));
}
protected void setHeaderText(int resId, CharSequence... args) {
@@ -167,14 +171,14 @@ public abstract class StorageWizardBase extends FragmentActivity {
protected void setAuxChecklist() {
final FrameLayout aux = requireViewById(R.id.storage_wizard_aux);
aux.addView(LayoutInflater.from(aux.getContext())
- .inflate(R.layout.storage_wizard_checklist, aux, false));
+ .inflate(R.layout.storage_wizard_checklist, aux, false));
aux.setVisibility(View.VISIBLE);
// Customize string based on disk
((TextView) aux.requireViewById(R.id.storage_wizard_migrate_v2_checklist_media))
- .setText(TextUtils.expandTemplate(
- getText(R.string.storage_wizard_migrate_v2_checklist_media),
- getDiskShortDescription()));
+ .setText(TextUtils.expandTemplate(
+ getText(R.string.storage_wizard_migrate_v2_checklist_media),
+ getDiskShortDescription()));
}
protected void setBackButtonText(int resId, CharSequence... args) {
@@ -198,7 +202,6 @@ public abstract class StorageWizardBase extends FragmentActivity {
protected void setIcon(int resId) {
final GlifLayout layout = getGlifLayout();
final Drawable icon = getDrawable(resId).mutate();
- icon.setTintList(Utils.getColorAccent(layout.getContext()));
layout.setIcon(icon);
}
@@ -250,14 +253,14 @@ public abstract class StorageWizardBase extends FragmentActivity {
final List vols = mStorage.getVolumes();
for (VolumeInfo vol : vols) {
if (Objects.equals(mDisk.getId(), vol.getDiskId()) && (vol.getType() == type)
- && (vol.getState() == VolumeInfo.STATE_MOUNTED)) {
+ && (vol.getState() == VolumeInfo.STATE_MOUNTED)) {
return vol;
}
}
if (--attempts > 0) {
Log.w(TAG, "Missing mounted volume of type " + type + " hosted by disk "
- + mDisk.getId() + "; trying again");
+ + mDisk.getId() + "; trying again");
SystemClock.sleep(250);
} else {
return null;
@@ -265,7 +268,8 @@ public abstract class StorageWizardBase extends FragmentActivity {
}
}
- protected @NonNull CharSequence getDiskDescription() {
+ protected @NonNull
+ CharSequence getDiskDescription() {
if (mDisk != null) {
return mDisk.getDescription();
} else if (mVolume != null) {
@@ -275,7 +279,8 @@ public abstract class StorageWizardBase extends FragmentActivity {
}
}
- protected @NonNull CharSequence getDiskShortDescription() {
+ protected @NonNull
+ CharSequence getDiskShortDescription() {
if (mDisk != null) {
return mDisk.getShortDescription();
} else if (mVolume != null) {
@@ -294,4 +299,4 @@ public abstract class StorageWizardBase extends FragmentActivity {
}
}
};
-}
+}
\ No newline at end of file
diff --git a/src/com/android/settings/deviceinfo/StorageWizardFormatConfirm.java b/src/com/android/settings/deviceinfo/StorageWizardFormatConfirm.java
index 9c18a0da608c297e864dee5b9679d9f734cc170e..e2d8c7edddc9b2c24f132c3bcb4bf5923840d649 100644
--- a/src/com/android/settings/deviceinfo/StorageWizardFormatConfirm.java
+++ b/src/com/android/settings/deviceinfo/StorageWizardFormatConfirm.java
@@ -84,15 +84,23 @@ public class StorageWizardFormatConfirm extends InstrumentedDialogFragment {
builder.setTitle(TextUtils.expandTemplate(
getText(R.string.storage_wizard_format_confirm_v2_title),
disk.getShortDescription()));
- builder.setMessage(TextUtils.expandTemplate(
- getText(R.string.storage_wizard_format_confirm_v2_body),
+ if (formatPrivate) {
+ builder.setMessage(TextUtils.expandTemplate(
+ getText(R.string.storage_wizard_format_confirm_v2_body),
+ disk.getDescription(),
+ disk.getShortDescription(),
+ disk.getShortDescription()));
+ } else {
+ builder.setMessage(TextUtils.expandTemplate(
+ getText(R.string.storage_wizard_format_confirm_v2_body_external),
disk.getDescription(),
disk.getShortDescription(),
disk.getShortDescription()));
+ }
builder.setNegativeButton(android.R.string.cancel, null);
builder.setPositiveButton(
- TextUtils.expandTemplate(getText(R.string.storage_wizard_format_confirm_v2_action),
+ TextUtils.expandTemplate(getText(R.string.storage_menu_format_option),
disk.getShortDescription()),
(dialog, which) -> {
final Intent intent = new Intent(context, StorageWizardFormatProgress.class);
@@ -104,4 +112,4 @@ public class StorageWizardFormatConfirm extends InstrumentedDialogFragment {
return builder.create();
}
-}
+}
\ No newline at end of file
diff --git a/src/com/android/settings/deviceinfo/StorageWizardInit.java b/src/com/android/settings/deviceinfo/StorageWizardInit.java
index 426395c24fe7bed233b0706332222e3fd739336f..3a0f7e61df79d6a970ff930b0eee36514e38c024 100644
--- a/src/com/android/settings/deviceinfo/StorageWizardInit.java
+++ b/src/com/android/settings/deviceinfo/StorageWizardInit.java
@@ -18,21 +18,27 @@ package com.android.settings.deviceinfo;
import android.app.ActivityManager;
import android.app.settings.SettingsEnums;
-import android.content.Intent;
import android.os.Bundle;
import android.os.UserManager;
-import android.os.storage.DiskInfo;
-import android.os.storage.VolumeInfo;
+import android.text.Html;
+import android.text.Spannable;
+import android.text.method.LinkMovementMethod;
+import android.text.style.TypefaceSpan;
+import android.text.style.URLSpan;
import android.view.View;
-import android.widget.Button;
+import android.widget.TextView;
+import android.widget.Toast;
+import android.widget.ViewFlipper;
import com.android.settings.R;
import com.android.settings.overlay.FeatureFactory;
public class StorageWizardInit extends StorageWizardBase {
- private Button mInternal;
private boolean mIsPermittedToAdopt;
+ private boolean mPortable;
+
+ private ViewFlipper mFlipper;
@Override
protected void onCreate(Bundle savedInstanceState) {
@@ -41,63 +47,119 @@ public class StorageWizardInit extends StorageWizardBase {
finish();
return;
}
- setContentView(R.layout.storage_wizard_init);
mIsPermittedToAdopt = UserManager.get(this).isAdminUser()
- && !ActivityManager.isUserAMonkey();
+ && !ActivityManager.isUserAMonkey();
- setHeaderText(R.string.storage_wizard_init_v2_title, getDiskShortDescription());
+ if (!mIsPermittedToAdopt) {
+ //Notify guest users as to why formatting is disallowed
+ Toast.makeText(getApplicationContext(),
+ R.string.storage_wizard_guest, Toast.LENGTH_LONG).show();
+ finish();
+ return;
+ }
- mInternal = requireViewById(R.id.storage_wizard_init_internal);
+ setContentView(R.layout.storage_wizard_init);
+ setupHyperlink();
+ mPortable = true;
+
+ mFlipper = (ViewFlipper) findViewById(R.id.viewFlipper);
+ mFlipper.setDisplayedChild(0);
+ setHeaderText(R.string.storage_wizard_init_v2_external_title,
+ getDiskShortDescription());
- setBackButtonText(R.string.storage_wizard_init_v2_later);
- setNextButtonVisibility(View.INVISIBLE);
+ setNextButtonText(R.string.storage_wizard_init_v2_external_action);
+ setBackButtonText(R.string.wizard_back_adoptable);
+ setNextButtonVisibility(View.VISIBLE);
if (!mDisk.isAdoptable()) {
- // If not adoptable, we only have one choice
- mInternal.setEnabled(false);
- onNavigateExternal(null);
- } else if (!mIsPermittedToAdopt) {
+ setBackButtonVisibility(View.GONE);
+ }
+ }
+
+ @Override
+ public void onBackPressed() {
+ if (mPortable) {
+ super.onBackPressed();
+ } else {
+ mFlipper.showPrevious();
+ setBackButtonText(R.string.wizard_back_adoptable);
+ setHeaderText(R.string.storage_wizard_init_v2_external_title,
+ getDiskShortDescription());
+ setNextButtonText(R.string.storage_wizard_init_v2_external_action);
+ mPortable = true;
+ }
+ }
+
+ @Override
+ public void onNavigateBack(View v) {
+ if (mPortable == false) {
+ return;
+ }
+ if (!mIsPermittedToAdopt) {
// TODO: Show a message about why this is disabled for guest and
// that only an admin user can adopt an sd card.
- mInternal.setEnabled(false);
+
+ v.setEnabled(false);
+ } else {
+ mFlipper.showNext();
+ setHeaderText(R.string.storage_wizard_init_v2_internal_title,
+ getDiskShortDescription());
+ setNextButtonText(R.string.storage_wizard_init_v2_internal_action);
+ setBackButtonVisibility(View.INVISIBLE);
+ mPortable = false;
}
}
@Override
- public void onNavigateBack(View view) {
- finish();
+ public void onNavigateNext(View v) {
+ if (mPortable) {
+ onNavigateExternal(v);
+ } else {
+ onNavigateInternal(v);
+ }
}
public void onNavigateExternal(View view) {
if (view != null) {
// User made an explicit choice for external
FeatureFactory.getFactory(this).getMetricsFeatureProvider().action(this,
- SettingsEnums.ACTION_STORAGE_INIT_EXTERNAL);
- }
-
- if (mVolume != null && mVolume.getType() == VolumeInfo.TYPE_PUBLIC
- && mVolume.getState() != VolumeInfo.STATE_UNMOUNTABLE) {
- // Remember that user made decision
- mStorage.setVolumeInited(mVolume.getFsUuid(), true);
-
- final Intent intent = new Intent(this, StorageWizardReady.class);
- intent.putExtra(DiskInfo.EXTRA_DISK_ID, mDisk.getId());
- startActivity(intent);
- finish();
-
- } else {
- // Gotta format to get there
- StorageWizardFormatConfirm.showPublic(this, mDisk.getId());
+ SettingsEnums.ACTION_STORAGE_INIT_EXTERNAL);
}
+ StorageWizardFormatConfirm.showPublic(this, mDisk.getId());
}
public void onNavigateInternal(View view) {
if (view != null) {
// User made an explicit choice for internal
FeatureFactory.getFactory(this).getMetricsFeatureProvider().action(this,
- SettingsEnums.ACTION_STORAGE_INIT_INTERNAL);
+ SettingsEnums.ACTION_STORAGE_INIT_INTERNAL);
}
-
StorageWizardFormatConfirm.showPrivate(this, mDisk.getId());
}
+
+ private void setupHyperlink() {
+ TextView external_storage_textview = findViewById(R.id.storage_wizard_init_external_text);
+ TextView internal_storage_textview = findViewById(R.id.storage_wizard_init_internal_text);
+ String external_storage_text = getResources().getString(R.string.
+ storage_wizard_init_v2_external_summary);
+ String internal_storage_text = getResources().getString(R.string.
+ storage_wizard_init_v2_internal_summary);
+
+ Spannable external_storage_spannable = styleFont(external_storage_text);
+ Spannable internal_storage_spannable = styleFont(internal_storage_text);
+ external_storage_textview.setText(external_storage_spannable);
+ internal_storage_textview.setText(internal_storage_spannable);
+
+ external_storage_textview.setMovementMethod(LinkMovementMethod.getInstance());
+ internal_storage_textview.setMovementMethod(LinkMovementMethod.getInstance());
+ }
+
+ private Spannable styleFont(String text) {
+ Spannable s = (Spannable) Html.fromHtml(text);
+ for (URLSpan span : s.getSpans(0, s.length(), URLSpan.class)) {
+ TypefaceSpan typefaceSpan = new TypefaceSpan("sans-serif-medium");
+ s.setSpan(typefaceSpan, s.getSpanStart(span), s.getSpanEnd(span), 0);
+ }
+ return s;
+ }
}
diff --git a/src/com/android/settings/deviceinfo/StorageWizardReady.java b/src/com/android/settings/deviceinfo/StorageWizardReady.java
index 813bcc6e2018420001e83717b1598c76d0a3994d..8de94724afde06da96fadd93766fe145e3d392ad 100644
--- a/src/com/android/settings/deviceinfo/StorageWizardReady.java
+++ b/src/com/android/settings/deviceinfo/StorageWizardReady.java
@@ -19,6 +19,7 @@ package com.android.settings.deviceinfo;
import android.os.Bundle;
import android.os.storage.VolumeInfo;
import android.view.View;
+import android.widget.ImageView;
import com.android.settings.R;
@@ -48,7 +49,9 @@ public class StorageWizardReady extends StorageWizardBase {
setBodyText(R.string.storage_wizard_ready_v2_external_body,
getDiskDescription());
}
-
+ ImageView img = (ImageView) findViewById(R.id.storage_wizard_body_image);
+ img.setImageResource(R.drawable.ic_storage_wizard_ready);
+ setIcon(R.drawable.ic_test_tick);
setNextButtonText(R.string.done);
setBackButtonVisibility(View.INVISIBLE);
}
diff --git a/src/com/android/settings/deviceinfo/VolumeOptionMenuController.java b/src/com/android/settings/deviceinfo/VolumeOptionMenuController.java
index 4b87e422c1b81a321dbe2b5e772b3915fe5191e7..289db520ec0eb86e2ec3320b3de8da93bdbe750f 100644
--- a/src/com/android/settings/deviceinfo/VolumeOptionMenuController.java
+++ b/src/com/android/settings/deviceinfo/VolumeOptionMenuController.java
@@ -30,6 +30,7 @@ import android.util.Log;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
+import android.widget.Toast;
import androidx.annotation.VisibleForTesting;
import androidx.fragment.app.Fragment;
@@ -55,7 +56,9 @@ public class VolumeOptionMenuController implements LifecycleObserver, OnCreateOp
OnPrepareOptionsMenu, OnOptionsItemSelected {
private static final String TAG = "VolumeOptionMenuController";
-
+ private final Context mContext;
+ private final Fragment mFragment;
+ private final PackageManager mPackageManager;
@VisibleForTesting
MenuItem mRename;
@VisibleForTesting
@@ -74,18 +77,12 @@ public class VolumeOptionMenuController implements LifecycleObserver, OnCreateOp
MenuItem mFree;
@VisibleForTesting
MenuItem mForget;
-
- private final Context mContext;
- private final Fragment mFragment;
- private final PackageManager mPackageManager;
- private final StorageManager mStorageManager;
private StorageEntry mStorageEntry;
public VolumeOptionMenuController(Context context, Fragment parent, StorageEntry storageEntry) {
mContext = context;
mFragment = parent;
mPackageManager = context.getPackageManager();
- mStorageManager = context.getSystemService(StorageManager.class);
mStorageEntry = storageEntry;
}
@@ -162,12 +159,7 @@ public class VolumeOptionMenuController implements LifecycleObserver, OnCreateOp
if (mStorageEntry.isPublic()) {
mRename.setVisible(true);
mUnmount.setVisible(true);
- mFormat.setVisible(true);
- final DiskInfo diskInfo = mStorageManager.findDiskById(mStorageEntry.getDiskId());
- mFormatAsInternal.setVisible(diskInfo != null
- && diskInfo.isAdoptable()
- && UserManager.get(mContext).isAdminUser()
- && !ActivityManager.isUserAMonkey());
+ mFormatAsInternal.setVisible(true);
return;
}
}
@@ -225,6 +217,16 @@ public class VolumeOptionMenuController implements LifecycleObserver, OnCreateOp
}
if (menuId == R.id.storage_format_as_portable) {
if (mStorageEntry.isPrivate()) {
+ boolean mIsPermittedToAdopt = UserManager.get(mContext).isAdminUser()
+ && !ActivityManager.isUserAMonkey();
+
+ if(!mIsPermittedToAdopt){
+ //Notify guest users as to why formatting is disallowed
+ Toast.makeText(mFragment.getActivity(),
+ R.string.storage_wizard_guest,Toast.LENGTH_LONG).show();
+ (mFragment.getActivity()).finish();
+ return false;
+ }
final Bundle args = new Bundle();
args.putString(VolumeInfo.EXTRA_VOLUME_ID, mStorageEntry.getId());
new SubSettingLauncher(mContext)
@@ -239,8 +241,9 @@ public class VolumeOptionMenuController implements LifecycleObserver, OnCreateOp
}
if (menuId == R.id.storage_format_as_internal) {
if (mStorageEntry.isPublic()) {
- StorageWizardFormatConfirm.showPrivate(mFragment.getActivity(),
- mStorageEntry.getDiskId());
+ final Intent intent = new Intent(mFragment.getActivity(), StorageWizardInit.class);
+ intent.putExtra(VolumeInfo.EXTRA_VOLUME_ID, mStorageEntry.getId());
+ mContext.startActivity(intent);
return true;
}
return false;
@@ -269,4 +272,4 @@ public class VolumeOptionMenuController implements LifecycleObserver, OnCreateOp
updateOptionsMenu();
}
-}
+}
\ No newline at end of file
diff --git a/tests/unit/src/com/android/settings/deviceinfo/VolumeOptionMenuControllerTest.java b/tests/unit/src/com/android/settings/deviceinfo/VolumeOptionMenuControllerTest.java
index 8bd9b018d18ced67540d0ec58b54018ff4654734..d347f919628672f4fe0b3fa2cdda7f19cd8151fa 100644
--- a/tests/unit/src/com/android/settings/deviceinfo/VolumeOptionMenuControllerTest.java
+++ b/tests/unit/src/com/android/settings/deviceinfo/VolumeOptionMenuControllerTest.java
@@ -55,7 +55,6 @@ public class VolumeOptionMenuControllerTest {
@Mock(answer = Answers.RETURNS_DEEP_STUBS)
private Menu mMenu;
@Mock private PackageManager mPackageManager;
- @Mock private StorageManager mStorageManager;
@Mock private VolumeInfo mExternalVolumeInfo;
@Mock private VolumeInfo mInternalVolumeInfo;
@@ -68,7 +67,6 @@ public class VolumeOptionMenuControllerTest {
mContext = spy(ApplicationProvider.getApplicationContext());
when(mContext.getPackageManager()).thenReturn(mPackageManager);
- when(mContext.getSystemService(StorageManager.class)).thenReturn(mStorageManager);
when(mInternalVolumeInfo.getId()).thenReturn(INTERNAL_VOLUME_ID);
when(mInternalVolumeInfo.getType()).thenReturn(VolumeInfo.TYPE_PRIVATE);
@@ -173,17 +171,16 @@ public class VolumeOptionMenuControllerTest {
when(mExternalVolumeInfo.getState()).thenReturn(VolumeInfo.STATE_MOUNTED);
when(mExternalVolumeInfo.getDiskId()).thenReturn(DISK_ID);
final DiskInfo externalDiskInfo = mock(DiskInfo.class);
- when(mStorageManager.findDiskById(DISK_ID)).thenReturn(externalDiskInfo);
mController.setSelectedStorageEntry(new StorageEntry(mContext, mExternalVolumeInfo));
mController.onPrepareOptionsMenu(mMenu);
verify(mController.mRename, atLeastOnce()).setVisible(true);
verify(mController.mUnmount, atLeastOnce()).setVisible(true);
- verify(mController.mFormat, atLeastOnce()).setVisible(true);
- verify(mController.mMount, never()).setVisible(true);
+ verify(mController.mFormatAsInternal, atLeastOnce()).setVisible(true);
verify(mController.mFormatAsPortable, never()).setVisible(true);
- verify(mController.mFormatAsInternal, never()).setVisible(true);
+ verify(mController.mFormat, never()).setVisible(true);
+ verify(mController.mMount, never()).setVisible(true);
verify(mController.mFree, never()).setVisible(true);
verify(mController.mForget, never()).setVisible(true);
}