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

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

@@ -10,31 +10,24 @@
<uses-permission android:name="android.permission.DELETE_PACKAGES" /> <uses-permission android:name="android.permission.DELETE_PACKAGES" />
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" /> <uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
<uses-permission android:name="android.permission.BLUETOOTH" /> <uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" /> <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" /> <!-- 【必须】 移动推送 TPNS SDK 5.0版本所需权限 -->
<!-- 【必须】 移动推送 TPNS SDK 5.0版本所需权限 -->
<permission <permission
android:name="com.tt.ttutils.permission.XGPUSH_RECEIVE" android:name="com.tt.ttutils.permission.XGPUSH_RECEIVE"
android:protectionLevel="signature" /> android:protectionLevel="signature" />
<uses-permission android:name="android.permission.SET_WALLPAPER" /> <uses-permission android:name="android.permission.SET_WALLPAPER" />
<uses-permission android:name="com.tt.ttutils.permission.XGPUSH_RECEIVE" /> <uses-permission android:name="com.tt.ttutils.permission.XGPUSH_RECEIVE" /> <!-- 【必须】 移动推送 TPNS SDK所需权限 -->
<!-- 【必须】 移动推送 TPNS SDK所需权限 -->
<uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" /> <uses-permission android:name="android.permission.WAKE_LOCK" /> <!-- 【常用】 移动推送 TPNS SDK所需权限 -->
<!-- 【常用】 移动推送 TPNS SDK所需权限 -->
<uses-permission android:name="android.permission.VIBRATE" /> <uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.RECEIVE_USER_PRESENT" /> <uses-permission android:name="android.permission.RECEIVE_USER_PRESENT" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" /> <uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <!-- Required -->
<!-- Required -->
<permission <permission
android:name="${applicationId}.permission.JPUSH_MESSAGE" android:name="${applicationId}.permission.JPUSH_MESSAGE"
android:protectionLevel="signature" /> android:protectionLevel="signature" /> <!-- Required 一些系统要求的权限,如访问网络等 -->
<!-- Required 一些系统要求的权限,如访问网络等 -->
<uses-permission android:name="${applicationId}.permission.JPUSH_MESSAGE" /> <uses-permission android:name="${applicationId}.permission.JPUSH_MESSAGE" />
<uses-permission android:name="android.permission.RECEIVE_USER_PRESENT" /> <uses-permission android:name="android.permission.RECEIVE_USER_PRESENT" />
<uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.INTERNET" />
@@ -43,17 +36,13 @@
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS" /> <uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> <!-- Optional for location -->
<!-- Optional for location -->
<uses-permission android:name="android.permission.VIBRATE" /> <uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" /> <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" /> <!-- 用于开启 debug 版本的应用在6.0 系统上 层叠窗口权限 -->
<!-- 用于开启 debug 版本的应用在6.0 系统上 层叠窗口权限 -->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" /> <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" /> <uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" /> <!-- Android Q后台定位权限 -->
<!-- Android Q后台定位权限 -->
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" /> <uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" /> <uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
<uses-permission android:name="android.permission.GET_TASKS" /> <uses-permission android:name="android.permission.GET_TASKS" />
@@ -67,25 +56,30 @@
android:roundIcon="@mipmap/ic_launcher_round" android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true" android:supportsRtl="true"
android:theme="@style/ImmerseTheme"> android:theme="@style/ImmerseTheme">
<activity android:name=".activity.AoleyunTestActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".activity.main.MainActivity"> <activity android:name=".activity.main.MainActivity">
<intent-filter> <!-- <intent-filter> -->
<action android:name="android.intent.action.MAIN" /> <!-- <action android:name="android.intent.action.MAIN" /> -->
<!-- <category android:name="android.intent.category.LAUNCHER" /> -->
<category android:name="android.intent.category.LAUNCHER" /> <!-- </intent-filter> -->
</intent-filter>
</activity> </activity>
<activity android:name=".activity.KotlinMainActivity"> <activity android:name=".activity.KotlinMainActivity">
<!-- <intent-filter> --> <!-- <intent-filter> -->
<!-- <action android:name="android.intent.action.MAIN" /> --> <!-- <action android:name="android.intent.action.MAIN" /> -->
<!-- <category android:name="android.intent.category.LAUNCHER" /> --> <!-- <category android:name="android.intent.category.LAUNCHER" /> -->
<!-- </intent-filter> --> <!-- </intent-filter> -->
</activity> </activity>
<activity android:name=".activity.test.TestActivity"> <activity android:name=".activity.test.TestActivity">
<!-- <intent-filter>-->
<!-- <action android:name="android.intent.action.MAIN" />--> <!-- <intent-filter> -->
<!-- <category android:name="android.intent.category.LAUNCHER" />--> <!-- <action android:name="android.intent.action.MAIN" /> -->
<!-- </intent-filter>--> <!-- <category android:name="android.intent.category.LAUNCHER" /> -->
<!-- </intent-filter> -->
</activity> </activity>
<activity android:name=".activity.retrofit.RetrofitActivity" /> <activity android:name=".activity.retrofit.RetrofitActivity" />
<activity android:name=".activity.PackageActivity" /> <activity android:name=".activity.PackageActivity" />
@@ -137,15 +131,11 @@
<!-- 自定义广播 --> <!-- 自定义广播 -->
<action android:name="com.jiaoguanyi.appstore.intent.action.BOOT_COMPLETED" /> <action android:name="com.jiaoguanyi.appstore.intent.action.BOOT_COMPLETED" />
</intent-filter> </intent-filter>
</receiver> </receiver> <!-- -->
<!-- -->
<!-- 应用的其它配置 --> <!-- 应用的其它配置 -->
<uses-library <uses-library
android:name="org.apache.http.legacy" android:name="org.apache.http.legacy"
android:required="false" /> android:required="false" /> <!-- 【必须】 移动推送 TPNS 默认通知 -->
<!-- 【必须】 移动推送 TPNS 默认通知 -->
<activity <activity
android:name="com.tencent.android.tpush.TpnsActivity" android:name="com.tencent.android.tpush.TpnsActivity"
android:theme="@android:style/Theme.Translucent.NoTitleBar"> android:theme="@android:style/Theme.Translucent.NoTitleBar">
@@ -159,8 +149,7 @@
<category android:name="android.intent.category.BROWSABLE" /> <category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />
</intent-filter> </intent-filter>
</activity> </activity> <!-- 【必须】 移动推送 TPNS receiver广播接收 -->
<!-- 【必须】 移动推送 TPNS receiver广播接收 -->
<receiver <receiver
android:name="com.tencent.android.tpush.XGPushReceiver" android:name="com.tencent.android.tpush.XGPushReceiver"
android:process=":xg_vip_service"> android:process=":xg_vip_service">
@@ -179,13 +168,11 @@
<action android:name="android.intent.action.ACTION_POWER_CONNECTED" /> <action android:name="android.intent.action.ACTION_POWER_CONNECTED" />
<action android:name="android.intent.action.ACTION_POWER_DISCONNECTED" /> <action android:name="android.intent.action.ACTION_POWER_DISCONNECTED" />
</intent-filter> </intent-filter>
</receiver> </receiver> <!-- 【必须】移动推送 TPNS service -->
<!-- 【必须】移动推送 TPNS service -->
<service <service
android:name="com.tencent.android.tpush.service.XGVipPushService" android:name="com.tencent.android.tpush.service.XGVipPushService"
android:persistent="true" android:persistent="true"
android:process=":xg_vip_service" /> android:process=":xg_vip_service" /> <!-- 【必须】通知 service android:name 部分改为包名.XGVIP_PUSH_ACTION -->
<!-- 【必须】通知 service android:name 部分改为包名.XGVIP_PUSH_ACTION -->
<service <service
android:name="com.tencent.android.tpush.rpc.XGRemoteService" android:name="com.tencent.android.tpush.rpc.XGRemoteService"
android:exported="false"> android:exported="false">
@@ -194,21 +181,17 @@
<!-- 【必须】请修改为当前APP名包.XGVIP_PUSH_ACTION --> <!-- 【必须】请修改为当前APP名包.XGVIP_PUSH_ACTION -->
<action android:name="com.tt.ttutils.XGVIP_PUSH_ACTION" /> <action android:name="com.tt.ttutils.XGVIP_PUSH_ACTION" />
</intent-filter> </intent-filter>
</service> </service> <!-- 【必须】【注意】authorities 修改为包名.XGVIP_PUSH_AUTH -->
<!-- 【必须】【注意】authorities 修改为包名.XGVIP_PUSH_AUTH -->
<provider <provider
android:name="com.tencent.android.tpush.XGPushProvider" android:name="com.tencent.android.tpush.XGPushProvider"
android:authorities="com.tt.ttutils.XGVIP_PUSH_AUTH" /> android:authorities="com.tt.ttutils.XGVIP_PUSH_AUTH" /> <!-- 【必须】【注意】authorities 修改为包名.TPUSH_PROVIDER -->
<!-- 【必须】【注意】authorities 修改为包名.TPUSH_PROVIDER -->
<provider <provider
android:name="com.tencent.android.tpush.SettingsContentProvider" android:name="com.tencent.android.tpush.SettingsContentProvider"
android:authorities="com.tt.ttutils.TPUSH_PROVIDER" /> android:authorities="com.tt.ttutils.TPUSH_PROVIDER" /> <!-- 【可选】用于增强保活能力 -->
<!-- 【可选】用于增强保活能力 -->
<provider <provider
android:name="com.tencent.android.tpush.XGVipPushKAProvider" android:name="com.tencent.android.tpush.XGVipPushKAProvider"
android:authorities="com.tt.ttutils.AUTH_XGPUSH_KEEPALIVE" android:authorities="com.tt.ttutils.AUTH_XGPUSH_KEEPALIVE"
android:exported="true" /> android:exported="true" /> <!-- 【可选】APP实现的Receiver用于接收消息透传和操作结果的回调请根据需要添加 -->
<!-- 【可选】APP实现的Receiver用于接收消息透传和操作结果的回调请根据需要添加 -->
<!-- YOUR_PACKAGE_PATH.CustomPushReceiver需要改为自己的Receiver --> <!-- YOUR_PACKAGE_PATH.CustomPushReceiver需要改为自己的Receiver -->
<receiver android:name=".tpush.MessageReceiver"> <receiver android:name=".tpush.MessageReceiver">
<intent-filter> <intent-filter>
@@ -218,8 +201,7 @@
<!-- 监听注册、反注册、设置/删除标签、通知被点击等处理结果 --> <!-- 监听注册、反注册、设置/删除标签、通知被点击等处理结果 -->
<action android:name="com.tencent.android.xg.vip.action.FEEDBACK" /> <action android:name="com.tencent.android.xg.vip.action.FEEDBACK" />
</intent-filter> </intent-filter>
</receiver> </receiver> <!-- MQTT START -->
<!-- MQTT START -->
<service <service
android:name="com.tencent.tpns.mqttchannel.services.MqttService" android:name="com.tencent.tpns.mqttchannel.services.MqttService"
android:exported="false" android:exported="false"
@@ -228,25 +210,19 @@
<provider <provider
android:name="com.tencent.tpns.baseapi.base.SettingsContentProvider" android:name="com.tencent.tpns.baseapi.base.SettingsContentProvider"
android:authorities="com.tt.ttutils.XG_SETTINGS_PROVIDER" android:authorities="com.tt.ttutils.XG_SETTINGS_PROVIDER"
android:exported="false" /> android:exported="false" /> <!-- MQTT END -->
<!-- MQTT END -->
<!-- 【必须】 请修改为 APP 的 AccessId“15”开头的10位数字中间没空格 --> <!-- 【必须】 请修改为 APP 的 AccessId“15”开头的10位数字中间没空格 -->
<meta-data <meta-data
android:name="XG_V2_ACCESS_ID" android:name="XG_V2_ACCESS_ID"
android:value="1500026407" /> android:value="1500026407" /> <!-- 【必须】 请修改为APP的AccessKey“A”开头的12位字符串中间没空格 -->
<!-- 【必须】 请修改为APP的AccessKey“A”开头的12位字符串中间没空格 -->
<meta-data <meta-data
android:name="XG_V2_ACCESS_KEY" android:name="XG_V2_ACCESS_KEY"
android:value="AQ6C6W1O19LT" /> android:value="AQ6C6W1O19LT" /> <!-- Rich push 核心功能 since 2.0.6 -->
<!-- Rich push 核心功能 since 2.0.6 -->
<activity <activity
android:name="cn.jpush.android.ui.PopWinActivity" android:name="cn.jpush.android.ui.PopWinActivity"
android:exported="false" android:exported="false"
android:theme="@style/MyDialogStyle" android:theme="@style/MyDialogStyle"
tools:replace="android:exported" /> tools:replace="android:exported" /> <!-- Required SDK核心功能 -->
<!-- Required SDK核心功能 -->
<activity <activity
android:name="cn.jpush.android.ui.PushActivity" android:name="cn.jpush.android.ui.PushActivity"
android:configChanges="orientation|keyboardHidden" android:configChanges="orientation|keyboardHidden"
@@ -259,8 +235,7 @@
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />
<category android:name="${applicationId}" /> <category android:name="${applicationId}" />
</intent-filter> </intent-filter>
</activity> </activity> <!-- Required SDK 核心功能 -->
<!-- Required SDK 核心功能 -->
<!-- 可配置android:process参数将PushService放在其他进程中 --> <!-- 可配置android:process参数将PushService放在其他进程中 -->
<service <service
android:name="cn.jpush.android.service.PushService" android:name="cn.jpush.android.service.PushService"
@@ -271,14 +246,12 @@
<action android:name="cn.jpush.android.intent.PushService" /> <action android:name="cn.jpush.android.intent.PushService" />
<action android:name="cn.jpush.android.intent.PUSH_TIME" /> <action android:name="cn.jpush.android.intent.PUSH_TIME" />
</intent-filter> </intent-filter>
</service> </service> <!-- since 3.0.9 Required SDK 核心功能 -->
<!-- since 3.0.9 Required SDK 核心功能 -->
<provider <provider
android:name="cn.jpush.android.service.DataProvider" android:name="cn.jpush.android.service.DataProvider"
android:authorities="${applicationId}.DataProvider" android:authorities="${applicationId}.DataProvider"
android:exported="false" android:exported="false"
android:process=":pushcore" /> android:process=":pushcore" /> <!-- since 1.8.0 option 可选项。用于同一设备中不同应用的JPush服务相互拉起的功能。 -->
<!-- since 1.8.0 option 可选项。用于同一设备中不同应用的JPush服务相互拉起的功能。 -->
<!-- 若不启用该功能可删除该组件,或把 enabled 设置成 false App 不会被其他 App 拉起,但会拉起其他的 App。 --> <!-- 若不启用该功能可删除该组件,或把 enabled 设置成 false App 不会被其他 App 拉起,但会拉起其他的 App。 -->
<service <service
android:name="cn.jpush.android.service.DaemonService" android:name="cn.jpush.android.service.DaemonService"
@@ -289,8 +262,7 @@
<category android:name="${applicationId}" /> <category android:name="${applicationId}" />
</intent-filter> </intent-filter>
</service> </service> <!-- 可选如果使用静态Activity方式拉起该组件必须声明 -->
<!-- 可选如果使用静态Activity方式拉起该组件必须声明 -->
<activity <activity
android:name="cn.jpush.android.service.DActivity" android:name="cn.jpush.android.service.DActivity"
android:enabled="true" android:enabled="true"
@@ -302,13 +274,11 @@
<category android:name="${applicationId}" /> <category android:name="${applicationId}" />
</intent-filter> </intent-filter>
</activity> </activity> <!-- since 3.1.0 Required SDK 核心功能 -->
<!-- since 3.1.0 Required SDK 核心功能 -->
<provider <provider
android:name="cn.jpush.android.service.DownloadProvider" android:name="cn.jpush.android.service.DownloadProvider"
android:authorities="${applicationId}.DownloadProvider" android:authorities="${applicationId}.DownloadProvider"
android:exported="true" /> android:exported="true" /> <!-- Required SDK核心功能 -->
<!-- Required SDK核心功能 -->
<receiver <receiver
android:name="cn.jpush.android.service.PushReceiver" android:name="cn.jpush.android.service.PushReceiver"
android:enabled="true"> android:enabled="true">
@@ -328,18 +298,14 @@
<data android:scheme="package" /> <data android:scheme="package" />
</intent-filter> </intent-filter>
</receiver> </receiver> <!-- Required SDK核心功能 -->
<!-- Required SDK核心功能 -->
<receiver <receiver
android:name="cn.jpush.android.service.AlarmReceiver" android:name="cn.jpush.android.service.AlarmReceiver"
android:exported="false" /> android:exported="false" /> <!-- 3.5.0新增,用于定时展示功能 -->
<!-- 3.5.0新增,用于定时展示功能 -->
<receiver <receiver
android:name="cn.jpush.android.service.SchedulerReceiver" android:name="cn.jpush.android.service.SchedulerReceiver"
android:exported="false" /> android:exported="false" /> <!-- 3.6.7 新增,用于负反馈组件 -->
<!-- 3.6.7 新增,用于负反馈组件 --> <service android:name="cn.jpush.android.service.MessagingIntentService" /> <!-- User defined. For test only 用户自定义的广播接收器 -->
<service android:name="cn.jpush.android.service.MessagingIntentService" />
<!-- User defined. For test only 用户自定义的广播接收器 -->
<receiver <receiver
android:name=".sdk.jpush.jpushdemo.MyReceiver" android:name=".sdk.jpush.jpushdemo.MyReceiver"
android:enabled="true"> android:enabled="true">
@@ -356,8 +322,7 @@
<!-- 接收网络变化 连接/断开 since 1.6.3 --> <!-- 接收网络变化 连接/断开 since 1.6.3 -->
<category android:name="${applicationId}" /> <category android:name="${applicationId}" />
</intent-filter> </intent-filter>
</receiver> </receiver> <!-- User defined. For test only 用户自定义接收消息器,3.0.7开始支持,目前新tag/alias接口设置结果会在该广播接收器对应的方法中回调 -->
<!-- User defined. For test only 用户自定义接收消息器,3.0.7开始支持,目前新tag/alias接口设置结果会在该广播接收器对应的方法中回调 -->
<!-- since 3.3.0 接收JPush相关事件 --> <!-- since 3.3.0 接收JPush相关事件 -->
<receiver android:name=".sdk.jpush.jpushdemo.PushMessageReceiver"> <receiver android:name=".sdk.jpush.jpushdemo.PushMessageReceiver">
<intent-filter> <intent-filter>
@@ -365,8 +330,7 @@
<category android:name="${applicationId}" /> <category android:name="${applicationId}" />
</intent-filter> </intent-filter>
</receiver> </receiver> <!-- since 3.3.0 Required SDK核心功能 -->
<!-- since 3.3.0 Required SDK核心功能 -->
<activity <activity
android:name="cn.jpush.android.service.JNotifyActivity" android:name="cn.jpush.android.service.JNotifyActivity"
android:exported="false" android:exported="false"
@@ -378,8 +342,7 @@
<category android:name="${applicationId}" /> <category android:name="${applicationId}" />
</intent-filter> </intent-filter>
</activity> </activity> <!-- since 3.3.0 Required SDK 核心功能 -->
<!-- since 3.3.0 Required SDK 核心功能 -->
<!-- 可配置android:process参数将PushService放在其他进程中 --> <!-- 可配置android:process参数将PushService放在其他进程中 -->
<!-- User defined. For test only 继承自cn.jpush.android.service.JCommonService --> <!-- User defined. For test only 继承自cn.jpush.android.service.JCommonService -->
<service <service
@@ -389,8 +352,7 @@
<action android:name="cn.jiguang.user.service.action" /> <action android:name="cn.jiguang.user.service.action" />
</intent-filter> </intent-filter>
</service> <!-- since 3.5.6 新增华硕通道 --> </service> <!-- since 3.5.6 新增华硕通道 -->
<receiver android:name="cn.jpush.android.asus.AsusPushMessageReceiver" /> <receiver android:name="cn.jpush.android.asus.AsusPushMessageReceiver" /> <!-- Required . Enable it you can get statistics data with channel -->
<!-- Required . Enable it you can get statistics data with channel -->
<!-- 值来自开发者平台取得的AppKey --> <!-- 值来自开发者平台取得的AppKey -->
<meta-data <meta-data
android:name="JPUSH_CHANNEL" android:name="JPUSH_CHANNEL"
@@ -398,8 +360,6 @@
<meta-data <meta-data
android:name="JPUSH_APPKEY" android:name="JPUSH_APPKEY"
android:value="${JPUSH_APPKEY}" /> android:value="${JPUSH_APPKEY}" />
<meta-data <meta-data
android:name="design_width_in_dp" android:name="design_width_in_dp"
android:value="640" /> android:value="640" />

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));
}
}

