Merge "Use primaryUserOnly attribute to disable CryptKeeper"
This commit is contained in:
committed by
Android (Google) Code Review
commit
290e137456
@@ -1,4 +1,5 @@
|
|||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
|
||||||
package="com.android.settings"
|
package="com.android.settings"
|
||||||
coreApp="true"
|
coreApp="true"
|
||||||
android:sharedUserId="android.uid.system">
|
android:sharedUserId="android.uid.system">
|
||||||
@@ -1724,6 +1725,7 @@
|
|||||||
android:theme="@style/Theme.SubSettingsDialogWhenLarge"/>
|
android:theme="@style/Theme.SubSettingsDialogWhenLarge"/>
|
||||||
|
|
||||||
<activity android:name=".CryptKeeper"
|
<activity android:name=".CryptKeeper"
|
||||||
|
androidprv:primaryUserOnly="true"
|
||||||
android:immersive="true"
|
android:immersive="true"
|
||||||
android:launchMode="singleTop"
|
android:launchMode="singleTop"
|
||||||
android:excludeFromRecents="true"
|
android:excludeFromRecents="true"
|
||||||
@@ -1738,12 +1740,6 @@
|
|||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
|
|
||||||
<receiver android:name=".CryptKeeper$UserInitBroadcastReceiver" >
|
|
||||||
<intent-filter>
|
|
||||||
<action android:name="android.intent.action.USER_INITIALIZE" />
|
|
||||||
</intent-filter>
|
|
||||||
</receiver>
|
|
||||||
|
|
||||||
<activity android:name=".CryptKeeper$FadeToBlack"
|
<activity android:name=".CryptKeeper$FadeToBlack"
|
||||||
android:immersive="true"
|
android:immersive="true"
|
||||||
android:launchMode="singleTop"
|
android:launchMode="singleTop"
|
||||||
|
@@ -17,9 +17,7 @@
|
|||||||
package com.android.settings;
|
package com.android.settings;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.ActivityManager;
|
|
||||||
import android.app.StatusBarManager;
|
import android.app.StatusBarManager;
|
||||||
import android.content.BroadcastReceiver;
|
|
||||||
import android.content.ComponentName;
|
import android.content.ComponentName;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
@@ -50,10 +48,10 @@ import android.util.Log;
|
|||||||
import android.view.KeyEvent;
|
import android.view.KeyEvent;
|
||||||
import android.view.MotionEvent;
|
import android.view.MotionEvent;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.WindowManager;
|
|
||||||
import android.view.View.OnClickListener;
|
import android.view.View.OnClickListener;
|
||||||
import android.view.View.OnKeyListener;
|
import android.view.View.OnKeyListener;
|
||||||
import android.view.View.OnTouchListener;
|
import android.view.View.OnTouchListener;
|
||||||
|
import android.view.WindowManager;
|
||||||
import android.view.inputmethod.EditorInfo;
|
import android.view.inputmethod.EditorInfo;
|
||||||
import android.view.inputmethod.InputMethodInfo;
|
import android.view.inputmethod.InputMethodInfo;
|
||||||
import android.view.inputmethod.InputMethodManager;
|
import android.view.inputmethod.InputMethodManager;
|
||||||
@@ -68,10 +66,10 @@ import com.android.internal.widget.LockPatternUtils;
|
|||||||
import com.android.internal.widget.LockPatternView;
|
import com.android.internal.widget.LockPatternView;
|
||||||
import com.android.internal.widget.LockPatternView.Cell;
|
import com.android.internal.widget.LockPatternView.Cell;
|
||||||
|
|
||||||
import static com.android.internal.widget.LockPatternView.DisplayMode;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import static com.android.internal.widget.LockPatternView.DisplayMode;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Settings screens to show the UI flows for encrypting/decrypting the device.
|
* Settings screens to show the UI flows for encrypting/decrypting the device.
|
||||||
*
|
*
|
||||||
@@ -1027,17 +1025,4 @@ public class CryptKeeper extends Activity implements TextView.OnEditorActionList
|
|||||||
pm.setComponentEnabledSetting(name, PackageManager.COMPONENT_ENABLED_STATE_DISABLED,
|
pm.setComponentEnabledSetting(name, PackageManager.COMPONENT_ENABLED_STATE_DISABLED,
|
||||||
PackageManager.DONT_KILL_APP);
|
PackageManager.DONT_KILL_APP);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class UserInitBroadcastReceiver extends BroadcastReceiver {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onReceive(Context context, Intent intent) {
|
|
||||||
final String intentAction = intent.getAction();
|
|
||||||
// Disable CryptKeeper activity if user is not primary
|
|
||||||
if (Intent.ACTION_USER_INITIALIZE.equals(intentAction)
|
|
||||||
&& UserHandle.USER_OWNER != UserHandle.myUserId()) {
|
|
||||||
disableCryptKeeperComponent(context);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user