Bitmap should be transferred directly through an Android Intent. Now Browser Actions library passes the Bitmap icons of custom items directly through the extra of BrowserActionsIntent.
The following revision refers to this bug: https://chromium.googlesource.com/custom-tabs-client/+/afe8a13457103292fb1ba49877a0b0e5abdc2f36 commit afe8a13457103292fb1ba49877a0b0e5abdc2f36 Author: Lei Tian <ltian@chromium.org> Date: Thu Nov 09 22:02:07 2017 Pass and retrieve the icons of Browser Actions custom items by their resource ids Instead of passing the Bitmap directly through BrowserActionsIntent, passing the resource ids of the icons, then get the Resources of the client app by PackageManager.getResourcesForApplication() and use it to retrieve the Bitmap icons. Bug: 775798 Change-Id: If66137ed19148224373a2cc4bcf5d869d41455cf Reviewed-on: https://chromium-review.googlesource.com/759260 Commit-Queue: Lei Tian <ltian@chromium.org> Reviewed-by: Yusuf Ozuysal <yusufo@chromium.org> [modify] https://crrev.com/afe8a13457103292fb1ba49877a0b0e5abdc2f36/Application/src/main/java/org/chromium/customtabsclient/MainActivity.java [modify] https://crrev.com/afe8a13457103292fb1ba49877a0b0e5abdc2f36/customtabs/src/android/support/customtabs/browseractions/BrowserActionsIntent.java [modify] https://crrev.com/afe8a13457103292fb1ba49877a0b0e5abdc2f36/customtabs/src/android/support/customtabs/browseractions/BrowserActionItem.java
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/fa849f85fa78faa965b2b392a9b0428ef743893c commit fa849f85fa78faa965b2b392a9b0428ef743893c Author: Lei Tian <ltian@chromium.org> Date: Mon Nov 13 20:50:32 2017 Chrome retrieves Browser Actions' custom item icons through resource ids Browser Actions will pass only the resource ids of the custom items' icons through the Intent, instead of passing the whole Bitmaps. Then with the source package name, Chrome can retrieve the client app's Resources by PackageManager.getResourcesForApplication() and use it to get the icons. Bug: 775798 Change-Id: Ia63f07a6245673df63e71b550ffff2f63753964f Reviewed-on: https://chromium-review.googlesource.com/758745 Commit-Queue: Lei Tian <ltian@chromium.org> Reviewed-by: Ted Choc <tedchoc@chromium.org> Cr-Commit-Position: refs/heads/master@{#516036} [modify] https://crrev.com/fa849f85fa78faa965b2b392a9b0428ef743893c/DEPS [modify] https://crrev.com/fa849f85fa78faa965b2b392a9b0428ef743893c/chrome/android/java/AndroidManifest.xml [modify] https://crrev.com/fa849f85fa78faa965b2b392a9b0428ef743893c/chrome/android/java/src/org/chromium/chrome/browser/browseractions/BrowserActionActivity.java [modify] https://crrev.com/fa849f85fa78faa965b2b392a9b0428ef743893c/chrome/android/java/src/org/chromium/chrome/browser/browseractions/BrowserActionsContextMenuHelper.java [modify] https://crrev.com/fa849f85fa78faa965b2b392a9b0428ef743893c/chrome/android/java/src/org/chromium/chrome/browser/browseractions/BrowserActionsCustomContextMenuItem.java [modify] https://crrev.com/fa849f85fa78faa965b2b392a9b0428ef743893c/chrome/android/javatests/src/org/chromium/chrome/browser/browseractions/BrowserActionActivityTest.java [modify] https://crrev.com/fa849f85fa78faa965b2b392a9b0428ef743893c/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/ClientManagerTest.java [modify] https://crrev.com/fa849f85fa78faa965b2b392a9b0428ef743893c/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabActivityTest.java [modify] https://crrev.com/fa849f85fa78faa965b2b392a9b0428ef743893c/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabsConnectionTest.java [modify] https://crrev.com/fa849f85fa78faa965b2b392a9b0428ef743893c/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabsTestUtils.java [modify] https://crrev.com/fa849f85fa78faa965b2b392a9b0428ef743893c/chrome/android/junit/src/org/chromium/chrome/browser/browseractions/BrowserActionsIntentTest.java
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/c5ced10789e420d2427ebbd7a6c0e6790a661924 commit c5ced10789e420d2427ebbd7a6c0e6790a661924 Author: Wei-Yin Chen (陳威尹) <wychen@chromium.org> Date: Tue Nov 14 00:21:30 2017 Revert "Chrome retrieves Browser Actions' custom item icons through resource ids" This reverts commit fa849f85fa78faa965b2b392a9b0428ef743893c. Reason for revert: downstream CL is not ready yet. Original change's description: > Chrome retrieves Browser Actions' custom item icons through resource ids > > Browser Actions will pass only the resource ids of the custom items' > icons through the Intent, instead of passing the whole Bitmaps. Then > with the source package name, Chrome can retrieve the client app's > Resources by PackageManager.getResourcesForApplication() and use it to > get the icons. > > Bug: 775798 > Change-Id: Ia63f07a6245673df63e71b550ffff2f63753964f > Reviewed-on: https://chromium-review.googlesource.com/758745 > Commit-Queue: Lei Tian <ltian@chromium.org> > Reviewed-by: Ted Choc <tedchoc@chromium.org> > Cr-Commit-Position: refs/heads/master@{#516036} TBR=tedchoc@chromium.org,yusufo@chromium.org,ltian@chromium.org Change-Id: Ief3ca089894435000d493ff2af37d35a8003d24e No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: 775798 Reviewed-on: https://chromium-review.googlesource.com/767807 Reviewed-by: Wei-Yin Chen (陳威尹) <wychen@chromium.org> Commit-Queue: Wei-Yin Chen (陳威尹) <wychen@chromium.org> Cr-Commit-Position: refs/heads/master@{#516110} [modify] https://crrev.com/c5ced10789e420d2427ebbd7a6c0e6790a661924/DEPS [modify] https://crrev.com/c5ced10789e420d2427ebbd7a6c0e6790a661924/chrome/android/java/AndroidManifest.xml [modify] https://crrev.com/c5ced10789e420d2427ebbd7a6c0e6790a661924/chrome/android/java/src/org/chromium/chrome/browser/browseractions/BrowserActionActivity.java [modify] https://crrev.com/c5ced10789e420d2427ebbd7a6c0e6790a661924/chrome/android/java/src/org/chromium/chrome/browser/browseractions/BrowserActionsContextMenuHelper.java [modify] https://crrev.com/c5ced10789e420d2427ebbd7a6c0e6790a661924/chrome/android/java/src/org/chromium/chrome/browser/browseractions/BrowserActionsCustomContextMenuItem.java [modify] https://crrev.com/c5ced10789e420d2427ebbd7a6c0e6790a661924/chrome/android/javatests/src/org/chromium/chrome/browser/browseractions/BrowserActionActivityTest.java [modify] https://crrev.com/c5ced10789e420d2427ebbd7a6c0e6790a661924/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/ClientManagerTest.java [modify] https://crrev.com/c5ced10789e420d2427ebbd7a6c0e6790a661924/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabActivityTest.java [modify] https://crrev.com/c5ced10789e420d2427ebbd7a6c0e6790a661924/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabsConnectionTest.java [modify] https://crrev.com/c5ced10789e420d2427ebbd7a6c0e6790a661924/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabsTestUtils.java [modify] https://crrev.com/c5ced10789e420d2427ebbd7a6c0e6790a661924/chrome/android/junit/src/org/chromium/chrome/browser/browseractions/BrowserActionsIntentTest.java
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/50dd9d88b9d2fe948bba0309beec53769cebecbe commit 50dd9d88b9d2fe948bba0309beec53769cebecbe Author: Lei Tian <ltian@chromium.org> Date: Wed Nov 15 23:02:18 2017 Reland "Chrome retrieves Browser Actions' custom item icons through resource ids" This is a reland of fa849f85fa78faa965b2b392a9b0428ef743893c. Original change's description: > Chrome retrieves Browser Actions' custom item icons through resource ids > > Browser Actions will pass only the resource ids of the custom items' > icons through the Intent, instead of passing the whole Bitmaps. Then > with the source package name, Chrome can retrieve the client app's > Resources by PackageManager.getResourcesForApplication() and use it to > get the icons. > > Bug: 775798 > Change-Id: Ia63f07a6245673df63e71b550ffff2f63753964f > Reviewed-on: https://chromium-review.googlesource.com/758745 > Commit-Queue: Lei Tian <ltian@chromium.org> > Reviewed-by: Ted Choc <tedchoc@chromium.org> > Cr-Commit-Position: refs/heads/master@{#516036} Bug: 775798 Change-Id: I6b382d155408ce070bbb5f678df210ad77edf844 Reviewed-on: https://chromium-review.googlesource.com/769770 Reviewed-by: Peter Wen <wnwen@chromium.org> Reviewed-by: Ted Choc <tedchoc@chromium.org> Commit-Queue: Lei Tian <ltian@chromium.org> Cr-Commit-Position: refs/heads/master@{#516873} [modify] https://crrev.com/50dd9d88b9d2fe948bba0309beec53769cebecbe/DEPS [modify] https://crrev.com/50dd9d88b9d2fe948bba0309beec53769cebecbe/build/android/lint/suppressions.xml [modify] https://crrev.com/50dd9d88b9d2fe948bba0309beec53769cebecbe/chrome/android/java/AndroidManifest.xml [modify] https://crrev.com/50dd9d88b9d2fe948bba0309beec53769cebecbe/chrome/android/java/src/org/chromium/chrome/browser/browseractions/BrowserActionActivity.java [modify] https://crrev.com/50dd9d88b9d2fe948bba0309beec53769cebecbe/chrome/android/java/src/org/chromium/chrome/browser/browseractions/BrowserActionsContextMenuHelper.java [modify] https://crrev.com/50dd9d88b9d2fe948bba0309beec53769cebecbe/chrome/android/java/src/org/chromium/chrome/browser/browseractions/BrowserActionsCustomContextMenuItem.java [modify] https://crrev.com/50dd9d88b9d2fe948bba0309beec53769cebecbe/chrome/android/javatests/src/org/chromium/chrome/browser/browseractions/BrowserActionActivityTest.java [modify] https://crrev.com/50dd9d88b9d2fe948bba0309beec53769cebecbe/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/ClientManagerTest.java [modify] https://crrev.com/50dd9d88b9d2fe948bba0309beec53769cebecbe/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabActivityTest.java [modify] https://crrev.com/50dd9d88b9d2fe948bba0309beec53769cebecbe/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabsConnectionTest.java [modify] https://crrev.com/50dd9d88b9d2fe948bba0309beec53769cebecbe/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabsTestUtils.java [modify] https://crrev.com/50dd9d88b9d2fe948bba0309beec53769cebecbe/chrome/android/junit/src/org/chromium/chrome/browser/browseractions/BrowserActionsIntentTest.java
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/9199b4ed3f7c321d29bfae17e95962c705d420b4 commit 9199b4ed3f7c321d29bfae17e95962c705d420b4 Author: Lei Tian <ltian@chromium.org> Date: Tue Nov 28 19:24:10 2017 Retrieve Browser Actions icon by ResourcesCompat and AppCompatResources ResourcesCompat and ApiCompatibilityUtils cannot get drawable corrrectly for vector drawable on pre-L devices. AppCompatResources has problem to get LayerDrawable and AnimationDrawable. By combing them together, it will have a good coverage for different types of drawable on different os. Bug: 775798 Change-Id: Id6e407260323bd1c43ea301c9952bc49725dd066 Reviewed-on: https://chromium-review.googlesource.com/792129 Commit-Queue: Lei Tian <ltian@chromium.org> Reviewed-by: Ted Choc <tedchoc@chromium.org> Cr-Commit-Position: refs/heads/master@{#519789} [modify] https://crrev.com/9199b4ed3f7c321d29bfae17e95962c705d420b4/chrome/android/java/src/org/chromium/chrome/browser/browseractions/BrowserActionsContextMenuHelper.java [modify] https://crrev.com/9199b4ed3f7c321d29bfae17e95962c705d420b4/chrome/android/javatests/src/org/chromium/chrome/browser/browseractions/BrowserActionActivityTest.java
The following revision refers to this bug: https://chromium.googlesource.com/custom-tabs-client/+/86d8643d95258acddd0b915d78b29530af327cc7 commit 86d8643d95258acddd0b915d78b29530af327cc7 Author: Lei Tian <ltian@chromium.org> Date: Wed Jan 24 23:30:11 2018 Pass images through FileProvider This CL implements passing images between different applications of browser service through FileProvider. The detail of design is here: https://docs.google.com/document/d/1h7C47nSfKNjzhixTwXbF6jJSL7Xf0Mqs3Ex0xyPX_oc/edit?usp=sharing Bug: 775798 Change-Id: I82599060c9a38bdf8af74296451be6fda566ba78 Reviewed-on: https://chromium-review.googlesource.com/835281 Reviewed-by: Yusuf Ozuysal <yusufo@chromium.org> Reviewed-by: Tommy Nyquist <nyquist@chromium.org> Reviewed-by: Ted Choc <tedchoc@chromium.org> Commit-Queue: Lei Tian <ltian@chromium.org> [modify] https://crrev.com/86d8643d95258acddd0b915d78b29530af327cc7/Application/src/main/java/org/chromium/customtabsclient/MainActivity.java [add] https://crrev.com/86d8643d95258acddd0b915d78b29530af327cc7/customtabs/src/android/support/customtabs/browseractions/BrowserServiceFileProvider.java [modify] https://crrev.com/86d8643d95258acddd0b915d78b29530af327cc7/customtabs/src/android/support/customtabs/browseractions/BrowserActionsIntent.java [add] https://crrev.com/86d8643d95258acddd0b915d78b29530af327cc7/customtabs/src/android/support/customtabs/browseractions/BrowserServiceImageReadTask.java [add] https://crrev.com/86d8643d95258acddd0b915d78b29530af327cc7/Application/src/main/res/xml/filepaths.xml [modify] https://crrev.com/86d8643d95258acddd0b915d78b29530af327cc7/customtabs/AndroidManifest.xml [modify] https://crrev.com/86d8643d95258acddd0b915d78b29530af327cc7/Application/src/main/AndroidManifest.xml [modify] https://crrev.com/86d8643d95258acddd0b915d78b29530af327cc7/customtabs/src/android/support/customtabs/browseractions/BrowserActionItem.java
The following revision refers to this bug: https://chromium.googlesource.com/custom-tabs-client/+/ad730ac12ab1c96b3211b6afca3b0edb591b37ae commit ad730ac12ab1c96b3211b6afca3b0edb591b37ae Author: Lei Tian <ltian@chromium.org> Date: Thu Jan 25 22:42:31 2018 Injecting package name to CCT support lib AndroidManifest and merge it into imported apps This CL tries to achieve injecting package name variable into the provider in the AndroidManifest of CCT support lib. The AndroidManifest has a provider whose authorities should be inflated different package names based on the imported apps. This is achieved by having a build variable ${package_name} in the AndroidManifest of CCT support lib. When imported, the AndroidManifest is merged into app's AndroidManifest and inflate with the app's package name. Bug: 775798 Change-Id: I9cb804a972abd5e80e853ca1a1ac7bba4627ec61 Reviewed-on: https://chromium-review.googlesource.com/874912 Commit-Queue: Lei Tian <ltian@chromium.org> Reviewed-by: Yusuf Ozuysal <yusufo@chromium.org> [modify] https://crrev.com/ad730ac12ab1c96b3211b6afca3b0edb591b37ae/Application/src/main/AndroidManifest.xml [rename] https://crrev.com/ad730ac12ab1c96b3211b6afca3b0edb591b37ae/customtabs/res/xml/filepaths.xml [modify] https://crrev.com/ad730ac12ab1c96b3211b6afca3b0edb591b37ae/customtabs/AndroidManifest.xml
The following revision refers to this bug: https://chromium.googlesource.com/custom-tabs-client/+/0f51f5ce50a24fa333e381560266b6f5d57f2cac commit 0f51f5ce50a24fa333e381560266b6f5d57f2cac Author: Lei Tian <ltian@chromium.org> Date: Thu Feb 08 19:53:42 2018 Clean up images which have not been shared by file provdier for a period of time Implement to clean up the images which haven't been shared by Browser Service file provider for a period of time. The detail of design is here: https://docs.google.com/document/d/1h7C47nSfKNjzhixTwXbF6jJSL7Xf0Mqs3Ex0xyPX_oc/edit?usp=sharing. Now if an image is not used for more than a week, it will be deleted. Bug: 775798 Change-Id: Ie8a8390e6a387dd7ed46c3d0b1a5076fd3eb7337 Reviewed-on: https://chromium-review.googlesource.com/846107 Reviewed-by: Ted Choc <tedchoc@chromium.org> Reviewed-by: Yusuf Ozuysal <yusufo@chromium.org> Commit-Queue: Lei Tian <ltian@chromium.org> [modify] https://crrev.com/0f51f5ce50a24fa333e381560266b6f5d57f2cac/customtabs/src/android/support/customtabs/browseractions/BrowserServiceFileProvider.java
The following revision refers to this bug: https://chromium.googlesource.com/custom-tabs-client/+/911f9f6ebb9ddb6d65d2dbbddabe402b1b10d8a6 commit 911f9f6ebb9ddb6d65d2dbbddabe402b1b10d8a6 Author: Lei Tian <ltian@chromium.org> Date: Tue Feb 13 19:48:53 2018 Browser Actions fallback dialog could retrieve image from image provider Add logic to fallback dialog to retrieve custom item icons from image provider. Bug: 775798 Change-Id: I72db51f6aaae753a9b3d9572cfeb2532b6fbf65f Reviewed-on: https://chromium-review.googlesource.com/907632 Commit-Queue: Lei Tian <ltian@chromium.org> Reviewed-by: Ted Choc <tedchoc@chromium.org> Reviewed-by: Yusuf Ozuysal <yusufo@chromium.org> [modify] https://crrev.com/911f9f6ebb9ddb6d65d2dbbddabe402b1b10d8a6/customtabs/src/android/support/customtabs/browseractions/BrowserActionsFallbackMenuAdapter.java [modify] https://crrev.com/911f9f6ebb9ddb6d65d2dbbddabe402b1b10d8a6/customtabs/src/android/support/customtabs/browseractions/BrowserServiceImageReadTask.java
The following revision refers to this bug: https://chromium.googlesource.com/custom-tabs-client/+/9cfda16f07de5d34c2cce32da389612ae673d235 commit 9cfda16f07de5d34c2cce32da389612ae673d235 Author: Lei Tian <ltian@chromium.org> Date: Wed Feb 21 22:50:27 2018 Fix IndexOutOfBoundsException when urls to grant permission is empty or null When the urls passed to BrowserServiceFileProvider.grantReadPermission() is null or empty, the function crashes with an IndexOutOfBoundException. This CL fixes it and removes the duplicate urls added to ClipData. Bug: 775798 temp change Change-Id: Iba366b665ec9c9377ff6a50edd296c0592eded8c Reviewed-on: https://chromium-review.googlesource.com/927601 Reviewed-by: Yusuf Ozuysal <yusufo@chromium.org> Commit-Queue: Lei Tian <ltian@chromium.org> [modify] https://crrev.com/9cfda16f07de5d34c2cce32da389612ae673d235/customtabs/src/android/support/customtabs/browseractions/BrowserServiceImageReadTask.java [modify] https://crrev.com/9cfda16f07de5d34c2cce32da389612ae673d235/customtabs/src/android/support/customtabs/browseractions/BrowserServiceFileProvider.java
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/b67b9013d1fde057389b13e191ea1dcfcef2af91 commit b67b9013d1fde057389b13e191ea1dcfcef2af91 Author: Lei Tian <ltian@chromium.org> Date: Thu Feb 22 20:09:14 2018 Roll src/third_party/custom_tab_client/src/11160d7...e3002b7 (4 commits) Bug: 775798 Change-Id: I571b4bdb62c4076fe4fe9b6ae6eeb0f022dba15e Reviewed-on: https://chromium-review.googlesource.com/893702 Commit-Queue: Lei Tian <ltian@chromium.org> Reviewed-by: Yusuf Ozuysal <yusufo@chromium.org> Reviewed-by: agrieve <agrieve@chromium.org> Reviewed-by: Peter Wen <wnwen@chromium.org> Cr-Commit-Position: refs/heads/master@{#538539} [modify] https://crrev.com/b67b9013d1fde057389b13e191ea1dcfcef2af91/DEPS [modify] https://crrev.com/b67b9013d1fde057389b13e191ea1dcfcef2af91/third_party/custom_tabs_client/BUILD.gn
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/496ca4c24b4188538fccd463488a479bd1dc3de8 commit 496ca4c24b4188538fccd463488a479bd1dc3de8 Author: Lei Tian <ltian@chromium.org> Date: Thu Feb 22 22:01:22 2018 Retrieve images of Browser Actions through BrowserServiceFileProvider This CL syncs the implemntation of sending images from Browser Actions through FileProvider. It also implement to use the uris from the provider to access the images and populate the ui. Bug: 775798 Change-Id: I17bee57063c6db1d9387b156f7e6341eae5ba15b Reviewed-on: https://chromium-review.googlesource.com/835285 Commit-Queue: Lei Tian <ltian@chromium.org> Reviewed-by: Ted Choc <tedchoc@chromium.org> Reviewed-by: Yusuf Ozuysal <yusufo@chromium.org> Cr-Commit-Position: refs/heads/master@{#538581} [modify] https://crrev.com/496ca4c24b4188538fccd463488a479bd1dc3de8/chrome/android/java/src/org/chromium/chrome/browser/browseractions/BrowserActionsContextMenuHelper.java [modify] https://crrev.com/496ca4c24b4188538fccd463488a479bd1dc3de8/chrome/android/java/src/org/chromium/chrome/browser/browseractions/BrowserActionsCustomContextMenuItem.java [modify] https://crrev.com/496ca4c24b4188538fccd463488a479bd1dc3de8/chrome/android/java/src/org/chromium/chrome/browser/contextmenu/ChromeContextMenuItem.java [modify] https://crrev.com/496ca4c24b4188538fccd463488a479bd1dc3de8/chrome/android/java/src/org/chromium/chrome/browser/contextmenu/ContextMenuItem.java [modify] https://crrev.com/496ca4c24b4188538fccd463488a479bd1dc3de8/chrome/android/java/src/org/chromium/chrome/browser/contextmenu/ShareContextMenuItem.java [modify] https://crrev.com/496ca4c24b4188538fccd463488a479bd1dc3de8/chrome/android/java/src/org/chromium/chrome/browser/contextmenu/TabularContextMenuListAdapter.java [modify] https://crrev.com/496ca4c24b4188538fccd463488a479bd1dc3de8/chrome/android/javatests/src/org/chromium/chrome/browser/browseractions/BrowserActionActivityTest.java
Comment 1 by bugdroid1@chromium.org
, Nov 9 2017