增加一些奥乐云手动测试的管控

This commit is contained in:
2022-06-29 19:56:01 +08:00
parent 5ba956f3ec
commit 53738c7b15
3 changed files with 601 additions and 91 deletions

View File

@@ -0,0 +1,189 @@
package com.tt.ttutils.activity;
import android.content.Intent;
import android.os.Bundle;
import android.provider.Settings;
import android.widget.Button;
import androidx.appcompat.app.AppCompatActivity;
import com.tt.ttutils.R;
import butterknife.BindView;
import butterknife.ButterKnife;
public class AoleyunTestActivity extends AppCompatActivity {
@BindView(R.id.bt_usb)
Button bt_usb;
@BindView(R.id.bt_usb_statu)
Button bt_usb_statu;
@BindView(R.id.bt_usb_charge)
Button bt_usb_charge;
@BindView(R.id.bt_usb_mtp)
Button bt_usb_mtp;
@BindView(R.id.bt_usb_midi)
Button bt_usb_midi;
@BindView(R.id.bt_desktop)
Button bt_desktop;
@BindView(R.id.bt_desktop_statu)
Button bt_desktop_statu;
@BindView(R.id.bt_desktop_launcher)
Button bt_desktop_launcher;
@BindView(R.id.bt_desktop_dop2)
Button bt_desktop_dop2;
@BindView(R.id.bt_desktop_aoleyun)
Button bt_desktop_aoleyun;
@BindView(R.id.bt_sd)
Button bt_sd;
@BindView(R.id.bt_sd_statu)
Button bt_sd_statu;
@BindView(R.id.bt_sd_on)
Button bt_sd_on;
@BindView(R.id.bt_sd_off)
Button bt_sd_off;
@BindView(R.id.bt_developer)
Button bt_developer;
@BindView(R.id.bt_developer_statu)
Button bt_developer_statu;
@BindView(R.id.bt_developer_on)
Button bt_developer_on;
@BindView(R.id.bt_developer_off)
Button bt_developer_off;
@BindView(R.id.bt_navigation)
Button bt_navigation;
@BindView(R.id.bt_navigation_statu)
Button bt_navigation_statu;
@BindView(R.id.bt_navigation_on)
Button bt_navigation_on;
@BindView(R.id.bt_navigation_off)
Button bt_navigation_off;
@BindView(R.id.bt_status)
Button bt_status;
@BindView(R.id.bt_status_statu)
Button bt_status_statu;
@BindView(R.id.bt_status_on)
Button bt_status_on;
@BindView(R.id.bt_status_off)
Button bt_status_off;
@BindView(R.id.bt_hotspot)
Button bt_hotspot;
@BindView(R.id.bt_hotspot_statu)
Button bt_hotspot_statu;
@BindView(R.id.bt_hotspot_on)
Button bt_hotspot_on;
@BindView(R.id.bt_hotspot_off)
Button bt_hotspot_off;
@BindView(R.id.bt_bht)
Button bt_bht;
@BindView(R.id.bt_bht_statu)
Button bt_bht_statu;
@BindView(R.id.bt_bht_on)
Button bt_bht_on;
@BindView(R.id.bt_bht_off)
Button bt_bht_off;
@BindView(R.id.bt_bt_on)
Button bt_bt_on;
@BindView(R.id.bt_bt_off)
Button bt_bt_off;
@BindView(R.id.bt_bhtvideo_on)
Button bt_bhtvideo_on;
@BindView(R.id.bt_bhtvideo_off)
Button bt_bhtvideo_off;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_aoleyun_test);
ButterKnife.bind(this);
init();
}
private void init() {
bt_usb_charge.setOnClickListener(view -> {
Intent usbIntent = new Intent("aole_action_usb_usb_charge").setPackage("com.android.settings");
sendBroadcast(usbIntent);
});
bt_usb_mtp.setOnClickListener(view -> {
Intent usbIntent = new Intent("aole_action_usb_usb_mtp").setPackage("com.android.settings");
sendBroadcast(usbIntent);
});
bt_usb_midi.setOnClickListener(view -> {
Intent usbIntent = new Intent("aole_action_usb_usb_midi").setPackage("com.android.settings");
sendBroadcast(usbIntent);
});
bt_desktop_launcher.setOnClickListener(view -> {
Intent intent = new Intent("setDefaultLauncher");
intent.putExtra("package", "com.android.launcher3");
intent.putExtra("className", "com.android.launcher3.Launcher");
intent.setPackage("com.android.settings");
sendBroadcast(intent);
});
bt_desktop_dop2.setOnClickListener(view -> {
Intent intent = new Intent("setDefaultLauncher");
intent.putExtra("package", "com.aoleyunos.dop2");
intent.putExtra("className", "com.aoleyunos.dop2.activity.main.MainActivity");
intent.setPackage("com.android.settings");
sendBroadcast(intent);
});
bt_desktop_aoleyun.setOnClickListener(view -> {
Intent intent = new Intent("setDefaultLauncher");
intent.putExtra("package", "com.aoleyunos.os");
intent.putExtra("className", "com.aoleyunos.os.Launcher");
intent.setPackage("com.android.settings");
sendBroadcast(intent);
});
bt_sd_on.setOnClickListener(view -> Settings.System.putInt(getContentResolver(), "aole_sdcard_forbid_on", 0));
bt_sd_off.setOnClickListener(view -> Settings.System.putInt(getContentResolver(), "aole_sdcard_forbid_on", 1));
bt_developer_on.setOnClickListener(view -> Settings.System.putInt(getContentResolver(), "aole_Developeroptions", 0));
bt_developer_off.setOnClickListener(view -> Settings.System.putInt(getContentResolver(), "aole_Developeroptions", 1));
bt_navigation_on.setOnClickListener(view -> {
Intent navIntent = new Intent("aole_show_NavigationBar").setPackage("com.android.systemui");
sendBroadcast(navIntent);
});
bt_navigation_off.setOnClickListener(view -> {
Intent navIntent = new Intent("aole_hide_NavigationBar").setPackage("com.android.systemui");
sendBroadcast(navIntent);
});
bt_status_on.setOnClickListener(view -> {
Intent navIntent = new Intent("aole_show_statusBar").setPackage("com.android.systemui");
sendBroadcast(navIntent);
});
bt_status_off.setOnClickListener(view -> {
Intent navIntent = new Intent("aole_hide_statusBar").setPackage("com.android.systemui");
sendBroadcast(navIntent);
});
bt_hotspot_on.setOnClickListener(view -> {
Settings.System.putInt(getContentResolver(), "aole_hotspot_forbid_on", 0);
});
bt_hotspot_off.setOnClickListener(view -> {
Settings.System.putInt(getContentResolver(), "aole_hotspot_forbid_on", 1);
Intent intent = new Intent("aole_hotspot_close");
intent.setPackage("com.android.settings");
sendStickyBroadcast(intent);
});
bt_bht_on.setOnClickListener(view -> Settings.System.putInt(getContentResolver(), "aole_bht_forbid_on", 0));
bt_bht_off.setOnClickListener(view -> Settings.System.putInt(getContentResolver(), "aole_bht_forbid_on", 1));
bt_bt_on.setOnClickListener(view -> Settings.System.putInt(getContentResolver(), "aole_bt_forbid_on", 0));
bt_bt_off.setOnClickListener(view -> Settings.System.putInt(getContentResolver(), "aole_bt_forbid_on", 1));
bt_bhtvideo_on.setOnClickListener(view -> Settings.System.putInt(getContentResolver(), "aole_bhtvideo_forbid_on", 0));
bt_bhtvideo_off.setOnClickListener(view -> Settings.System.putInt(getContentResolver(), "aole_bhtvideo_forbid_on", 1));
}
}