update:2020.11.27
fix:适配横屏 add:
This commit is contained in:
@@ -11,6 +11,7 @@ import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.content.pm.ActivityInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.res.Configuration;
|
||||
import android.graphics.Bitmap;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
@@ -96,9 +97,9 @@ public class MainActivity extends CheckPermissionsActivity implements AMapLocati
|
||||
//设置定位监听
|
||||
locationClient.setLocationListener(this);
|
||||
locationClient.startLocation();
|
||||
if (getRequestedOrientation() != ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE) {
|
||||
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
|
||||
}
|
||||
// if (getRequestedOrientation() != ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE) {
|
||||
// setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
|
||||
// }
|
||||
|
||||
PackageManager pm = getPackageManager();
|
||||
//后台为0可能传过来null
|
||||
@@ -124,6 +125,16 @@ public class MainActivity extends CheckPermissionsActivity implements AMapLocati
|
||||
HTTPInterface.setBrowser(MainActivity.this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConfigurationChanged(Configuration newConfig) {
|
||||
super.onConfigurationChanged(newConfig);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onSaveInstanceState(Bundle outState) {
|
||||
super.onSaveInstanceState(outState);
|
||||
}
|
||||
|
||||
public void registerRefreshReceiver() {
|
||||
mRefreshReceiver = new RefreshReceiver();
|
||||
IntentFilter filter = new IntentFilter();
|
||||
|
||||
@@ -410,6 +410,20 @@ public class MyReceiver extends BroadcastReceiver {
|
||||
boolean qch_usb_choose = Settings.System.putString(context.getContentResolver(), "qch_usb_choose", "usb_mtp");
|
||||
LogUtils.e("setUsbState:", Settings.System.getString(context.getContentResolver(), "qch_usb_choose"));
|
||||
}
|
||||
String usbStatus = "";
|
||||
switch (is_dataline) {
|
||||
case 1:
|
||||
usbStatus = "qch_action_usb_usb_charge";
|
||||
break;
|
||||
case 0:
|
||||
usbStatus = "qch_action_usb_usb_mtp";
|
||||
break;
|
||||
// case "usb_midi":
|
||||
// usbStatus = "qch_action_usb_usb_midi";
|
||||
// break;
|
||||
}
|
||||
Intent usbIntent = new Intent(usbStatus).setPackage("com.android.settings");
|
||||
context.sendBroadcast(usbIntent);
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
LogUtils.e("setUsbState", e.getMessage());
|
||||
|
||||
@@ -368,6 +368,7 @@ public class HTTPInterface {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
synchronized public static void getAllAppPackageName(final Context context) {
|
||||
OkGo.<String>post(UrlPath.GET_ALL_PACKAGENAME)
|
||||
.params("sn", Utils.getSerial())
|
||||
@@ -387,10 +388,13 @@ public class HTTPInterface {
|
||||
for (com.alibaba.fastjson.JSONObject jsonObject : jsonArray) {
|
||||
packageList += jsonObject.getString("app_package") + ",";
|
||||
}
|
||||
packageList = packageList + "com.info.sn,com.android.uiuios,com.appstore.uiui,com.uiuios.updatetools";
|
||||
packageList = packageList + "com.info.sn,com.android.uiuios,com.appstore.uiui,com.uiuios.updatetools,com.jiaoguanyi.pager2,com.android.uiuios";
|
||||
Log.e("packageList now", packageList);
|
||||
Log.e("packageList", Settings.System.getString(context.getContentResolver(), "qch_app_forbid"));
|
||||
Settings.System.putString(context.getContentResolver(), "qch_app_forbid", packageList);
|
||||
}else {
|
||||
Settings.System.putString(context.getContentResolver(), "qch_app_forbid", "com.info.sn,com.android.uiuios,com.appstore.uiui,com.uiuios.updatetools,com.jiaoguanyi.pager2,com.android.uiuios");
|
||||
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Log.e("getAllAppPackageName", e.getMessage());
|
||||
@@ -405,6 +409,7 @@ public class HTTPInterface {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public static void setBrowser(final Context context) {
|
||||
OkGo.<String>post(UrlPath.SET_BROWSER_URL)
|
||||
.params("sn", Utils.getSerial())
|
||||
|
||||
Reference in New Issue
Block a user