View File

@@ -0,0 +1,361 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".activity.AoleyunTestActivity">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:visibility="gone">
<Button
android:id="@+id/bt_usb"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="USB管控" />
<Button
android:id="@+id/bt_usb_statu"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="状态:" />
<Button
android:id="@+id/bt_usb_charge"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="charge" />
<Button
android:id="@+id/bt_usb_mtp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="mtp" />
<Button
android:id="@+id/bt_usb_midi"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="midi" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<Button
android:id="@+id/bt_desktop"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="默认桌面" />
<Button
android:id="@+id/bt_desktop_statu"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="状态:" />
<Button
android:id="@+id/bt_desktop_launcher"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:maxLines="1"
android:singleLine="true"
android:text="launcher" />
<Button
android:id="@+id/bt_desktop_dop2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="dop2" />
<Button
android:id="@+id/bt_desktop_aoleyun"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:maxLines="1"
android:singleLine="true"
android:text="aoleyun.os" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<Button
android:id="@+id/bt_sd"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="存储卡管控" />
<Button
android:id="@+id/bt_sd_statu"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="状态:" />
<Button
android:id="@+id/bt_sd_on"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:maxLines="1"
android:singleLine="true"
android:text="on" />
<Button
android:id="@+id/bt_sd_off"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="off" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<Button
android:id="@+id/bt_developer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="开发者模式" />
<Button
android:id="@+id/bt_developer_statu"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="状态:" />
<Button
android:id="@+id/bt_developer_on"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:maxLines="1"
android:singleLine="true"
android:text="on" />
<Button
android:id="@+id/bt_developer_off"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="off" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:visibility="gone">
<Button
android:id="@+id/bt_navigation"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="导航栏" />
<Button
android:id="@+id/bt_navigation_statu"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="状态:" />
<Button
android:id="@+id/bt_navigation_on"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:maxLines="1"
android:singleLine="true"
android:text="on" />
<Button
android:id="@+id/bt_navigation_off"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="off" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:visibility="gone">
<Button
android:id="@+id/bt_status"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="状态栏" />
<Button
android:id="@+id/bt_status_statu"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="状态:" />
<Button
android:id="@+id/bt_status_on"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:maxLines="1"
android:singleLine="true"
android:text="on" />
<Button
android:id="@+id/bt_status_off"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="off" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<Button
android:id="@+id/bt_hotspot"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="WIFI热点" />
<Button
android:id="@+id/bt_hotspot_statu"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="状态:" />
<Button
android:id="@+id/bt_hotspot_on"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:maxLines="1"
android:singleLine="true"
android:text="on" />
<Button
android:id="@+id/bt_hotspot_off"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="off" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<Button
android:id="@+id/bt_bht"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="蓝牙" />
<Button
android:id="@+id/bt_bht_statu"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="状态:" />
<Button
android:id="@+id/bt_bht_on"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:maxLines="1"
android:singleLine="true"
android:text="总开关on" />
<Button
android:id="@+id/bt_bht_off"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="总开关off" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<Button
android:id="@+id/bt_bt_on"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="传输on" />
<Button
android:id="@+id/bt_bt_off"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="传输off" />
<Button
android:id="@+id/bt_bhtvideo_on"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:maxLines="1"
android:singleLine="true"
android:text="音频on" />
<Button
android:id="@+id/bt_bhtvideo_off"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="音频off" />
</LinearLayout>
</LinearLayout>
</ScrollView>
</androidx.constraintlayout.widget.ConstraintLayout>