• R/O
  • HTTP
  • SSH
  • HTTPS

提交

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

packages/apps/Settings


Commit MetaInfo

修訂a20b507e7239531768524f9fb9506650d1d3ff30 (tree)
時間2017-09-29 02:16:57
作者android-build-team Robot <android-build-team-robot@goog...>
Commiterandroid-build-team Robot

Log Message

Merge cherrypicks of [2973982, 2974657, 2974658, 2973983, 2973984, 2974689, 2974690, 2974691, 2974692, 2974710, 2974711, 2974713, 2974714, 2974215, 2974216, 2974217, 2974218, 2974219, 2974220, 2974729, 2974730, 2974731, 2974732, 2974733, 2974734, 2974735, 2974736, 2974737, 2974738, 2974739, 2974740, 2974741, 2974742, 2974749, 2974750, 2974751, 2974752, 2974753, 2974647, 2974744, 2974693, 2974694, 2974648, 2974513, 2974665, 2974746] into nyc-mr2-release

Change-Id: I0d33346d338c50065825f52a47a1c09c4a27a4c6

Change Summary

差異

--- a/src/com/android/settings/DeviceAdminAdd.java
+++ b/src/com/android/settings/DeviceAdminAdd.java
@@ -16,6 +16,8 @@
1616
1717 package com.android.settings;
1818
19+import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS;
20+
1921 import android.app.Activity;
2022 import android.app.ActivityManagerNative;
2123 import android.app.AlertDialog;
@@ -88,7 +90,6 @@ public class DeviceAdminAdd extends Activity {
8890 Handler mHandler;
8991
9092 DevicePolicyManager mDPM;
91- AppOpsManager mAppOps;
9293 DeviceAdminInfo mDeviceAdmin;
9394 CharSequence mAddMsgText;
9495 String mProfileOwnerName;
@@ -113,19 +114,17 @@ public class DeviceAdminAdd extends Activity {
113114 boolean mWaitingForRemoveMsg;
114115 boolean mAddingProfileOwner;
115116 boolean mAdminPoliciesInitialized;
116- int mCurSysAppOpMode;
117- int mCurToastAppOpMode;
118117
119118 boolean mIsCalledFromSupportDialog = false;
120119
121120 @Override
122121 protected void onCreate(Bundle icicle) {
123122 super.onCreate(icicle);
123+ getWindow().addPrivateFlags(PRIVATE_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS);
124124
125125 mHandler = new Handler(getMainLooper());
126126
127127 mDPM = (DevicePolicyManager)getSystemService(Context.DEVICE_POLICY_SERVICE);
128- mAppOps = (AppOpsManager)getSystemService(Context.APP_OPS_SERVICE);
129128 PackageManager packageManager = getPackageManager();
130129
131130 if ((getIntent().getFlags()&Intent.FLAG_ACTIVITY_NEW_TASK) != 0) {
@@ -447,24 +446,14 @@ public class DeviceAdminAdd extends Activity {
447446 @Override
448447 protected void onResume() {
449448 super.onResume();
449+ mActionButton.setEnabled(true);
450450 updateInterface();
451- // As long as we are running, don't let this admin overlay stuff on top of the screen.
452- final int uid = mDeviceAdmin.getActivityInfo().applicationInfo.uid;
453- final String pkg = mDeviceAdmin.getActivityInfo().applicationInfo.packageName;
454- mCurSysAppOpMode = mAppOps.checkOp(AppOpsManager.OP_SYSTEM_ALERT_WINDOW, uid, pkg);
455- mCurToastAppOpMode = mAppOps.checkOp(AppOpsManager.OP_TOAST_WINDOW, uid, pkg);
456- mAppOps.setMode(AppOpsManager.OP_SYSTEM_ALERT_WINDOW, uid, pkg, AppOpsManager.MODE_IGNORED);
457- mAppOps.setMode(AppOpsManager.OP_TOAST_WINDOW, uid, pkg, AppOpsManager.MODE_IGNORED);
458451 }
459452
460453 @Override
461454 protected void onPause() {
462455 super.onPause();
463- // As long as we are running, don't let this admin overlay stuff on top of the screen.
464- final int uid = mDeviceAdmin.getActivityInfo().applicationInfo.uid;
465- final String pkg = mDeviceAdmin.getActivityInfo().applicationInfo.packageName;
466- mAppOps.setMode(AppOpsManager.OP_SYSTEM_ALERT_WINDOW, uid, pkg, mCurSysAppOpMode);
467- mAppOps.setMode(AppOpsManager.OP_TOAST_WINDOW, uid, pkg, mCurToastAppOpMode);
456+ mActionButton.setEnabled(false);
468457 try {
469458 ActivityManagerNative.getDefault().resumeAppSwitches();
470459 } catch (RemoteException e) {