Methods Summary |
---|
public void | initView()
requestWindowFeature(Window.FEATURE_NO_TITLE);
String unknown = getString(R.string.unknown);
//set description
String desc = getString(R.string.security_settings_desc);
if(desc == null) {
desc = unknown;
}
LayoutInflater inflater = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE);
mContentView = inflater.inflate(R.layout.install_confirm, null);
setContentView(mContentView);
//initialize views
PackageUtil.initAppSnippet(this, mAppInfo, R.id.app_snippet);
if(desc != null) {
((TextView)findViewById(R.id.security_settings_desc)).setText(desc);
}
LinearLayout permsView = (LinearLayout) mContentView.findViewById(
R.id.permissions_section);
boolean permVisible = false;
PackageParser.Package pkg = PackageUtil.getPackageInfo(mPkgURI);
if(pkg != null) {
AppSecurityPermissions asp = new AppSecurityPermissions(this, pkg);
if(asp.getPermissionCount() > 0) {
permVisible = true;
permsView.setVisibility(View.VISIBLE);
LinearLayout securityList = (LinearLayout) permsView.findViewById(
R.id.security_settings_list);
securityList.addView(asp.getPermissionsView());
}
}
if(!permVisible){
permsView.setVisibility(View.GONE);
}
mOk = (Button)findViewById(R.id.ok_button);
mCancel = (Button)findViewById(R.id.cancel_button);
mOk.setOnClickListener(this);
mCancel.setOnClickListener(this);
|
public void | onClick(android.view.View v)
int result = RESULT_CANCELED;
if(v == mOk) {
result = RESULT_OK;
setResultAndReturn(result);
} else if(v == mCancel) {
result = RESULT_CANCELED;
setResultAndReturn(result);
}
|
public void | onCreate(android.os.Bundle icicle)
super.onCreate(icicle);
Intent intent = getIntent();
if(localLOGV) Log.i(TAG, "intent="+intent);
mAppInfo = intent.getParcelableExtra(PackageUtil.INTENT_ATTR_APPLICATION_INFO);
mPkgURI = intent.getData();
if(localLOGV) Log.i(TAG, "mAppInfo = "+mAppInfo);
initView();
|
public void | setResultAndReturn(int result)
if(result == RESULT_CANCELED) Log.i(TAG, "Result has been canceled");
if(result == RESULT_OK) Log.i(TAG, "result ok");
setResult(result);
finish();
|