| | | |
Offset 254, 22 lines modified | Offset 254, 22 lines modified |
254 | ········if·(!TextUtils.isEmpty((CharSequence)s))·{ | 254 | ········if·(!TextUtils.isEmpty((CharSequence)s))·{ |
255 | ············return·s; | 255 | ············return·s; |
256 | ········} | 256 | ········} |
257 | ········s·=·"external_primary"; | 257 | ········s·=·"external_primary"; |
258 | ········if·(!Objects.equals(s2,·s))·{ | 258 | ········if·(!Objects.equals(s2,·s))·{ |
259 | ············return·s2; | 259 | ············return·s2; |
260 | ········} | 260 | ········} |
261 | ········return·this.getContext().getResources().getString(2131558446); | 261 | ········return·this.getContext().getResources().getString(2131558447); |
262 | ····} | 262 | ····} |
263 | ···· | 263 | ···· |
264 | ····private·String·cleanUpMediaDisplayName(final·String·s)·{ | 264 | ····private·String·cleanUpMediaDisplayName(final·String·s)·{ |
265 | ········if·(!"<unknown>".equals(s))·{ | 265 | ········if·(!"<unknown>".equals(s))·{ |
266 | ············return·s; | 266 | ············return·s; |
267 | ········} | 267 | ········} |
268 | ········return·this.getContext().getResources().getString(2131558446); | 268 | ········return·this.getContext().getResources().getString(2131558447); |
269 | ····} | 269 | ····} |
270 | ···· | 270 | ···· |
271 | ····private·void·enforceShellRestrictions()·{ | 271 | ····private·void·enforceShellRestrictions()·{ |
272 | ········if·(UserHandle.getAppId(Binder.getCallingUid())·==·2000·&&·((UserManager)this.getContext().getSystemService((Class)UserManager.class)).hasUserRestriction("no_usb_file_transfer"))·{ | 272 | ········if·(UserHandle.getAppId(Binder.getCallingUid())·==·2000·&&·((UserManager)this.getContext().getSystemService((Class)UserManager.class)).hasUserRestriction("no_usb_file_transfer"))·{ |
273 | ············final·StringBuilder·sb·=·new·StringBuilder(); | 273 | ············final·StringBuilder·sb·=·new·StringBuilder(); |
274 | ············sb.append("Shell·user·cannot·access·files·for·user·"); | 274 | ············sb.append("Shell·user·cannot·access·files·for·user·"); |
275 | ············sb.append(UserHandle.myUserId()); | 275 | ············sb.append(UserHandle.myUserId()); |
Offset 496, 24 lines modified | Offset 496, 24 lines modified |
496 | ········else·{ | 496 | ········else·{ |
497 | ············n·=·10; | 497 | ············n·=·10; |
498 | ········} | 498 | ········} |
499 | ········final·MatrixCursor$RowBuilder·row·=·matrixCursor.newRow(); | 499 | ········final·MatrixCursor$RowBuilder·row·=·matrixCursor.newRow(); |
500 | ········final·String·s·=·"audio_root"; | 500 | ········final·String·s·=·"audio_root"; |
501 | ········row.add("root_id",·(Object)s); | 501 | ········row.add("root_id",·(Object)s); |
502 | ········row.add("flags",·(Object)n); | 502 | ········row.add("flags",·(Object)n); |
503 | ········row.add("title",·(Object)this.getContext().getString(2131558438)); | 503 | ········row.add("title",·(Object)this.getContext().getString(2131558439)); |
504 | ········row.add("document_id",·(Object)s); | 504 | ········row.add("document_id",·(Object)s); |
505 | ········row.add("mime_types",·(Object)MediaDocumentsProvider.AUDIO_MIME_TYPES); | 505 | ········row.add("mime_types",·(Object)MediaDocumentsProvider.AUDIO_MIME_TYPES); |
506 | ········row.add("query_args",·(Object)MediaDocumentsProvider.SUPPORTED_QUERY_ARGS); | 506 | ········row.add("query_args",·(Object)MediaDocumentsProvider.SUPPORTED_QUERY_ARGS); |
507 | ····} | 507 | ····} |
508 | ···· | 508 | ···· |
509 | ····private·void·includeAudioRootDocument(final·MatrixCursor·matrixCursor)·{ | 509 | ····private·void·includeAudioRootDocument(final·MatrixCursor·matrixCursor)·{ |
510 | ········final·MatrixCursor$RowBuilder·row·=·matrixCursor.newRow(); | 510 | ········final·MatrixCursor$RowBuilder·row·=·matrixCursor.newRow(); |
511 | ········row.add("document_id",·(Object)"audio_root"); | 511 | ········row.add("document_id",·(Object)"audio_root"); |
512 | ········row.add("_display_name",·(Object)this.getContext().getString(2131558438)); | 512 | ········row.add("_display_name",·(Object)this.getContext().getString(2131558439)); |
513 | ········row.add("mime_type",·(Object)"vnd.android.document/directory"); | 513 | ········row.add("mime_type",·(Object)"vnd.android.document/directory"); |
514 | ····} | 514 | ····} |
515 | ···· | 515 | ···· |
516 | ····private·void·includeDocument(final·MatrixCursor·matrixCursor,·final·Cursor·cursor)·{ | 516 | ····private·void·includeDocument(final·MatrixCursor·matrixCursor,·final·Cursor·cursor)·{ |
517 | ········final·String·docIdForIdent·=·getDocIdForIdent("document",·cursor.getLong(0)); | 517 | ········final·String·docIdForIdent·=·getDocIdForIdent("document",·cursor.getLong(0)); |
518 | ········final·MatrixCursor$RowBuilder·row·=·matrixCursor.newRow(); | 518 | ········final·MatrixCursor$RowBuilder·row·=·matrixCursor.newRow(); |
519 | ········row.add("document_id",·(Object)docIdForIdent); | 519 | ········row.add("document_id",·(Object)docIdForIdent); |
Offset 544, 24 lines modified | Offset 544, 24 lines modified |
544 | ········else·{ | 544 | ········else·{ |
545 | ············n·=·14; | 545 | ············n·=·14; |
546 | ········} | 546 | ········} |
547 | ········final·MatrixCursor$RowBuilder·row·=·matrixCursor.newRow(); | 547 | ········final·MatrixCursor$RowBuilder·row·=·matrixCursor.newRow(); |
548 | ········final·String·s·=·"documents_root"; | 548 | ········final·String·s·=·"documents_root"; |
549 | ········row.add("root_id",·(Object)s); | 549 | ········row.add("root_id",·(Object)s); |
550 | ········row.add("flags",·(Object)n); | 550 | ········row.add("flags",·(Object)n); |
551 | ········row.add("title",·(Object)this.getContext().getString(2131558439)); | 551 | ········row.add("title",·(Object)this.getContext().getString(2131558440)); |
552 | ········row.add("document_id",·(Object)s); | 552 | ········row.add("document_id",·(Object)s); |
553 | ········row.add("mime_types",·(Object)MediaDocumentsProvider.DOCUMENT_MIME_TYPES); | 553 | ········row.add("mime_types",·(Object)MediaDocumentsProvider.DOCUMENT_MIME_TYPES); |
554 | ········row.add("query_args",·(Object)MediaDocumentsProvider.SUPPORTED_QUERY_ARGS); | 554 | ········row.add("query_args",·(Object)MediaDocumentsProvider.SUPPORTED_QUERY_ARGS); |
555 | ····} | 555 | ····} |
556 | ···· | 556 | ···· |
557 | ····private·void·includeDocumentsRootDocument(final·MatrixCursor·matrixCursor)·{ | 557 | ····private·void·includeDocumentsRootDocument(final·MatrixCursor·matrixCursor)·{ |
558 | ········final·MatrixCursor$RowBuilder·row·=·matrixCursor.newRow(); | 558 | ········final·MatrixCursor$RowBuilder·row·=·matrixCursor.newRow(); |
559 | ········row.add("document_id",·(Object)"documents_root"); | 559 | ········row.add("document_id",·(Object)"documents_root"); |
560 | ········row.add("_display_name",·(Object)this.getContext().getString(2131558439)); | 560 | ········row.add("_display_name",·(Object)this.getContext().getString(2131558440)); |
561 | ········row.add("flags",·(Object)48); | 561 | ········row.add("flags",·(Object)48); |
562 | ········row.add("mime_type",·(Object)"vnd.android.document/directory"); | 562 | ········row.add("mime_type",·(Object)"vnd.android.document/directory"); |
563 | ····} | 563 | ····} |
564 | ···· | 564 | ···· |
565 | ····private·void·includeImage(final·MatrixCursor·matrixCursor,·final·Cursor·cursor)·{ | 565 | ····private·void·includeImage(final·MatrixCursor·matrixCursor,·final·Cursor·cursor)·{ |
566 | ········final·String·docIdForIdent·=·getDocIdForIdent("image",·cursor.getLong(0)); | 566 | ········final·String·docIdForIdent·=·getDocIdForIdent("image",·cursor.getLong(0)); |
567 | ········final·MatrixCursor$RowBuilder·row·=·matrixCursor.newRow(); | 567 | ········final·MatrixCursor$RowBuilder·row·=·matrixCursor.newRow(); |
Offset 592, 24 lines modified | Offset 592, 24 lines modified |
592 | ········else·{ | 592 | ········else·{ |
593 | ············n·=·14; | 593 | ············n·=·14; |
594 | ········} | 594 | ········} |
595 | ········final·MatrixCursor$RowBuilder·row·=·matrixCursor.newRow(); | 595 | ········final·MatrixCursor$RowBuilder·row·=·matrixCursor.newRow(); |
596 | ········final·String·s·=·"images_root"; | 596 | ········final·String·s·=·"images_root"; |
597 | ········row.add("root_id",·(Object)s); | 597 | ········row.add("root_id",·(Object)s); |
598 | ········row.add("flags",·(Object)n); | 598 | ········row.add("flags",·(Object)n); |
599 | ········row.add("title",·(Object)this.getContext().getString(2131558440)); | 599 | ········row.add("title",·(Object)this.getContext().getString(2131558441)); |
600 | ········row.add("document_id",·(Object)s); | 600 | ········row.add("document_id",·(Object)s); |
601 | ········row.add("mime_types",·(Object)MediaDocumentsProvider.IMAGE_MIME_TYPES); | 601 | ········row.add("mime_types",·(Object)MediaDocumentsProvider.IMAGE_MIME_TYPES); |
602 | ········row.add("query_args",·(Object)MediaDocumentsProvider.SUPPORTED_QUERY_ARGS); | 602 | ········row.add("query_args",·(Object)MediaDocumentsProvider.SUPPORTED_QUERY_ARGS); |
603 | ····} | 603 | ····} |
604 | ···· | 604 | ···· |
605 | ····private·void·includeImagesRootDocument(final·MatrixCursor·matrixCursor)·{ | 605 | ····private·void·includeImagesRootDocument(final·MatrixCursor·matrixCursor)·{ |
606 | ········final·MatrixCursor$RowBuilder·row·=·matrixCursor.newRow(); | 606 | ········final·MatrixCursor$RowBuilder·row·=·matrixCursor.newRow(); |
607 | ········row.add("document_id",·(Object)"images_root"); | 607 | ········row.add("document_id",·(Object)"images_root"); |
608 | ········row.add("_display_name",·(Object)this.getContext().getString(2131558440)); | 608 | ········row.add("_display_name",·(Object)this.getContext().getString(2131558441)); |
609 | ········row.add("flags",·(Object)48); | 609 | ········row.add("flags",·(Object)48); |
610 | ········row.add("mime_type",·(Object)"vnd.android.document/directory"); | 610 | ········row.add("mime_type",·(Object)"vnd.android.document/directory"); |
611 | ····} | 611 | ····} |
612 | ···· | 612 | ···· |
613 | ····private·void·includeVideo(final·MatrixCursor·matrixCursor,·final·Cursor·cursor)·{ | 613 | ····private·void·includeVideo(final·MatrixCursor·matrixCursor,·final·Cursor·cursor)·{ |
614 | ········final·String·docIdForIdent·=·getDocIdForIdent("video",·cursor.getLong(0)); | 614 | ········final·String·docIdForIdent·=·getDocIdForIdent("video",·cursor.getLong(0)); |
615 | ········final·MatrixCursor$RowBuilder·row·=·matrixCursor.newRow(); | 615 | ········final·MatrixCursor$RowBuilder·row·=·matrixCursor.newRow(); |
Offset 640, 24 lines modified | Offset 640, 24 lines modified |
640 | ········else·{ | 640 | ········else·{ |
641 | ············n·=·14; | 641 | ············n·=·14; |
642 | ········} | 642 | ········} |
643 | ········final·MatrixCursor$RowBuilder·row·=·matrixCursor.newRow(); | 643 | ········final·MatrixCursor$RowBuilder·row·=·matrixCursor.newRow(); |
644 | ········final·String·s·=·"videos_root"; | 644 | ········final·String·s·=·"videos_root"; |
645 | ········row.add("root_id",·(Object)s); | 645 | ········row.add("root_id",·(Object)s); |
646 | ········row.add("flags",·(Object)n); | 646 | ········row.add("flags",·(Object)n); |
647 | ········row.add("title",·(Object)this.getContext().getString(2131558441)); | 647 | ········row.add("title",·(Object)this.getContext().getString(2131558442)); |
648 | ········row.add("document_id",·(Object)s); | 648 | ········row.add("document_id",·(Object)s); |
649 | ········row.add("mime_types",·(Object)MediaDocumentsProvider.VIDEO_MIME_TYPES); | 649 | ········row.add("mime_types",·(Object)MediaDocumentsProvider.VIDEO_MIME_TYPES); |
650 | ········row.add("query_args",·(Object)MediaDocumentsProvider.SUPPORTED_QUERY_ARGS); | 650 | ········row.add("query_args",·(Object)MediaDocumentsProvider.SUPPORTED_QUERY_ARGS); |
651 | ····} | 651 | ····} |
652 | ···· | 652 | ···· |
653 | ····private·void·includeVideosRootDocument(final·MatrixCursor·matrixCursor)·{ | 653 | ····private·void·includeVideosRootDocument(final·MatrixCursor·matrixCursor)·{ |
654 | ········final·MatrixCursor$RowBuilder·row·=·matrixCursor.newRow(); | 654 | ········final·MatrixCursor$RowBuilder·row·=·matrixCursor.newRow(); |
655 | ········row.add("document_id",·(Object)"videos_root"); | 655 | ········row.add("document_id",·(Object)"videos_root"); |
656 | ········row.add("_display_name",·(Object)this.getContext().getString(2131558441)); | 656 | ········row.add("_display_name",·(Object)this.getContext().getString(2131558442)); |
657 | ········row.add("flags",·(Object)48); | 657 | ········row.add("flags",·(Object)48); |
658 | ········row.add("mime_type",·(Object)"vnd.android.document/directory"); | 658 | ········row.add("mime_type",·(Object)"vnd.android.document/directory"); |
659 | ····} | 659 | ····} |
660 | ···· | 660 | ···· |
661 | ····private·boolean·isEmpty(final·Uri·uri)·{ | 661 | ····private·boolean·isEmpty(final·Uri·uri)·{ |
662 | ········final·ContentResolver·contentResolver·=·this.getContext().getContentResolver(); | 662 | ········final·ContentResolver·contentResolver·=·this.getContext().getContentResolver(); |
663 | ········final·long·clearCallingIdentity·=·Binder.clearCallingIdentity(); | 663 | ········final·long·clearCallingIdentity·=·Binder.clearCallingIdentity(); |
Offset 1292, 15 lines modified | Offset 1292, 15 lines modified |
1292 | ························} | 1292 | ························} |
1293 | ····················} | 1293 | ····················} |
1294 | ····················else·if·("audio_root".equals(s))·{ | 1294 | ····················else·if·("audio_root".equals(s))·{ |
1295 | ························final·boolean·shouldFilterMimeType3·=·shouldFilterMimeType(stringArray,·"audio/*",·list); | 1295 | ························final·boolean·shouldFilterMimeType3·=·shouldFilterMimeType(stringArray,·"audio/*",·list); |
1296 | ························if·(stringArray·!=·null·&&·shouldFilterMimeType3·&&·list.size()·<=·0)·{ | 1296 | ························if·(stringArray·!=·null·&&·shouldFilterMimeType3·&&·list.size()·<=·0)·{ |
1297 | ····························break·Label_1010; | 1297 | ····························break·Label_1010; |
1298 | ························} | 1298 | ························} |
1299 | ························final·Pair·buildSearchSelection3·=·buildSearchSelection(string,·(String[])list.toArray(new·String[0]),·long1,·long2,·"title",·"mime_type",·"date_modified",·"_size"); | 1299 | ························final·Pair·buildSearchSelection3·=·buildSearchSelection(string,·(String[])list.toArray(new·String[0]),·long1,·long2,·"_display_name",·"mime_type",·"date_modified",·"_size"); |
1300 | ························cursor·=·contentResolver.query(MediaStore$Audio$Media.EXTERNAL_CONTENT_URI,·MediaDocumentsProvider$SongQuery.PROJECTION,·(String)buildSearchSelection3.first,·(String[])buildSearchSelection3.second,·"date_modified·DESC"); | 1300 | ························cursor·=·contentResolver.query(MediaStore$Audio$Media.EXTERNAL_CONTENT_URI,·MediaDocumentsProvider$SongQuery.PROJECTION,·(String)buildSearchSelection3.first,·(String[])buildSearchSelection3.second,·"date_modified·DESC"); |
1301 | ························matrixCursor.setNotificationUri(contentResolver,·MediaStore$Audio$Media.EXTERNAL_CONTENT_URI); | 1301 | ························matrixCursor.setNotificationUri(contentResolver,·MediaStore$Audio$Media.EXTERNAL_CONTENT_URI); |
1302 | ························while·(cursor.moveToNext())·{ | 1302 | ························while·(cursor.moveToNext())·{ |
1303 | ····························this.includeAudio(matrixCursor,·cursor); | 1303 | ····························this.includeAudio(matrixCursor,·cursor); |
1304 | ························} | 1304 | ························} |
1305 | ····················} | 1305 | ····················} |
1306 | ····················else·{ | 1306 | ····················else·{ |