Avoid run RadioInfo activity from non-system users
RadioInfo is hidden from testing menu, but it could be launched from explicit intents for example. Add system user check to avoid phone process crash. Bug: 31219235 Change-Id: I5661fbe0889b1ee9d0dea6810f4a4cde2c9d9e22
This commit is contained in:
@@ -29,7 +29,6 @@ import android.os.AsyncResult;
|
|||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.os.Message;
|
import android.os.Message;
|
||||||
import android.os.SystemProperties;
|
|
||||||
import android.telephony.CellInfo;
|
import android.telephony.CellInfo;
|
||||||
import android.telephony.CellInfoCdma;
|
import android.telephony.CellInfoCdma;
|
||||||
import android.telephony.CellInfoGsm;
|
import android.telephony.CellInfoGsm;
|
||||||
@@ -343,6 +342,11 @@ public class RadioInfo extends Activity {
|
|||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle icicle) {
|
public void onCreate(Bundle icicle) {
|
||||||
super.onCreate(icicle);
|
super.onCreate(icicle);
|
||||||
|
if (!android.os.Process.myUserHandle().isSystem()) {
|
||||||
|
Log.e(TAG, "Not run from system user, don't do anything.");
|
||||||
|
finish();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
setContentView(R.layout.radio_info);
|
setContentView(R.layout.radio_info);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user