How to disable USB storage autostart?


#1

Autorun is triggered and a window with action selection when you connect a USB flash.

Please tell, How to disable this window?

Thank you!


#2

You need to modify the file packages/apps/TvSettings/Settings/src/com/android/tv/settings/device/storage/NewStorageActivity.java

diff --git a/Settings/src/com/android/tv/settings/device/storage/NewStorageActivity.java b/Settings/src/com/android/tv/settings/device/storage/NewStorageActivity.java
index fffd078..b101ac6 100644
--- a/Settings/src/com/android/tv/settings/device/storage/NewStorageActivity.java
+++ b/Settings/src/com/android/tv/settings/device/storage/NewStorageActivity.java
@@ -442,14 +442,6 @@ public class NewStorageActivity extends Activity {
                 if (record.isInited() || record.isSnoozed()) {
                     continue;
                 }
-                final DiskInfo disk = info.getDisk();
-                if (disk.isAdoptable()) {
-                    final Intent i = NewStorageActivity.getNewStorageLaunchIntent(context,
-                            volumeId, disk.getId());
-                    setPopupLaunchFlags(i);
-                    context.startActivity(i);
-                    break;
-                }
             }
         }