增加合作平台测试
This commit is contained in:
@@ -99,6 +99,14 @@ public class MainActivity extends ImmerseBaseActivity {
|
||||
@BindView(R.id.bt_camera_refresh)
|
||||
Button bt_camera_refresh;
|
||||
|
||||
@BindView(R.id.tv_net_statu)
|
||||
TextView tv_net_statu;
|
||||
@BindView(R.id.bt_net_close)
|
||||
Button bt_net_close;
|
||||
@BindView(R.id.bt_net_open)
|
||||
Button bt_net_open;
|
||||
@BindView(R.id.bt_net_refresh)
|
||||
Button bt_net_refresh;
|
||||
|
||||
private ServiceConnection mServiceConnection;
|
||||
private INoteAidlInterface noteAidlInterface;
|
||||
@@ -322,9 +330,9 @@ public class MainActivity extends ImmerseBaseActivity {
|
||||
// Log.e("mIGetInfoConnection", "getForbidAPP: " + forbidAPP);
|
||||
boolean isControl = getInfoInterface.isControl();
|
||||
Log.e("mIGetInfoConnection", "isControl: " + isControl);
|
||||
boolean isAvailable = getInfoInterface.inControl("com.zhiduoke.fxy");
|
||||
boolean isAvailable = getInfoInterface.inControl("com.youku.phone");
|
||||
Log.e("mIGetInfoConnection", "inControl: " + isAvailable);
|
||||
String content = getInfoInterface.getDisableContent("com.zhiduoke.fxy");
|
||||
String content = getInfoInterface.getDisableContent("com.youku.phone");
|
||||
Log.e("mIGetInfoConnection", "getDisableContent: " + content);
|
||||
|
||||
// textView.setText(userInfo);
|
||||
@@ -373,6 +381,24 @@ public class MainActivity extends ImmerseBaseActivity {
|
||||
sendBroadcast(cameraIntent);
|
||||
}
|
||||
});
|
||||
|
||||
bt_net_close.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
Settings.System.putString(getContentResolver(), "app_web_white_list",
|
||||
"com.android.browser:baidu.com,taobao.com,qq.com;com.uiui.browser:jd.com,bilibili.com,baidu.com;org.chromium.browser:zhihu.com,baidu.com,taobao.com,qq.com");
|
||||
Settings.System.putString(getContentResolver(), "app_view_click_disabled",
|
||||
"com.android.gallery3d:12345,78901;com.android.settings:9876543,12346");
|
||||
|
||||
}
|
||||
});
|
||||
bt_net_open.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
Settings.System.putString(getContentResolver(), "app_web_white_list", "null");
|
||||
Settings.System.putString(getContentResolver(), "app_view_click_disabled", "null");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -0,0 +1,78 @@
|
||||
package com.tt.ttutils.utils.java;
|
||||
|
||||
import android.annotation.TargetApi;
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.os.Build;
|
||||
import android.util.Log;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
|
||||
/**
|
||||
* Glide 加载 简单判空封装 防止异步加载数据时调用Glide 抛出异常
|
||||
* Created by Li_Xavier on 2017/6/20 0020.
|
||||
*/
|
||||
public class GlideLoadUtils {
|
||||
private String TAG = "ImageLoader";
|
||||
|
||||
/**
|
||||
* 借助内部类 实现线程安全的单例模式
|
||||
* 属于懒汉式单例,因为Java机制规定,内部类SingletonHolder只有在getInstance()
|
||||
* 方法第一次调用的时候才会被加载(实现了lazy),而且其加载过程是线程安全的。
|
||||
* 内部类加载的时候实例化一次instance。
|
||||
*/
|
||||
public GlideLoadUtils() {
|
||||
}
|
||||
|
||||
private static class GlideLoadUtilsHolder {
|
||||
private final static GlideLoadUtils INSTANCE = new GlideLoadUtils();
|
||||
}
|
||||
|
||||
public static GlideLoadUtils getInstance() {
|
||||
return GlideLoadUtilsHolder.INSTANCE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Glide 加载 简单判空封装 防止异步加载数据时调用Glide 抛出异常
|
||||
*
|
||||
* @param context
|
||||
* @param url 加载图片的url地址 String
|
||||
* @param imageView 加载图片的ImageView 控件
|
||||
* @param default_image 图片展示错误的本地图片 id
|
||||
*/
|
||||
public void glideLoad(Context context, String url, ImageView imageView, int default_image) {
|
||||
if (context != null) {
|
||||
Glide.with(context).load(url).centerCrop().error(default_image).into(imageView);
|
||||
} else {
|
||||
Log.i(TAG, "Picture loading failed,context is null");
|
||||
}
|
||||
}
|
||||
|
||||
@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1)
|
||||
public void glideLoad(Activity activity, String url, ImageView imageView, int default_image) {
|
||||
if (!activity.isDestroyed()) {
|
||||
Glide.with(activity).load(url).centerCrop().error(default_image).into(imageView);
|
||||
} else {
|
||||
Log.i(TAG, "Picture loading failed,activity is Destroyed");
|
||||
}
|
||||
}
|
||||
|
||||
public void glideLoad(Fragment fragment, String url, ImageView imageView, int default_image) {
|
||||
if (fragment != null && fragment.getActivity() != null) {
|
||||
Glide.with(fragment).load(url).centerCrop().error(default_image).into(imageView);
|
||||
} else {
|
||||
Log.i(TAG, "Picture loading failed,fragment is null");
|
||||
}
|
||||
}
|
||||
|
||||
public void glideLoad(android.app.Fragment fragment, String url, ImageView imageView, int default_image) {
|
||||
if (fragment != null && fragment.getActivity() != null) {
|
||||
Glide.with(fragment).load(url).centerCrop().error(default_image).into(imageView);
|
||||
} else {
|
||||
Log.i(TAG, "Picture loading failed,android.app.Fragment is null");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -52,6 +52,41 @@
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_net_statu"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/bt_net_close"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="黑名单" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/bt_net_open"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="清除" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/bt_net_refresh"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="刷新"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_qch_Developeroptions"
|
||||
android:layout_width="wrap_content"
|
||||
|
||||
@@ -52,6 +52,41 @@
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_net_statu"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/bt_net_close"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="黑名单" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/bt_net_open"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="清除" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/bt_net_refresh"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="刷新"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_qch_Developeroptions"
|
||||
android:layout_width="wrap_content"
|
||||
|
||||
Reference in New Issue
Block a user