1.android 通知使用权
默认容许某个应用的 通知使用权
diff --git a/alps/frameworks/base/core/res/res/values/config.xml b/alps/frameworks/base/core/res/res/values/config.xml
index 5539aa126e6..009db955054 100755
--- a/alps/frameworks/base/core/res/res/values/config.xml
+++ b/alps/frameworks/base/core/res/res/values/config.xml
@@ -3515,7 +3515,7 @@
<string name="config_defaultTrustAgent" translatable="false"></string>
<!-- Colon separated list of package names that should be granted Notification Listener access -->
- <string name="config_defaultListenerAccessPackages" translatable="false"></string>
+ <string name="config_defaultListenerAccessPackages" translatable="false">com.uiuios.aios</string>
<!-- Maximum size, specified in pixels, to restrain the display space width to. Height and
density will be scaled accordingly to maintain aspect ratio. A value of 0 indicates no
2.默认容许一些usb 接入设备的 权限,以屏蔽usb 使用的弹出框
--- a/alps/vendor/mediatek/proprietary/packages/apps/SystemUI/src/com/android/systemui/usb/UsbConfirmActivity.java
+++ b/alps/vendor/mediatek/proprietary/packages/apps/SystemUI/src/com/android/systemui/usb/UsbConfirmActivity.java
@@ -38,7 +38,7 @@ import android.view.View;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.TextView;
-
+import android.widget.Toast;
import com.android.internal.app.AlertActivity;
import com.android.internal.app.AlertController;
import com.android.systemui.R;
@@ -116,8 +116,15 @@ public class UsbConfirmActivity extends AlertActivity
com.android.internal.R.id.clearDefaultHint);
mClearDefaultHint.setVisibility(View.GONE);
}
+ if(mResolveInfo.activityInfo.packageName.equals("com.displaylink.presenter")){
+ UsbConfirmDefault();
+ // Toast.makeText(getApplicationContext(), appName, Toast.LENGTH_LONG).show();
+ // Log.i(TAG, "appName:"+appName+" packageName:"+mResolveInfo.activityInfo.packageName+" no need to show confirm dialog!");
+ }else{
setupAlert();
-
+ // Toast.makeText(getApplicationContext(), appName, Toast.LENGTH_LONG).show();
+ // Log.i(TAG, "appName:"+appName+" packageName:"+mResolveInfo.activityInfo.packageName+" no need to show confirm dialog!");
+ }
}
@Override
@@ -177,7 +184,54 @@ public class UsbConfirmActivity extends AlertActivity
}
finish();
}
+ public void UsbConfirmDefault(){
+ try {
+ IBinder b = ServiceManager.getService(USB_SERVICE);
+ IUsbManager service = IUsbManager.Stub.asInterface(b);
+ final int uid = mResolveInfo.activityInfo.applicationInfo.uid;
+ final int userId = UserHandle.myUserId();
+ boolean alwaysUse = true;//mAlwaysUse != null ? mAlwaysUse.isChecked() : false;
+ Intent intent = null;
+
+ if (mDevice != null) {
+ intent = new Intent(UsbManager.ACTION_USB_DEVICE_ATTACHED);
+ intent.putExtra(UsbManager.EXTRA_DEVICE, mDevice);
+
+ // grant permission for the device
+ service.grantDevicePermission(mDevice, uid);
+ // set or clear default setting
+ if (alwaysUse) {
+ service.setDevicePackage(
+ mDevice, mResolveInfo.activityInfo.packageName, userId);
+ } else {
+ service.setDevicePackage(mDevice, null, userId);
+ }
+ } else if (mAccessory != null) {
+ intent = new Intent(UsbManager.ACTION_USB_ACCESSORY_ATTACHED);
+ intent.putExtra(UsbManager.EXTRA_ACCESSORY, mAccessory);
+
+ // grant permission for the accessory
+ service.grantAccessoryPermission(mAccessory, uid);
+ // set or clear default setting
+ if (alwaysUse) {
+ service.setAccessoryPackage(
+ mAccessory, mResolveInfo.activityInfo.packageName, userId);
+ } else {
+ service.setAccessoryPackage(mAccessory, null, userId);
+ }
+ }
+
+ intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+ intent.setComponent(
+ new ComponentName(mResolveInfo.activityInfo.packageName,
+ mResolveInfo.activityInfo.name));
+ startActivityAsUser(intent, new UserHandle(userId));
+ } catch (Exception e) {
+ Log.e(TAG, "Unable to start activity", e);
+ }
+ finish();
+ }
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
if (mClearDefaultHint == null) return;
diff --git a/alps/vendor/mediatek/proprietary/packages/apps/SystemUI/src/com/android/systemui/usb/UsbPermissionActivity.java b/alps/vendor/mediatek/proprietary/packages/apps/SystemUI/src/com/android/systemui/usb/UsbPermissionActivity.java
index 98b4209ede0..6812ab5ae53 100644
--- a/alps/vendor/mediatek/proprietary/packages/apps/SystemUI/src/com/android/systemui/usb/UsbPermissionActivity.java
+++ b/alps/vendor/mediatek/proprietary/packages/apps/SystemUI/src/com/android/systemui/usb/UsbPermissionActivity.java
@@ -133,8 +133,12 @@ public class UsbPermissionActivity extends AlertActivity
com.android.internal.R.id.clearDefaultHint);
mClearDefaultHint.setVisibility(View.GONE);
}
-
+ if(mPackageName.equals("com.displaylink.presenter")){
+ mPermissionGranted = true;
+ finish();
+ } else{
setupAlert();
+ }
}
@Override
3. 长按关机键 去掉关机弹出框 ,改为长按直接关机
--- a/alps/frameworks/base/core/res/res/values/config.xml
+++ b/alps/frameworks/base/core/res/res/values/config.xml
@@ -934,7 +934,7 @@
2 - Power off (with confirmation)
3 - Power off (without confirmation)
-->
- <integer name="config_longPressOnPowerBehavior">1</integer>
+ <integer name="config_longPressOnPowerBehavior">3</integer>
4.去掉音量按键 弹出的音量 通知框
--- a/alps/vendor/mediatek/proprietary/packages/apps/SystemUI/res/values/config.xml
+++ b/alps/vendor/mediatek/proprietary/packages/apps/SystemUI/res/values/config.xml
@@ -311,7 +311,7 @@
<integer name="zen_mode_max_conditions">5</integer>
<!-- Enable the default volume dialog -->
- <bool name="enable_volume_ui">true</bool>
+ <bool name="enable_volume_ui">false</bool>
5.android 8.1 的系统做 系统强制横屏
--- a/alps/frameworks/base/services/core/java/com/android/server/wm/WindowManagerService.java
+++ b/alps/frameworks/base/services/core/java/com/android/server/wm/WindowManagerService.java
@@ -266,7 +266,7 @@ import java.text.DateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
-
+import android.content.pm.ActivityInfo;
/// M: add for fullscreen switch feature @{
import com.mediatek.server.MtkSystemServiceFactory;
import com.mediatek.server.wm.WmsExt;
@@ -2645,7 +2645,8 @@ public class WindowManagerService extends IWindowManager.Stub
long ident = Binder.clearCallingIdentity();
try {
final DisplayContent dc = mRoot.getDisplayContent(displayId);
- final int req = dc.getOrientation();
+ //final int req = dc.getOrientation();
+ final int req = ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE;