Loading src/com/android/documentsui/files/ActionHandler.java +8 −0 Original line number Original line Diff line number Diff line Loading @@ -511,6 +511,14 @@ public class ActionHandler<T extends Activity & Addons> extends AbstractActionHa return; return; } } // For APKs, even if the type is preview, we send an ACTION_VIEW intent to allow // PackageManager to install it. This allows users to install APKs from any root. // The Downloads special case is handled above in #manageDocument. if (MimeTypes.isApkType(doc.mimeType)) { viewDocument(doc); return; } switch (type) { switch (type) { case VIEW_TYPE_REGULAR: case VIEW_TYPE_REGULAR: if (viewDocument(doc)) { if (viewDocument(doc)) { Loading tests/unit/com/android/documentsui/files/ActionHandlerTest.java +9 −0 Original line number Original line Diff line number Diff line Loading @@ -333,6 +333,15 @@ public class ActionHandlerTest { mActivity.assertActivityStarted(DocumentsContract.ACTION_MANAGE_DOCUMENT); mActivity.assertActivityStarted(DocumentsContract.ACTION_MANAGE_DOCUMENT); } } @Test public void testDocumentPicked_Home_SendsActionViewForApks() throws Exception { mActivity.currentRoot = TestProvidersAccess.HOME; mHandler.openDocument(TestEnv.FILE_APK, ActionHandler.VIEW_TYPE_PREVIEW, ActionHandler.VIEW_TYPE_REGULAR); mActivity.assertActivityStarted(Intent.ACTION_VIEW); } @Test @Test public void testDocumentPicked_Downloads_ManagesPartialFiles() throws Exception { public void testDocumentPicked_Downloads_ManagesPartialFiles() throws Exception { mActivity.currentRoot = TestProvidersAccess.DOWNLOADS; mActivity.currentRoot = TestProvidersAccess.DOWNLOADS; Loading Loading
src/com/android/documentsui/files/ActionHandler.java +8 −0 Original line number Original line Diff line number Diff line Loading @@ -511,6 +511,14 @@ public class ActionHandler<T extends Activity & Addons> extends AbstractActionHa return; return; } } // For APKs, even if the type is preview, we send an ACTION_VIEW intent to allow // PackageManager to install it. This allows users to install APKs from any root. // The Downloads special case is handled above in #manageDocument. if (MimeTypes.isApkType(doc.mimeType)) { viewDocument(doc); return; } switch (type) { switch (type) { case VIEW_TYPE_REGULAR: case VIEW_TYPE_REGULAR: if (viewDocument(doc)) { if (viewDocument(doc)) { Loading
tests/unit/com/android/documentsui/files/ActionHandlerTest.java +9 −0 Original line number Original line Diff line number Diff line Loading @@ -333,6 +333,15 @@ public class ActionHandlerTest { mActivity.assertActivityStarted(DocumentsContract.ACTION_MANAGE_DOCUMENT); mActivity.assertActivityStarted(DocumentsContract.ACTION_MANAGE_DOCUMENT); } } @Test public void testDocumentPicked_Home_SendsActionViewForApks() throws Exception { mActivity.currentRoot = TestProvidersAccess.HOME; mHandler.openDocument(TestEnv.FILE_APK, ActionHandler.VIEW_TYPE_PREVIEW, ActionHandler.VIEW_TYPE_REGULAR); mActivity.assertActivityStarted(Intent.ACTION_VIEW); } @Test @Test public void testDocumentPicked_Downloads_ManagesPartialFiles() throws Exception { public void testDocumentPicked_Downloads_ManagesPartialFiles() throws Exception { mActivity.currentRoot = TestProvidersAccess.DOWNLOADS; mActivity.currentRoot = TestProvidersAccess.DOWNLOADS; Loading