Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ protected void onCreate(Bundle state) {
findViewById(R.id.scrim).setOnClickListener(v -> finish());
LinearLayout rows = findViewById(R.id.rows);
addRow(rows, R.drawable.ic_settings, R.string.tv_settings, 0, SystemSettings.intent(this, Settings.ACTION_SETTINGS));
addRow(rows, R.drawable.ic_picture, R.string.quick_picture, 0, SystemSettings.intent(this, Settings.ACTION_DISPLAY_SETTINGS));
addRow(rows, R.drawable.ic_picture, R.string.quick_picture, 0, SystemSettings.displayIntent(this));
addRow(rows, R.drawable.ic_wifi, R.string.quick_network, 0, SystemSettings.intent(this, Settings.ACTION_WIFI_SETTINGS));
addRow(rows, R.drawable.ic_apps, R.string.quick_apps, R.string.quick_apps_hint,
SystemSettings.intent(this, Settings.ACTION_MANAGE_APPLICATIONS_SETTINGS));
Expand Down
13 changes: 13 additions & 0 deletions launcher/app/src/main/java/com/gathin/tvhome/SystemSettings.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,17 @@ static Intent appInfo(Context context, String pkg) {
Intent info = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS, Uri.parse("package:" + pkg));
return context.getPackageManager().resolveActivity(info, PackageManager.MATCH_DEFAULT_ONLY) != null ? info : null;
}

/**
* The TV's display or picture settings. On Xiaomi sets, the AOSP DISPLAY_SETTINGS action resolves to
* an empty stub in DroidTvSettings; prefer Xiaomi's own PictureActivity where installed.
*/
static Intent displayIntent(Context context) {
ComponentName xiaomi = new ComponentName("com.android.tv.settings",
"com.xiaomi.mitv.settings.picture.PictureActivity");
if (context.getPackageManager().resolveActivity(new Intent().setComponent(xiaomi), 0) != null) {
return new Intent().setComponent(xiaomi);
}
return intent(context, Settings.ACTION_DISPLAY_SETTINGS);
}
}
Loading